4

I can't find this symbol used to indicate the disjoint sharp operator.

enter image description here

It's a # inside a circle. Is this symbol available in LaTex? if not, how can I draw it inside a mathematical equation?

  • Maybe help: https://tex.stackexchange.com/a/7045/31034 –  Sep 17 '19 at 20:47
  • Here's two links that are helpful for this sort of problem in the future. I checked them and found nothing, but they're still useful for this sort of thing. http://detexify.kirelabs.org/classify.html http://shapecatcher.com/ – Captain Man Sep 18 '19 at 15:18

4 Answers4

4

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}

enter image description here

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}

enter image description here

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}

enter image description here

egreg
  • 1,121,712
3

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:

Image

\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}
Marc
  • 123
Sebastiano
  • 54,118
3

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:

enter image description here

Marijn
  • 37,699
3

Here is a possibility with stackengine and the \bigovoid symbol from mathabx (without replacing the default maths fonts with the mathabx fonts):

\documentclass{article}

\usepackage{amsmath}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{%
<-6> mathx5 
<6-7> mathx6 
<7-8> mathx7
<8-9> mathx8 
<9-10> mathx9
<10-12> mathx10 
<12-> mathx12
}{}

\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}

\DeclareMathSymbol{\bigovoid}{\mathop}{mathx}{"EC}

\usepackage{stackengine}
\newcommand{\Otag}{\mathbin{\stackMath\stackinset{c}{}{c}{}{\#}{\bigovoid}}}

\begin{document}

\[A \Otag B = C \]

\end{document} 

enter image description here

Bernard
  • 271,350