缩写词连字

缩写词连字

当我尝试防止长格式和短格式之间出现换行符时,使用用户定义的连字符规则很难在长缩写词中正确使用连字符。

\documentclass{article}

\usepackage{showframe}

\hyphenation{mi-cros-co-py}

\begin{document}
\paragraph{Long Text} This is some text abcdefgh Acronym Containing Microscopy~(ACM).
\paragraph{Longer Text} This is some text abcdefgh Acronym Containing Microscopy~(ACM).
\paragraph{Even Longer Text} This is some text abcdefgh Acronym Containing Microscopy~(ACM).

\paragraph{Another try} Let's try manual hyphenation.

\paragraph{Long Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py~(ACM).
\paragraph{Longer Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py~(ACM).
\paragraph{Even Longer Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py~(ACM).

\paragraph{Another try} Let's also skip the non-breaking space.

\paragraph{Long Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py (ACM).
\paragraph{Longer Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py (ACM).
\paragraph{Even Longer Text} This is some text abcdefgh Acronym Containing Mi\-cros\-co\-py (ACM).

\end{document}

微波功率

从 MWP 中可以看出,在某些情况下,即使没有不间断空格和手动连字,排版也会导致水平盒子溢出。\hyphenpenalty=0在序言中设置也无济于事,结果相同。

我在这里遗漏了什么?

严格来说,我在实际文档中使用该glossaries包,并调整了缩写格式,包括缩写形式前的不间断空格:\renewcommand{\acrfullformat}[2]{#1~(#2)}我将这些部分替换为 MWP 的纯文本,因为结果是一样的。以防万一有人知道基于此问题的解决方案glossaries

答案1

假设您不想在中间断行,(ACM)那么添加更多连字符点(或减少连字符的惩罚)也无济于事。您需要允许空白区域伸展,以便在断行后填满行。

\begin{document}\setlength\emergencystretch{1.5em}

不会产生过满的线条(尽管产生的线条有点空旷)

在此处输入图片描述

相关内容