开发者

Vertical placement of math symbol in LaTeX

开发者 https://www.devze.com 2022-12-31 13:03 出处:网络
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}{\\ens

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}{\ensurem开发者_JAVA百科ath \otimes}, then $\myop I$ becomes

Vertical placement of math symbol in LaTeX

and $F_{\myop I}$ becomes

Vertical placement of math symbol in LaTeX

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

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

This fixes $\myop I$:

Vertical placement of math symbol in LaTeX

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

Vertical placement of math symbol in LaTeX

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"?


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.


$F_{\raisebox{1pt}{\scriptsize$\otimes$} I}$
0

精彩评论

暂无评论...
验证码 换一张
取 消