连字符、长单词、换行符和外划线

连字符、长单词、换行符和外划线

目前我正在使用 LaTeX 编写一份德语文档(包含许多长单词)。

有时,我希望在单词末尾添加连字符。例如:

Averylongword-, Anotherverylongword- and Yetanotherverylongword

这会导致 LaTeX 避免在前两个单词内使用连字符,从而导致单词超出页面边界。为了解决这个问题,我加载了 extdash 包,它提供了\-/允许“复合词连字符”的快捷方式:

Averylongword\-/, Anotherverylongword\-/ and Yetanotherverylongword

现在,这些单词的连字符已正确连接。

但是,的使用\-/会引入另一个问题:有时,以 结尾的单词\-/,被放置为页面的最后一个单词,但逗号会转移到下一页,从而导致:

Averyongword-

[pagebreak]

, Anotherverylongword- and Yetanotherverylongword

我该如何解决这个问题并让逗号“粘”在单词末尾?

答案1

以下是一个例子:

\documentclass{article}
\usepackage[shortcuts]{extdash}

\begin{document}
\hsize 4cm

We have ababababababa\-/, edededededed\-/~and ififififi\-/methods.
\end{document}

屈服

在此处输入图片描述

解决方案在文档中,其中extdash说有时破折号后立即出现换行符是不可接受的,而应改用\=/

相反\=/,它会产生更好的

在此处输入图片描述

相关内容