我想禁用或修改microtype
特定字符的字符突出(通过 启用)。
让我用短破折号来说明这个问题,它突出得太宽了,不符合我的口味:
(左:无突起;右:有突起)
但是我无法使用以下方法禁用突起\SetProtrusion
:
\documentclass{memoir}
\usepackage{mathptmx}
\usepackage[T3,T1]{fontenc}
\usepackage{microtype}
%\usepackage[protrusion=false]{microtype}
\SetProtrusion
{ encoding = T1,
family = ptm }
{ \textendash = {,0} }
\begin{document}
Word word word word word word word word word word word word word word -- word
word word word word word word word word word word word word word word word
word word word word word word word word word word word word word word word
word word word word word word ...
\end{document}
我还收到以下警告:
Package microtype Warning: protrusion codes list `ptm-T1' will override list
(microtype) `q.tex/9' for font `T1/ptm///' on input line 105.
根据如何在序言中调用微类型的 \SetProtraction?\LoadMicrotypeFile{ptm}
,包括帮助之前的一行\SetProtrusion
;如果我尝试这样做,这似乎解决了--
(\textendash
)的问题,但(1)恼人的警告仍然存在,并且(2)我的代码禁用全部突起(通过使用我的简短列表覆盖整个突起值列表)。部分覆盖默认字符突起设置的正确方法是什么?理想情况下,会有一种方法可以消除任何警告,同时又不会禁用重要microtype
功能。
答案1
您可以这样扩展或更改现有设置:
确保您要更改的设置已加载;在序言中,不能保证情况如此,因此您需要
\LoadMicrotypeFile
。创建新的设置,通过
load
键加载默认设置。如果您想要将任何字形的突起设置为零,那么您必须明确地这样做 - 声明空的突起值(例如
\textendash = {,}
)不会改变任何东西。如果收到的警告让您感到不安,您可以通过使用 加载包来抑制它编辑:自 2.7 版起,如果覆盖的列表与已加载的列表相同,您将不再收到警告。verbose=silent
;但请注意,这也会抑制所有其他microtype
警告。(我猜像override
设置键这样的东西会很有用,但现在就是这样。)
因此,将其转换为代码:
\usepackage[verbose=silent]{microtype}
\LoadMicrotypeFile{ptm}
\SetProtrusion
[ name = ptm-adapted, % the name is optional
load = ptm-T1 ]
{ encoding = T1,
family = {ptm,ptmx,ptmj} }
{
\textendash = { ,0}, % left protrusion will remain untouched,
% right protrusion set to zero
%\textendash = {150,150}, % this would set protrusion on both sides to 150
}
要调整多种字体的设置,您必须再次执行相同的操作(加载设置并创建新设置),即多次发出\SetProtrusion
(使用):\LoadMicrotypeFile
\LoadMicrotypeFile{ppl}
\SetProtrusion
[ load = ppl-T1 ]
{ encoding = T1,
family = {ppl,pplx,pplj} }
{ ... }
另一种更简单但不太精细的方法可能是使用小于factor
1000 的值加载包;这将缩放所有字体的所有字形的凸出值。例如,
\usepackage[factor=500]{microtype}
会使所有突出值减半。
答案2
我目前加载了microtype
以下突出调整。也许有人有兴趣使用我的值,尤其是 Times ( ptm
),在我看来它的突出太多了。请注意,我选择的调整并非力求详尽无遗。
\usepackage[verbose=silent]{microtype}
\LoadMicrotypeFile{ptm}
\SetProtrusion
[ name = ptm-adapted,
load = ptm-T1 ]
{ encoding = T1,
family = {ptm,ptmx,ptmj} }
{ f = { ,-200},
r = { ,-100},
\textquoteleft = {300, }, % default uses 500
\textquoteright = { ,300}, % default uses 500
\textquotedblleft = {75, }, % default uses 300
\textquotedblright = { ,75}, % default uses 400
\textendash = {0,0}, % default is 300/300
\textemdash = {0,0}, % default is 200/200
/ = { ,-100}, % default uses 200
( = {67, }, % default uses 100
) = { ,67}, % default uses 200
{,} = { ,167}, % default uses 500
: = { ,167}, % default uses 500
; = { ,100}, % default uses 300
. = { ,233}, % default uses 700
? = { ,33} } % default uses 100
\SetProtrusion
[ name = ptm-it-adapted,
load = ptm-it-T1 ]
{ encoding = T1,
family = {ptm,ptmx,ptmj},
shape = {it,sl} }
{ f = { ,-300},
: = { ,0}, % default uses 500
. = { ,233} } % default uses 700
\LoadMicrotypeFile{ppl}
\SetProtrusion
[ name = ppl-adapted,
load = ppl-T1 ]
{ encoding = T1,
family = {ppl,pplx,pplj} }
{ \textquoteleft = {150, }, % default uses 500
\textquoteright = { ,150}, % default uses 700
\textquotedblleft = {75, }, % default uses 300
\textquotedblright = { ,75}, % default uses 400
\textendash = {0,0}, % default is 300/300
\textemdash = {0,0}, % default is 200/200
/ = { ,100}, % default uses 300
( = {50, }, % default uses 100
) = { ,150}, % default uses 300
{,} = { ,250}, % default uses 500
: = { ,250}, % default uses 500
; = { ,250}, % default uses 500
. = { ,350}, % default uses 700
? = { ,100} } % default uses 200
\SetProtrusion
[ name = txtt ]
{ encoding = T1,
family = txtt,
shape = {it,sl} }
{ f = { ,-120},
- = { ,300} } % in order to match ordinary hyphens' protrusion in body text