4
\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{equation}
    \mathbf{v}_{\textnormal{h}}=\mathbf{v}_{\textnormal{h},0}\left(X_{\textnormal{m}}, X_{\textnormal{s}}, z\right)+\epsilon\mathbf{v}_{\textnormal{h},1}\left(X_{\textnormal{m}},X_{\textnormal{s}}, z\right)+\epsilon^2\mathbf{v}_{\textnormal{h},2}\left(X_{\textnormal{m}},X_{\textnormal{s}}, z\right)+\cdots\,.
\end{equation}
\end{document}

Question: How can I label epsilon? I'd like to have an arrow (\downarrow) pointing to the equation with text below the arrow.

2

2 Answers 2

5

You can do it with \overset, where the upper part is a zero width tabular in the appropriate size, namely, \scriptsize.

In case you have various annotations, you may need to help TeX in order to get them at the same vertical position.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\annot}[2]{% #1 symbol to annotate, #2 = text
  \overset{%
    \makebox[0pt]{%
      \normalfont\scriptsize
      \begin{tabular}{@{}c@{}} #2 \\ $\downarrow$ \end{tabular}%
    }%
  }{\mathstrut #1}%
}

\begin{document}

\begin{equation}
\mathbf{v}_{\mathrm{h}}=
\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon}{interesting}\mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\epsilon^2\mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\dotsb.
\end{equation}

\begin{equation}
\mathbf{v}_{\mathrm{h}}=
\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon\vphantom{\epsilon^2}}{interesting}
   \mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon^2}{more interesting}
   \mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\dotsb.
\end{equation}

\end{document}

Note the omission of the useless \left and \right tokens, but also \dotsb instead of \cdots.

enter image description here

You can modify the code to allow for both above and below annotation: below positioning is obtained with \annot*.

\documentclass{article}
\usepackage{amsmath}

\NewDocumentCommand{\annot}{smm}{%
  % if *, below, otherwise above
  % #2 = symbol to annotate
  % #3 = text
  \IfBooleanTF{#1}{%
    \innerannot{\underset}{#2}{#3}{\textuparrow}%
  }{%
    \innerannot{\overset}{#2}{\textdownarrow}{#3}%
  }%
}
\NewDocumentCommand{\innerannot}{mmmm}{%
  #1{% \overset or underset
     \makebox[0pt]{%
       \normalfont\scriptsize
       \begin{tabular}{@{}c@{}} #4 \\ #3 \end{tabular}%
    }%
  }{\mathstrut #2}%
}

\begin{document}

\begin{equation}
\mathbf{v}_{\mathrm{h}}=
\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon}{interesting}\mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\epsilon^2\mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\dotsb.
\end{equation}

\begin{equation}
\mathbf{v}_{\mathrm{h}}=
\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon\vphantom{\epsilon^2}}{interesting}
   \mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon^2}{more interesting}
   \mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\dotsb.
\end{equation}

\begin{equation}
\mathbf{v}_{\mathrm{h}}=
\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot{\epsilon}{interesting}
   \mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\annot*{\epsilon^2}{more interesting}
   \mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
  +\dotsb.
\end{equation}

\end{document}

enter image description here

2
  • thank you. Probably off-topic but can I use the same structure to label a second epsilon below the equation?
    – Sylvia
    Commented Jan 19 at 13:34
  • @Sylvia See last edit
    – egreg
    Commented Jan 19 at 13:54
5

The following solution provides two user macros: \explainabove and \explainbelow. They employ \overset and \underset, respectively, which are macros provided by the amsmath package, as well as \mathclap, a macro provide by the mathtools package. (The mathtools package is a superset of the amsmath package.) That way, you can simply write \explainabove{some text}{\epsilon} and \explainbelow{more text}{\epsilon^2} to provide the desired annotations.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for '\mathclap' macro; load 'amsmath' automatically

%% two new user macros
\newcommand\explainabove[2]{%
    \overset{\overset{\mathclap{\textnormal{#1}}}{\downarrow}}{#2\mathstrut}}
\newcommand\explainbelow[2]{%
    \underset{\underset{\mathclap{\textnormal{#1}}}{\uparrow}}{#2\mathstrut}}

\begin{document}

\begin{equation}
 \mathbf{v}_{\mathrm{h}}
=\mathbf{v}_{\mathrm{h},0}(X_{\mathrm{m}},X_{\mathrm{s}},z)
+\explainabove{some text}{\epsilon}
 \mathbf{v}_{\mathrm{h},1}(X_{\mathrm{m}},X_{\mathrm{s}},z)
+\explainbelow{more text}{\epsilon^2}
 \mathbf{v}_{\mathrm{h},2}(X_{\mathrm{m}},X_{\mathrm{s}}, z)
+\dotsb
\end{equation}

\end{document}
1
  • I'd not use \substack but \underset.
    – egreg
    Commented Jan 19 at 13:21

You must log in to answer this question.

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