When I execute the following command, it works:
\makeatletter\CROP@center\makeatother
But, when I include this command in a \def, as shown below, it no longer works:
\def\fixCroppingBugCausedByChangeOfGeometry
{\makeatletter\CROP@center\makeatother}
How to fix that?
Here is my MWE.
\documentclass{article}
\usepackage{geometry}
\usepackage[
width=25truecm, height=32truecm, cam,
pdftex,
center
]{crop}
\def\fixCroppingBugCausedByChangeOfGeometry
{\makeatletter\CROP@center\makeatother}
\begin{document}
Page 1
\newpage
\newgeometry{left = 5cm, right = 5cm}
\fixCroppingBugCausedByChangeOfGeometry
%\makeatletter\CROP@center\makeatother
Page 2
\newpage
\restoregeometry
\fixCroppingBugCausedByChangeOfGeometry
%\makeatletter\CROP@center\makeatother
Page 3
\end{document}
PS:
I have to do that because I want to execute the command \CROP@center only if the crop package is loaded.
\makeatletter\def\fixCroppingBugCausedByChangeOfGeometry{\CROP@center}\makeatother– Ulrike Fischer Feb 26 '23 at 12:25