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)...
- 29,114
-
4Related question: How to raise a superscript. The accepted answer there can be given a negative amount to lower the second subscript as much as you like. – Alan Munn Dec 13 '11 at 05:01
-
2My honest answer is there are none. – percusse Dec 13 '11 at 05:08
-
1I don't think the two questions are related. Rather, the current question is about how to group the indexing characters in order to achieve output that's both visually as well as mathematically pleasing. – Mico Dec 13 '11 at 05:59
1 Answers
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}

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.
- 506,678
-
Thanks! I think it was actually the font I was using that didn't make
$x_{n_i}$look lowered enough. – jamaicanworm Dec 13 '11 at 20:30 -
1
-
I was using the Arev font, with
\usepackage{fouriernc}. Do you happen to know of any similar fonts which don't make sub-subscripts look terrible? – jamaicanworm Dec 13 '11 at 21:07 -
1
-
I am (and have been) using
$x_{n_i}$, but in Arev, this did not look very good; it actually looked a lot like${x_n}_i$. – jamaicanworm Dec 13 '11 at 21:55 -
1In arev, the letter
idefinitely looks very skinny, even anorexic, when it appears in the second-level subscript position. Sadly, only very few font families have so-called "multiple master" designs; if they're lacking this aspect, they'll look skinny at sizes well below the so-called "design size", and they'll look bulky at large sizes. – Mico Dec 13 '11 at 23:12 -
1@Mico: Excellent answer. Somehow I never saw this question before, and think that this is the first time I thought I was reading an "egreg" answer and it turned out not to be one of his. – Peter Grill Apr 08 '13 at 07:01
-