[Tex/LaTex] flush text on the left and centre equation of the same line (not working!)

equationshorizontal alignmentsubequations

Output from latex

I want to have the "Mass" and "Momentum" text part aligned to the left side of the page (where you see 'steady' and 'version' from the previous paragraph), while keeping the equations on the same line and centered. I have tried using {align}, \llap, {aligned}, {flalign}, and none have worked properly. I want to label each equation within the {subequations} command to reference them so \begin{equation} is used within each subequation.

\llap has managed to help me get the text to not interfere with the centering of the equations, but using \begin{flushleft}, \begin{flushright}, etc only give me errors. Here is my code:

\documentclass[a4paper,12pt,default,numbered,print,index]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx} % Required for the inclusion of images
\usepackage{setspace}        % for use of \singlespacing and \doublespacing
\usepackage{pdfpages}
\usepackage{cite}
\usepackage[section]{placeins}
\usepackage{comment}
\usepackage{hyperref}
\usepackage{siunitx}
\usepackage{color}
\usepackage{ragged2e}
\usepackage{esvect}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{soul}
\usepackage{bm}
\usepackage{url}
\usepackage{xparse}

\begin{document}

We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j}$ = 0), an ideal gas ($p = \rho RT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:

\begin{subequations}
\begin{equation}
\label{eq:linear_EOM_vector_mass}
\llap{\text{Mass}}\frac{\bar{D}\rho'}{Dt} + \bar{\rho}\nabla\cdot\boldsymbol{u}' = 
\mathbf{0}
\end{equation}
\begin{equation}
\label{eq:linear_EOM_vector_mom}
\llap{\text{Momentum}}\frac{\bar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} 
\nabla p' = \mathbf{0}
\end{equation}
\end{subequations}

\end{document}

I have also tried using \llap and adding on space myself (as seen below) but it's messy because each equation requires different spacings and it will never properly align:

\llap{\text{Momentum}\qquad\qquad\qquad\qquad\qquad\qquad\enspace}

Please let me know what to do! Thanks so much in advance.




EDIT #2: image for the two different alternatives given by helpful comments:

enter image description here

\documentclass[a4paper,12pt,default,numbered,print,index]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx} % Required for the inclusion of images
\usepackage{setspace}        % for use of \singlespacing and \doublespacing
\usepackage{pdfpages}
\usepackage{cite}
\usepackage[section]{placeins}
\usepackage{comment}
\usepackage{hyperref}
\usepackage{siunitx}
\usepackage{color}
\usepackage{ragged2e}
\usepackage{esvect}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{soul}
\usepackage{bm}
\usepackage{url}
\usepackage{xparse}

\begin{document}

We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j}$ = 0), an ideal gas ($p = \rho RT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:

\begin{subequations}
\begin{flalign}
&    \rlap{Mass}     &
    \frac{\bar{D}\rho'}{Dt} + \bar{\rho}\nabla\cdot\boldsymbol{u}'
            & = \mathbf{0}  &   \label{eq:linear_EOM_vector_mass}\\
&    \rlap{Momentum} &
    \frac{\bar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} \nabla p'
            & = \mathbf{0}  &   \label{eq:linear_EOM_vector_mom}\\
&    \rlap{Energy}     &
    c_p\frac{\bar{D}}{Dt}(\bar{\rho}T' + \rho'\bar{T}) + \nabla \cdot     (\boldsymbol{u'}\bar{p} + \bar{\boldsymbol{u}}p')
            & = \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho'   &       \label{eq:linear_EOM_vector_energy}\\
&    \rlap{Entropy}     &
    \frac{\bar{D}s'}{Dt}
            & = \frac{\dot{q}'}{\bar{\rho}\bar{T}}  &       \label{eq:linear_EOM_vector_entropy}\\
&    \rlap{Vorticity}     &            
    \frac{\bar{D}\boldsymbol{\xi}'}{Dt}
            & = \mathbf{0}  &   \label{eq:linear_EOM_vector_vorticity}           
\end{flalign}
\end{subequations}

\begin{subequations}
\begin{flalign}
 & \rlap{Mass} & & \frac{\bar{D}\rho'}{Dt} +     \bar{\rho}\nabla\cdot\boldsymbol{u}' = \mathbf{0} &     \label{eq:linear_EOM_vector_mass}\\
 & \rlap{Momentum} & & \frac{\bar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}}     \nabla p' = \mathbf{0} & \label{eq:linear_EOM_vector_mom}\\
 & \rlap{Energy} & & c_p\frac{\bar{D}}{Dt}(\bar{\rho}T' + \rho'\bar{T}) +     \nabla \cdot (\boldsymbol{u'}\bar{p} +\bar{\boldsymbol{u}}p') =     \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho' & \label{eq:linear_EOM_vector_energy}\\
 & \rlap{Entropy} & & \frac{\bar{D}s'}{Dt} = \frac{\dot{q}'}    {\bar{\rho}\bar{T}} & \label{eq:linear_EOM_vector_entropy}\\
 & \rlap{Vorticity} & & \frac{\bar{D}\boldsymbol{\xi}'}{Dt} = \mathbf{0} &     \label{eq:linear_EOM_vector_vorticity}    
\end{flalign}
\end{subequations}

\end{document}

Best Answer

Here are three possibilities; the first two are variants based on the flalign environment, with a different positioning of the equations w.r.t.the left margin text. The third possibility paves the texts aligned w.r.t. each other, at some distance from the equations. It's based on alignat:

\documentclass[a4paper, 12pt, default, numbered, print, index]{article}
\usepackage{mathtools}

\usepackage{eqparbox} \newcommand{\eqmathbox}2[M]{\eqmakebox[#1]{$\displaystyle#2$}}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5><6><7><8><9><10>
<10.95><12><14.4><17.28><20.74><24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}

\begin{document}

We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j}$ = 0), an ideal gas ($p = ρRT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:

\begin{subequations}
\begin{flalign}
\label{eq:linear_EOM_vector_mass}
 & \rlap{Mass} & &\eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0}} & \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
 & \rlap{Momentum} & &\eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}}
\end{flalign}
\end{subequations}

\begin{subequations}
\begin{flalign}
\label{eq:linear_EOM_vector_mass}
 & \text{Mass} & & \frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0} &\hspace{12em} \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
 & \text{Momentum} & & \frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}&&
\end{flalign}
\end{subequations}

\begin{subequations}
\begin{alignat}{2}
\label{eq:linear_EOM_vector_mass}
 & \text{Mass} &\hspace{3em} &\frac{\widebar{D}\rho'}{Dt} + \bar{ρ}∇ · \boldsymbol{u}' = \mathbf{0} \\[0.8ex]
\label{eq:linear_EOM_vector_mom}
 & \text{Momentum} & & \frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{ρ}}
∇ p' = \mathbf{0}
\end{alignat}
\end{subequations}

\end{document} 

enter image description here

Edit: Here is how to adapt the first solution to the last version of the O.P.'s code (two variants):

\documentclass[a4paper,12pt,default,numbered,print,index]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx} % Required for the inclusion of images
\usepackage{setspace} % for use of \singlespacing and \doublespacing
\usepackage{pdfpages}
\usepackage{cite}
\usepackage[section]{placeins}
\usepackage{comment}
\usepackage{siunitx}
\usepackage{color}
\usepackage{ragged2e}
\usepackage{esvect}
\usepackage{mathtools}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{soul}
\usepackage{bm}
\usepackage{url}
\usepackage{xparse}
\usepackage{hyperref}
\newcommand{\myeqlabel}[1]{\rlap{\bfseries#1}}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}

    \DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
    \DeclareFontShape{U}{mathx}{m}{n}{
    <5><6><7><8><9><10>
    <10.95><12><14.4><17.28><20.74><24.88>
    mathx10
    }{}
    \DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
    \DeclareFontSubstitution{U}{mathx}{m}{n}
    \DeclareMathAccent{\widebar}{0}{mathx}{"73}


\begin{document}

We can simplify our analysis by assuming the flow is inviscid ($\tau_{i,j} = 0$), an ideal gas ($p = \rho RT$), and calorically perfect ($c_p$, $c_v$ = constant). Thus, for a homogeneous, steady, uniform gas flow in a straight duct without heat conduction, the linearised governing equations can be written as:
\begin{subequations}
\begin{flalign}
& \myeqlabel{Mass} &&
    \eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{\rho}\,\nabla\cdot\boldsymbol{u}'
            = \mathbf{0}} & \label{eq:linear_EOM_vector_mass}\\
& \myeqlabel{Momentum} &&
    \eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} \nabla p'
            = \mathbf{0}} & \label{eq:linear_EOM_vector_mom}\\
& \myeqlabel{Energy} && 
    \eqmathbox{c_p\frac{\widebar{D}}{Dt}(\bar{\rho}\,T' + \rho'\widebar{T}) + \nabla \cdot (\boldsymbol{u'}\bar{p} + \bar{\boldsymbol{u}}p')
            = \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho' }& \label{eq:linear_EOM_vector_energy}\\
& \myeqlabel{Entropy} && 
    \eqmathbox{\frac{\widebar{D}s'}{Dt}
            = \frac{\dot{q}'}{\bar{\rho}\,\bar{T}}} & \label{eq:linear_EOM_vector_entropy}\\
& \myeqlabel{Vorticity} &&
    \eqmathbox{\frac{\widebar{D}\boldsymbol{\xi}'}{Dt}
            = \mathbf{0}} & \label{eq:linear_EOM_vector_vorticity}
\end{flalign}
\end{subequations}
\begin{subequations}
\begin{flalign}
& \myeqlabel{Mass} &&
    \eqmathbox{\frac{\widebar{D}\rho'}{Dt} + \bar{\rho}\,\nabla\cdot\boldsymbol{u}'
            = \mathbf{0}} & \label{eq:linear_EOM_vector_mass}\\
& \textbf{Momen\rlap{tum}} &&
    \eqmathbox{\frac{\widebar{D}\mathbf{u}'}{Dt} + \frac{1}{\bar{\rho}} \nabla p'
            = \mathbf{0}} & \label{eq:linear_EOM_vector_mom}\\
& \myeqlabel{Energy} &&
    \eqmathbox{c_p\frac{\widebar{D}}{Dt}(\bar{\rho}\,T' + \rho'\widebar{T}) + \nabla \cdot (\boldsymbol{u'}\bar{p} + \bar{\boldsymbol{u}}p')
            = \dot{q}'\bar{\rho} + \bar{\dot{q}}\rho' }& \label{eq:linear_EOM_vector_energy}\\
& \myeqlabel{Entropy} &&
    \eqmathbox{\frac{\widebar{D}s'}{Dt}
            = \frac{\dot{q}'}{\bar{\rho}\,\bar{T}}} & \label{eq:linear_EOM_vector_entropy}\\
& \myeqlabel{Vorticity} &&
    \eqmathbox{\frac{\widebar{D}\boldsymbol{\xi}'}{Dt}
            = \mathbf{0}} & \label{eq:linear_EOM_vector_vorticity}
\end{flalign}
\end{subequations}

\end{document} 

enter image description here

Related Question