6

Most single commands don't require explicit braces if they appear in a subscript or superscript. For example,

a_\text{n}

compiles fine. But a few do require explicit braces: for example,

a_{\tilde{n}}

compiles while

a_\tilde{n}

does not. Is there any rule for which commands must be surrounded by explicit braces in a subscript even when they appear by themselves?

tparker
  • 719

1 Answers1

4

TL;DR

Always use braces. Always use braces. Always use braces.

Some more words

The LaTeX manual always uses

_{<subscript>}

even if the subscript consists of a single token and it has very good reasons for doing so; for instance, it would propose

a_{1}+b_{11}

Experienced users tend to omit the braces, but this can be very dangerous. For example, the following example

\documentclass{article}
\begin{document}
$A_\in+A_\notin$
\end{document}

will fail with

! Missing { inserted.
<to be read again> 
                   \mathrel 
l.3 $A_\in+A_\notin
                   $

because \notin is not really a single object.

An input such as A_\tilde{x} will similarly fail. On the other hand,

F_\mathrm{eff}

will work, but it's just luck. So, what's the rule?

Sorry, there's none except always using braces.

egreg
  • 1,121,712