git.iko.soy/typeable/pandoc
on master help sign in
default.latex: Use \ScaleIfNeeded w/ nicer def instead of \maxwidth.
commit7a93757ff12f6ada1309c63dfc6e7ec5b7627762 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 7 May 2013, 17:30 (13 years ago) parent2c876ed
1 file changed+8−3
default.latex+8−3
default.latex+8−3
@@ -70,13 +70,18 @@ $if(graphics)$
7070% Images get their normal width if they fit onto the page, but
7171% are scaled down if they would overflow the margins.
7272\makeatletter
73−\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
74−\else\Gin@nat@width\fi}
73+\def\ScaleIfNeeded{%
74+ \ifdim\Gin@nat@width>\linewidth
75+ \linewidth
76+ \else
77+ \Gin@nat@width
78+ \fi
79+}
7580\makeatother
7681\let\Oldincludegraphics\includegraphics
7782{%
7883 \catcode`\@=11\relax%
79− \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}%
84+ \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}%
8085}%
8186$endif$
8287\ifxetex