# Turning off default scaling options (\setkeys{Gin}) temporarily

To set the default scaling values for the \includegraphics command, one can use \setkeys{Gin}{(key)=value)} from the graphicx package. For example, say I put down

\setkeys{Gin}{width=.7\textwidth}


This will automatically scale all succeeding \includegraphics commands by the above width value. Is there a way to turn off this setting for certain graphics? That is, is there a way to still use \includegraphics without having the width set as the above?

I'm aware that

\begin{group}
\setkeys{Gin}{width=.7\textwidth}
\includegraphics{pizza.jpg} %this uses setted values
\end{group}
\includegraphics{pizza.jpg} %this uses normal values


works, but I'm wondering if I can do this without having to surround the \setkeys{Gin} command.

-
\includegraphics[width=2cm]{pizza.jpg} (or the length you want) should override the default value. Never use \begin{group} and \end{group}. – egreg Mar 15 '13 at 23:06
What I mean is that I want to \includegraphics{pizza.jpg} in its native setting, i.e., with absolutely no scaling values in place. Something like [width=2cm] only overwrites the scaling value with another one. – Dustin Tran Mar 15 '13 at 23:09

You can use the value stored in \Gin@nat@width, defining a handier interface to it:

\documentclass{article}
\usepackage{graphicx}

\setkeys{Gin}{width=30pt} % exaggerated for the example
\makeatletter
\let\ginnatwidth\Gin@nat@width
\makeatother

\begin{document}
\includegraphics{example-image-9x16}

\includegraphics[width=\ginnatwidth]{example-image-9x16}
\end{document}


-
Sorry, late response! Yes, this works perfectly. By extension, one can do the same for height as well. :) – Dustin Tran Mar 18 '13 at 4:17