From fd87d7c0f0e5bcb3fe5145547ccb6300c3375577 Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 29 Jun 2021 23:27:19 +0200 Subject: [PATCH] Scale figures in the document properly --- assets/babathesis.latex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/assets/babathesis.latex b/assets/babathesis.latex index c8bb4ee..cf15d1d 100644 --- a/assets/babathesis.latex +++ b/assets/babathesis.latex @@ -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