[Tex/LaTex] Set standard default scaling of \includegraphics

graphicsscalingsphinx

I am using Sphinx and the plantuml package to include UML diagrams.

The plantuml package for Sphinx generates the following LaTeX code:

\includegraphics{%s}

Anyways – the diagrams are to big, so what I want is

\includegraphics[scale=0.75]{%s}

Can I – without patching the plantum package – set a default scale for \includegraphics in my LaTeX preamble?

Best Answer

There are two ways.

First way: set a default value for some keys.

\usepackage{graphicx}
\setkeys{Gin}{width=.75\csname Gin@nat@width\endcsname,keepaspectratio}

(the natural width is stored in \Gin@nat@width)

Second way: add scale=0.75 to the passed options.

\usepackage{graphicx}
\let\ORIincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{\ORIincludegraphics[scale=0.75,#1]{#2}}