頭字語のハイフネーション

頭字語のハイフネーション

長い形式と短い形式の間で改行が発生しないようにする場合、ユーザー定義のハイフネーション ルールを使用して長い頭字語のハイフネーションを正しく行うことが困難です。

\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}

MWPS

MWP からわかるように、場合によっては、改行なしスペースや手動ハイフネーションがなくても、hbox がいっぱいになってタイプセットが終了します。\hyphenpenalty=0プリアンブルで設定しても効果はなく、結果は同じです。

ここで何が欠けているのでしょうか?

厳密に言えば、私はglossaries実際のドキュメントで、短縮形の前の改行なしスペースを含む頭字語の書式を調整したパッケージを使用しています。\renewcommand{\acrfullformat}[2]{#1~(#2)}結果は同じなので、これらの部分を MWP のプレーン テキストに置き換えました。念のため、この問題を解決するためのソリューションについて知っている人がいたら教えてくださいglossaries

答え1

行内で改行したくない場合は(ACM)、ハイフネーション ポイントを追加しても (またはハイフネーションのペナルティを減らしても) 役に立ちません。改行後に行が埋まるように、空白を伸ばす必要があります。

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

過剰な線は生成されない(ただし、生成される線は少し間隔が空いている)

ここに画像の説明を入力してください

関連情報