4

The crux of the issue is I want to refer to some equations as "Equation 1" in the body of the text. However, the actual numbering of the equations I want to appear as a right justified "eq. 1". Below is what I currently have.

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage[colorlinks]{hyperref}
\usepackage{cleveref}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }

%\def\theequation{eq. \arabic{equation}}

\begin{document}
    Blah blah blah (\autoref{eq:nitrate_intro}). Also blah blah,
    \autoref{eq:reduce_intro}.

\begin{equation}
    \label{eq:nitrate_intro}
    \includegraphics[scale=0.3, valign=c]{nitration_intro.png}
\end{equation}
\begin{equation}
    \label{eq:reduce_intro}
    \includegraphics[scale=0.3, valign=c]{reduction_intro.png}
\end{equation}
\end{document}

Output

This is almost perfect. The only extra thing I need (for points) is to change the equation numbering from "(1)" to "(eq. 1)". I commented out this bit of code

\def\theequation{eq. \arabic{equation}}

The problem with that is that it makes the labels turn into "Equation eq. 1". Below is an example with the \def\theequation line uncommented.

enter image description here

3

Welcome to TeX-SE! \newtagform from mathtools allows you to do that.

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage[colorlinks]{hyperref}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{mathtools}
\newtagform{FG}{(eq.\ }{)}
\usetagform{FG}
\usepackage{cleveref}

%\def\theequation{eq. \arabic{equation}}

\begin{document}
    Blah blah blah (\autoref{eq:nitrate_intro}). Also blah blah,
    \autoref{eq:reduce_intro}.

\begin{equation}
    \label{eq:nitrate_intro}
    \includegraphics[scale=0.3, valign=c]{example-image-a}
\end{equation}
\begin{equation}
    \label{eq:reduce_intro}
    \includegraphics[scale=0.3, valign=c]{example-image-b}
\end{equation}
\end{document}

enter image description here

If you want to confine this effect to these equations, you can switch back to normal with \usetagform{default}.

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage[colorlinks]{hyperref}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{mathtools}
\newtagform{FG}{(eq.\ }{)}
\usepackage{cleveref}

%\def\theequation{eq. \arabic{equation}}

\begin{document}
    Blah blah blah (\autoref{eq:nitrate_intro}). Also blah blah,
    \autoref{eq:reduce_intro}.\usetagform{FG}

\begin{equation}
    \label{eq:nitrate_intro}
    \includegraphics[scale=0.3, valign=c]{example-image-a}
\end{equation}
\begin{equation}
    \label{eq:reduce_intro}
    \includegraphics[scale=0.3, valign=c]{example-image-b}
\end{equation}
\usetagform{default}

\end{document}

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.