关于使用嵌套 \left( \right) 整齐地拆分或收缩对齐的非常长的方程式的建议

关于使用嵌套 \left( \right) 整齐地拆分或收缩对齐的非常长的方程式的建议

我有一组对齐的非常长的方程式,很难拆分或缩小。我尝试了三种方法

  • 使用\begin{split}内部\begin{align}={}&&进行对齐和拆分 - 最终左对齐并且看起来很混乱。
\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}

使用分割和对齐的方程式 - 使用\begin{multlined}内部\begin{align}尝试将每个等式的第二行对齐到右侧 - 这似乎将第二行对齐到上一行的右侧,而不是页面的右侧。

\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}

使用多行和对齐的方程式 - 使用\begin{align}inside of\scalebox{0.6}{\parabox{1.7\textwidth}}将方程式保持在一行上,并缩小方程式文本 - 通过改变比例\parabox,我可以移动方程式标签的位置,但它当然不会移动左边缘,因此对齐非常困难。此外,为了将所有内容放在一行上,比例\scalebox需要非常小,以至于方程式,特别是方程式标签,变得难以阅读。

\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}

使用比例尺盒的方程

我无法替换任何术语(这一点非常重要)。我应该标记每个术语,但我只标记整个块一次,因为事实上,它们每次都是相同的方程,只是展开了。

\scalebox目前产生了最佳效果,但由于文本太小,我不知道它是否可以工作。我也不喜欢方程式标签比我工作中的其他标签小得多。

目前,我认为我的下一个偏好是\split,但只是因为\multlined它不将第二行与页面右侧对齐,而是与前一行右侧对齐。如果可以修复这个问题,\multlined可能会跳到第一位。

我还欢迎其他关于如何呈现这些方程式、在哪里最好地分割它们以及是否有任何我应该知道的一般惯例的建议。

答案1

我将指数拉入它自己的表达式中:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

Placeholder sentence to designate how long lines are and therefore indicate the correct placement of the equation labels.
\[
\frac{\Delta P}{P(\mathbf{\Gamma}|\mathbf{d}^t)}
=\prod_m \frac{\exp\{E\}}{\sqrt{2 \pi C_{\mu|m}}P(\mathbf{d}(t))}-1
\]
where
\begin{align}
E&=
-\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
\\
&=
-\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)
\\
&\begin{aligned}
=
-\frac{1}{2} \sum_m & \frac{d_m(t)^2}{C_{\mu|m}}
\\
&-\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)
\end{aligned}
\end{align}
\end{document}

pdf 输出

这使得(对我来说)更容易意识到只有指数在变化。这样,前两个表达式就足够短,可以单独成一行,第三个表达式也有足够的空间。我使用aligned并插入了一个任意值&将第二行推到右边(我同意,multlined如果我知道如何让它右对齐到更大的框,那会更好)。(我也不确定 $-1$ 是否应该在乘积中;这可以使用一些括号:$\prod(X-1)$ 或 $(\prod X)-1$。)

相关内容