Scale figures in the document properly

This commit is contained in:
coolneng 2021-06-29 23:27:19 +02:00
parent fcda54fc2f
commit fd87d7c0f0
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 14 additions and 0 deletions

View File

@ -382,6 +382,20 @@
\graphicspath{{./figures/}}
% 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, ...]{}
\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
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Custom macros