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.
Best Answer
I find the notation
unclear; readers won't be able to distinguish it from
However, if you really insist on doing it that way, you just have to add a pair of braces; I add what I'd do, instead.
It's a problem with math accent that sometimes shows up; in an expression such as
${\dot{v}_k}$
the outer braces are stripped off by rule, because they contain a single Acc atom; therefore the intuitivegives a
Double subscript
error. Adding an empty subformula avoids the problem.