15

My question

I am trying to make an equal circled of the same size as \oplus or \otimes, etc. I tried to use the solution provided here :

How do I put a circle around an operator?

However, the size of the operators are not the same.

I used as preamble :

\makeatletter
\newcommand\incircbin
{%
  \mathpalette\@incircbin
}
\newcommand\@incircbin[2]
{%
  \mathbin%
  {%
    \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}%
  }%
}
\newcommand{\oeq}{\incircbin{=}}
\makeatother

And, inside the document itself :

  $\oeq$, $\oplus$, $\otimes$

Which is displayed as follow :

enter image description here

As you can notice, the operator \oeq is bigger than the others. Is there a way to get the exact size used by $\oplus$ or $\otimes$ ? Please note that I would rather keep the compilation with pdflatex.

Thank you in advance for any help you may provide.


Minimal working example

\documentclass[10pt,a4paper]{article}

\makeatletter
\newcommand\incircbin
{%
  \mathpalette\@incircbin
}
\newcommand\@incircbin[2]
{%
  \mathbin%
  {%
    \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}%
  }%
}
\newcommand{\oeq}{\incircbin{=}}
\makeatother

\begin{document}
\Huge   $\oeq$, $\oplus$, $\otimes$
\end{document}
4
  • 3
    This is a really nicely-asked question :) presumably you need to resize the circle - perhaps you could use resizebox from the graphics package?
    – cmhughes
    Aug 30, 2014 at 13:57
  • 1
    @cmhughes maybe possible but I think it will be difficult to obtain the same line thickness then. Maybe its easier to measure the hight of the original symbol and redo them all in TikZ.
    – LaRiFaRi
    Aug 30, 2014 at 14:22
  • 1
    @LaRiFaRi sounds like a plan :)
    – cmhughes
    Aug 30, 2014 at 14:25
  • 2
    @cmhughes : Thank you your remark and for your proposal as well. However, the solution proposed below by LaRiFaRi fits well with what I expected. Have you both a nice day =)
    – booba24
    Aug 30, 2014 at 14:31

1 Answer 1

15

One solution would be to use the unicode-symbol U+229C for this. For example with the package unicode-math.

% arara: lualatex

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\[\oplus\ominus\otimes\oslash\odot\circledcirc\circledast\circledequal\circleddash\]
\end{document}

enter image description here

\circledequal or \symbol{"229C} yield your desired symbol in the right size for the most common fonts.

Edit:

As mentioned in comment, the OP wants to stick to PDFLaTeX. For this case, I would choose the binary operators defined in the package mathabx which look even nicer than the default ones (in my eyes). The macro \ovoid yields an empty circle of the size of the other operators.

% arara: pdflatex

\documentclass[10pt,a4paper]{article}
\usepackage{mathabx}

\makeatletter
\newcommand\incircbin
{%
  \mathpalette\@incircbin
}
\newcommand\@incircbin[2]
{%
  \mathbin%
  {%
    \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\ovoid$}%
  }%
}
\newcommand{\oeq}{\incircbin{=}}
\makeatother

\begin{document}
\Huge   $\oeq$, $\oplus$, $\otimes$
\end{document}

enter image description here

5
  • 3
    Is there an equivalent solution with pdflatex please ? I am actually receiving this error : ! Fatal fontspec error: "cannot-use-pdftex" ! The fontspec package requires either XeTeX or LuaTeX to function., and I wish I could stay under pdflatex compilation process.
    – booba24
    Aug 30, 2014 at 13:50
  • @booba24 Please see my update for a PDFLaTeX-version.
    – LaRiFaRi
    Aug 30, 2014 at 14:15
  • 1
    Your second proposals suits me perfectly, thank you very much for your prompt help !
    – booba24
    Aug 30, 2014 at 14:28
  • @booba24 You are very welcome. Btw: found it here: tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdf
    – LaRiFaRi
    Aug 30, 2014 at 14:29
  • 1
    Thank you for the link, that may be useful in the future ! Have a nice day ! =)
    – booba24
    Aug 30, 2014 at 14:33

You must log in to answer this question.

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