From 6d02bede162e7f180e88260dcd0e54823fa67d0c Mon Sep 17 00:00:00 2001 From: Jarka <57811074+jarkabaker@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:41:10 +0100 Subject: [PATCH 1/5] Temp fix --- src/template.latex | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/template.latex b/src/template.latex index b1ceb8a..f373ca6 100644 --- a/src/template.latex +++ b/src/template.latex @@ -229,19 +229,6 @@ $endif$ \pretocmd{\figure}{\toggletrue{infigure}}{}{} % Set toggle when entering/exiting figure environments \apptocmd{\endfigure}{\togglefalse{infigure}}{}{} -\let\oldincludegraphics\includegraphics % Save the original includegraphics command - -\renewcommand{\includegraphics}[2][]{ % Redefine includegraphics to check if it's already in a figure - \iftoggle{infigure}{% - \oldincludegraphics[#1]{#2}% - }{% - \begin{figure} - \centering - \oldincludegraphics[#1]{#2} - \end{figure}% - }% -} - % Remove "Figure X." prefix from captions \usepackage{caption} \captionsetup[figure]{labelformat=empty} From 894b038172c66f684fd93a15c4d9004731aed2fb Mon Sep 17 00:00:00 2001 From: Jarka <57811074+jarkabaker@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:51:28 +0100 Subject: [PATCH 2/5] Fix to centre image --- src/template.latex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/template.latex b/src/template.latex index f373ca6..723b0c8 100644 --- a/src/template.latex +++ b/src/template.latex @@ -221,13 +221,13 @@ $endif$ \floatplacement{figure}{H} % Centre images -\usepackage{etoolbox} % For toggle functionality - -\newtoggle{infigure} % Create toggle to track if we're inside a figure environment -\togglefalse{infigure} % Initialize as false - -\pretocmd{\figure}{\toggletrue{infigure}}{}{} % Set toggle when entering/exiting figure environments -\apptocmd{\endfigure}{\togglefalse{infigure}}{}{} +\let\oldincludegraphics\includegraphics + +\renewcommand{\includegraphics}[2][]{% + \begin{center} + \oldincludegraphics[#1]{#2}% + \end{center} +} % Remove "Figure X." prefix from captions \usepackage{caption} From 7963119f88be91dbbc5e53c385b55f5a9c31582f Mon Sep 17 00:00:00 2001 From: Jarka <57811074+jarkabaker@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:01:21 +0100 Subject: [PATCH 3/5] A test without image center --- src/template.latex | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/template.latex b/src/template.latex index 723b0c8..bb8d070 100644 --- a/src/template.latex +++ b/src/template.latex @@ -220,15 +220,6 @@ $endif$ \usepackage{float} \floatplacement{figure}{H} -% Centre images -\let\oldincludegraphics\includegraphics - -\renewcommand{\includegraphics}[2][]{% - \begin{center} - \oldincludegraphics[#1]{#2}% - \end{center} -} - % Remove "Figure X." prefix from captions \usepackage{caption} \captionsetup[figure]{labelformat=empty} From 97a1eb58406b45cf726aff190586eeb712529272 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 10 Apr 2025 15:17:42 +0100 Subject: [PATCH 4/5] template update --- src/template.latex | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/template.latex b/src/template.latex index bb8d070..0f7d9ce 100644 --- a/src/template.latex +++ b/src/template.latex @@ -125,13 +125,23 @@ $endif$ $if(graphics)$ \usepackage{graphicx,grffile} \makeatletter -\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} -\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} -\makeatother -% Scale images if necessary, so that they will not overflow the page -% margins by default, and it is still possible to overwrite the defaults -% using explicit options in \includegraphics[width, height, ...]{} -\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} + +% Updating our template following changes to Pandoc +% https://github.com/jgm/pandoc/pull/9666/files + +\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% +} + +% End update + $endif$ $if(links-as-notes)$ % Make links footnotes instead of hotlinks: From 0802c2eaab5f7bd09c92c6bfb56d88c0e68e71e4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 10 Apr 2025 15:22:35 +0100 Subject: [PATCH 5/5] update docker version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f1e6ed9..f282451 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG NODE_VERSION=20 # Stage 1: Install pandoc FROM public.ecr.aws/lambda/nodejs:${NODE_VERSION} as pandoc -ARG PANDOC_VERSION=3.1.13 +ARG PANDOC_VERSION=3.6.4 # Install tar and gzip RUN dnf install -y tar gzip