I have this body:
\begin{center}
\includegraphics[scale=0.8]{image.png}
\captionof{figure}{Image Caption}
\end{center}
But I'd like to simplify it to:
\mygraphics[scale=0.8]{image.png}{Image Caption}
with:
\newcommand{\mygraphics}[2][???]{%
\begin{center}%
\includegraphics[???]{#1}%
\captionon{figure}{#2}%
\end{center}%
}
\newcommand{\mygraphics}[2][]{ ... \includegraphics[#1]{#2}\caption{figure}{#3}...}? Even if someone puts several options into it like[xscale=\textwidth,yscale=\textheight]? – Stewart Mar 02 '21 at 08:59\newcommand{\mygraphics}[3][]{ ...}. You have three arguments. The optional parameter is always the first. – campa Mar 02 '21 at 09:00#2with#3;#1with#2,[???]with[#1];[???]with[];[2]with[3]– egreg Mar 02 '21 at 09:03\begin{center}\centering...doesn't make much sense,\begin{center}should be enough. – Skillmon Mar 02 '21 at 09:16*.{aux,toc,lof}and rerun to solve the error. – Stewart Mar 02 '21 at 09:57