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?

2

4 Answers 4

5

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

4
  • Thanks, I copied your code and it is fine. The only thing I would change is the fact that the circle is bigget than A and B. How can I change its diameter? Sep 17, 2019 at 22:58
  • @GerardoZinno In the image you showed the circle is larger than the letters.
    – egreg
    Sep 18, 2019 at 8:11
  • I know. But is there a simple way to make the circle roughly the same size of the letters? Sep 18, 2019 at 9:08
  • 1
    @GerardoZinno I added two new implementations
    – egreg
    Sep 18, 2019 at 9:38
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

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

2
  • Tante grazie for warning me, Sebastiano!
    – Bernard
    Sep 17, 2019 at 21:12
  • Ahahah. I'm very glad to help you and the correct behaviour user :0) excellent...tante grazie.
    – Sebastiano
    Sep 18, 2019 at 14:53
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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .