# adjust alignment of equation numbers with leqno

I an using leqno and would like the equation numbers to be right justified relative to themselves. That is, I want all the digits in the ones column aligned, as they are when not using leqno. Below is what happen naturally, but I want the equation numbers to look like the enumerate numbers.

\documentclass{article}
\usepackage[leqno]{amsmath}
\usepackage[shortlabels]{enumitem}

\begin{document}

\begin{enumerate}[(1)]
\setcounter{enumi}{7}
\item A
\item B
\item C
\item D
\end{enumerate}

\setcounter{equation}{7}
\begin{align}
a=b\\
b=c\\
c=d\\
d=e
\end{align}

\end{document}


You first of all need to detach \eqref and the equation number making macros. Then you can redefine \tagform@ to add a space as wide as a digit in case the equation number is less than 10.

\documentclass{article}
\usepackage[leqno]{amsmath}
\usepackage[shortlabels]{enumitem}

\makeatletter
% detach \eqref and \tag making
\renewcommand{\eqref}[1]{\textup{\eqreftagform@{\ref{#1}}}}
\let\eqreftagform@\tagform@

\def\tagform@#1{%
\ifx\theequation#1%
\ifnum\value{equation}<10 \hphantom{0}\fi
\fi
\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}%
}
\makeatother

\begin{document}

\begin{enumerate}[(1)]
\setcounter{enumi}{7}
\item A
\item B
\item C
\item D
\end{enumerate}

\setcounter{equation}{7}
\begin{gather}
a=b\\
b=c\\
c=d\\
d=e
\end{gather}

\end{document}


Cases where you use \tag{...} are not covered.

I wouldn't do it.

• Why would you not do it? – pgregory Aug 16 '15 at 14:38
• @pgregory I wouldn't use leqno in the first place; I find the space before the number much worse than the missing alignment. – egreg Aug 16 '15 at 14:42