Context: I'm building a new package for my university. I need to set a lot of options for the document class, like twoside, a4paper, 12pt, or firstpagenum=chapter.

I would like to set them by default in my package without creating a new class. Is it possible?

  • 6
    Maybe what you actually need to develop is a class file instead of a package. They're equally easy or difficult, depending on your experience. As Grandmaster Carlisle has indicated, unless you use \RequirePackage on top of \documentclass, passing options to a class from a package will require a new invention. Passing options to class after the class file has been read is not possible - and the class file can’t be read twice. In your class file, you can call \PassOptionsToClass before \LoadClass, or, in place of these two commands, simply call \LoadClassWithOptions. – Ahmed Musa May 26 '12 at 2:25

No the class file has been read by the time you load a package, But it sounds like you should be defining a class file. you can have myclass.cls just handle the options it needs and then \LoadClassWithOptions{article} (or whichever base class you need).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.