[XeTeX] vertically aligned sub and superscript

William Adams will.adams at frycomm.com
Fri Jul 20 16:26:00 CEST 2007


On Jul 20, 2007, at 9:50 AM, Manuel Souto Pico wrote:

> I would like to know if it's possible to have a subscript and a  
> superscript
> at the same and vertically aligned.
>
> What I'm doing now is x_{a}^{b} o x^{b}_{a} but a and b are not  
> aligned.

You'll need a strut or invisible box of some sort to make the box for  
the ``a'' as tall as that for the ``b'' --- probably the best thing  
to do is to define a macro which takes three arguments, e.g.:

\documentclass{minimal}
\newcommand{\supersub}[3]{#1^{#2\vphantom{b}}_{#3\vphantom{b}}}
\begin{document}
$x^a_b$ $x^b_a$ $\supersub{x}{a}{b}$ $\supersub{x}{b}{a}$
\end{document}

I believe.

I'd suggest checking out Gratzer's Math Into LaTeX to be sure of a  
good answer though.

William

-- 
William Adams
senior graphic designer
Fry Communications




More information about the XeTeX mailing list