0

This is intentionally a duplicate of Formula label outside of formula . The accepted answer to the linked question does not appear to give the requested behaviour, as this MWE demonstrates:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\subsection{Un-numbered equations work}

\noindent Centred equation using \texttt{align*}:
\begin{align*}
    a &= b + c + d
\end{align*}
Centred equation using \texttt{flalign*} and \texttt{phantom}
\begin{flalign*}
    \text{(Very very very long label)}
    &&
    a &= b + c + d
    &
    \phantom{\text{(Very very very long label)}}
\end{flalign*}

\subsection{Numbered equations don't work}

\noindent Centred equation using \texttt{align}:
\begin{align}
    a &= b + c + d
\end{align}
``Centred'' equation using \texttt{flalign} and \texttt{phantom}
\begin{flalign}
    \text{(Very very very long label)}
    &&
    a &= b + c + d
    &
    \phantom{\text{(Very very very long label)}}
\end{flalign}
Removing \texttt{phantom} makes things worse:
\begin{flalign}
    \text{(Very very very long label)}
    &&
    a &= b + c + d
    &
\end{flalign}

\end{document}

Output with markup:

enter image description here

It appears that, for a numbered equation, the "centred" part of the equation is not centred between the margins, but rather centred in the space between the left margin and the left-hand side of the equation number.

Is it possible to get the "centred" part of the equation centred between the margins?

Edit: I'm not set on using flalign; other solutions are fine. I just used flalign in the MWE because the objective of the MWE is to justify the new question by showing why the previous answer (which uses flalign) doesn't work

0
3

What you have observed is the intended behavior of flalign* and flalign:

User’s Guide for the amsmath Package, Page 8: The environment flalign (“full length alignment”) stretches the space between the equation columns to the maximum possible width, leaving only enough space at the margin for the equation number, if present.

To achieve your description, \usetagform from the mathtools package comes to mind:

\documentclass{article}

%\usepackage{amsmath}
\usepackage{mathtools}% loads `amsmath'
\newtagform{zerowidth}{\llap\bgroup(}{)\egroup}

\begin{document}

\subsection{Numbered equations}

\noindent Centred equation using \texttt{align}:
\begin{align}
    a &= b + c + d
\end{align}
``Centred'' equation using \texttt{flalign} with user-defined tag style \texttt{zerowidth}:
\usetagform{zerowidth}
\begin{flalign}
    \text{(Very very very long label)}
    &&
    a &= b + c + d
    &
    \phantom{\text{(Very very very long label)}}
\end{flalign}
\usetagform{default}% don't forget to switch back

\end{document}

equation number with zero width

2
  • Thanks for the reference. I am not looking for information on flalign though; I'm looking for a way of centring the equation with right-aligned numbers and a left-aligned label. I have edited my question to clarify. – user1476176 Aug 17 '18 at 4:29
  • @user1476176 Answer updated per request. :) – Ruixi Zhang Aug 17 '18 at 4:40

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.