为什么在各种 LaTeX 引擎中使用 Libertine/Libertinus 时单词间距会发生剧烈变化?

为什么在各种 LaTeX 引擎中使用 Libertine/Libertinus 时单词间距会发生剧烈变化?

libertine我只是在 LaTeX 中使用和包进行了一些调整libertinus,并注意到从 LaTeX 切换到 XeLaTex 再切换到 LuaLaTeX 所生成的 PDF 的长度大致相同,只是段落间距略有变化。

这是什么原因造成的?有“正确”的输出吗?

起初我以为这libertinus与从 pdfLaTeX 的 Type 1 编码切换到 XeLaTeX/LuaLaTeX 的 OpenType 有关(不确定是否libertine以相同的方式工作),但即使 XeLaTeX 和 LuaLaTeX 的输出也不同。

\documentclass{turabian-researchpaper}
\usepackage{biblatex-chicago}
\usepackage{turabian-formatting}
\usepackage[pass,letterpaper]{geometry}
\usepackage{libertine} % or libertinus %

\begin{document}

Afraid of intimacy, we use technology to remove ourselves from the real world because we
believe more will listen to us when we are online. The internet and our phones become an
addiction that is hard to break. Although our technological habits change our personal
relationships for the worst, we continue the cycle of needing to text or post to social
media to feel validated. We have been blinded by our own emotions into thinking we need to
be online so we don't have to self-reflect, even though the situation is the opposite. This
is extremely harmful to our social skills, and we form habits that, before technology, most
would have called awkward or antisocial. We sit with our friends without interacting. We go
to cafés alone to do nothing but text. We spew hateful comments online through the barrier
of anonymity. However, the habit of checking your phone, posting to social media, and
commenting on content is extremely hard to break and needs patience and the willingness to
take breaks often. Technology does not need to always be wasting resources in the back of
your mind.
\footnote{Before you start an unrelated argument, I'm not actually anti-technology like
this might suggest. This was an essay written to appease an English teacher.}

\end{document}

抱歉,这还不够简单。如果没有这些单词和包,我无法找到重现此问题的方法。

此 GIF 演示了 pdfLaTeX、XeLaTeX 和 LuaLaTeX 之间的区别。不同的 TeX 引擎产生的不同间距。


(由 David Carlisle 添加)测试文件仅使用文章类,但宽度和字体设置与原始示例相同,它显示与原始文件相同的 pdf/xe/lua latex 的三种输出变体,但依赖性较少,因此更容易跟踪(也许)

\documentclass[12pt]{article}


\usepackage{libertine} % or libertinus %

\setlength\textwidth{469.755pt}
\setlength\parindent{36.135pt}
\addtolength\oddsidemargin{-1cm}

\begin{document}

\typeout{\the\font}
\typeout{\the\fontdimen2\font} % space
\typeout{\the\fontdimen3\font} % stretch
\typeout{\the\fontdimen4\font} % shrink
\typeout{\the\fontdimen7\font} % punct

Afraid of intimacy, we use technology to remove ourselves from the real world because we
believe more will listen to us when we are online. The internet and our phones become an
addiction that is hard to break. Although our technological habits change our personal
relationships for the worst, we continue the cycle of needing to text or post to social
media to feel validated. We have been blinded by our own emotions into thinking we need to
be online so we don't have to self-reflect, even though the situation is the opposite. This
is extremely harmful to our social skills, and we form habits that, before technology, most
would have called awkward or antisocial. We sit with our friends without interacting. We go
to cafés alone to do nothing but text. We spew hateful comments online through the barrier
of anonymity. However, the habit of checking your phone, posting to social media, and
commenting on content is extremely hard to break and needs patience and the willingness to
take breaks often. Technology does not need to always be wasting resources in the back of
your mind.


\end{document}

答案1

如果你添加

\typeout{\the\font}
\typeout{\the\fontdimen2\font} %space
\typeout{\the\fontdimen3\font} %stretch
\typeout{\the\fontdimen4\font} % shrink
\typeout{\the\fontdimen7\font} % punct

之后\begin{document}你会发现

pdftex

\OT1/LinuxLibertineT-TLF/m/n/12 
3.0pt
1.5pt
0.99959pt
0.5004pt

西特克斯

\TU/LinLibertine(0)/m/n/12 
3.0pt
1.5pt
1.0pt
1.0pt

路特克斯

\TU/LinLibertine(0)/m/n/12 
3.0pt
1.5pt
1.0pt
1.0pt

请注意,fontdimen7(标点符号后的额外空格)在 OpenType 字体中最终会比 pdftex 使用的 tfm 指标大一倍。我注意到 libertinus 字体支持昨天在 texlive 中进行了更新,这是在 texlive 2018 上运行的该软件包的最新版本(以及 luatex 1.09 的开发版本)。

因此,pdftex 与其他软件之间的巨大差异并不令人惊讶,除了 luatex 明确记录它使用变体连字算法(即使使用相同的模式也不总是选择相同的点)之外,很难看出 luatex 和 xetex 之间差异的明显原因。

相关内容