Is it possible to change the default width of an image included via \includegraphics (from the graphicx package) to a custom value, for example \linewidth.

So I want something like this:



%or something like \setglobalimagewidth=\linewidth


\includegraphics{test1} %width=\linewidth
\includegraphics[width=4cm]{test1} %width=4cm

  • Another example, were this makes perfectly sense is the use of vector graphics, which do not suffer from scaling.
    – luator
    Apr 2, 2015 at 12:31

2 Answers 2


Some options of package graphicx can be set using \setkeys:



What is Gin ? Documentation:

Here ‘Gin’ is the name used for the keyval keys associated with ‘Graphics inclusion`.


I do not think that I have the perfect solution but I am happy with:

% Define new length
% Set the new length to a specific value

When I insert a figure then I just use something like

\caption[Short Caption]{Long Caption}

I am writing my phd thesis this way and have inserted over 50 figures this way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .