正确定位 \smallskip

正确定位 \smallskip

\smallskip以下三个例子中物质的位置是否重要?版本 1 适用\smallskip于上一段的末尾。

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.\smallskip

Keywords: Skip.
\end{document}

第 2 版为 引入了新的段落\smallskip

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\smallskip

Keywords: Skip.
\end{document}

版本适用\smallskip于后续段落的开头。

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\smallskip Keywords: Skip.
\end{document}

虽然结果看起来很相似,但我仍然想知道它们的逻辑含义是否不同。

答案1

始终使用第二种或第三种形式,它们是等效的,空格后的段落没有区别,因为 tex 此时已经处于垂直模式。

第一个在水平模式下添加空格,以便它适用于当前行之后段落分成几行后。例如,尝试将其放在段落中间。实际上,在段落末尾,这将出现在与在垂直模式下开始相同的位置,尽管代码路径完全不同。

要避免的主要情况是skip0如下例所示,其中您的第一个表单处于\vspace水平模式,但前面有空白,这可能会导致在段落中添加一条额外的虚假行,因为 vadjust 节点会阻止删除行尾的最后一个空格。

在此处输入图片描述

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\smallskip

Keywords: Skip0.

This is a sentence. This is a sentence. This is a sentence. This is a sentence.\smallskip

Keywords: Skip1.


This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\smallskip

Keywords: Skip2.

This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\smallskip Keywords: Skip3.

\end{document}

相关内容