3

In the equation environment, the equation is centered, but the equation number is right-aligned. I would like to have, locally, a list of equations (think enumerate), where similarly the equations themselves are centered but the labels are not. Ideally they should be left-aligned but a bit indented. (I do not wish to do this with all equations, but just in a single place.)

This is how I would like it to look.

\documentclass{article}
\usepackage{parskip}
\begin{document}
    
The two following equations are equivalent:

    \-\hspace{3mm} 1) $\hspace{5cm} a=b$
    
    \-\hspace{3mm} 2) $\hspace{5cm} b=a\,.$
    
\end{document}

enter image description here

I've tried \begin{center} and \centering but they seem to need or create new lines/paragraphs. Being inside an enumerate environment might make things even harder, so perhaps I could do the listing and indentation manually. However, trying to do centering by adding horizontal space doesn't seem reasonable...

2
  • 2
    Welcome to TeX.SE. Should all equation numbers be placed on the left, or just some of them? Please advise.
    – Mico
    Jan 21 at 12:57
  • Hi! Just some of them. I have clarified the post.
    – Lorents
    Jan 21 at 13:09

2 Answers 2

4

You could use a \makebox to create your custom label without taking space and then use \hfill before and after your inline equation to center it:

\documentclass{article}
\usepackage{parskip}
\begin{document}
    
The two following equations are equivalent:

    \makebox[0pt][l]{\hspace{3mm} 1)} \hfill $a=b$ \hfill\mbox{}
    
\end{document}
2
4

You can use a custom enumerate, in which labels would be redefined to reflect equation numbers. The list label can be further formatted, e.g. parentheses, indentation etc. It's also possible to use a cross-reference to such equations.

Example below requires enumitem package. The amsmath is only for \eqref{...} which encloses references within parentheses. The macro \eqcenter is to make sure equations are centred regardless of a label and its indentation.

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}

\newlist{lefteq}{enumerate}{1}
\setlist[lefteq]{
  left=4em,   % indentation
  before*=\stepcounter{equation}\setcounter{lefteqi}{\theequation},
  label=\arabic{lefteqi})\setcounter{equation}{\thelefteqi},
  ref=\arabic{lefteqi},
}
\newcommand\eqcenter[1]{\hfill\llap{\clap{#1}\hspace{0.5\textwidth}}}


\begin{document}
Regular numbering
\begin{equation}
  a = b
\end{equation}

Custom numbering
\begin{lefteq}
\item \eqcenter{$f(x) = ax_1 + bx_2$} \label{eq:a}
\item \eqcenter{$g(x) = c \sin(x)$}
\end{lefteq}

Regular numbering
\begin{equation}
  a = b
\end{equation}

References to custom equation \eqref{eq:a}.
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .