Microtype 和 LuaTeX:改变凸出和悬挂标点

Microtype 和 LuaTeX:改变凸出和悬挂标点

我正在尝试(使用 TeXLive 2013)将标点符号完全延伸到左右边距。我不知道如何添加图片,所以我会尽力在这里格式化以显示我所说的内容:

 Text with normal space
"Quotation mark hanging"
 text with normal space

如果我使用 pdfTeX 和 microtype 以及以下代码,它就可以工作:

\documentclass{article}
\usepackage{microtype}
\LoadMicrotypeFile{cmr}
\SetProtrusion 
{encoding=OT1,family=cmr}
{\textquotedblleft = {1000, },\textquotedblright = { ,1000}}
\begin{document}
Text\\
text\\
"text"\\
text.
\end{document}

(您看不到右边距,但它也可以工作)。但我当然想使用 LuaLaTeX,这样我就可以获得所有我喜欢的字体,但为了简单起见:

\documentclass{article}
\usepackage{fontspec}
\usepackage{microtype}
\LoadMicrotypeFile{cmr}
\SetProtrusion 
{encoding=OT1,family=cmr}
{\textquotedblleft = {1000, },\textquotedblright = { ,1000}}
\begin{document}
Text\\
text\\
"text"\\
text.
\end{document}

使用 LuaLaTeX 进行编译时,我得到了正常的突出部分(即使我使用 0 或 3000 进行修改,也只有大约半个引号),但这与我没有包含所有“\SetProclusion”操作时完全相同。由于我使用的是 LuaLaTeX,因此我希望能够使用自己的字体,因此如果我这样做:

\documentclass{article}
\usepackage{fontspec}
\usepackage{microtype}
\setmainfont[Ligatures=TeX]{Garamond Premier Pro}
% \LoadMicrotypeFile{cmr}
\SetProtrusion 
{encoding=OT1,family=Garamond Premier Pro}
{\textquotedblleft = {1000, },\textquotedblright = { ,1000}}
\begin{document}
Text\\
text\\
"text"\\
text.
\end{document}

这样产生的结果看起来与我刚刚使用不带“\SetProtraction”业务的微打字机时没有什么不同,即正常的突出量。

hanging包存在并且做了不错的工作但不包含任何控制突出量的方法,而且手册警告使用它,因为它将标点符号视为命令而不是字形(我不明白区别)然后当然我不确定它是如何工作/冲突的microtype(虽然我猜可以关闭突出microtype并让它hanging处理这个问题?)

还有:

\usepackage[factor=3000]{microtype}

它得到了我想要的左侧悬挂标点符号,但实际上却搞砸了右侧。

还有其他问题涉及类似的想法,但其中一些已经过时,其他问题提到了使用,Renderer=Basic但这不仅没有帮助,而且看起来它完全关闭了突起,或者至少使引号看起来很奇怪。然后其他问题似乎与系统字体无关。

所以实际上所有的一切都归结为我无法弄清楚在使用 LuaLaTeX 时如何指定突起设置,或者microtype这是否可能。

答案1

好的,这有效,显然我没有选择正确的编码并使用星号解决了它:

\documentclass{article}
\usepackage{fontspec}
\usepackage{microtype}
\setmainfont[Ligatures=TeX]{Garamond Premier Pro}
\SetProtrusion 
{encoding= *}
{\textquotedblleft = {1000, },\textquotedblright = { ,1000}}
\begin{document}
Text\\
text\\
"text"\\
text.
\end{document}

我不确定为什么 OT1 不起作用或者使用星号是否存在问题,但它可以与几种不同的字体一起使用,所以我想我的问题已经得到解答了。

相关内容