8

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

enter image description here

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}

\begin{equation}
\varphi = 1337
\end{equation}
\end{document}

enter image description here

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}

\textbf{Quadbased}

\begin{equation}
\varphi = 1337 \qquad \text{defs}
\end{equation}
\end{document}

enter image description here

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}

\begin{equation}
\varphi = 1337 \tag*{defs}
\end{equation}
\end{document}

enter image description here

Anyone that has a solution?

14

Welcome! You could use \newtagform from mathtools.

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

enter image description here

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.