2

I'm writing a style file for my colleagues to typeset their exam papers. The paper size needs to be A4, but some of my colleagues always forget to invoke the a4paper option in the documentclass. Can I force A4 size via the style file, without doing \RequirePackage[a4paper]{geometry} (as I can't assume my colleagues have the geometry package)?

I suppose the answer is to emulate what the geometry package does, but I wonder whether there's a simpler way.

3
  • 4
    why not make your file a class rather than a package, then the problem goes away as you can simply remove the option of changing paper size. Mar 4, 2016 at 10:42
  • 1
    I'm all for finding the most widely-applicable solution, but also for reducing the amount of code you have to maintain. What are the odds in 2016 that a colleague won't have geometry? If so, what are the odds that they'll also have a very limited TeX install that will cause other problems later? Mar 4, 2016 at 12:46
  • why not use KOMA-class? a4paper is invoked by default.
    – naphaneal
    Apr 3, 2016 at 17:04

1 Answer 1

1

Use the following two lines in your style file.

\setlength\paperheight {297mm}
\setlength\paperwidth  {210mm}
2
  • 3
    this won't actually affect the formatting in any way in most classes.You need \textwidth and \textheight to change to a size appropriate for A4. Mar 4, 2016 at 10:45
  • @DavidCarlisle Then I will have to ask you to answer the question. That much knowledge is deep water for me.
    – Masroor
    Mar 4, 2016 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .