File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -125,13 +125,23 @@ $endif$
125125$if(graphics)$
126126\usepackage{graphicx,grffile}
127127\makeatletter
128- \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
129- \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
130- \makeatother
131- % Scale images if necessary, so that they will not overflow the page
132- % margins by default, and it is still possible to overwrite the defaults
133- % using explicit options in \includegraphics[width, height, ...]{}
134- \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
128+
129+ % Updating our template following changes to Pandoc
130+ % https://github.com/jgm/pandoc/pull/9666/files
131+
132+ \newsavebox\pandoc@box
133+ \newcommand*\pandocbounded[1]{% scales image to fit in text height/width
134+ \sbox\pandoc@box{#1}%
135+ \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
136+ \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
137+ \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
138+ \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
139+ \else\usebox{\pandoc@box}%
140+ \fi%
141+ }
142+
143+ % End update
144+
135145$endif$
136146$if(links-as-notes)$
137147% Make links footnotes instead of hotlinks:
You can’t perform that action at this time.
0 commit comments