Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've defined the following new commands:

\newcommand{\atoi}{\mathrm{\rotatebox[origin=c]{180}{$\iotaup$}}}
\newcommand{\scriptatoi}{{\scriptsize{\mathrm{\rotatebox[origin=c]{180}{$\iotaup$}}}}}

to use in this formula (and other formulas in which $\atoi$ occurs):

$\psi^{\scriptatoi x\phi}_{z}  \equiv \exists y(\phi^y_x \:\&\: \forall u(\phi^u_x \rightarrow u\!=\!y) \:\&\: \psi^y_z)$

When I typeset the LaTeX source file using pdflatex (from TeXLive 2010), I get the following complaint:

LaTeX Font Warning: Command \scriptsize invalid in math mode on input line 352.

If, however, I write the following line instead:

$\psi^{\atoi x\phi}_{z}  \equiv \exists y(\phi^y_x \:\&\: \forall u(\phi^u_x \rightarrow u\!=\!y) \:\&\: \psi^y_z)$

the atoi character appears full size, not superscript size.

Writing

$\psi^{\scriptsize\atoi x\phi}_{z}  \equiv \exists y(\phi^y_x \:\&\: \forall u(\phi^u_x \rightarrow u\!=\!y) \:\&\: \psi^y_z)$

again yields the desired typeset result, and again yields the LaTeX Font Warning.

How can I do what I want, that is, get my new symbol in an appropriate superscript size when using it in a superscript, while respecting the font restrictions of math mode?

share|improve this question
1  
As far as I know, the command is called \scriptstyle. Generally, \...size applies to textmode, whereas \...style applies to mathmode. –  tohecz Jun 21 '12 at 7:22
    
    
Thank you for your comment, and especially for the pointer to the fine exposition of rotation. –  Paul E. Oppenheimer Jun 22 '12 at 0:18

3 Answers 3

up vote 4 down vote accepted

this construction is simple enough that you can forget about redefining it for multiple sizes. instead, use the \text facility of amsmath:

\renewcommand{\atoi}{\text{\rotatebox[origin=c]{180}{$\iotaup$}}}

this can be used both in the "main line" and in super/subscripts of any level, and it should produce the desired result.

(the definition of \text is based on \mathchoice; take a look at amstext.sty -- it isn't very long.)

share|improve this answer

use it this way:

\newcommand\atoi{\rotatebox[origin=c]{180}{$\iotaup$}}
\newcommand\scriptatoi{\rotatebox[origin=c]{180}{$\scriptstyle\iotaup$}}

in math mode the font style is scriptstyle

share|improve this answer

You can use the command \mathchoice that chooses the correct math size:

\newcommand\atoistyle[1]{\mbox{\rotatebox[origin=c]{180}{$#1\iotaup$}}}
\newcommand\atoi{\mathchoice
  {\atoistyle\displaystyle}
  {\atoistyle\textstyle}
  {\atoistyle\scriptstyle}
  {\atoistyle\scriptscriptstyle}
}

As egreg points out in the chat, this is the job of the command \mathpalette (see details here), so the following is an exact equivalent of the preceeding:

\newcommand\atoistyle[2]{\mbox{\rotatebox[origin=c]{180}{$#1\iotaup$}}}
\newcommand\atoi{\mathpalette\atoistyle\relax}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.