1

I was trying to format the following expression using align. However, I need it in two column. Of all the equations, one is a long expression and Hence I added \rlap.

The problem is the lengthy expression is not adjusting to the page width. Could you please let me know the proper choice available?

\documentclass[]{article}
\usepackage{amsmath}
\begin{document}
\begin{align} 
 \eta_7~&=~\eta_2~f_0(\lambda)~-~\eta_1~g_0(\lambda)\nonumber&\eta_8~&=~\eta_1~f_0(\lambda)~+~\eta_2~g_0(\lambda)\nonumber\\
  \eta_9~&=~\rlap{$pEL~a~-~\displaystyle\frac{\sigma_c~\lambda^2}{2}$}&\nonumber\\
  \eta_{10}~&=~\rlap{$\sqrt{2}~\left\{4~l^2~\left[\eta_2~f_0(\lambda)~-~\eta_1~g_0(\lambda)\right]~-~\left[\lambda^2~-~a^2\right]~\left[\eta_1~f_0(\lambda)~+~\eta_2~g_0(\lambda)\right]\right\}-4~l~\lambda~\eta_6$}\nonumber
\end{align}

\begin{equation}
\eta_{10}~=~\sqrt{2}~\left\{4~l^2~\left[\eta_2~f_0(\lambda)~-~\eta1~g_0(\lambda)\right]~-~\left[\lambda^2~-~a^2\right]~\left[\eta1~f_0(\lambda)~+~\eta2~g_0(\lambda)\right]\right\}-4~l~\lambda~\eta_6\nonumber
\end{equation}
\end{document}

The equation I am having the problem is the last equation (i.e. \eta_10). The output from the align environment for \eta_10 is not spreading to the whole page width. However, the output from the equation environment is spreading to the page width.

Question: How to make the \eta_10 equation to spread to the page width. Am I missing any commands?

0

You can use flalign*:

enter image description here

Notes:

  • With the starred variant you don't need to use \nonumber.
  • I also remove the manually added ~ for spacing as manual spacing should normally be avoided in math.

Code:

\documentclass[]{article}
\usepackage{showframe}
\usepackage{amsmath}
\begin{document}
\begin{flalign*} 
 \eta_7 &= \eta_2 f_0(\lambda) - \eta_1 g_0(\lambda)\nonumber&\eta_8 &= \eta_1 f_0(\lambda) + \eta_2 g_0(\lambda)\nonumber\\
  \eta_9 &= \rlap{$pEL a - \displaystyle\frac{\sigma_c \lambda^2}{2}$}\\
  \eta_{10} &= \rlap{$\sqrt{2} \left\{4 l^2 \left[\eta_2 f_0(\lambda) - \eta_1 g_0(\lambda)\right] - \left[\lambda^2 - a^2\right] \left[\eta_1 f_0(\lambda) + \eta_2 g_0(\lambda)\right]\right\}-4 l \lambda \eta_6$}
\end{flalign*}
\end{document}
  • this flushes the second equation on the first line to the right margin -- and in this case, looks wrong, because the placement implies that the page doesn't need to be that wide since the last equation ends farther to the left, so there shouldn't have been a problem in the first place. however, you've also removed the extra spaces (input with ~) which makes everything much narrower. please explain that it's a better idea to let tex handle the spacing; otherwise i'll put in an answer doing so. – barbara beeton Jun 15 '13 at 12:36
  • @barbarabeeton: Hmmm, yes you are correct, it does appear as if there should not have been a problem in the first place -- so not sure why flalign was needed. I mention in the notes that manual spacing should be avoided. – Peter Grill Jun 15 '13 at 15:20

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.