0

I moved a part of my code to function and that stopped working. I don't understand why?

this code is working:

\begin{document}
\makeatletter
\immediate\write18{start cmd echo /k magick convert _SDC4828.jpg  -crop 50\@percentchar x100\@percentchar\space +repage _SDC4828.jpg}
\makeatother
\end{document}

This not working:

\newcommandx{\twosidepic}{
\makeatletter
\immediate\write18{start cmd echo /k magick convert _SDC4828.jpg  -crop 50\@percentchar x100\@percentchar\space +repage _SDC4828.jpg}
\makeatother
}

\begin{document}
\twosidepic
\end{document}

Browse other questions tagged or ask your own question.