合并“全宽 + 对齐”而不开始新段落

合并“全宽 + 对齐”而不开始新段落

如何在 Tufte 样式的文档中实现垂直间距正确的全宽数学环境(如图所示)?

请看下面的截图。请注意“Textwidth”align*环境中的垂直间距如何尊重它是段落中间还是段落开头。我想用全宽来实现这种行为(或者只是摆脱新段落的垂直跳跃)align*,但似乎fullwidth环境包含其自己的单独段落。这可以纠正吗?

在此处输入图片描述

\documentclass{caesar_book}

\begin{document}

Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\begin{align*}
    \text{(Textwidth, same paragraph) } 1 + 2 + 3 + 4 + 5
\end{align*}
Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

\begin{align*}
    \text{(Textwidth, new paragraph) } 1 + 2 + 3 + 4 + 5
\end{align*}
Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\begin{fullwidth}
    \begin{align*}
        \text{(Fullwidth, same paragraph) } 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
    \end{align*}
\end{fullwidth}
Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

\begin{fullwidth}
    \begin{align*}
        \text{(Fullwidth, new paragraph) } 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
    \end{align*}
\end{fullwidth}
Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

\end{document}

答案1

为了消除 两种用法中的额外垂直空间fullwidth,必须定义一个新环境——类似于 ——在包含fullwidth时使用 。align*

当然,如果要模拟fullwidth不使用时的行为,只在第一次使用时使用(同一段)。

C

\documentclass{caesar_book}

\newenvironment{fullwidthx} % added<<<<<<<<<<<<
{\ifthenelse{\boolean{@twoside}}%
    {\begin{adjustwidth*}{}{-\overhang}\vskip-\baselineskip}% <<<<<<<<<
        {\begin{adjustwidth}{}{-\overhang}\vskip-\baselineskip}% <<<<<<<<<<
        }%
        {\ifthenelse{\boolean{@twoside}}%
            {\end{adjustwidth*}}%
        {\end{adjustwidth}}%
}

\begin{document}
    
    Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    \begin{align*}
        \text{(Textwidth, same paragraph) } 1 + 2 + 3 + 4 + 5
    \end{align*}
    Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    
    \begin{align*}
        \text{(Textwidth, new paragraph) } 1 + 2 + 3 + 4 + 5
    \end{align*}
    Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    \begin{fullwidthx} %<<<<<<<<<<<<<<<<<<<<<
        \begin{align*}
            \text{(Fullwidthx, same paragraph) } 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
        \end{align*}
    \end{fullwidthx}
    Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    
    \begin{fullwidthx} %<<<<<<<<<<<<<<<<<<<<<<<
        \begin{align*}
            \text{(Fullwidthx, new paragraph) } 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
        \end{align*}
    \end{fullwidthx}
    Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    
\end{document}

相关内容