# Annotate equation

I have an equation that uses (\varphi) which I'd like to define with a text, like the following (hardcoded) example:

The "traditional" way would be to do this in the surrounding text:

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

\textbf{Textbased}

Blabla where $\varphi$ is \texttt{definition}

$$\varphi = 1337$$
\end{document}


Now, doing a simple \text{def} would work, however this affects the alignment, as the equation is centered around the total equation, which includes the \text{def}. Furthermore, the definition is not right-aligned as desired:

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

$$\varphi = 1337 \qquad \text{defs}$$
\end{document}


Another option is listing a tag. This does what I desire, which is to define some variable to the side of the main equation. However, its main problem is that it actually replaces the equation number like so:

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

\textbf{Tagbased}

$$\varphi = 1337 \tag*{defs}$$
\end{document}


Anyone that has a solution?

Welcome! You could use \newtagform from mathtools.

\documentclass[11pt]{article}
\usepackage{mathtools}
\newtagform{defs}{\text{defs}~(}{)}
\begin{document}
\usetagform{defs}
$$\varphi = 1337$$
\usetagform{default}
$$E=m\,c^2$$
\end{document}


As illustrated, with \usetagform{default} you can switch back to the default tag form.