pdfTeX 字体扩展错误 - microtype 包中的 \SetExpansion

pdfTeX 字体扩展错误 - microtype 包中的 \SetExpansion

我正在尝试通过缩小字体来添加一些堆叠矩阵符号以适合段落。为此,我使用了包\SetExpansion中的选项microtype。但是 pdfTeX 每次都会出现此错误:

! pdfTeX error (font expansion): using fonts with different step of expansion i

我在下面的 MWE 中提供了一个这样的实例。当 MWE 按原样运行时,文本将错位。取消注释该部分时,microtypecontext错误会弹出。

    % START PREAMBLE
\documentclass[12pt]{report}
\usepackage[margin=1.25in]{geometry}

%Required math packages
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\newcommand\vect[1]{\bm{#1}}%bm{#1}

%For experimenting
\usepackage{verbatim}

%Document and typesetting
\usepackage{setspace}
\linespread{1.5}
\setlength{\parindent}{0in}

%Microtyping
\usepackage{microtype}

\SetExpansion
[ context = sloppy,
    stretch = 0,
    shrink  = 100,
    step    =  5  ]
{ encoding = {OT1,T1,TS1,OML,OMS,OMX,U} }
{ }

% END PREAMBLE

\begin{document}

To proceed forward, we first write the equation system in the equation compactly. To do so, define the following ($S$ x 1) vectors of vertically stacked propensities, count outcome indices, observed count outcomes, and combined error terms $\left[ {\eta_{qj}^*\,\,( = {v_q} + {u_{qj}} + {\omega_{qs}} + {\varepsilon_{qjs}})} \right]$;
$\vect{y}_{qj}^* = (y_{qj1}^*,{\text{ }}y_{qj2}^*,\dots,{\text{ }}y_{qjS}^*)'$,
$\vect{y}_{qj}^{} = (y_{qj1}^{},{\text{ }}y_{qj2}^{},\dots,{\text{ }}y_{qjS}^{})'$,
$\vect{m}_{qj}^{} = (m_{qj1}^{},{\text{ }}m_{qj2}^{},\dots,{\text{ }}m_{qjS}^{})'$, and
${\vect{\eta }}_{qj}^* = (\eta _{qj1}^*,{\text{ }}\eta _{qj2}^*,\dots,{\text{ }}\eta_{qjS}^*)'$.

\begin{comment}
{\microtypecontext{expansion=sloppy}%
To proceed forward, we first write the equation system in the equation compactly. To do so, define the following ($S$ x 1) vectors of vertically stacked propensities, count outcome indices, observed count outcomes, and combined error terms $\left[ {\eta_{qj}^*\,\,( = {v_q} + {u_{qj}} + {\omega_{qs}} + {\varepsilon_{qjs}})} \right]$;
$\vect{y}_{qj}^* = (y_{qj1}^*,{\text{ }}y_{qj2}^*,\dots,{\text{ }}y_{qjS}^*)'$,
$\vect{y}_{qj}^{} = (y_{qj1}^{},{\text{ }}y_{qj2}^{},\dots,{\text{ }}y_{qjS}^{})'$,
$\vect{m}_{qj}^{} = (m_{qj1}^{},{\text{ }}m_{qj2}^{},\dots,{\text{ }}m_{qjS}^{})'$, and
${\vect{\eta }}_{qj}^* = (\eta _{qj1}^*,{\text{ }}\eta _{qj2}^*,\dots,{\text{ }}\eta_{qjS}^*)'$.}
\end{comment}

\end{document}  

我在这里遗漏了什么?

答案1

这是 中的一个错误microtype,它忽略了在上下文改变后重新设置数学字体;因此,你会在一个段落中看到混合了正常设置的字体和设置混乱的字体,这是pdftex不允许的。

在软件包更新之前,您可以在加载后添加以下几行来修复它microtype

\makeatletter
\MT@addto@setup{%
  \DeclareRobustCommand\microtypecontext[1]{%
    \MT@setup@contexts
    \let\MT@reset@context\relax
    \let\glb@currsize\@empty % <- added 
    \setkeys{MTC}{#1}%
    \selectfont
    \MT@reset@context
  }%
}
\makeatother

相关内容