I am trying to use a big equation inside flalign. The biggest chunk is the third line and I couldn't figure out how to something akin to \shoveright
in this third equation, as I want is ending on the right margin. Does anyone know how I can do that in this code?
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[letterpaper]{geometry}
\begin{document}
\def\del{\, \mathrm{d}}
\def\inv{^{-1}}
\begin{flalign*}
&\del L_j= \beta_j^{-2}\left (\tilde{\Sigma}_j\inv+\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\inv\left\{\tilde{\Sigma}_j^{-3}\left (\Sigma_{\epsilon j}-\Sigma_j\right )\del \Sigma_j\right. & \\
&\phantom{\del L_j=} +\left[1+2\left (\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\Sigma_{\epsilon j}\right ]\del \tilde{\Sigma}_{wj}\inv &\\
& \left. +2\left[\left (\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\Sigma_{\epsilon j}\left (1+2\rho^{-2}\sigma_x^{-2}\Psi_j\inv\right )+\left (1+\rho^{-2}\sigma_x^{-2}\Psi_j\inv\right )\right ]\del \Psi_{j}\inv\right\}&\\
&\phantom{\del L_j}= \text{right-hand-side number 1}&\\
&\phantom{\del L_j}= \text{right-hand-side number 2}&\\
&\phantom{\del L_j}= \text{etc.} &
\end{flalign*}
\noindent
This text is just to show the left and right margins. This text is just to show the left and right margins.
\multlinegap=0pt
\begin{multline*}
\del L_j= \beta_j^{-2}\left (\tilde{\Sigma}_j\inv+\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\inv\left\{\tilde{\Sigma}_j^{-3}\left (\Sigma_{\epsilon j}-\Sigma_j\right )\del \Sigma_j\right. \\
+\left[1+2\left (\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\Sigma_{\epsilon j}\right ]\del \tilde{\Sigma}_{wj}\inv\\
\shoveright{\left. +2\left[\left (\tilde{\Sigma}_{wj}\inv+\Psi_j\inv +\rho^{-2}\sigma_x^2\Psi_j^{-2}\right )\Sigma_{\epsilon j}\left (1+2\rho^{-2}\sigma_x^{-2}\Psi_j\inv\right )+\left (1+\rho^{-2}\sigma_x^{-2}\Psi_j\inv\right )\right ]\del \Psi_{j}\inv\right\}}\\
\shoveleft{\begin{aligned}
\phantom{\del L_j} &= \text{right-hand-side number 1}\\
\phantom{\del L_j} &= \text{right-hand-side number 2}\\
\phantom{\del L_j} &= \text{etc.}
\end{aligned}}
\end{multline*}
\noindent
This text is just to show the left and right margins. This text is just to show the left and right margins.
\end{document}
In the second attempt, the third equation ends at the right margin. The caveat is that the spacing between on equation and the next in the aligned
is not as large as the one in the previous code using align
, so I don't regard it as satisfactory.
Also, for some reason my compiler reports over and underfull boxes, even though I cannot see why.
\left
...\right
, which would allow you to break it across lines at your leisure. See Using\left(
&\right)
aroundamsmath
'salign
delimiter (“&”) and/or\left
/\right
across multiline equation on how to break it across lines. – Werner May 29 '14 at 5:01