Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base.tex.j2 for macro compatibility with newer versions of Pandoc #2196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading