Alex Rivera | Logout

Vertical placement of math symbol in LaTeX

Asked 2010-05-19T14:57:07.353
23

I'm using the symbol \otimes as a unary operator and it's vertical alignment doesn't seem right to me. It wants to sit a bit below the baseline. For example, if I define \newcommand{\myop}{\ensuremath \otimes}, then $\myop I$ becomes

Operator below the baseline

and $F_{\myop I}$ becomes

Operator misaligned in subscript

I tried using \raisebox to fix this, e.g.,

\newcommand{\myop}{\ensuremath \raisebox{1pt}{$\otimes$}}

This fixes $\myop I$:

Operator near baseline

But \raisebox doesn't seem to be sensitive to subscripts. The operator stays the same size while everything around it shrinks:

Operator too big in subscript

The problem, I think, is that \raisebox creates its own LR box, which doesn't inherit the settings in the surrounding math environment. Is there a version of \raisebox that "respects math"?

Edit
Report

1 Answer

15

Try \mathchoice (or \mathpalette):

\newcommand{\myop}{%
  \mathchoice{\raisebox{1pt}{$\displaystyle\otimes$}}
             {\raisebox{1pt}{$\otimes$}}
             {\raisebox{0.5pt}{$\scriptstyle\otimes$}}
             {\raisebox{0.2pt}{$\scriptscriptstyle\otimes$}}}

The amsopn documentation says:

... the vertical spacing may not be optimal in script and scriptscript sizes. Unfortunately TeX provides no easy way to do math mode vertical spacing that varies with current math style like mu units.

answered 2010-05-19T16:15:21.177

Your Answer