Skip to content

Commit ba05f1a

Browse files
committed
update template to fix pandoc errors
pandoc 3.2.1 introduced `pandocbounded`, the absence of the definition of which which led to this error: Error producing PDF. ! Undefined control sequence. l.378 \pandocbounded Update `template.tex` using the changes from here: jgm/pandoc-templates@6c0e7b0 Which I found via this discussion: https://codebase.helmholtz.cloud/mussel/paper-modelingpractise/-/issues/5
1 parent 93a62fa commit ba05f1a

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

docs/soar_manual/template.tex

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
\makeatother
194194

195195
% \newcommand{\passthrough}[1]{#1}
196-
\newcommand{\passthrough}[1]{\lstset{mathescape=false}#1\lstset{mathescape=true}}
196+
\newcommand{\passthrough}[1]{\lstset{mathescape=false}#1\lstset{mathescape=true}}
197197
\lstset{defaultdialect=[5.3]Lua}
198198
\lstset{defaultdialect=[x86masm]Assembler}
199199
$endif$
@@ -229,15 +229,16 @@
229229
$if(graphics)$
230230
\usepackage{graphicx}
231231
\makeatletter
232-
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
233-
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
234-
\makeatother
235-
% Scale images if necessary, so that they will not overflow the page
236-
% margins by default, and it is still possible to overwrite the defaults
237-
% using explicit options in \includegraphics[width, height, ...]{}
238-
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
239-
% Set default figure placement to htbp
240-
\makeatletter
232+
\newsavebox\pandoc@box
233+
\newcommand*\pandocbounded[1]{% scales image to fit in text height/widthAdd commentMore actions
234+
\sbox\pandoc@box{#1}%
235+
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
236+
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
237+
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
238+
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
239+
\else\usebox{\pandoc@box}%
240+
\fi%
241+
}
241242
\def\fps@figure{htbp}
242243
\makeatother
243244
$endif$
@@ -330,13 +331,15 @@
330331
% get rid of language-specific shorthands (see #6817):
331332
\let\LanguageShortHands\languageshorthands
332333
\def\languageshorthands#1{}
334+
$if(selnolig-langs)$
335+
\ifLuaTeXAdd commentMore actions
336+
\usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
337+
\fi
338+
$endif$
333339
$endif$
334340
$for(header-includes)$
335341
$header-includes$
336342
$endfor$
337-
\ifLuaTeX
338-
\usepackage{selnolig} % disable illegal ligatures
339-
\fi
340343
$if(dir)$
341344
\ifPDFTeX
342345
\TeXXeTstate=1
@@ -434,22 +437,22 @@
434437
\begin{document}
435438
\begin{titlepage}
436439
\vspace{1.5in}
437-
440+
438441
\begin{center}
439442
\begin{huge}
440443
The Soar User's Manual \vspace{10pt} \\
441444
Version \SoarVersionMajor.\SoarVersionMinor.\SoarVersionRevision \vspace{20pt} \\
442445
\end{huge}
443446
\vspace{36pt}
444-
445-
447+
448+
446449
\begin{large}
447450
\vspace{20pt}
448451
John E. Laird, Clare Bates Congdon, \\
449452
Mazin Assanie, Nate Derbinsky and Joseph Xu \\
450453
\vspace{20pt}
451454
\end{large}
452-
455+
453456
\vspace{20pt}
454457
\begin{large}
455458
Additional contributions by: \\
@@ -462,32 +465,32 @@
462465
Division of Computer Science and Engineering\\
463466
University of Michigan \vspace{.3in} \\
464467
\end{large}
465-
468+
466469
Draft of:
467470
\today
468-
471+
469472
\end{center}
470-
473+
471474
\vspace*{0pt plus 1filll}
472475
{\em
473476
Errors may be reported to John E. Laird (laird@umich.edu)\\
474477
\\
475478
}
476479
Copyright \copyright\ 1998 - \the\year, The Regents of the University of Michigan
477480
\vspace{.1in}
478-
481+
479482
Development of earlier versions of this manual were supported under
480483
contract N00014-92-K-2015 from the Advanced Systems Technology Office of
481484
the Advanced Research Projects Agency and the Naval Research Laboratory,
482485
and contract N66001-95-C-6013 from the Advanced Systems Technology
483486
Office of the Advanced Research Projects Agency and the Naval Command
484487
and Ocean Surveillance Center, RDT\&E division.
485-
488+
486489
\newpage
487490
\setlength{\parskip}{3pt}
488491
\normalsize
489492
\setlength{\parskip}{8pt}
490-
493+
491494
\end{titlepage}
492495
493496
$if(abstract)$

0 commit comments

Comments
 (0)