The formula $a_\beta$ renders the same as $a_{\beta}$.
But $a_\bar{b}$ yields the Missing { inserted error, as opposed to $a_{\bar{b}}$.
Why?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityTeX expects a math subformula as subscript or superscript. This is either a plain math atom or a formula surrounded by curly braces. This has nothing to do with argument parsing. Arguments are assigned based on token and token groups (curly braces) without expanding. Sub- and superscripts, however, look for math atoms and formulas with expansion.
\beta is usually a math atom and can therefore be used without curly braces as sub- or superscript.
% plain TeX
$ a_\beta $
\def\beta{BETA}
$ a_\beta $
$ a_\empty\csname alpha\endcsname $
\bye
In the second case, \beta is a single token, but it is a sequence of four math atoms B, E, T, A. The first goes to the subscript.
The third case uses eight tokens as subscript without the need for curly braces,
because after expanding the math atom \alpha remains.
This is different from parsing as undelimited argument. Then, the subscript would have taken the token \empty that expands to nothing.
If you are unsure about the nature of the subscript, use curly braces. The curly braces can be omitted for single math atoms or if the expansion already provides curly braces for a subformula as in the case of \text of package amstext (amsmath):
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
a_1 = a_{1}
\]
\[
a_\text{subscript} = a_{\text{subscript}}
\]
\end{document}
10^-1 doesn't work, but 10^{-1 } does. Brilliant explanation!
Sep 8, 2020 at 16:33
\betais a single token. But\bar{b}is several tokens (4?). so it takes\baras the next token and this pulls the one after as its argument. So you get\barapplied to just{as the subscript andb}is left. Hence the unbalanced brackets and the complaint that a{is missing.\fbox{\fbox{x}}double boxes x but\fbox\fbox{x}is\fbox{\fbox}{x}which just gives errors