
我經常排版文本——由於特定的語言學慣例——較短的部分的單字被強調。據我了解該機制的開始/結束\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
而插入斜體更正(TeX 術語中的一種“隱式緊排”,會阻礙連字)\textit{...}
則不會。因此,\emph{...}
{\itshape ...}
\itshape
不,本身,阻礙連字符。
如果您可以使用 LuaLaTeX 並且願意使用 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}