
私は、特定の文献学上の慣習により、次のような文章をタイプセットすることがよくあります。短い部分単語の先頭と末尾が強調されます。私が理解している限り、このメカニズムでは、\emph
タグの開始/終了が単語の境界とみなされ、結果としていくつかの正しくハイフンでつながれた単語がありますが、数が少なすぎます。
\documentclass[12pt]{article}
%\usepackage[english]{babel}
%\usepackage{polyglossia}
%\setdefaultlanguage{english}
\begin{document}
\parbox{.7cm}{
some hyphenati\emph{o}n
}
\hspace{2cm}\parbox{.7cm}{
some hyphenat\emph{i}on
}
\hspace{2cm}\parbox{.7cm}{
some h\emph{y}phenation
}
\hspace{2cm}\parbox{.7cm}{
some h\emph{y}phe\emph{n}ation
}
\end{document}
ハイフネーションを決定する際に、LaTeX で強調を無視し、単語全体を考慮する方法を探しています。
答え1
\textit{...}
と は\emph{...}
イタリック体の修正(TeX の専門用語でハイフネーションを妨げる「暗黙のカーニング」の一種)を挿入しますが、{\itshape ...}
は挿入しません。したがって、\itshape
は挿入しません。それ自体ハイフネーションを妨げます。
LuaLaTeX を使用でき、\itshape
強調するために を使用することをいとわない場合 (そして、その過程で、単語内の強調された内容の斜体修正が不足することを受け入れる場合)、結局、これらの単語をハイフンで区切ることができます。
MWE - それぞれのインスタンスで、許容されるすべてのハイフネーション ポイントが「見つかる」ことを確認します。
% !TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage{showhyphens} % a LuaLaTeX-only package
\hyphenation{hy-phen-a-tion} % indicate all 3 permissible hyphenation points
\setlength\parindent{0pt}
\setlength\textwidth{0.1mm}
\begin{document}
\obeylines
hyphenati{\itshape o}n
hyphenat{\itshape i}on
h{\itshape y}phenation
h{\itshape y}phe{\itshape n}ation
\end{document}