![使用 \singlespacing 与 \doublespacing 文本编写简洁的方程参数定义](https://linux22.com/image/304676/%E4%BD%BF%E7%94%A8%20%5Csinglespacing%20%E4%B8%8E%20%5Cdoublespacing%20%E6%96%87%E6%9C%AC%E7%BC%96%E5%86%99%E7%AE%80%E6%B4%81%E7%9A%84%E6%96%B9%E7%A8%8B%E5%8F%82%E6%95%B0%E5%AE%9A%E4%B9%89.png)
这个问题是基于如何写出完美的方程参数描述?问题:
我希望使用 来定义参数,\singlespacing
就像我目前用于\doublespacing
论文间距一样。建议的conditions
和conditions*
环境都非常有用,我也尝试调整 来conditions*
反映no break after where:
我希望实现的变体。
\singlespacing
按照我的做法进行定义会导致conditions
出现不必要的缩进和missing \endgroup inserted
错误,尽管从视觉上看它是可行的
conditions*
通过调整上述变体来定义我也会导致不必要的缩进,而且我无法弄清楚如何插入\singlespacing
参数而不导致错误。
以下是我所做的所有修改后的 MWE:
\documentclass{scrreprt}
\usepackage{array,tabularx}
\usepackage{setspace}
\doublespace
\newenvironment{conditions}[1][where:]
{\singlespace#1 \begin{tabular}[t]{>{$}l<{$} @{${}:{}$} l}}
{\doublespace\end{tabular}\\[\belowdisplayskip]}
\newenvironment{conditions*}[1][where:]
{#1 \begin{tabular}[t]{>{$}l<{$} @{}>{${}}c<{{}$}@{} l}}
{\end{tabular}\\[\belowdisplayskip]}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions}
P & notional permeability factor \\
N & number of waves \\
S_{d} & damage level
\end{conditions}
Some text after the equation.
Another equation with symbols
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions*}
P & : & notional permeability factor \\
N & \sim & number of waves \\
S_{d} & \propto & damage level
\end{conditions*}
and so this is where we continue with some more text after the equation.
\end{document}
答案1
在双倍行距文档中寻找印刷美感是一场预先的失败之战。
你可以用如下方法限制损失:
\documentclass{scrreprt}
\usepackage{array,tabularx}
\usepackage{setspace}
\newenvironment{conditions}[1][where:]
{\begin{minipage}{\textwidth}
\vspace*{-.5\belowdisplayskip}%
\linespread{1}\selectfont #1 \begin{tabular}[t]{>{$}l<{$} @{${}:{}$} l}}
{\end{tabular}\end{minipage}\\[\belowdisplayskip]}
\newenvironment{conditions*}[1][where:]
{\begin{minipage}{\textwidth}
\vspace*{-.5\belowdisplayskip}%
\linespread{1}\selectfont #1 \begin{tabular}[t]{>{$}l<{$} @{}>{${}}c<{{}$}@{} l}}
{\end{tabular}\end{minipage}\\[\belowdisplayskip]}
\doublespacing
\begin{document}
An equation just to start
An equation just to start
An equation just to start
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions}
P & notional permeability factor \\
N & number of waves \\
S_{d} & damage level
\end{conditions}
Some text after the equation.
Some text after the equation.
Some text after the equation.
Some text after the equation.
Some text after the equation.
Some text after the equation.
Some text after the equation.
Another equation with symbols
Another equation with symbols
Another equation with symbols
Another equation with symbols
Another equation with symbols
Another equation with symbols
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions*}
P & : & notional permeability factor \\
N & \sim & number of waves \\
S_{d} & \propto & damage level
\end{conditions*}
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
and so this is where we continue with some more text after the equation.
\end{document}
请注意,正确的命令是\doublespacing
,而不是\doublespace
。