# Aligning an equation at multiple points, with both left and right alignment, as well as equals sign alignment

I am trying to achieve the formatting in the image attached, with the bracketed right equation/text aligned to the right side of the page. However, I would also like to be able to align the equal signs on the left hand expressions, whilst also aligning the most side of each line with the left hand side of the page.

I have attempted to do this using align and /hfill; however I suspect this is not exactly efficient or correct. I am not a Latex expert, I would just like to make lists of these fairly simple equations look pretty.

Any assistance would be greatly appreciated.

The code I have used is below:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\par \vspace{3mm} R{_{1}} &= \dfrac{wl}{2} \\
\par \vspace{3mm} R{_{2}} &= R{_{1}} \\
\par \vspace{3mm} V{_{x}} &= w\left(\dfrac{l}{2}-x\right) \\
\par \vspace{3mm} V{_{max}} &= R{_{1}}=R{_{2}} \hfill \text{(at}\;R_{1}\;\text{and}\;R_{2}\text{)} \\
\par \vspace{3mm} M{_{max}}&=\dfrac{wl^{2}}{8} \hfill \text{(at centre)}\\
\par \vspace{3mm} M{_{x}}&=\dfrac{wx}{2}\left(l-x\right) \\
\par \vspace{3mm} \Delta{_{max}}&=\dfrac{5wl^{4}}{384EI} \\
\par \vspace{3mm} \Delta{_{x}}&=\dfrac{wx}{24EI}\left(l^{3}-2lx^{2}+x^{3}\right) \hfill \text{(at centre)}\\
\end{align*}
\end{document}


Many thanks and kind regards

Some preliminary notes:

• R{_{1}} is wrong and should be R_{1} (similarly for the other cases)
• “max” in a subscript should be upright
• \par and \vspace are meaningless in a math display
• the last line in a display should not end with \\

In the code below I used showframe just to show the page margins; don't use it yourself.

You can use the eqparbox environment. Each use should have a unique label, in this case A. Use a different one for each display where you need \lefteqbox.

I also added how I would typeset the display.

\documentclass{article}
\usepackage{amsmath,eqparbox}

\newcommand{\lefteqbox}[2]{%
\eqparbox[t]{#1}{$\displaystyle#2$\hfil}%
}

\usepackage{showframe}

\begin{document}

This is possibly what you want to achieve
\begin{flalign*}
\lefteqbox{A}{R_{1}}         &= \frac{wl}{2} \1ex] \lefteqbox{A}{R_{2}} &= R_{1} \\[1ex] \lefteqbox{A}{V_{x}} &= w\left(\frac{l}{2}-x\right) \\[1ex] \lefteqbox{A}{V_{\max}} &= R_{1}=R_{2} & \text{(at R_{1} and R_{2})} & \\[1ex] \lefteqbox{A}{M_{\max}} &= \frac{wl^{2}}{8} & \text{(at centre)} &\\[1ex] \lefteqbox{A}{M_{x}} &= \frac{wx}{2}(l-x) \\[1ex] \lefteqbox{A}{\Delta_{\max}} &= \frac{5wl^{4}}{384EI} \\[1ex] \lefteqbox{A}{\Delta_{x}} &= \frac{wx}{24EI}(l^{3}-2lx^{2}+x^{3}) & \text{(at centre)} & \end{flalign*} However, my opinion is that the following is better and clearer \begin{alignat*}{2} R_{1} &= \frac{wl}{2} \\[1ex] R_{2} &= R{_{1}} \\[1ex] V_{x} &= w\left(\frac{l}{2}-x\right) \\[1ex] V_{\max} &= R_{1}=R_{2} &\qquad& \text{(at R_{1} and R_{2})} \\[1ex] M_{\max} &= \frac{wl^{2}}{8} &\qquad& \text{(at centre)} \\[1ex] M_{x} &= \frac{wx}{2}(l-x) \\[1ex] \Delta_{\max} &= \frac{5wl^{4}}{384EI} \\[1ex] \Delta_{x} &= \frac{wx}{24EI}(l^{3}-2lx^{2}+x^{3}) &\qquad& \text{(at centre)} \end{alignat*} \end{document}  A different realization exploiting tabular*: \documentclass{article} \usepackage{amsmath,array} \usepackage{showframe} \begin{document} \[ \begin{tabular*}{\displaywidth}{ @{} >{\displaystyle}l<{} @{} >{\displaystyle{}}l<{} @{\extracolsep{\fill}} r @{} } R_{1} &= \frac{wl}{2} \\[2ex] R_{2} &= R_{1} \\[2ex] V_{x} &= w\left(\frac{l}{2}-x\right) \\[2ex] V_{\max} &= R_{1}=R_{2} & (at R_{1} and R_{2}) \\[2ex] M_{\max} &= \frac{wl^{2}}{8} & (at centre) \\[2ex] M_{x} &= \frac{wx}{2}(l-x) \\[2ex] \Delta_{\max} &= \frac{5wl^{4}}{384EI} \\[2ex] \Delta_{x} &= \frac{wx}{24EI}(l^{3}-2lx^{2}+x^{3}) & (at centre) \end{tabular*}

\end{document}


• This is great, thank you for your comprehensive answer. I will consider your comments too – Tokamec Apr 19 '19 at 10:07

With the help or an array you can achieve the following layout:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}

\begin{document}
\setlength\extrarowheight{10pt}
$\begin{array}{llr} R{_{1}} &= \dfrac{wl}{2} \\ R{_{2}} &= R{_{1}} \\ V{_{x}} &= w\left(\dfrac{l}{2}-x\right) \\ V{_{max}} &= R{_{1}}=R{_{2}} & \text{(at}\;R_{1}\;\text{and}\;R_{2}\text{)} \\ M{_{max}}&=\dfrac{wl^{2}}{8} & \text{(at centre)}\\ M{_{x}}&=\dfrac{wx}{2}\left(l-x\right) \\ \Delta{_{max}}&=\dfrac{5wl^{4}}{384EI} \\ \Delta{_{x}}&=\dfrac{wx}{24EI}\left(l^{3}-2lx^{2}+x^{3}\right) & \text{(at centre)}\\ \end{array}$
\end{document}

• note this still has V{_{max}} copied from the question (wrong font and wrong _ placement) also you could point out that you are needing \dfrac here as unlike the ams alignments array is intended for matrices of values not displayed equations so sets the entries in inline math mode. – David Carlisle Apr 19 '19 at 11:23

With flalign* and package eqparbox:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M] {\eqmakebox[#1][l]{$\displaystyle #2$}}

\begin{document}

\begin{flalign*}
\eqmathbox{R{_{1}}} &= \frac{wl}{2} \\[1ex]
\eqmathbox{R{_{2}}} &= R{_{1}}\\[1ex]
\eqmathbox{V{_{x}}} &= w\left(\frac{l}{2}-x\right)\\[1ex]
\eqmathbox{V{_{\max}}} &= R{_{1}}=R{_{2}} & & & \text{(at}\;R_{1} \text{ and } R_{2}\text{)}\\[1ex]
\eqmathbox{M{_{\max}}}&=\frac{wl^{2}}{8} & & & \text{(at centre)}\\[1ex]
\eqmathbox{M{_{x}}}&=\frac{wx}{2}\left(l-x\right)\\[1ex]
\eqmathbox{\Delta{_{\max}}}&=\frac{5wl^{4}}{384EI}\\[1ex]
\eqmathbox{\Delta{_{x}}}&=\frac{wx}{24EI}\left(l^{3}-2lx^{2}+x^{3}\right) & & & \text{(at centre)}
\end{flalign*}

\end{document}


• Hi, another great answer, thanks - there seem to be multiple ways to do this – Tokamec Apr 19 '19 at 10:09