[comp.text] Double subscripts and \mathaccent's in TeX

ribet@maalox.berkeley.edu (Kenneth A. Ribet) (10/10/89)

Hello, everyone.  I'm posting this question to find out whether
the peculiarity of TeX which I ran into this morning is a well known
phenomenon.

Consider the expressions ${A_B}_C$ and ${\tilde A}_B$.  They pose
no problems for TeX.  However, TeX refuses to process the expression
    ${{\tilde A}_B}_C$,
claiming that there is a ``double subscript.''  The only workaround
for this that I know is to embed the $\tilde A$ in a \hbox.

Presumably, this behavior is explained by the rules in Appendix G
of the TeXbook; even so, I find it a bit illogical.

Am I doing something wrong?  Is my difficulty familiar to everybody?

-ken ribet, UC Berkeley Math Department

...ucbvax!math!ribet        ribet@math.berkeley.edu

ribet@maalox.berkeley.edu (Kenneth A. Ribet) (10/11/89)

In article <1989Oct9.214708.8873@agate.berkeley.edu> I wrote:

>Consider the expressions ${A_B}_C$ and ${\tilde A}_B$.  They pose
>no problems for TeX.  However, TeX refuses to process the expression
>    ${{\tilde A}_B}_C$,
>claiming that there is a ``double subscript.''  The only workaround
>for this that I know is to embed the $\tilde A$ in a \hbox.
>
>Presumably, this behavior is explained by the rules in Appendix G
>of the TeXbook; even so, I find it a bit illogical.

The solution to my difficulty was provided by Joe Weening
(weening@Gang-of-Four.Stanford.EDU):


>On p. 291 of the TeXbook, when describing the semantics of braces in
>math mode, it says "If the resulting math list is a single Acc atom,
>however (i.e., an accented quantity), that atom is appended."  This is
>probably done to make things like {\tilde A}_B come out right; he
>wants to make B a subscript of the Acc atom, not of an Ord atom that
>would otherwise result from the braces.  But it leads to the anomaly
>in your case, that

>	A_B_C		  fails because of a double subscript
>	{A_B}_C		  doesn't fail because {A_B} becomes an atom
>	{{\tilde A}_B}_C  fails because {\tilde A} is an Acc atom,
>			  and {{\tilde A}_B} is also an Acc atom, so
>			  the braces have no net effect

>But you can fix it by putting in a {} in various places:

>	{{}{\tilde A}_B}_C
>	{{{}\tilde A}_B}_C
>	{{\tilde A{}}_B}_C
>	{{\tilde A}{}_B}_C
>	{{\tilde A}_B{}}_C
>	{{\tilde A}_B}{}_C

I don't like the last alternative, because it makes the subscript $C$
at the same level on the page as the subscript $B$, but the first five
solutions seem fine.  Thanks, Joe.


-ken ribet, UC Berkeley Math Department

...ucbvax!math!ribet        ribet@math.berkeley.edu