我正在用 aprox 寫一本書。 200+ A5 頁。在從 pdflatex 遷移到 xelatex 的過程中,我注意到一些嚴重的佈局差異。為了追蹤問題,我開始關注 pdflatex 的 MWE。
\documentclass[paper=a5,pagesize,fontsize=13pt]{scrbook}
\usepackage{showframe}
\usepackage[T1]{fontenc}
\usepackage[osf]{libertine}
\begin{document}
Hello, here is some text without a meaning. This text
should show what a printed text will look like at this place.
\end{document}
如果
\usepackage[T1]{fontenc}
生效後,第一行文字以「This text」結尾。如果註解掉,它會以「此文字應該」結尾,也會產生一個過滿的方塊。
答案1
差異是由於
OT1:
.\OT1/LinuxLibertineT-TOsF/m/n/13 i
.\OT1/LinuxLibertineT-TOsF/m/n/13 n
.\OT1/LinuxLibertineT-TOsF/m/n/13 g
.\OT1/LinuxLibertineT-TOsF/m/n/13 .
.\glue 3.7921 plus 4.875 minus 0.36096
.\OT1/LinuxLibertineT-TOsF/m/n/13 (ligature Th)
.\OT1/LinuxLibertineT-TOsF/m/n/13 i
.\OT1/LinuxLibertineT-TOsF/m/n/13 s
.\glue 3.25 plus 1.625 minus 1.08289
.\OT1/LinuxLibertineT-TOsF/m/n/13 t
.\OT1/LinuxLibertineT-TOsF/m/n/13 e
.\kern-0.091
.\OT1/LinuxLibertineT-TOsF/m/n/13 x
.\OT1/LinuxLibertineT-TOsF/m/n/13 t
T1:
....\T1/LinuxLibertineT-TOsF/m/n/13 i
....\T1/LinuxLibertineT-TOsF/m/n/13 n
....\T1/LinuxLibertineT-TOsF/m/n/13 g
....\T1/LinuxLibertineT-TOsF/m/n/13 .
....\glue 3.7921 plus 4.875 minus 0.36096
....\T1/LinuxLibertineT-TOsF/m/n/13 T
....\T1/LinuxLibertineT-TOsF/m/n/13 h
....\T1/LinuxLibertineT-TOsF/m/n/13 i
....\T1/LinuxLibertineT-TOsF/m/n/13 s
....\glue 3.25 plus 1.625 minus 1.08289
....\T1/LinuxLibertineT-TOsF/m/n/13 t
....\T1/LinuxLibertineT-TOsF/m/n/13 e
....\kern-0.091
....\T1/LinuxLibertineT-TOsF/m/n/13 x
....\T1/LinuxLibertineT-TOsF/m/n/13 t
也就是說,OT1 字體具有 T1 字體中不存在的 Th 連字。這有點令人驚訝,但不一定是錯誤。之後,字長略有不同,這足以導致段落換行符採取不同的路徑。
你可以避免像這樣的連字
\documentclass[paper=a5,pagesize,fontsize=13pt]{scrbook}
\usepackage{showframe}
%\usepackage[T1]{fontenc}
\usepackage[osf]{libertine}
%\showoutput
\begin{document}
Hello, here is some text without a meaning. T{}his text
should show what a printed text will look like at this place.
\end{document}
答案2
microtype
您可以透過載入和發出來停用 OT1 字體中可怕的 Th 連字
\DisableLigatures[T]{encoding=OT1}
但這有一個缺點,即針對 T 的字距調整也被停用,如下例所示。
\documentclass[paper=a5,pagesize,fontsize=13pt]{scrbook}
\usepackage{showframe}
\usepackage[T1]{fontenc}
\usepackage[osf]{libertine}
\usepackage{microtype}
\DisableLigatures[T]{encoding=OT1}
\begin{document}
\fontencoding{OT1}\selectfont
Hello, here is some text without a meaning. This text
should show what a printed text will look like at this place.
To
\fontencoding{T1}\selectfont
Hello, here is some text without a meaning. This text
should show what a printed text will look like at this place.
To
\end{document}
所以你的問題沒有真正的解決方案。您可以要求軟體包的維護者libertine
新增一個選項來停用 OT1 編碼中的 Th 連字(需要一組新的虛擬字體)。在我看來,這將是一個非常很好的功能,因為我發現連字真的很糟糕。