TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Do you realy want this? This scaling does not make the quality of your pictures better. Better would be to prepare the pictures with the finaly needed width, so you do not have to scale them ... – Kurt Nov 1 '12 at 13:11
@Kurt Yes I have some applications where I put images into minipage environments very often (on the left a text in a minipage, on the right a picture in a minipage). In this case I just set the image width to 0.9\linewidth, then the picture automatically scales to fill the space of the minipage. For such documents it would be great to do this globally. In most cases this makes the picture much smaller, so in most cases there is no quality problem for my purposes... – student Nov 1 '12 at 13:18
Another example, were this makes perfectly sense is the use of vector graphics, which do not suffer from scaling. – luator Apr 2 '15 at 12:31
up vote 5 down vote accepted

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


share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.