[Tex/LaTex] How to put symbols of equal size on top of each other

stacking-symbolssymbols

I would like to put (any) two symbols on top of each other. With \overset the one on top is smaller. However, I want them to appear vertically centered and of equal size. How can this be done? Obviously, the following is quite a bad hack:

\documentclass{scrartcl}
\usepackage{amsmath}
\newcommand*{\ou}[2]{\overset{\text{\large ${#1}$}}{#2}}
\begin{document}
$a\ou{>}{<}0$ or $a\raisebox{-3pt}{\,$\ou{>}{<}$\,}0$ or $a\,{>\atop <}\,0$
\end{document}

\atop is not too bad, but a) how can I bring the symbols (vertically) closer to each other and b) how can this be defined as a command which takes care of the spacing around operators (\,)?

Best Answer

The symbol you want to build is already available, so this is just a hint for other similar situations. If you want to set symbols on top of one another, as opposed to superimpose symbols over each other, the tool to use is \ialign, not \ooalign that is handy for the latter case.

\documentclass{article}

\newcommand{\ou}{%
  \mathrel{%
    \vcenter{\offinterlineskip
      \ialign{##\cr$<$\cr\noalign{\kern-1.5pt}$>$\cr}%
    }%
  }%
}

\begin{document}
$a \ou b$
\end{document}

I use \mathrel to declare the symbol type, \vcenter to make the whole construction centered with respect to the formula axis and \ialign with no baselineskip, so I can fine tune the spacing with \noalign{\kern...}.

Improvements with \mathpalette are possible for making the symbol available in all formula styles.

enter image description here