[Tex/LaTex] Double Subscript for Subsequences

subscripts

What's the best way to write subsequences? $x_n_i$ gives an error, while $x_{n_{i}}$ works, but it just looks like $x_{ni}$ (the i isn't lowered enough below the n)…

Best Answer

I'm a bit puzzled by your statement that $x_{n_i}$ would create output which "just looks like" that of $x_{ni}$ -- this is not the case in the following MWE (minimum working example). I have a hunch that what you want is $x_{n_i}$, but read on.

\documentclass{article}
\begin{document}
\begin{verbatim}
$x_{ni}$ or ${x_n}_i$ or $x_{n_i}$?
\end{verbatim}
$x_{ni}$ or ${x_n}_i$ or $x_{n_i}$?
\end{document}

enter image description here

Clearly, the first expression, $x_{ni}$, can't be what you want. Note that ${x_n}_i$ and $x_{n_i}$ are both valid expressions from a purely syntactic point of view. However, they do not create the same output. In the former case, the character i is both lowered by a smaller amount and has a larger font size than is the case in the latter. (To be a bit TeXnical, in the first two expressions above, n and i are both typeset in "scriptstyle", whereas in the third expression n is in scriptstyle and i is in "scriptscriptstyle". For Computer Modern math fonts, "scriptstyle" is 30% linearly reduced from "textstyle", and "scriptscriptstyle" is 30% reduced from "scriptstyle" -- or ca 50% linearly reduced from "textstyle". Thus, if the textstyle font size is 10pt, scriptsize is 7pt and scriptscriptsize is 5pt.)

These differences in appearance are, of course, not accidental: in the middle expression above, the symbol i is a subscript/index to the subformula $x_n$, whereas in the final expression i indexes n which, in turn, indexes x. Put differently, in the final expression ${n_i}$ is a subformula that serves to index x.

If there's any chance for ambiguity as to which characters are supposed to index which other characters, you should not hesitate to use parentheses, brackets, or braces -- or whatever grouping symbols are appropriate in your math writing style -- to clarify the intended meaning of your writing.

Addendum, prompted by a follow-up communication from the OP. As the image above illustrates, there's not much visual difference in the appearance of the first and second cases, i.e., of $x_{ni}$ and ${x_n}_i$. In both cases, (a) the n and i characters are in scriptsize, and (b) the i's are set below the baseline by the same amount. The only visual difference, then, is that TeX sets the n in the second case in so-called "cramped subscript" mode, which differs from the "ordinary subscript" position by a (very) small amount.