How do I write this symbol in latex? (disjoint sharp operator)
You can use a scaled up version of \bigcirc
and \ooalign
:
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\vphantom{\biggercirc{#1}}%
\ooalign{$#1\biggercirc{#1}$\cr\hidewidth$#1#2$\hidewidth\cr}%
\endgroup
}
\newcommand{\biggercirc}[1]{%
\vcenter{\hbox{\scalebox{1.4}{$\m@th#1\bigcirc$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
I used \mathbin
but it could be \mathrel
depending on the meaning.
See https://tex.stackexchange.com/a/22375/4427 for a quick course on \ooalign
.
With a smaller circle
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\vphantom{\bigcirc}%
\ooalign{$#1\bigcirc$\cr\hidewidth$#1\make@smaller{#1}{#2}$\hidewidth\cr}%
\endgroup
}
\newcommand{\make@smaller}[2]{%
\vcenter{\hbox{\scalebox{0.7}{$\m@th#1#2$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
When symbols are “bigger”, they are usually centered with respect to the formula axis.
Another possibility:
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\sbox\z@{$#1A$}%
\sbox\tw@{%
\raisebox{\depth}{%
\vphantom{$#1A$}%
\ooalign{%
\hidewidth$#1\make@smaller{#1}{#2}$\hidewidth\cr
$#1\bigcirc$\cr
}%
}%
}%
\resizebox{!}{\ht\z@}{\box\tw@}%
\endgroup
}
\newcommand{\make@smaller}[2]{%
\vcenter{\hbox{\scalebox{0.7}{$\m@th#1#2$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
You can use TikZ to draw a circle node with a #
inside. Using \DeclareMathOperator
from amsmath
improves the spacing. The character should be a bit smaller than the current font, which you can do using \smaller
from the relsize
package, to make sure it works in different fontsizes.
MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{relsize}
\DeclareMathOperator{\chash}{\tikz{\node[circle,draw,inner sep=0,outer sep=0]{\smaller[3]\#}}}
\begin{document}
$A\chash B$
\Huge$A\chash B$
\end{document}
Result:
I have created your symbol with a combination of packages. Excuse me for the complicated code. The symbol has the name \disj
. It is a variable name that you can change. Here is my MWE:
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{MnSymbol,scalerel}
\newcommand{\disj}{\mathrel{{\bigcircle}\mkern-4mu\raise.3ex\llap{$\scaleobj{.6}{\#}$}}}
\begin{document}
$A\disj B=C$
\end{document}