stevetemplates
stevetemplates copied to clipboard
Major update required by pandoc 3.2.1
I thank Justin Esarey for bringing this to my attention by email because I wouldn't have otherwise noticed it. From his email:
Pandoc has changed itself in a way that requires a minor update to your LaTeX templates (in the stevetemplates package). Specifically, it now makes use of a pandocbounded macro that must be defined in each template. A few more details here (note a typo where he calls it pandocunbounded instead of pandocbounded).
Fortunately, Justin was kind enough to pass on the solution:
TLDR: you need to drop this in place of the existing $if(graphics)$ statement in your templates:
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\def\fps@figure{htbp}
\makeatother
$endif$