7

I am trying to hammer in some stacked matrix notation to fit the paragraph by shrinking the font. To do so I am using the \SetExpansion option from the microtype package. But pdfTeX is spitting out this error every-time:

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

I have provided one such instance in the MWE below. The text will be out of place when the MWE is run as is. On un-commenting the the microtypecontext part the error pops up.

    % 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}  

What am I missing here?

1
  • 2
    The problem seems to be the relation and binary operator (where an equation can insert a line break). $y=z$ gives an error, but $y\mathrel{=}z$ and ${y=z}$ works. But I can't tell you if this is a pdftex problem or a microtype problem. Commented Nov 13, 2012 at 12:59

1 Answer 1

7

It's a bug in microtype, which neglects to set up the math fonts anew after the change of context; therefore you get a mixture of fonts with the normal settings and those with sloppy settings within one paragraph, which pdftex does not allow.

Until the package is updated, you can fix it by adding these lines after loading 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
4
  • So this goes into the preamble?
    – sriramn
    Commented Nov 13, 2012 at 21:19
  • @RazorXsr Exactly.
    – Robert
    Commented Nov 13, 2012 at 21:32
  • One quick question - can I use different expansion context say Sloopy1 - where shrink is 100 and Sloppy2 - where shrink is 50 - in the same document applied on the math font? As in can the math font be shrunk to different scales in different places within the same document?
    – sriramn
    Commented Nov 13, 2012 at 21:54
  • @RazorXsr Yes, that's possible, as long as you don't mix the contexts within one paragraph.
    – Robert
    Commented Nov 13, 2012 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .