Update: 2013-04-18
After upgrading to microtype
2.5 today this specific test cases indeed runs much faster (from approximately 3:00 minutes down to 8 seconds). However, I do have another cases where the compile time has not quite improved as much: only went down from 2:05 hr to 1:30 hr.
Question:
I would like to disable the features of the microtype
package for a portion of the document. I attempted to use \microtypesetup{activate=false}
but that seems to have no effect. Additional options I tried included:
\microtypesetup{expansion=false}
\microtypesetup{protrusion=false}
\microtypesetup{kerning=false}
\microtypesetup{tracking=false}
and did not seem to fix the compile time issue.
Background:
This problem seems related to Why does the use of microtype and xfrac lead to a long compile time? as my compile time for this small document is very large if all three of the \def
defined at the top are uncommented: ie.,
- The
microtype
package is used, and \sfrac
from thexfrac
pacakge is used, and- My "extended" version of the
\bracr
macro is used
Otherwise this document compiles just fine. With %\def\UseMicrotype{}
commented, and the other two \def
uncommented, this produces:
The last sentence is only to show why I need the "extended" version of the \bracr
macro.
Notes:
- I am using
microtype
from CTAN (2.4), and will update to 2.5 once it is released (which apparently does not have this long compile time issue with\sfrac
). In the mean time, if there is a way to disablemicrotype
that would be helpful.
Code:
%%% Problems ONLY if ALL three of these are uncommented
%\def\UseMicrotype{}% Enable use of microtype.
\def\UseExtendedBrac{}% Enable use of "extended" version of \brac macro
\def\UseSFrac{}% Enable use of \sfrac
\documentclass{article}
\usepackage{showframe}%
\usepackage{amsmath}%
\usepackage{xfrac}% Provides sfrac
\ifdefined\UseMicrotype
\usepackage{microtype}%
\fi
\ifdefined\UseExtendedBrac%
\makeatletter
\newcommand{\@Brac}[3]{% #1,#3 = left/right bracket type
\ensuremath{%
\left#1\vphantom{#2}\right.% left bracket
#2% content
\left.\vphantom{#2}\right#3% right bracket
}%
}%
\newcommand{\bracr}[1]{\@Brac{(}{#1}{)}}%
\newcommand{\bracs}[1]{\@Brac{[}{#1}{]}}%
\makeatother
\else% Works if these are used
\newcommand{\bracr}[1]{\left(#1\right)}
\newcommand{\bracs}[1]{\left[#1\right]}
\fi
\ifdefined\UseSFrac
\else% No problem if we don't use \sfrac
\renewcommand*{\sfrac}[2]{\frac{#1}{#2}}%
\fi
\begin{document}
\ifdefined\UseMicrotype
\microtypesetup{activate=false}
\fi
%
\begin{align*}
f(x,y)
&= \bracr{\frac{x^{ \sfrac{3}{2}}}
y^{-\sfrac{1}{2}}}^{\!\!\!-2} \\
&= \bracr{
\bracs{
\frac{x^{ \sfrac{3}{2}}}
{y^{-\sfrac{1}{2}}}}^2}^{\!\!\!-1}
\end{align*}
%
% Reason for using the "extended" brac as it yields line wrapping.
As we can see in the following, the \verb|\bracr| wraps around lines:
$\bracr{x^{-1} + x^{-2} + x^{-3} +x^{-4} + x^{-5} + \cdots }$
\end{document}
microtype
or the fact that xfrac loads the LaTeX3 packages? – Yiannis Lazarides Apr 4 '12 at 17:56microtype
andxfrac
. My "extended"bracr
macro just makes things much worse. If you don't usemicrotype
things work just fine (this is how the code as posted is: disablesmicrotype
, uses\sfrac
). – Peter Grill Apr 4 '12 at 17:58