I have an aligned set of very long equations that are difficult to split or shrink. I have tried three methods
- using
\begin{split}
inside\begin{align}
with={}&
and&
for alignment and splitting - this ends up aligned left and looks confusing.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, mathtools}
\usepackage{graphicx}
\begin{document}
Placeholder sentence to designate how long lines are and therefore indicate the correct placement of the equation labels.
\begin{align}
\begin{split}\label{eq:deltaPOverP}
\frac{\Delta P}{P(\mathbf{\Gamma}|\mathbf{d}^t)} ={}&
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}}
\left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t) \right. \right. \right. \\
& \left. \left. \left.
- \sum_n A_{mn}\Gamma_n
\right)^2
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{split}\\
\begin{split}\label{eq:deltaPOverPExpanded}
={}&
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t)^2 \right. \right. \right. \\
& \left. \left. \left.
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{split}\\
\begin{split}\label{eq:deltaPOverPFactored}
={}&
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left(
-\frac{1}{2} \sum_m \frac{d_m(t)^2}{C_{\mu|m}}
\right)
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}} \right. \right.\\
& \left. \left. \left(
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{split}
\end{align}
\end{document}
- using
\begin{multlined}
inside \begin{align}
to try and align the second line of each equation to the right - this seems to align the second line just to the right of the previous line, rather than to the right of the page.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, mathtools}
\usepackage{graphicx}
\begin{document}
Placeholder sentence to designate how long lines are and therefore indicate the correct placement of the equation labels.
\begin{align}
\frac{\Delta P}{P(\mathbf{\Gamma}|\mathbf{d}^t)} &=
\begin{multlined}[t]\label{eq:deltaPOverP}
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}}
\left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t) \right. \right. \right. \\
\left. \left. \left.
- \sum_n A_{mn}\Gamma_n
\right)^2
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{multlined}\\
&=\begin{multlined}[t]\label{eq:deltaPOverPExpanded}
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t)^2 \right. \right. \right. \\
\left. \left. \left.
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{multlined}\\
&=\begin{multlined}[t]\label{eq:deltaPOverPFactored}
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left(
-\frac{1}{2} \sum_m \frac{d_m(t)^2}{C_{\mu|m}}
\right)
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}} \right. \right.\\
\left. \left. \left(
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{multlined}
\end{align}
\end{document}
- using
\begin{align}
inside of \scalebox{0.6}{\parabox{1.7\textwidth}}
to keep the equations on a single line each, and shrink the equation text - by varying the \parabox
scale, I can shift where the equation labels go, but it of course doesnt shift the left hand edge so alignment is very difficult. Furthermore, to fit it all on a line, the \scalebox
scale needs to be so prohibitively small that the equation, and particularly the equation labels, become unreadable.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, mathtools}
\usepackage{graphicx}
\begin{document}
Placeholder sentence to designate how long lines are and therefore indicate the correct placement of the equation labels. \\
\scalebox{0.6}{\parbox{1.7\textwidth}{%
\begin{align}
\label{eq:deltaPOverP}
\frac{\Delta P}{P(\mathbf{\Gamma}|\mathbf{d}^t)} &=
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}}
\left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t)
- \sum_n A_{mn}\Gamma_n
\right)^2
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1 \\
\label{eq:deltaPOverPExpanded}
&=
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left( \vphantom{\sum_n}
d_m(t)^2
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1 \\
\label{eq:deltaPOverPFactored}
&=
\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \left\{
\exp
\left(
-\frac{1}{2} \sum_m \frac{d_m(t)^2}{C_{\mu|m}}
\right)
\exp
\left[
-\frac{1}{2} \sum_m \frac{1}{C_{\mu|m}}
\left(
- 2d_m(t)\sum_n A_{mn}\Gamma_n + \left[\sum_n A_{mn}{\Gamma_n}\right]^2
\right)
\right]
\middle/
P(\mathbf{d}(t))
\right\} - 1
\end{align}
}}
\end{document}
I cannot substitute any terms (very important for this bit). I should have each term labeled but I would settle for labeling this entire block only once as they are, in fact, the same equation every time, just expanded.
\scalebox
is currently producing the best results, but with the text so small, I dont know if it can work. I also dont like that the equation labels are much smaller than the other ones in my work.
Currently, I think my next preference is for \split
, but only because \multlined
does not align the second line to the right of the page, but just to the right of the previous line. If that could be fixed, \multlined
might jump to first place.
I also welcome other suggestions for how to present these equations, where best to split them, and if there are any general conventions I should be aware of.
\[\frac{\Delta P}{P(\mathbf{\Gamma}|\mathbf{d}^t)} =\prod_m \frac{1}{\sqrt{2 \pi C_{\mu|m}}} \exp\{E\}/P(\mathbf{d}(t))\]
and thenalign
the rest?