# Referencing equations

I know that this is somewhat a style-question, but I think it is quite common, so maybe there is a kind of an established standard to this problem.

Consider equational reasoning:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

$$\label{g} g(n) = 0$$

$$\label{searchdx} \begin{split} f(g(n) + 3) & \\ \tiny(\ref{g})\quad &= f(3)\\ %reference to g &= \ldots \end{split}$$
\end{document}


What I attempt to do is to lead the reader along a path of equalities until a conclusion. I prepare this with a list of labeled equations up-front. In the final (and some intermediate) step, I use these equations. What is a good style to reference this usage? The reference should be unobtrusive but notable. Are there macros for this?

edit: On paper or a blackboard, I would annotate each step at the side (roughly where the equation label sits). But how would I do this in LaTeX (and how would I avoid confusing it with the actual label?).

• Could you provide a screenshot of what you want?It would be really great if you can provide that as well. Commented Nov 25, 2016 at 14:04
• Note that \tiny is a text-mode command. It shouldn't be used while in math mode.
– Mico
Commented Nov 25, 2016 at 15:49

Here are two possibilities:

• Write the equation labels above the equation sign.
• Add the justification in a separate column. I don't think that the references are mixed up with the new labels, in particular when you omit the parentheses.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

$$\label{g} g(n) = 0$$

$$\label{h} h(n) = 0$$

\newcommand\justifiedeq[2]{\stackrel{\text{#1}}=}
\begin{align}
f(h(g(n)) + 3) & \justifiedeq{\eqref{g}} f(h(0)+3) \label{f1} \\
& \justifiedeq{\eqref{h}} f(0+3)    \label{f2} \\
& \justifiedeq{ar.}       f(0)      \label{f3}
\end{align}

\begin{align}
f(h(g(n)) + 3) & = f(h(0)+3) && \text{by equation~\ref{g}} \label{F1} \\
& = f(0+3)    && \text{by equation~\ref{h}} \label{F2} \\
& = f(0)      && \text{by arithmetic}       \label{F3}
\end{align}
\end{document}