# Annotate a math symbol in an itemize

I would like to annotate underneath a math symbol in an itemize list. I would like to have the option of having the annotation either (a) centered or (b) left-aligned with the math symbol, like the following example I made in a word processor (looks ugly, doesn't it?):

I may also need to adjust the spacing between items so that it is obvious what the annotation is referring to.

\documentclass{article}

\newcommand{\dDGp}{\delta\Delta\Gamma_{+}}
\newcommand{\dDGm}{\delta\Delta\Gamma_{-}}

\begin{document}

Centered:
\begin{itemize}
\item{for $\dDGp$ from A to B}
\item{for $\dDGm$ from C to D}
\item{for $\dDGp$ from E to F}
\end{itemize}

Left-aligned:
\begin{itemize}
\item{for $\dDGp$ from A to B}
\item{for $\dDGm$ from C to D}
\item{for $\dDGp$ from E to F}
\end{itemize}

\end{document}


You can use amsmath's \underset{<under>}{<stuff>} to set <under> below <stuff>.

\documentclass{article}

\usepackage{amsmath}

\newlength\tmplen
\newcommand{\dDGp}[1][c]{%
\settowidth{\tmplen}{$\delta\Delta\Delta\Delta\Gamma_+$}%
\underset{\text{\makebox[\tmplen][#1]{positive}}}{\delta\Delta\Delta\Delta\Gamma_+}}
\newcommand{\dDGm}[1][c]{%
\settowidth{\tmplen}{$\delta\Delta\Delta\Delta\Gamma_-$}%
\underset{\text{\makebox[\tmplen][#1]{negative}}}{\delta\Delta\Delta\Delta\Gamma_-}}

\begin{document}

Centered:
\begin{itemize}
\item{for $\dDGp$ from A to B}
\item{for $\dDGm$ from C to D}
\item{for $\dDGp$ from E to F}
\end{itemize}

Left-aligned:
\begin{itemize}
\item{for $\dDGp[l]$ from A to B}
\item{for $\dDGm[l]$ from C to D}
\item{for $\dDGp[l]$ from E to F}
\end{itemize}

Right-aligned:
\begin{itemize}
\item{for $\dDGp[r]$ from A to B}
\item{for $\dDGm[r]$ from C to D}
\item{for $\dDGp[r]$ from E to F}
\end{itemize}

\end{document}


The content is placed in a box of matching width where an optional argument is used to [c]entre, [l]eft-align or [r]ight-align the "subscript." I've enlarged the operator (<stuff>) in the example for reference.

Vertical spacing between items in a list can be managed easily via enumitem.

Here, I use stackengine to achieve the underset. Optional argument determines the alignment (c by default). The following choices I made can be changed: \small under-text size, \sffamily, underset baseline 8pt below the text baseline, and the width of the anchor text determines the width of the complete stack.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\setstackgap{L}{8pt}
\renewcommand\useanchorwidth{T}
\newcommand{\dDGp}[1][c]{\Longunderstack[#1]{$\delta\Delta\Gamma_{+}$%
\\\small\sffamily positive}}
\newcommand{\dDGm}[1][c]{\Longunderstack[#1]{$\delta\Delta\Gamma_{-}$%
\\\small\sffamily negative}}

\begin{document}

Centered:
\begin{itemize}
\item for \dDGp{} from A to B
\item for \dDGm{} from C to D
\item for \dDGp{} from E to F
\end{itemize}

Left-aligned:
\begin{itemize}
\item for \dDGp[l] from A to B
\item for \dDGm[l] from C to D
\item for \dDGp[l] from E to F
\end{itemize}

\end{document}


• Thanks! Do you know how I can adapt this to work in an equation environment? – Andrew Oct 21 '20 at 20:29
• @Andrew The macros \dDGp and \dDGn should work in an equation environment, as well. As to the remaining text, one would typically use \textrm{...} or, with the amsmath package, \text{...}. – Steven B. Segletes Oct 22 '20 at 0:23

I guess that you want the text below to take no space. A \vtop with a nested \halign seems a good solution. You can do \annot[l]{whatever}{something} if you want left alignment. Actually any single letter except c will do.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\annot}[3][c]{%
\leavevmode\vtop{%
\offinterlineskip
\ialign{%
##\cr
#2\cr
\noalign{\vskip1pt}
\if#1c\hidewidth\fi
\check@mathfonts\fontsize{\sf@size}{0}\sffamily\upshape#3\vphantom{Ay}%
\hidewidth\cr
}%
}%
}
\makeatother

\newcommand{\dDGp}{\delta\Delta\Gamma_{+}}
\newcommand{\dDGm}{\delta\Delta\Gamma_{-}}

\begin{document}

Centered:
\begin{itemize}
\item{for \annot{$\dDGp$}{positive} from A to B}
\item{for \annot{$\dDGm$}{negative} from C to D}
\item{for \annot{$\dDGp$}{loooooonger} from E to F}
\end{itemize}

Left-aligned:
\begin{itemize}
\item{for \annot[l]{$\dDGp$}{positive} from A to B}
\item{for \annot[l]{$\dDGm$}{negative} from C to D}
\item{for \annot[l]{$\dDGp$}{loooooonger} from E to F}
\end{itemize}

\end{document}