1

What is the _ used to signify when following some sequence like \hat? The error I sometimes get leads me to wonder if it represents a function call, with whatever follows it being the arguments.

1 Answer 1

4

Yes.

_ (in math mode) identifies "subscript notation"; similarly ^ identifies "superscript notation".

From the TeX Book (Chapter 16: Typing Math Formulas, p 128):

... you can get superscripts (up high) and subscripts (down low) by using ^ and _, as shown in the following examples:

Input -> Output
$x^2$ -> x2
$x_2$ -> x2
$2^x$ -> 2x
$x^2y^2$ -> x2y2
$x ^ 2y ^ 2$ -> x2y2
$x_2y_2$ -> x2y2
$_2F_3$ -> 2F3

Notice that ^ and _ apply only to the next single character. If you want several things to be superscripted or subscripted, just enclose them in braces.

In case these are used with operators (like \int, and \sum, ...), they may be set slightly differently when used in a display.

2
  • 2
    As we know, DEK doesn't always quite tell the truth :-) Assuming _ is catcode 8 then it will work with certain unbraced content.
    – Joseph Wright
    Jul 29, 2015 at 6:32
  • 3
    For instance, $x_ \relax\space\relax\bgroup 2\egroup$ is equivalent to $x_2$. But this is going esoteric. ;-)
    – egreg
    Jul 29, 2015 at 6:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .