mirror of
https://github.com/Wandmalfarbe/pandoc-latex-template.git
synced 2024-12-18 22:07:51 +00:00
adding \pandocbounded macro for pandoc 3.2.1 (#392)
This commit is contained in:
parent
ffa4f0c74b
commit
1ad0d6d787
18
eisvogel.tex
18
eisvogel.tex
@ -365,15 +365,17 @@ $endif$
|
||||
$if(graphics)$
|
||||
\usepackage{graphicx}
|
||||
\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}
|
||||
\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
|
||||
\makeatletter
|
||||
% Make use of float-package and set default placement for figures to H.
|
||||
% The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like').
|
||||
\usepackage{float}
|
||||
|
Loading…
Reference in New Issue
Block a user