# Can I define a variable to scale with it several figures?

I have several pictures in my document, using the subfigure environment, the code is the following:

\begin{subfigure}[b]{0.22\textwidth}
\includegraphics[width=\textwidth]{pictures/...}
\end{subfigure}


Now, the size of the pictures will be the same for all of them. When I adjust their size, I don't want to change 0.22 to some other value for all of them. Can I define some variable? I tried with \newlength, but this register requires a unit of length.

• Have you tried simply \newcommand{\sizeA}{0.22}? – Rmano Apr 22 '15 at 8:20
• @Rmano That was really simple, it works, thanks! – wondering Apr 22 '15 at 8:36
• If you use graphicx then I suggest you read the package documentation because it explains how to define defaults with \setkeys. Also see this presentation. – user10274 Apr 22 '15 at 9:17

\newcommand{\mysize}{0.22}

\begin{subfigure}[b]{\mysize\textwidth}