# Change default width of images in graphicx package

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:

\documentclass{article}

\usepackage[draft,width=\linewidth]{graphicx}

%or something like \setglobalimagewidth=\linewidth

\begin{document}

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

\end{document}

-
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

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

\documentclass{article}
\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth}

\begin{document}
\noindent
\includegraphics{test1}
\end{document}

-

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

% Define new length
\newlength{\myFigureStandardWidth}
% Set the new length to a specific value
\setlength{\myFigureStandardWidth}{0.90\textwidth}


When I insert a figure then I just use something like

\begin{figure}
\centering
\includegraphics[width=\myFigureStandardWidth]%
{FigureName.png}%
\caption[Short Caption]{Long Caption}
\label{fig:FigureName}
\end{figure}


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

-