Horizontal values
The idea of KOMA-Script is:
If there are two pages side by side, then the white space at the left of the left page (even numbered) is the same as the white space at the right of the right page (odd numbered) and is the same as the white space between the text body of the left page and the text of the right page.
With DIV=12
, the outer margins get 2 units, the inner margins get 1 unit (because they sum up to 2 units from the even and odd page), the text width
gets 9 units:
unit width: 210mm / 12 = 17.5mm
outer margin: 2 * 17.5mm = 35mm
inner margin: 1 * 17.5mm = 17.5mm
text width: 9 * 17.5mm = 157.5mm
Thus the table values for the text width and inner margin are correct.
Text width
The value for \textwidth
is correct, the table says 157,50mm
and you get 157.49817mm
. (The English version should have replaced the comma by a period for the decimal separator.
Left margins
The left margin of an odd numbered page is an inner margin and should be 17.5mm:
25.4mm (TeX origin)
-7.89989mm (\oddsidemargin)
----------
17.50011mm
Correct (modulo rounding error)
The left margin of an even numbered page is an outer margin and should be 35mm:
25.4mm (TeX origin)
9.59988mm (\evensidemargin)
----------
34.99988mm
Correct (modulo rounding error)
Vertical values
DIV=12
means that the page height is divided into 12 units. The top margin is one unit, the bottom gets two units and the remaining 9 units go to the text height.
unit height: 297mm / 12 = 24.75mm
top margin: 1 * 24.75mm = 24.75mm
bottom margin: 2 * 24.75mm = 49.5mm
text height: 9 * 24.75mm = 222.75mm
Therefore the table values for the text height and the top margin are correct.
Top margin
Table value: 24,75mm
25.4mm (TeX origin)
-13.79442mm (\topmargin)
5.97475mm (\headheight)
7.1697mm (\headsep)
------------
24.75mm
Correct.
Text height
The table caption is not correctly translated, the German version also says, that \topskip
is not taken into account.
\@typearea
calculates the text height the following way:
RealTextHeight = topskip + n * baselineskip
with
n is a natural number
and
0 ≤ RealTextHeight - DivTextHeight < baselineskip
Thus the real text height depends on the value calculated via the div method, the setting of \topskip
(depends on font size) and \baselineskip
(also depends on font size).
Therefore the text height can be larger than the table value. The visual text height can even be larger, because the depth of the bottom box on the text area can descend up to \maxdepth
(= .5\topskip
with typearea
) below the text area.
The values for class option 11pt
(default):
\topskip: 11pt ≈ 3.86606mm
\baselineskip: 13.6pt ≈ 4.77985mm
\maxdepth: 5.5pt ≈ 1.93303mm
Then
\textheight = \topskip + 46 * \baselineskip
636.60028pt = 11pt + 46 * 13.6pt (modulo rounding error)
223.73679mm = 3.86606mm + 46 * 4.77985mm (modulo rounding error)
and
223.73679mm ≥ 222.75mm
223.73679mm < \topskip + 47 * \baselineskip
Therefore the text height is correct according to the algorithm used by \typearea
.
Best Answer
Note that the KOMA-Script class loads the package
typearea
itself and the text block and the margins are calculated immediately for the first time.The first and the second version are the same (if the standard value is chosen in the second): the text body and the margins are calculated onces.
Third version: There is a second calculation of the page layout when
\typearea[<bcor>]{<div>}
is called. Already done changes of line spacing andKOMAoptions
regarding to the page layout are taken into account.And there is also a difference between your third and fourth version. From the KOMA-Script manual:
I suggest to set the
BCOR
option as an argument of the KOMA-class because it depends from the document itself, especially from the number of pages.Note that the predefined
DIV
value is only a compromise and does not take into account the font chosen. I suggest to useDIV=calc
instead of the predefined value.Here is an simple example to demonstrate the difference:
The following snippet of the log file shows that the calculated
DIV
value is 9 instead of the predefined value 12:But as I have already mentioned the KOMA-Script class loads the package
typearea
itself and at that moment the class optionDIV=calc
is evaluated to a value according to the LaTeX standard font.After loading a package with a significant different font (
lmodern
is similar to the standard fonts) you have to (re)calculate this value using\KOMAoptions{DIV=calc}
or\typearea[current]{calc}
. Instead you can say\recalctypearea
ifDIV=calc
was already set for the previous calculation of the text block and the margins.\recalctypearea
is an abbreviated command for\KOMAoptions{DIV=last}
or\typearea[current]{last}
.In addition, a recalculation by the
typearea
package is necessary if you changeKOMAoptions
regarding the page layout (headheight
,headinclude
etc.) and also if you change the line spreading (to ensure that the\textheight
less\topskip
is a multiple of\baselineskip
).In conclusion, I suggest:
Use
\documentclass[BCOR=<bcor>,DIV=calc,...]{scrbook}
in the main file.If there are significant changes of font or any changes of the line spacing or the
KOMAoptions
regarding the page layout in yourmarito.sty
file, use\recalctypearea
after this changes are done.Note that you find all values determined by typearea in the log file. If necessary you can set a moderately adjusted value
<div>
by\documentclass[BCOR=<bcor>,DIV=<div>,...]{scrbook}
. Then the command\recalctypearea
will also use this manually chosen<div>
value.