Centering part of a line

centerenumitemequationshorizontal alignmentlists

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…

Best Answer

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}
Related Question