\documentclass[a4paper,10pt,twoside]{book}
\usepackage[demo]{graphicx}
\begin{document}
\newcommand{\scalefactor}{scale = 0.25}
\begin{figure}[!ht]
\centering
%Next line does not work
\includegraphics[\scalefactor]{image}
% The following line works
%\includegraphics[scale = 0.25]{image}
\end{figure}
\end{document}
Output:
! Package keyval Error: scale = 0.25 undefined.
I need to scale a number of images by the same factor, hence the command.
- How to solve this and more importantly
- Why is this only specific to
\includegraphics
Best Answer
Try this way: