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}
\makeatletterand\makeatothermust be used outside of\newcommand. – moewe May 30 '20 at 14:01