自定义段落间距不规则

自定义段落间距不规则

考虑以下命令,旨在引入类似于的新段落\paragraph

\newcommand\ITEM[1]{\smallskip\par\noindent\textit{#1.}}

问题:如果前一个段落以完全填满行的行结束(但没有溢出水平盒子),则段落间空间会变得更大。此定义中缺少什么才能产生等距段落?

在此处输入图片描述

\documentclass{article}
\newcommand\ITEM[1]{\smallskip\par\noindent\textit{#1.}}
\begin{document}
  \ITEM{A} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
  \ITEM{B} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Ab.
  \ITEM{C} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
\end{document}

答案1

\vspace在垂直模式下添加

\documentclass{article}
\newcommand\ITEM[1]{\par\smallskip\noindent\textit{#1.}}
\begin{document}
  \ITEM{A} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
  \ITEM{B} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Ab.
  \ITEM{C} Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
\end{document}

在此处输入图片描述

使用原始版本,如果您之前没有添加空白行,\ITEM那么将\smallskip在上一行末尾的空格标记后添加,最终您会得到只有空格的段落的最后一行。

相关内容