To place a short arrow and explanatory text beneath an individual LaTeX term, combine \underset with a two-row \substack from amsmath. This guide gives a complete document for a Mac desktop workflow, plus a spacing adjustment for crowded expressions.
Build the annotation with amsmath
The basic arrangement has three levels: the algebraic term, an upward-pointing arrow beneath it, and a short label below the arrow. The arrow points back toward the term it explains. The amsmath guide documents \underset for placing material beneath a base and \substack for stacking multiple lines. Combining them produces the annotation used here. User’s Guide for the amsmath Package
For a Mac without a working LaTeX installation, the LaTeX Project recommends MacTeX, which includes a TeX system and document editors. If you already compile LaTeX documents successfully, use that installation. Getting LaTeX
Save the following complete document as annotations.tex in your LaTeX editor. Compile it with pdfLaTeX and inspect the resulting PDF. All labels and expressions are illustrative.
\documentclass{article}
\usepackage{amsmath}
% First argument: mathematical term.
% Second argument: short text label.
\newcommand{\termnote}[2]{%
\underset{\substack{\uparrow\\\text{#2}}}{#1}%
}
\begin{document}
\[
F(x)=
\termnote{ax^2}{quadratic}
+\termnote{bx}{linear}
+\termnote{c}{constant}.
\]
\end{document}
The example assigns a separate annotation to each of ax^2, bx, and c. The plus signs stay outside the command arguments, making the scope of each explanation explicit. To annotate an entire grouped expression, pass that group as the first argument instead.
The name \termnote is a custom command defined in this document; it is not a built-in package command. Its definition assembles documented components. The \text command supplies ordinary text inside mathematics and adapts its size to the surrounding mathematical style. The amstext package
Understand the argument order
Read \termnote{bx}{linear} as “annotate the term bx with the label linear.” Inside the definition, \underset takes the lower material first and the base second. The \\ separates the arrow row from the label row.
For a one-off annotation, the following is a math-mode fragment equivalent to that command call. It belongs inside the display delimiters of the complete document above:
\underset{\substack{\uparrow\\\text{linear}}}{bx}
Keep the arrow direction consistent throughout a document. The upward arrow suggests that the explanation identifies the term above it. If your intended reading is from the expression down to its explanation, replace \uparrow with \downarrow in the command definition.
Choose the layout that matches the explanation
Before adding packages, decide what the arrow needs to connect. An annotation identifying one term, an arrow extending along an expression, and an arrow explaining a transition between equation rows require different constructions.
| Intended result | Suitable construction | Where it belongs |
|---|---|---|
| Short vertical arrow and text beneath one term | Custom combination of \underset, \substack, and \text |
Inside a mathematical expression |
| Horizontal arrow beneath an expression | \underrightarrow, \underleftarrow, or \underleftrightarrow from amsmath |
Around the expression receiving the arrow |
| Horizontal arrow with text above or below its shaft | \xrightarrow or \xleftarrow from amsmath |
Between mathematical objects |
| Explanatory arrows beside successive equation rows | WithArrows or DispWithArrows from witharrows |
In the package’s equation alignment environments |
The amsmath guide distinguishes under-arrows from extensible arrows: the former decorate expressions, while the latter accommodate labels attached to an arrow. Neither automatically creates the three-level vertical annotation in the first example. User’s Guide for the amsmath Package
The witharrows package documents WithArrows as an alignment component resembling aligned, and DispWithArrows as a display environment resembling align. Its principal layout places explanatory arrows to the right of equation rows. For labels directly beneath individual terms, use the first example; choose witharrows when explaining steps between rows. The package witharrows for plain-TeX and LaTeX
Control label width without creating collisions
Start with the first document and inspect the spacing before changing it. A label such as constant may be substantially wider than its term, c. That extra width can make a short expression look spread out, but it also gives the explanation room.
When preserving compact term spacing matters, mathtools provides \mathclap. It centers its contents in a box with zero reported width. The package loads amsmath, so the revised document needs only \usepackage{mathtools}. The mathtools package, sections 2 and 3.1.1
Here is a second complete document for comparison. It hides only the label’s width; the arrow remains part of the measured annotation.
\documentclass{article}
\usepackage{mathtools}
\newcommand{\compacttermnote}[2]{%
\underset{%
\substack{\uparrow\\\mathclap{\text{#2}}}%
}{#1}%
}
\begin{document}
\[
F(x)=
\compacttermnote{ax^2}{quadratic}
\quad+\quad
\compacttermnote{bx}{linear}
\quad+\quad
\compacttermnote{c}{constant}.
\]
\end{document}
Zero reported width does not mean invisible text. The label still extends to either side of its center. Consequently, neighboring labels can overlap even though the algebra fits comfortably on the line. The explicit \quad spacing in this illustrative layout gives them additional room; adjust it after viewing your own expression.
Use this decision sequence: first shorten the labels, then compare the ordinary and compact versions, then add deliberate spacing where needed. If the explanation still requires a sentence, move that sentence into the surrounding prose and leave a brief identifier beneath the term. This keeps the annotation useful at normal reading size.
Put annotated expressions in the correct environment
For one unnumbered expression, use \[ ... \] as shown above. For several aligned rows, use align* directly in the document body. An aligned environment instead belongs inside an enclosing mathematical environment. These boundaries are documented in the amsmath guide. User’s Guide for the amsmath Package, section 3
The following is a replacement display fragment for the first document. It uses the existing \termnote definition; replace the entire original display, including its opening and closing delimiters.
\begin{align*}
F(x) &= ax^2+bx+c \\
&= \termnote{ax^2}{quadratic}
+\termnote{bx}{linear}
+\termnote{c}{constant}.
\end{align*}
Inspect the annotated row together with the following paragraph or equation. Labels add depth beneath the mathematical baseline, so a layout that looks balanced in isolation may feel crowded in a longer derivation. Prefer a display for these annotations when several terms need explanations.
Diagnose common problems
- The custom command is undefined: include its
\newcommanddefinition before\begin{document}. - A package command is undefined: check that the corresponding package is loaded. The compact example requires
mathtoolsfor\mathclap. - The wrong material receives the annotation: check the braces around the first argument. Use
\termnote{ax^2}{quadratic}to include the coefficient and exponent. - Labels collide: return to the ordinary-width version, shorten the wording, or increase separation between annotated terms.
- An alignment produces a nesting error: use the complete environment arrangement shown above rather than putting
align*inside another display.
For these ordinary algebraic terms, the command keeps the term as its base and attaches the explanation below. The amsmath implementation also preserves binary or relation classification when the base has that classification, but annotating operators introduces additional spacing considerations. Begin by annotating the terms themselves. The amsmath package, section 12
The examples were checked against the documented commands but were not compiled in the research environment. Compile the complete document in your Mac installation before integrating the command into a larger manuscript.
Keep the ordinary-width version as your starting point. Once each arrow clearly identifies its term and each label remains readable, use the compact variant only where the surrounding expression has enough room for the visible text.
Sources
- Getting LaTeX — The LaTeX Project.
- User’s Guide for the amsmath Package — American Mathematical Society and The LaTeX Project.
- The amstext package — The LaTeX Project, via CTAN.
- The mathtools package — Morten Høgholm, Lars Madsen, and The LaTeX3 Project, via CTAN.
- The package witharrows for plain-TeX and LaTeX — F. Pantigny, via CTAN.
- The amsmath package — The LaTeX Project, via CTAN.