I'm writing a document class based on the book class. In this class I have some code as below:
\RequirePackage[total={10cm,18cm},paperwidth=16cm, paperheight=23cm]{geometry} \RequirePackage[cross,center,noinfo,a4]{crop} I want to define an option for my class, say, nocrop so that when I use it, the above code change into the code below:
\RequirePackage[total={10cm,18cm}]{geometry} %\RequirePackage[cross,center,noinfo,a4]{crop} In other words, I want the crop package to be exempted from being run and the paperwidth=16cm, paperheight=23cm to be deleted.
Is this possible? if yes, how?
Here is my MWE:
\RequirePackage{filecontents} % my class file \begin{filecontents}{myclass.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} \ProcessOptions \LoadClass{book} \RequirePackage[total={10cm,18cm},paperwidth=16cm, paperheight=23cm]{geometry} \RequirePackage[cross,center,noinfo,a4]{crop} \endinput \end{filecontents} \documentclass{myclass} \usepackage{lipsum} \begin{document} \lipsum[1] \end{document} (I'm using XeLaTeX on a Windows machine, if it helps.)