From 7a93757ff12f6ada1309c63dfc6e7ec5b7627762 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 7 May 2013 17:30:44 -0700 Subject: [PATCH] default.latex: Use \ScaleIfNeeded w/ nicer def instead of \maxwidth. --- default.latex | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/default.latex b/default.latex index c91a03861..5ef9170a9 100644 --- a/default.latex +++ b/default.latex @@ -70,13 +70,18 @@ $if(graphics)$ % Images get their normal width if they fit onto the page, but % are scaled down if they would overflow the margins. \makeatletter -\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth -\else\Gin@nat@width\fi} +\def\ScaleIfNeeded{% + \ifdim\Gin@nat@width>\linewidth + \linewidth + \else + \Gin@nat@width + \fi +} \makeatother \let\Oldincludegraphics\includegraphics {% \catcode`\@=11\relax% - \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}% }% $endif$ \ifxetex