tags:

views:

248

answers:

3

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

A: 
$F_{\raisebox{1pt}{\scriptsize$\otimes$} I}$
Domenic
This works, sure, but I want to be able to put it in a macro that will work in any context. E.g., `\newcommand{\myop}{\ensuremath ... \otimes ... }`
Chris Conway
Edited the question to respond to this.
Chris Conway
A: 

That is indeed the correct vertical placement for the operator, although it seems slightly too low next to uppercase letters. Try using it with lowercase letters to see that. If it were higher, this would look odd.

Konrad Rudolph
In the context I'm using it in, it looks weird. E.g., juxtaposed with another operator that sits on the baseline: http://tinypic.com/r/15wfkg5/6
Chris Conway
@Chris: Agreed. The two symbols should sit on the same baseline.
Charles Stewart
+5  A: 

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.

Jouni K. Seppänen
`\mathchoice` seems to be just the thing. But I can't find the documentation for it in Google... Pointers?
Chris Conway
The TeXbook, p. 151. See http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=texbook for the source code.
Jouni K. Seppänen
@Chris: Extex's Javadocs have surprisingly good documentation of Tex primitives. For `\mathchoice`, see http://www.extex.org/snapshot/javadoc/org/extex/unit/tex/math/Mathchoice.html
Charles Stewart