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.
Asked
Active
Viewed 34 times
crop.styalso an alternative – MadyYuvi Sep 20 '23 at 16:50\documentclass{foo}is just\input{foo.cls}so it does not, itself, have any capability to do anything. If you are writingfoo.clsyou can use whatever commands you like to set the page size, including usinggeometrypackage. – David Carlisle Sep 20 '23 at 16:58\setlength{\paperwidth}{<dimen>}and\setlength{\paperheight}{<dimen>}to manually set both lengths. But depending on the used\documentclassand possible options that may look awkward... – lukeflo Sep 20 '23 at 17:06\setlengthonly for every sentence to end with aBUT. What possibilities exist to define a custom page size ? – Veak Sep 20 '23 at 19:21.cls), or put commands in a style file (.sty) ? – Veak Sep 20 '23 at 19:27article,reportandbook, can one set the page size and margins by using\documentclass? – Veak Sep 20 '23 at 19:48geometry? 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\setlengthas 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\setlength{\paperwidth}{<dimen>}depend upon the document class ? – Veak Sep 20 '23 at 22:24