I've found that KOMA classes don't change the page size if you don't pass the option pagesize
.
So the solution should be:
\documentclass[b4paper,pagesize]{scrbook}
\usepackage{lipsum}
\begin{document}
\lipsum[2-8]
\end{document}
I suppose that you get that warning because the b4 paper size is not defined in typearea.sty
.
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 and KOMAoptions
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:
If both BCOR and DIV need changing, then it is recommended to use
\typearea, since then the text block and margins are recalculated only
once. With \KOMAoptions{DIV=DIV ,BCOR=BCOR } the text block and
margins are recalculated once for the change to DIV and again for the
change to BCOR.
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 use DIV=calc
instead of the predefined value.
Here is an simple example to demonstrate the difference:
\documentclass[BCOR=3mm,12pt]{scrbook}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\KOMAoptions{DIV=calc}% recalculate the page layout with a calculated DIV value
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
The following snippet of the log file shows that the calculated DIV
value is 9 instead of the predefined value 12:
...
(C:\LocalPrograms\LocalTeXMFs\koma-script-current\tex\latex\koma-script\typeare
a.sty
Package: typearea 2014/04/09 v3.13.1756 KOMA-Script package (type area)
Package typearea, 2014/04/09 v3.13.1756 KOMA-Script package (type area)
Copyright (C) Frank Neukam, 1992-1994
Copyright (C) Markus Kohm, 1994-
\ta@bcor=\skip41
\ta@div=\count79
\ta@hblk=\skip42
\ta@vblk=\skip43
\ta@temp=\skip44
\footheight=\skip45
Package typearea Info: These are the values describing the layout:
(typearea) DIV = 12
(typearea) BCOR = 8.53581pt
(typearea) \paperwidth = 597.50793pt
(typearea) \textwidth = 441.7291pt
(typearea) DIV departure = -4%
(typearea) \evensidemargin = 25.89203pt
(typearea) \oddsidemargin = -14.65317pt
(typearea) \paperheight = 845.04694pt
(typearea) \textheight = 635.5pt
(typearea) \topmargin = -41.72441pt
(typearea) \headheight = 18.125pt
(typearea) \headsep = 21.75pt
(typearea) \topskip = 12.0pt
(typearea) \footskip = 50.75pt
(typearea) \baselineskip = 14.5pt
(typearea) on input line 1332.
)
...
...
DIV calculation for typearea with good linewidth.
LaTeX Font Info: Try loading font information for T1+lmr on input line 4.
(C:\LocalPrograms\MiKTeX2.9\tex\latex\lm\t1lmr.fd
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
Package typearea Info: These are the values describing the layout:
(typearea) DIV = 9
(typearea) BCOR = 8.53581pt
(typearea) \paperwidth = 597.50793pt
(typearea) \textwidth = 392.64809pt
(typearea) DIV departure = 0%
(typearea) \evensidemargin = 58.6127pt
(typearea) \oddsidemargin = 1.70717pt
(typearea) \paperheight = 845.04694pt
(typearea) \textheight = 577.5pt
(typearea) \topmargin = -18.25089pt
(typearea) \headheight = 18.125pt
(typearea) \headsep = 21.75pt
(typearea) \topskip = 12.0pt
(typearea) \footskip = 50.75pt
(typearea) \baselineskip = 14.5pt
(typearea) on input line 4.
...
But as I have already mentioned the KOMA-Script class loads the package typearea
itself and at that moment the class option DIV=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
if DIV=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 change KOMAoptions
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 your marito.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.
Best Answer
If you include the option
pagesize
, everything gets calculated correctly. No need for\recalctypearea
here.