5

I am trying to construct a new symbol: a circle with a vertical bar through it. The following MWE sorta works but doesn't look quite right.

MWE Output

\documentclass[12pt]{amsart}

\newcommand{\bcirc}{\mathrel{\ooalign{$\circ$\cr\hidewidth\hbox{$|\mkern 1.9mu$}\cr}}}


\begin{document}

    New symbol $x \bcirc_3 y$ works.
    Also huge version {\huge$x \bcirc_2 y$} works fine.
    In displaymath, compare:
    \begin{align*}
        x \bcirc_1 y &= \pi_{w \bcirc_2 z}  , \\
        x \circ_1 y &= \pi_{w \circ_2 z}  .
    \end{align*}

\end{document}
  1. Spacing to the right of the new symbol seems slightly too large I think?
  2. More importantly, this symbol does not resize when used as a subscript. Any tips/modifications I need to make to the definition?

This is based on an answer to this other tex.SE question.

1k5
  • 325
  • \mathpalette might be perfect here, as in the solution you linked. By the way, is the unbalancedness intended? – Manuel Jan 22 '15 at 15:31
  • @Manuel: If by unbalancedness you mean the fact that the vertical bar does not go through the circles center, then no, this is not intended. I didn't see it before when I defined this in another document, it looked right to me there. (The other document uses amsart article class and whole lot more packages.) – 1k5 Jan 22 '15 at 15:46
  • I didn't update the MWE, but used standalone class to produce the image included. Sorry. – 1k5 Jan 22 '15 at 15:49
  • The symbol is siilar to a sans serif Phi, try \usepackage{tipa,amsmath,graphicx} \def\bcirc{\scalebox{.7}{\text{\sffamily\textphi}}} – Fran Jan 22 '15 at 21:30

1 Answers1

6

You have to use \mathpalette:

\documentclass[12pt]{amsart}

\makeatletter
\newcommand{\bcirc}{\mathrel{\vphantom{|}\mathpalette\do@bcirc\relax}}
\newcommand{\do@bcirc}[2]{%
  \ooalign{%
    $#1\m@th\circ$\cr
    \hidewidth$#1\m@th|$\hidewidth\cr
  }%
}
\makeatother

\begin{document}

    New symbol $x \bcirc_3 y$ works.
    Also huge version {\huge$x \bcirc_2 y$} works fine.
    In displaymath, compare:
    \begin{align*}
        x \bcirc_1 y &= \pi_{w \bcirc_2 z}  , \\
        x \circ_1 y &= \pi_{w \circ_2 z}  .
    \end{align*}

\end{document}

enter image description here

I used \hidewidth instead of manual kerning. Centering seems to be good.

egreg
  • 1,121,712