I am trying to abstract code to make an image by making a macro. Could someone please explain why this does not work?
\newcommand[1]{\custpic}{\begin{figure}[H]\begin{center}\includegraphics[width=0.5\textwidth]{#1}\end{center}\caption{}\end{figure}} % url
\custpic{4b.png}
What is confusing me is that this does work as expected.
\newcommand[1]{\custpic}{\begin{figure}[H]\begin{center}\includegraphics[width=0.5\textwidth]{4b.png}\end{center}\caption{}\end{figure}}
\custpic
Thank you very much
\newcommand{\custpic}[1]{...}instead of\newcommand[1]{\custpic}{...}... – Paul Gaborit Mar 6 at 0:26\centeringis usually better than\begin{center}...forfigures: tex.stackexchange.com/questions/23650/… – Ethan Bolker Mar 6 at 1:01