更新 2016/12/10

更新 2016/12/10

我有一个非常棘手的问题。使用自定义 T1 字体(例如 via\usepackage{libertine}, \usepackage{raleway}, \usepackage{roboto}等)时​​,一切都运行正常,除了正常格式的文本和粗体文本之间的奇怪间距。使用 Miktex 和 pdflatex。今天完全重新安装了 MiKTeX 并进行了更新。 This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100 64-bit)

梅威瑟:

\documentclass{article}
\usepackage[default]{raleway}
\begin{document}
There is a \textbf{weird} gap before that \textbf{bold word}. But not for \emph{italic}.
\end{document}

结果: 结果

日志输出:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100 64-bit) (preloaded format=pdflatex 2016.12.7)  7 DEC 2016 14:24
entering extended mode
**./raleway.tex
(raleway.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(C:\Users\motze\AppData\Roaming\MiKTeX\2.9\tex\latex\raleway\raleway.sty
Package: raleway 2016/12/03 v1.4 Matt McInerney’s Raleway family

("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty"
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
("C:\Program Files\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkvutils.tex"
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15

("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\keyval.tex"))
\XKV@depth=\count87
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
Package: fontenc 2016/06/19 v1.99m Standard LaTeX package
 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\ot1enc.def"
File: ot1enc.def 2016/06/19 v1.99m Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding OT1 on input line 48.
)
(C:\Users\motze\AppData\Roaming\MiKTeX\2.9\tex\latex\ly1\ly1enc.def
File: ly1enc.def 2009/07/22 v0.7 TeX 'n ANSI encoding (DPC/KB)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"
File: t1enc.def 2016/06/19 v1.99m Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 48.
)
LaTeX Font Info:    Try loading font information for T1+ptm on input line 105.
 ("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\t1ptm.fd"
File: t1ptm.fd 2001/06/04 font definitions for T1/ptm.
))
(C:\Users\motze\AppData\Roaming\MiKTeX\2.9\tex\latex\mweights\mweights.sty
Package: mweights 2016/12/04 (Bob Tennent) Support package for multiple-weight font packages. 
LaTeX Info: Redefining \bfseries on input line 21.
LaTeX Info: Redefining \mdseries on input line 29.
LaTeX Info: Redefining \rmfamily on input line 37.
LaTeX Info: Redefining \sffamily on input line 56.
LaTeX Info: Redefining \ttfamily on input line 75.
)) (raleway.aux)
\openout1 = `raleway.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for LY1/ptm/m/n on input line 4.
LaTeX Font Info:    Try loading font information for LY1+ptm on input line 4.

(C:\Users\motze\AppData\Roaming\MiKTeX\2.9\tex\latex\ly1\ly1ptm.fd
File: ly1ptm.fd 2001/02/01 font definitions for LY1/ptm using Berry names.
)
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Try loading font information for T1+Raleway-TLF on input line 4.

(C:\Users\motze\AppData\Roaming\MiKTeX\2.9\tex\latex\raleway\t1raleway-tlf.fd
File: T1Raleway-TLF.fd 2014/07/28 (autoinst) Font definitions for T1/Raleway-TLF.
)
LaTeX Font Info:    Font shape `T1/Raleway-TLF/m/n' will be
(Font)              scaled to size 10.0pt on input line 4.
LaTeX Font Info:    Font shape `T1/Raleway-TLF/b/n' will be
(Font)              scaled to size 10.0pt on input line 5.
LaTeX Font Info:    Font shape `T1/Raleway-TLF/m/it' will be
(Font)              scaled to size 10.0pt on input line 5.
 [1

{C:/Users/motze/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (raleway.aux)

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 raleway.sty    2016/12/03 v1.4 Matt McInerney’s Raleway family
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
 fontenc.sty
  ot1enc.def    2016/06/19 v1.99m Standard LaTeX file
  ly1enc.def    2009/07/22 v0.7 TeX 'n ANSI encoding (DPC/KB)
   t1enc.def    2016/06/19 v1.99m Standard LaTeX file
   t1ptm.fd    2001/06/04 font definitions for T1/ptm.
mweights.sty    2016/12/04 (Bob Tennent) Support package for multiple-weight font packages. 
  ly1ptm.fd    2001/02/01 font definitions for LY1/ptm using Berry names.
t1raleway-tlf.fd
 ***********

 ) 
Here is how much of TeX's memory you used:
 1150 strings out of 493333
 16451 string characters out of 3139194
 60408 words of memory out of 3000000
 4709 multiletter control sequences out of 15000+200000
 47023 words of font info for 21 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 29i,4n,34p,179b,175s stack positions out of 5000i,500n,10000p,200000b,50000s
{C:/Users/motze/AppData/Roaming/MiKTeX/2.9/fonts/enc/dvips/raleway/a_bzmckq.enc}<C:/Users/motze/AppData/Roaming/MiKTeX
/2.9/fonts/type1/impallari/raleway/Raleway-Bold.pfb><C:/Users/motze/AppData/Roaming/MiKTeX/2.9/fonts/type1/impallari/ral
eway/Raleway-Italic.pfb><C:/Users/motze/AppData/Roaming/MiKTeX/2.9/fonts/type1/impallari/raleway/Raleway-Regular.pfb>
Output written on raleway.pdf (1 page, 49267 bytes).
PDF statistics:
 19 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

感谢你并致以真诚的问候

弗林斯顿

答案1

更新 2016/12/10

新版本mweights.sty已上传至 CTAN 并部署在 TeX Live 中,发布日期如下2016/12/09,这似乎解决了这个问题以及所有其他相关问题。

原始答案

上次更新mweights.sty引入了一些不受保护的行尾。

\def\mweights@init{%
% Define any undefined \mdseries@rm etc. 
% Defined \mdseries@rm etc. assumed to be fully expanded!
\ifdefined\mdseries@rm\else\edef\mdseries@rm{\mddefault}\fi
\ifdefined\bfseries@rm\else\edef\bfseries@rm{\bfdefault}\fi
\ifdefined\mdseries@sf\else\edef\mdseries@sf{\mddefault}\fi
\ifdefined\bfseries@sf\else\edef\bfseries@sf{\bfdefault}\fi
\ifdefined\mdseries@tt\else\edef\mdseries@tt{\mddefault}\fi
\ifdefined\bfseries@tt\else\edef\bfseries@tt{\bfdefault}\fi
% In case any unexpanded macros present in \rmdefault, etc
\edef\rmdef@ult{\rmdefault}
\edef\sfdef@ult{\sfdefault}
\edef\ttdef@ult{\ttdefault}
\edef\bfdef@ult{\bfdefault}
\edef\mddef@ult{\mddefault}
}

您可以在矫正后看到它们。

临时修复:

\documentclass{article}
\usepackage[default]{raleway}

\makeatletter
\def\mweights@init{%
% Define any undefined \mdseries@rm etc.
% Defined \mdseries@rm etc. assumed to be fully expanded!
\ifdefined\mdseries@rm\else\edef\mdseries@rm{\mddefault}\fi
\ifdefined\bfseries@rm\else\edef\bfseries@rm{\bfdefault}\fi
\ifdefined\mdseries@sf\else\edef\mdseries@sf{\mddefault}\fi
\ifdefined\bfseries@sf\else\edef\bfseries@sf{\bfdefault}\fi
\ifdefined\mdseries@tt\else\edef\mdseries@tt{\mddefault}\fi
\ifdefined\bfseries@tt\else\edef\bfseries@tt{\bfdefault}\fi
% In case any unexpanded macros present in \rmdefault, etc
\edef\rmdef@ult{\rmdefault}%
\edef\sfdef@ult{\sfdefault}%
\edef\ttdef@ult{\ttdefault}%
\edef\bfdef@ult{\bfdefault}%
\edef\mddef@ult{\mddefault}%
}
\makeatother


\begin{document}
There is a \textbf{weird} gap before that \textbf{bold word}. But not for \emph{italic}.
\end{document}

答案2

感谢您的帮助,这也解决了我的间距问题。

该文件的新版本尚未包含在 MikTeX 中。但有一个解决方法:从 CTAN 下载新版本,并将 .sty 文件放在与 .tex 文件相同的文件夹中。

相关内容