1

It seems like it should be easy enough, seeing how the kao.sty file comes with this...

% Set the default page layout
\RequirePackage[
    a4paper,
    bottom=27.4mm,
    inner=24.8mm,
    textwidth=107mm,
    marginparsep=8.2mm,
    marginparwidth=49.4mm,
    includemp
]{geometry}

...but if I change a4paper to c5paper, which is what I'm interested in, the whole page geometry doesn't get scaled accordingly, and so most of the margin notes are cut off since the page is now too small to contain them. Changing any of the margins listed here also seems to have no effects at all, other than randomly misplacing some of the margin notes that are already present in some of the chapters of the original unmodified template.

Am I doing something wrong? I didn't even want to change the paper size this way—I hoped there would be an option that would automatically scale everything up or down according to the new size (kind of like twoside=true or twoside=false, which can be changed simply by modifying a single word in the main.tex file); but I couldn't find such a thing anywhere, so I had to do it manually... and it's not working.

2 Answers 2

4

Update

Recent versions of the template support a class option to change the paper size. For example, to use the B5 format, load the class with the 'b5paper' option, like so: \documentclass[b5paper]{kaobook}.

Original answer

Besides the paper size, you should change also bottom, inner, textwidth, marginparsep, and marginparwidth. Moreover, you should change them not only in the \RequirePackage block, but also in each of the subsequent \newgeometry commands that can be found in kao.sty.

There are several more or less heuristic rules to construct the layout of a page (see e.g. chapter 2 of http://ctan.mirror.garr.it/mirrors/CTAN/macros/latex/contrib/koma-script/doc/scrguien.pdf), some of which have been in use for centuries. However, in the kaobook, the author did not use any algorithmic rule, but he manually tuned the numbers until he found a layout that he liked. Therefore, the same procedure should be repeated for other paper sizes.

The easiest way would probably be to maintain the same proportions of the original layout. For instance, the A4 paper is 210x297mm, while the C5 is 162x229mm; this means that, in order to go from A4 to C5 keeping the same proportions, the vertical measures should be scaled by a factor of 229:297 (= about 0.7710), while the horizontal measures should be scaled by a factor of 162:210 (= about 0.7714). Thus, in practice, if you multiply each of the original lengths by 0.771 you should get a reasonably good layout. I do not know whether the result will always be aesthetically pleasing using this method, but at least the margins will not be cut off.

If you download the latest version of the template from GitHub (https://github.com/fmarotta/kaobook/), you will find that I have defined two lengths, namely \hpll and \vpll, which are supposed to represent the scale of the page; by default they are both 1mm and they work for A4 paper; I have introduced them just so that instead of changing all the numbers one by one, one may simply change the horizontal (hpll) and vertical (vpll) scales. For instance in your case you would have to change this

\setlength{\hpll}{1mm}
\setlength{\vpll}{1mm}

% Set the default page layout
\RequirePackage[
    a4paper,
    top=\vpll*\real{27.4},
    bottom=\vpll*\real{27.4},
    inner=\hpll*\real{24.8},
    textwidth=\hpll*\real{107},
    marginparsep=\hpll*\real{8.2},
    marginparwidth=\hpll*\real{49.4},
    includemp
]{geometry}

into this

\setlength{\hpll}{0.7714mm}
\setlength{\vpll}{0.7710mm}

% Set the default page layout
\RequirePackage[
    c5paper,
    top=\vpll*\real{27.4},
    bottom=\vpll*\real{27.4},
    inner=\hpll*\real{24.8},
    textwidth=\hpll*\real{107},
    marginparsep=\hpll*\real{8.2},
    marginparwidth=\hpll*\real{49.4},
    includemp
]{geometry}

without touching the \newgeometry commands. With older versions of the template, however, you do need to change manually all the numbers, including those in the \newgeometry commands.

0

Coming to this very late, but I wanted a non-standard size page. I went into kao.sty and added a new paper. The addition of the scaling makes this very easy.

Mine was to make a simple square page 8 1/2" x 8 1/2" so I added

\@ifclasswith{\@baseclass}{squarepaper}{\setlength{\hscale}{1.028mm}\setlength{\vscale}{0.727mm}}{}

and it seems to work fine. I will probably need to change the top margin so it prints at the top instead of centered but for now it is fine.

You must log in to answer this question.

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