单独的 \align 环境的不同对齐方式

单独的 \align 环境的不同对齐方式

我制作了一个具有两种不同对齐环境的文档。

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{color}
\usepackage{import}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[german]{babel}
\usepackage{nicefrac}
\usepackage{hyperref}

\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}

\begin{document}
\paragraph{Geometric parameters}
\begin{align*}
&Area_{membrane}&           &\text{Active membrane area}\\
&n_{mod}&                   &\text{Number of modules in row}\\
&n_{env}&                   &\text{Number of wrappings per module}\\
&l_{mod}&                   &\text{Length of RO-module}\\
&t_f&                       &\text{Thickness of retentate/feedspacer}\\
&t_p&                   &\text{Thickness of permeatespacer}\\
&\varepsilon_{mem,permspacer}&  &\text{Porosity of permeatespacer}\\
&S_{V,mem,permspacer}&      &\text{Volume-specific Area of permeatespacer}\\
&\tau_{mem,permspacer}& &\text{Parameter for poregeometry of permeatespacer}\\
&\rho_{pp}&             &\text{Density of permeatespacer}\\
&c_{pp}&                    &\text{Heat capacity of pemeatespacer}
\end{align*}
%
\paragraph{Membrane and CP parameters}
\begin{align*}
&T_{mem,ref}&               &\text{Reference temperature for membrane}\\
&A_{mem,ref}&               &\text{Membrane permeability of water at\:}T_{ref}\\
&B_{mem,star,ref}&          &\text{Membrane permeability for salt at}\:T_{ref}\\
&\alpha_{mem}&          &\text{Temperature coefficient of membrane permeability of water}\\
&\beta_{mem}&           &\text{Temperature coefficient of membrane permeability of salt}\\
&k_{CP,ref}&                &\text{Reference coefficient of CP}\\
&\alpha_{CP}&               &\text{Exponent of influence of bulk velocity on CP}
\end{align*}
\end{document}

其结果为以下 .pdf。 生成的 .pdf

我如何才能协调这两个对齐环境?

答案1

\intertext{...}为什么在单个里面没用align*?类似于:

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{color}
\usepackage{import}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[german]{babel}
\usepackage{nicefrac}
\usepackage{hyperref}

\begin{document}
\paragraph{Geometric parameters}
\begin{align*}
&Area_{membrane}&           &\text{Active membrane area}\\
&n_{mod}&                   &\text{Number of modules in row}\\
&n_{env}&                   &\text{Number of wrappings per module}\\
&l_{mod}&                   &\text{Length of RO-module}\\
&t_f&                       &\text{Thickness of retentate/feedspacer}\\
&t_p&                   &\text{Thickness of permeatespacer}\\
&\varepsilon_{mem,permspacer}&  &\text{Porosity of permeatespacer}\\
&S_{V,mem,permspacer}&      &\text{Volume-specific Area of permeatespacer}\\
&\tau_{mem,permspacer}& &\text{Parameter for poregeometry of permeatespacer}\\
&\rho_{pp}&             &\text{Density of permeatespacer}\\
&c_{pp}&                    &\text{Heat capacity of pemeatespacer}
\intertext{\sectfont Membrane and CP parameters}
&T_{mem,ref}&               &\text{Reference temperature for membrane}\\
&A_{mem,ref}&               &\text{Membrane permeability of water at\:}T_{ref}\\
&B_{mem,star,ref}&          &\text{Membrane permeability for salt at}\:T_{ref}\\
&\alpha_{mem}&          &\text{Temperature coefficient of membrane permeability of water}\\
&\beta_{mem}&           &\text{Temperature coefficient of membrane permeability of salt}\\
&k_{CP,ref}&                &\text{Reference coefficient of CP}\\
&\alpha_{CP}&               &\text{Exponent of influence of bulk velocity on CP}
\end{align*}
\end{document}

在此处输入图片描述

答案2

使用包的解决方案 enumitem。这样的环境可以跨页面拆分,而表格类型的环境则需要使用longtableltablex。第二个enumerate环境与第一个环境一致,这要归功于resume*使用第一个列表的参数的选项:

\documentclass{scrartcl}
\usepackage[german]{babel}
\usepackage{hyperref}
\usepackage{enumitem}
\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}

\begin{document}

\paragraph{Geometric parameters}
\begin{enumerate}[wide=0pt, labelwidth = 3cm, leftmargin = 3cm, itemsep=0pt]
\item[$\mathit{Area}_\mathrm{membrane}$] Active membrane area
\item[$n_\mathrm{mod}$] Number of modules in row
\item[$n_\mathrm{env}$] Number of wrappings per module
\item[$l_\mathrm{mod}$] Length of RO-module
\item[$t_f$] Thickness of retentate/feedspacer
\item[$t_p$] Thickness of permeatespacer
\item[$ε_\mathrm{mem, permspacer}$] Porosity of permeatespacer
\item[$S_{V , \mathrm{mem, permspacer}}$] Volume-specific Area of permeatespacer
\item[$τ_\mathrm{mem,permspacer}$] Parameter for poregeometry of permeatespacer
\item[$ρ_{pp}$] Density of permeatespacer
\item[$c_{pp}$] Heat capacity of pemeatespacer
\end{enumerate}
%
\paragraph{Membrane and CP parameters}
\begin{enumerate}[resume*]
\item[$T_\mathrm{mem,ref}$] Reference temperature for membrane
\item[$A_\mathrm{mem,ref}$] Membrane permeability of water at $ T_{ref} $
\item[$B_\mathrm{mem, star, ref}$] Membrane permeability for salt at $ T_{ref} $
\item[$α_\mathrm{mem}$] Temperature coefficient of membrane permeability of water
\item[$β_\mathrm{mem}$] Temperature coefficient of membrane permeability of salt
\item[$k_\mathrm{CP,ref}$] Reference coefficient of CP
\item[$α_\mathrm{CP}$] Exponent of influence of bulk velocity on CP
\end{enumerate}
\end{document} 

在此处输入图片描述

答案3

在这种情况下使用align确实不是一个好主意。首先,它会限制页面被破坏的可能性。

我认为tabbing这是最简单的输入,只要第二列中的信息不超过两行,它就是最灵活、最可靠的输入之一。

下面,将识别第一列中最宽的条目并将其保存为宏,\widestfirst这样如果其中一个列表的内容发生变化,就可以轻松进行更改。

我还假设第一列中的“单词”确实是不应被视为数学变量的术语,并将它们设置为\text

\documentclass{scrartcl}
\usepackage{amsmath}

\newcommand{\widestfirst}{$S_{V,mem,permspacer}$\qquad}

\begin{document}
\thispagestyle{empty}
\paragraph{Geometric parameters}
\begin{tabbing}
\hspace*{1em} \= \widestfirst \= \kill
\> $\text{Area}_{\text{membrane}}$          \> Active membrane area\\
\> $n_{\text{mod}}$                  \> Number of modules in row\\
\> $n_{\text{env}}$                  \> Number of wrappings per module\\
\> $l_{\text{mod}}$                  \> Length of RO-module\\
\> $t_f$                      \> Thickness of retentate/feedspacer\\
\> $t_p$                  \> Thickness of permeatespacer\\
\> $\varepsilon_{\text{mem},\text{permspacer}}$ \> Porosity of permeatespacer\\
\> $S_{V,\text{mem},\text{permspacer}}$     \> Volume-specific Area of permeatespacer\\
\> $\tau_{\text{mem},\text{permspacer}}$\> Parameter for poregeometry of permeatespacer\\
\> $\rho_{pp}$            \> Density of permeatespacer\\
\> $c_{pp}$                   \> Heat capacity of permeatespacer
\end{tabbing}
%
\paragraph{Membrane and CP parameters}
\begin{tabbing}
\hspace*{1em} \= \widestfirst \= \kill
\> $T_{\text{mem},\text{ref}}$              \> Reference temperature for membrane\\
\> $A_{\text{mem},\text{ref}}$              \> Membrane permeability of water at $T_{ref}$\\
\> $B_{\text{mem},\text{star},\text{ref}}$         \> Membrane permeability for salt at $T_{ref}$\\
\> $\alpha_{\text{mem}}$         \> Temperature coefficient of membrane permeability of water\\
\> $\beta_{\text{mem}}$          \> Temperature coefficient of membrane permeability of salt\\
\> $k_{\text{CP},\text{ref}}$               \> Reference coefficient of CP\\
\> $\alpha_{\text{CP}}$              \> Exponent of influence of bulk velocity on CP
\end{tabbing}
\end{document}

示例代码的输出

答案4

表格方法:

\documentclass{scrartcl}

\usepackage{booktabs}

\newcommand*\mc[1]{\multicolumn{1}{c}{#1}}

\makeatletter
\begingroup\lccode`\~=`\_
\lowercase{\endgroup
  \protected\def~{\@ifnextchar|\subtextup\sb}%
}
\def\subtextup|#1|{\sb{\textup{\footnotesize #1}}}%
\AtBeginDocument{\catcode`\_=12 \mathcode`\_=\string"8000 }
\makeatother


\begin{document}

\section*{Geometric parameters}
\begin{center}
\begin{tabular}{p{3.3cm} p{10cm}}
  \toprule
   \mc{Symbol}                     & \mc{Explanation} \\
  \midrule
   $\mathrm{area}_|membran|$       & Active membrane area \\
   $n_|mod|$                       & Number of modules in row \\
   $n_|env|$                       & Number of wrappings per module \\
   $l_|mod|$                       & Length of RO-module \\
   $t_{f}$                         & Thickness of retentate/feedspacer \\
   $t_{p}$                         & Thickness of permeatespacer \\
   $\varepsilon_|mem, permspacer|$ & Porosity of permeatespacer \\
   $S_|$V$, mem, permspacer|$      & Volume-specific area of permeatespacer \\
   $\tau_|mem, permspacer|$        & Parameter for poregeometry of permeatespacer \\
   $\rho_{pp}$                     & Density of permeatespacer \\
   $c_{pp}$                        & Heat capacity of pemeatespacer \\
  \bottomrule
\end{tabular}
\end{center}

\section*{Membrane and CP parameters}
\begin{center}
\begin{tabular}{p{3.3cm} p{10cm}}
  \toprule
   \mc{Symbol}          & \mc{Explanation} \\
  \midrule
   $T_|mem, ref|$       & Reference temperature for membrane \\
   $A_|mem, ref|$       & Membrane permeability of water at $T_|ref|$ \\
   $B_|mem, star, ref|$ & Membrane permeability for salt at $T_|ref|$ \\
   $\alpha_|mem|$       & Temperature coefficient of membrane permeability of water \\
   $\beta_|mem|$        & Temperature coefficient of membrane permeability of salt \\
   $k_|CP, ref|$        & Reference coefficient of CP \\
   $\alpha_|CP|$        & Exponent of influence of bulk velocity on CP \\
  \bottomrule
\end{tabular}
\end{center}

\end{document}

输出1

或者

\documentclass{scrartcl}

\newcommand*\mc[1]{\multicolumn{1}{c}{#1}}

\makeatletter
\begingroup\lccode`\~=`\_
\lowercase{\endgroup
  \protected\def~{\@ifnextchar|\subtextup\sb}%
}
\def\subtextup|#1|{\sb{\textup{\footnotesize #1}}}%
\AtBeginDocument{\catcode`\_=12 \mathcode`\_=\string"8000 }
\makeatother


\begin{document}

\section*{Geometric parameters}
\begin{tabular}{p{3.3cm} l}
   $\mathrm{area}_|membran|$       & Active membrane area \\
   $n_|mod|$                       & Number of modules in row \\
   $n_|env|$                       & Number of wrappings per module \\
   $l_|mod|$                       & Length of RO-module \\
   $t_{f}$                         & Thickness of retentate/feedspacer \\
   $t_{p}$                         & Thickness of permeatespacer \\
   $\varepsilon_|mem, permspacer|$ & Porosity of permeatespacer \\
   $S_|$V$, mem, permspacer|$      & Volume-specific area of permeatespacer \\
   $\tau_|mem, permspacer|$        & Parameter for poregeometry of permeatespacer \\
   $\rho_{pp}$                     & Density of permeatespacer \\
   $c_{pp}$                        & Heat capacity of pemeatespacer \\
\end{tabular}

\section*{Membrane and CP parameters}
\begin{tabular}{p{3.3cm} l}
   $T_|mem, ref|$       & Reference temperature for membrane \\
   $A_|mem, ref|$       & Membrane permeability of water at $T_|ref|$ \\
   $B_|mem, star, ref|$ & Membrane permeability for salt at $T_|ref|$ \\
   $\alpha_|mem|$       & Temperature coefficient of membrane permeability of water \\
   $\beta_|mem|$        & Temperature coefficient of membrane permeability of salt \\
   $k_|CP, ref|$        & Reference coefficient of CP \\
   $\alpha_|CP|$        & Exponent of influence of bulk velocity on CP
\end{tabular}

\end{document}

输出2

相关内容