通过微类型扩展的本地设置修复过满行

通过微类型扩展的本地设置修复过满行

段落的第二行有一个总行距 (6pt)。我无法更改文本,并且前两行 (priv-vate 和 al-ready) 的连字符也无济于事。

修复过满的段落

我尝试更改此段落的微类型设置(我使用默认设置):

\SetExpansion
[ context = sloppy,
stretch = 30,
shrink = 60,
step
= 5 ]
{ encoding = {OT1,T1,TS1} }
{ }

{\microtypecontext{expansion=sloppy}%
You are horrified at our intending to do away with private
property.  But in your existing society, private property is
already done away with for nine-tenths of the population; its
existence for the few is solely due to its non-existence in the
hands of those nine-tenths.  You reproach us, therefore, with
intending to do away with a form of property, the necessary
condition for whose existence is the non-existence of any
property for the immense majority of society.
}

但是我收到了错误(lualatex 0.80 和 microtype v2.5a):

! Package microtype Error: microtype isn't set up for expansion contexts.
(microtype)                Ignoring `context' key on input line 701.

我不明白发生了什么。有人可以向我解释如何在本地更改微类型参数。

欢迎提供任何其他有关如何修复此过满线路的建议。

答案1

您必须将\SetExpansion块移至前导码或microtype使用该copyfonts选项加载包。文档说

copyfonts将在设置字体之前复制所有字体。这允许使用不同的参数进行突出和扩展。此选项也是未记录的希望我们总能自动发现它是否是必需的。

也就是说,将\SetExpansion块移至前导码是更好的做法,因为它可以microtype检测是否有必要复制字体。

\documentclass{article}
\usepackage{microtype}
\SetExpansion
[ context = sloppy,
  stretch = 30,
  shrink = 60,
  step = 5 ]
{ encoding = {OT1,T1,TS1} }
{ }
\newcommand\text{You are horrified at our intending to do away with
  private property.  But in your existing society, private property is
  already done away with for nine-tenths of the population; its
  existence for the few is solely due to its non-existence in the hands
  of those nine-tenths.  You reproach us, therefore, with intending to
  do away with a form of property, the necessary condition for whose
  existence is the non-existence of any property for the immense
  majority of society.}
\begin{document}
\text

{\microtypecontext{expansion=sloppy}\text}
\end{document}

在此处输入图片描述

相关内容