I want to pass some arguments to \includegraphics via a command, but I can't get it working as I would expect. My M(n)WE:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\newcommand{\widthText}{,width=3cm}
\includegraphics[scale=0.5 \widthText]{picture}
\end{document}
I guess that the point would be to expand \widthText before...
In my actual code, the command \widthText is actually either the one given above, or empty, depending on some boolean, and I have also a \heightText to set the height.