Skip to content

Commit

Permalink
Update base.tex.j2
Browse files Browse the repository at this point in the history
Added the macro \pandocbounded that is used by newer versions of pandoc.
  • Loading branch information
PetalAdrift authored Dec 3, 2024
1 parent 6e5fdb3 commit 038d474
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion share/templates/latex/base.tex.j2
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,26 @@ override this.-=))
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}

\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{%
\sbox\pandoc@box{#1}%
% scaling factors for width and height
\Gscale@div\@tempa\textheight{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb\linewidth{\wd\pandoc@box}%
% select the smaller of both
\ifdim\@tempb\p@<\@tempa\p@
\let\@tempa\@tempb
\fi
% scaling accordingly (\@tempa < 1)
\ifdim\@tempa\p@<\p@
\scalebox{\@tempa}{\usebox\pandoc@box}%
% scaling not needed, use as it is
\else
\usebox{\pandoc@box}%
\fi
}
\makeatother

% Define a nice break command that doesn't care if a line doesn't already
% exist.
Expand Down

0 comments on commit 038d474

Please sign in to comment.