2

I am looking at How to use A4 instead of letterpaper? and wondering how I can create a custom documentclass like \documentclass{foo}, and then have another function like \foosetsize{a4paper} right after that somehow, rather than putting the paper dimensions inside documentclass options. How can I do that?

So instead of:

\documentclass[a4paper]{foo}

It would be something like:

\documentclass{foo}
\setpapersize{a4paper}
3
  • Have you looked into the geometry package? It's the usual method for adjusting paper sizing. – Teepeemm Dec 22 '19 at 10:25
  • 1
    \usepackage[paperwidth=10cm, paperheight=10cm]{geometry} – Fran Dec 22 '19 at 10:33
  • Note that if you change the paper size without changing the margins etc. everything will wind up in the upper left corner. The right and bottom margins are whatever is left over. – John Kormylo Dec 22 '19 at 16:17
2

Help yourself to an introduction into LaTeX, that'll make your work easier.

To load options there are three ways:

  1. Global option, \documentclass[global-option1, global-option2]{article}
  2. Load them with the package: \usepackage[options]{packagename}
  3. With a command provided by the package.

You are looking for the third, something like:

\documentclass{article}
\usepackage{geometry}
\geometry{a4paper}

You get the manual of geometry and most other packages by typing texdoc packagename on the command line. If you work under Windows, that's cmd.exe.

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.