0

I want to specify a custom page size using \documentclass. Many suggest the geometry package, but I want to specify a custom size within the \documentclass, if \documentclass offers such capability.

Veak
  • 1
  • Welcome to TeX.SE. crop.sty also an alternative – MadyYuvi Sep 20 '23 at 16:50
  • 3
    \documentclass{foo} is just \input{foo.cls} so it does not, itself, have any capability to do anything. If you are writing foo.cls you can use whatever commands you like to set the page size, including using geometry package. – David Carlisle Sep 20 '23 at 16:58
  • Of course, since it seems that you're only talking about page size in general, you could just use \setlength{\paperwidth}{<dimen>} and \setlength{\paperheight}{<dimen>} to manually set both lengths. But depending on the used \documentclass and possible options that may look awkward... – lukeflo Sep 20 '23 at 17:06
  • Why is there not a simple way to do this ? Stating the use of \setlength only for every sentence to end with a BUT. What possibilities exist to define a custom page size ? – Veak Sep 20 '23 at 19:21
  • To make a custom document that uses a latex defined document class but sets a custom page size and custom margins, would one construct a new class (.cls), or put commands in a style file (.sty) ? – Veak Sep 20 '23 at 19:27
  • For article, report and book, can one set the page size and margins by using \documentclass ? – Veak Sep 20 '23 at 19:48
  • For those three standard classes, they only support certain pre-defined sizes. So the answer in general is 'no', but it might be 'yes' in your particular case, if you want one of the sizes they define. Why don't you want to use geometry? That's intended to make customising the paper size and layout easy for the standard classes, since they don't provide extensive options themselves.Alternatively, you can use \setlength as suggested above, but if you only change the size of the paper and nothing else, you'll get a letter-sized page on whatever paper size, which may indeed look strange. – cfr Sep 20 '23 at 20:35
  • To put this another way: the size of the paper is determined by 2 dimensions. The size of the logical page is determined by several other dimensions which specify the size of the text block, margins, header/footer, footnote separation and spaces between. (Also the width of columns and space between them in multi-column layouts.) Moreover, some of these dimensions may be different for odd and even pages in two-sided documents. – cfr Sep 20 '23 at 20:38
  • I want to make a custom size paper. So why does one get a letter-sized page ? Why cannot I get a straightforward answer that changes the paper size ? Why is it so difficult to set a different size without using geometry ? – Veak Sep 20 '23 at 21:02
  • Why would \setlength{\paperwidth}{<dimen>} depend upon the document class ? – Veak Sep 20 '23 at 22:24

0 Answers0