我正在尝试使用\everypar{\hang\setbox0=\lastbox}
来设置词汇表(而不是在每个条目前面加上\hang\noindent
)。如果所有内容都使用相同的字体,则它可以正常工作,但如果我尝试使用不同的字体设置词条,则悬挂段落会中断:
{\everypar{\hang\setbox0=\lastbox}
H\&J: Hyphenation and Justification. H\&J rules control how text is typeset into lines of type, how words are broken at line ends and whether the column edges are ragged or straight (justified).
Hairline: Thin printed line, usually 0.25 or 0.5 points thick.
{\it Half-title:} Normally in a hardback book, the first printed page, containing only the title of the book. Can also be used for a similar page appearing later in the prelims. Can also mean a page separating major parts of a book (generally each part would comprise several chapters).
Half-title verso: The page following the half-title. It often contains a list of other books by the same author.
}
我注意到\vp
我在这里发现的这个宏存在类似的问题:https://www.ctan.org/tex-archive/macros/plain/contrib/misc/paragraphs.tex。我在标题宏中使用它来抑制标题后第一个段落的缩进。
\def\unindent {%
\setbox0=\lastbox}
\def\vp {%
\everypar{\unindent\everypar{}}}
\vp
{\it First} paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Second Paragraph. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Third Paragraph. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
由于第一段的第一个单词使用了不同的字体,因此第一段和第二段都会丢失缩进。此宏也使用\everypar
和\setbox0=\lastbox
。
有谁知道如何解决这一问题?
答案1
答案2
egreg 已经描述了导致这种情况的原因,因此有一个简单的方法可以让你\everypar
对此免疫:使\hang
\global
:
\everypar{\global\hang\setbox0=\lastbox}