在单列和双列模式下按比例垂直间距对齐和换行一组长方程式

在单列和双列模式下按比例垂直间距对齐和换行一组长方程式

对于以下一组长方程,如何

1- 在单列和双列模式下美观地对齐和换行,而不跨越单列专用空间,并且

2- 分别控制两者内的垂直间距alignaligned以增强可读性,因为例如,我\begin{spreadlines}{1em}只需要align在具有另一个设置时产生影响aligned(例如\begin{spreadlines}{0.5em}无需手动使用\\[<spacing>]

在此处输入图片描述

\documentclass{article}
\usepackage{mathtools,multicol,lipsum}
\usepackage[bold-style=TeX]{unicode-math}
\setmathfont[math-style=ISO]{Cambria Math}
\usepackage[showframe]{geometry}
\begin{document}
    \begin{spreadlines}{1em} 
    \begin{align}
    &\frac{1}{\sigma(1-\alpha)} \sum_{j=0}^{k-1} \frac{T^{j+1}-T^j}{\tau_{j+1}} \left(1-\exp\left(-\sigma\tau_{j+1}\right)\right)\cdot\exp\left(-\sigma(k-j-1)\tau_{j+1}\right) = \nabla^2 T^{k}\\
    %
    &\frac{1}{\sigma(1-\alpha)} \begin{bmatrix*}[l] \left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} \\
    + \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right)\end{bmatrix*} = \nabla^2 T^{k}\\
     %
     & \begin{aligned} &\left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} \\
     &= - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{aligned}\\
     %
     &\begin{aligned} &T^k \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} = \\
     &T^{k-1} \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{aligned}
    \end{align}
    \end{spreadlines}

    \newpage

    \begin{multicols}{2}
        the above set of equations is needed to be typeset here again in a two-column mode.
    \end{multicols}
\end{document}

答案1

这仍然有点太满,但可能会给你一个开始

在此处输入图片描述

主要变化:

  • 不要使用扩展线,只\\[\jot]在外层换行符和\\内层换行符上使用。
  • 不要使用 bmatrix 显示方程式(它使用 textstyle math 显示矩阵)
  • 当没有对齐时,使用multlined(或类似的) 。align
\documentclass{article}
\usepackage{mathtools,multicol,lipsum}
\usepackage[bold-style=TeX]{unicode-math}
\setmathfont[math-style=ISO]{Cambria Math}
\usepackage[showframe]{geometry}
\allowdisplaybreaks
\begin{document}
    \begin{gather}
    \frac{1}{\sigma(1-\alpha)} \sum_{j=0}^{k-1} \frac{T^{j+1}-T^j}{\tau_{j+1}} \left(1-\exp\left(-\sigma\tau_{j+1}\right)\right)\cdot\exp\left(-\sigma(k-j-1)\tau_{j+1}\right) = \nabla^2 T^{k}\\[\jot]
    %
    \frac{1}{\sigma(1-\alpha)} \left[\begin{multlined} \left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} \\
    + \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right)\end{multlined}\right] = \nabla^2 T^{k}\\[\jot]
     %
   \begin{multlined} \left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} \\
     = - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{multlined}\\[\jot]
     %
     \begin{multlined} T^k \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} = \\
     T^{k-1} \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{multlined}
    \end{gather}


    \begin{multicols}{2}
        the above set of equations is needed to be typeset here again in a two-column mode.
    \begin{gather}
   \begin{multlined}
    \frac{1}{\sigma(1-\alpha)} \sum_{j=0}^{k-1} \frac{T^{j+1}-T^j}{\tau_{j+1}} \left(1-\exp\left(-\sigma\tau_{j+1}\right)\right)\cdot\\\exp\left(-\sigma(k-j-1)\tau_{j+1}\right)\\  = \nabla^2 T^{k}
   \end{multlined}\\[\jot]
    %
\begin{multlined}
    \frac{1}{\sigma(1-\alpha)} \bigl[ \left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} \\
    + \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot\\
 \exp \left( - \sigma (k-j-1) \tau_{j+1} \right)\bigr]\\ = \nabla^2 T^{k}
\end{multlined}\\[\jot]
     %
   \begin{multlined} \left(T^k-T^{k-1}\right) \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} \\
     = - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot\\
 \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{multlined}\\[\jot]
     %
     \begin{multlined} T^k \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k} - [\sigma(1-\alpha)]\nabla^2 T^{k} = \\
     T^{k-1} \frac{1-\exp\left(-\sigma\tau_k\right)}{\tau_k}\\ - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right) \cdot (1-\exp\left(-\sigma\tau_{j+1}\right)) \cdot\\ \exp \left( - \sigma (k-j-1) \tau_{j+1} \right) \end{multlined}
    \end{gather}

\end{multicols}
\end{document}

答案2

不错的@DavidCarlisle 答案的一个小变化(+1):

  • 而不是\exp(...)使用e^{-....}
  • 在包中multicolum 使用定义\medmathnccmath
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage[bold-style=TeX]{unicode-math}
\setmathfont[math-style=ISO]{Cambria Math}

\usepackage{nccmath, mathtools}
\makeatletter
\let\origexp\exp
\DeclareRobustCommand{\exp}{\@ifnextchar^{\Exp^{}}{\origexp }}
\def\Exp^#1{\,\mathop{\mathrm{\mathstrut e}\!\!}\nolimits^{#1}\,}
\makeatother
\allowdisplaybreaks
\usepackage{multicol,lipsum}

\begin{document}

    \begin{gather}
\frac{1}{\sigma(1-\alpha)}
    \sum_{j=0}^{k-1}\frac{T^{j+1} - T^j}{\tau_{j+1}}
                    \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)
                    \cdot\exp^{(-\sigma(k-j-1)\tau_{j+1})}
    = \nabla^2 T^{k}      \\
%
\frac{1}{\sigma(1-\alpha)}
    \left[
\left(T^k-T^{k-1}\right)
    \frac{1-\exp^{-\sigma\tau_k}}{\tau_k} +
    \displaystyle\sum_{j=0}^{k-2} \bigl( T^{j+1} - T^j \bigr)
     \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)
    \cdot \exp^{-\sigma(k-j-1)\tau_{j+1}}
    \right]
     = \nabla^2 T^{k}  \\
%
\bigl(T^k-T^{k-1}\bigr) \frac{1-\exp^{-\sigma\tau_k}}{\tau_k}
    - \bigl[\sigma(1-\alpha)\bigr]\nabla^2 T^{k}
    = - \sum_{j=0}^{k-2} \bigl( T^{j+1} - T^j \bigr)
    \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)
    \cdot \exp^{- \sigma(k-j-1)\tau_{j+1}} \\
%
    \begin{multlined}[0.75\linewidth]
T^k \frac{1-\exp^{-\sigma\tau_k}}{\tau_k}
    - \bigl[\sigma(1-\alpha)\bigr]\nabla^2 T^{k} = \\[-1ex]
         T^{k-1} \frac{1-\exp^{-\sigma\tau_k}}{\tau_k}
         - \sum_{j=0}^{k-2} \left( T^{j+1} - T^j \right)
         \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)
         \cdot \exp^{- \sigma (k-j-1) \tau_{j+1}}
     \end{multlined}
        \end{gather}
%%%%
\hrule
%%%%
\begin{multicols}{2}
The above set of equations is needed to be typeset here again in a two-column mode.
    \begin{gather}
%\begin{gathered}
\medmath{\begin{multlined}[0.8\linewidth]
\frac{1}{\sigma(1-\alpha)}
    \sum_{j=0}^{k-1}\frac{T^{j+1} - T^j}{\tau_{j+1}}=  \\[-1ex]
        \left(1-\exp^{-\sigma\tau_{j+1}}\right)
        \cdot\exp^{-\sigma(k-j-1)\tau_{j+1}}
        = \nabla^2 T^{k}      
    \end{multlined}}     \\[2ex]
%
\medmath{\begin{multlined}[0.8\linewidth]
\frac{1}{\sigma(1-\alpha)}
    \Biggl[
\bigl(T^k - T^{k-1}\bigr)
    \frac{1-\exp^{-\sigma\tau_k}}{\tau_k} +   \\[-1ex]
        \sum_{j=0}^{k-2} \bigl( T^{j+1} - T^j \bigr)
         \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr) \\[-1ex]
        \cdot \exp^{-\sigma(k-j-1)\tau_{j+1}}
    \Biggr]
    = \nabla^2 T^{k}  
    \end{multlined}}     \\[2ex]
%
\medmath{\begin{multlined}[0.8\linewidth]   
\bigl(T^k-T^{k-1}\bigr) \frac{1-\exp^{-\sigma\tau_k}}{\tau_k}
    - \bigl[\sigma(1-\alpha)\bigr]\nabla^2 T^{k} =      \\[-1ex]
        - \sum_{j=0}^{k-2} \bigl( T^{j+1} - T^j \bigr)
        \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)    
        \cdot \exp^{- \sigma(k-j-1)\tau_{j+1}}
    \end{multlined}}     \\[2ex]
%
\medmath{\begin{multlined}[0.8\linewidth]
T^k \frac{1-\exp^{-\sigma\tau_k}}{\tau_k} - \bigl[\sigma(1-\alpha)\bigr]\nabla^2 
    = T^{k-1} \frac{1-\exp^{-\sigma\tau_k}}{\tau_k}     \\[-1ex]
         - \sum_{j=0}^{k-2} \bigl( T^{j+1} - T^j \bigr)
         \cdot \bigl(1-\exp^{-\sigma\tau_{j+1}}\bigr)
         \cdot \exp^{- \sigma (k-j-1) \tau_{j+1}}
    \end{multlined}}
    \end{gather}
\end{multicols}
\end{document}

在此处输入图片描述

相关内容