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.
There is nothing wrong in the output you get. Let's look at an example:
\documentclass{article}
\usepackage{mathptmx}
\begin{document}
8,\textit{t},t $\beta_{8,t}$
\end{document}

You can see that the â8â is quite higher than the âtâ and the same proportions are respected in the subscript.
If you want some figures, here they are.

Here's the output of the example with \usepackage{newtxtext,newtxmath}
instead of \usepackage{mathptmx}

Here the ratio between the two heights (the same in normal size an in subscripts) is 1.19469.
With the stix
fonts the ratio is 1.14407 and the output is

You can reduce the large characters in sub/superscripts:
\documentclass{article}
\usepackage{mathptmx}
\newcommand{\sm}[1]{{\scriptscriptstyle#1}}
\begin{document}
8,\textit{t},t $\beta_{8,t}$ $\beta_{\sm{8},t}$
\end{document}

However, I don't think this should be done.
Best Answer
If you want to define it yourself, it is better with the help of
\DeclarePairedDelimiter
frommathtools
:MWE
Output