From d4d66453da7ea3fd6fc443a113b45031e79b0e30 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 Sep 2017 22:06:52 +0000 Subject: koma-script (14sep17) git-svn-id: svn://tug.org/texlive/trunk@45292 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/koma-script/scrkernel-typearea.dtx | 4624 ++++++++++---------- 1 file changed, 2332 insertions(+), 2292 deletions(-) (limited to 'Master/texmf-dist/source/latex/koma-script/scrkernel-typearea.dtx') diff --git a/Master/texmf-dist/source/latex/koma-script/scrkernel-typearea.dtx b/Master/texmf-dist/source/latex/koma-script/scrkernel-typearea.dtx index 9ea3998ff6e..3cbcdb47e33 100644 --- a/Master/texmf-dist/source/latex/koma-script/scrkernel-typearea.dtx +++ b/Master/texmf-dist/source/latex/koma-script/scrkernel-typearea.dtx @@ -1,4 +1,4 @@ -% \CheckSum{2789} +%\CheckSum{2811} % \iffalse meta-comment % ====================================================================== % scrkernel-typearea.dtx @@ -36,7 +36,7 @@ % % Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== -% \fi +% \fi^^A meta-comment % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -54,33 +54,40 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \iffalse -%%%% From File: $Id: scrkernel-typearea.dtx 2617 2017-04-03 13:56:55Z kohm $ (identify) -%%%% From File: $Id: scrkernel-typearea.dtx 2617 2017-04-03 13:56:55Z kohm $ (init) -% -% -%<*package&init> -% \end{macrocode} +% Before we can define page margins and a typing area, we have to define the +% paper size. Beside \Package{typearea} also \Package{scrletter} uses some of +% this code, because it needs the paper size, too. % % \begin{macro}{\PaperNameToSize} -% \changes{v3.23}{2017/02/22}{neu}^^A -% Dieses Makro zu diversen Papiernamen die Größen \cs{paperheight} und -% \cs{paperwidth}. Derzeit werden die ISO-Formate A, B, C und D sowie -% letter, legal und executive unterstützt. -% \begin{macrocode} +% \changes{v3.23}{2017/02/22}{new}^^A +% This command sets \cs{paperheight} and \cs{paperwidth} depending on +% the name of a paper size. It currently supports the ISO formats of the +% series A, B, C and D and the American formats letter, legal and +% executive. The command is defined using \Macro{providecommand} so a class +% can define it different before loading \Package{typearea}. The first +% optional argument is the error class. Error classes will be defined using +% \Macro{ProvideUnknownPaperSizeError} later. The second argument is the name +% of the paper size. +% \begin{macrocode} +%<*package&options> \providecommand*{\PaperNameToSize}[2][warning]{% \ifstr{#2}{letter}{% \setlength\paperheight{11in}% @@ -347,10 +226,9 @@ } % \end{macrocode} % \begin{macro}{\ISO@PaperNameToSize} -% \changes{v3.23}{2017/02/22}{neu}^^A -% Setzt zu einer ISO-Papiergrößenangabe die Größen \cs{paperheight} und -% \cs{paperwidth}. Derzeit werden die ISO-Formate A, B, C und D -% unterstützt. +% \changes{v3.23}{2017/02/22}{new (internal)}^^A +% For ISO paper sizes a sub-macro is used. It has to split the series and the +% root. % \begin{macrocode} \scr@ifundefinedorrelax{ISO@PaperNameToSize}{% \def\ISO@PaperNameToSize[#1]#2#3\@nil{% @@ -398,6 +276,12 @@ \multiply\paperwidth by186468 \multiply\paperheight by186468 \else +% \end{macrocode} +% The paper size is not a supported ISO format. If +% \Macro{scr@UnknownPaperSize@}\meta{errorclass} is defined, use it to show +% the error. If not, use \Macro{scr@UnknownPaperSize@error}. This means, +% \meta{errorclass} \texttt{error} has to be defined. +% \begin{macrocode} \scr@ifundefinedorrelax{scr@UnknownPaperSize@#1}{% \scr@UnknownPaperSize@error{#2#3}% }{% @@ -408,9 +292,11 @@ }{} % \end{macrocode} % \begin{macro}{\ProvideUnknownPaperSizeError} -% \changes{v3.23}{2017/02/22}{neu} -% Definiert eine Fehlerbehandlung für unbekannte Papiergrößen. Die -% Fehlerbehandlung hat genau ein Argument, nämlich die Papiergröße. +% \changes{v3.23}{2017/02/22}{new}^^A +% Define a new error class for unknown paper formats. The argument is the new +% error class. Each error class is represented by a command +% \Macro{scr@UnknownPaperSize@}\meta{errorclass}. That command also has +% exactly one argument, the unknown paper size. % \begin{macrocode} \providecommand*{\ProvideUnknownPaperSizeError}[1]{% \expandafter\providecommand\expandafter*% @@ -418,14 +304,14 @@ } % \end{macrocode} % \begin{macro}{\scr@UnkownPaperSize@error} -% \changes{v3.23}{2017/02/22}{neu (intern)} +% \changes{v3.23}{2017/02/22}{new (internal)} % \begin{macro}{\scr@UnkownPaperSize@warning} -% \changes{v3.23}{2017/02/22}{neu (intern)} +% \changes{v3.23}{2017/02/22}{new (internal)} % \begin{macro}{\scr@UnkownPaperSize@info} -% \changes{v3.23}{2017/02/22}{neu (intern)} +% \changes{v3.23}{2017/02/22}{new (internal)} % \begin{macro}{\scr@UnkownPaperSize@ignore} -% \changes{v3.23}{2017/02/22}{neu (intern)} -% Fehlerbehandlungen für \cs{PaperNameToSize}. +% \changes{v3.23}{2017/02/22}{new (internal)} +% Error handling (error classes) for \Macro{PaperNameToSize}. % \begin{macrocode} \ProvideUnknownPaperSizeError{error}{% \PackageError{% @@ -457,7 +343,7 @@ } \ProvideUnknownPaperSizeError{ignore}{} % -% +% % \end{macrocode} % \end{macro}^^A \scr@UnknownPaperSize@error % \end{macro}^^A \scr@UnknownPaperSize@warning @@ -467,726 +353,320 @@ % \end{macro}^^A \ISO@PaperNameToSize % \end{macro}^^A \PaperNameToSize % -% Das wird dann unmittelbar in \textsf{typearea} für die Auswertung der -% Papiergröße verwendet: -% \begin{macrocode} -%<*package&typearea&option> +% \begin{option}{a4paper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{a5paper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{b5paper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{letterpaper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{legalpaper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{executivepaper} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{landscape} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% \begin{option}{portrait} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{the option is standard but not deprecated}^^A +% The paper sizes of the standard classes are a special case. For +% compatibility they are declared explicitly. Note: There is still a pattern +% matching implementation for other paper size options, but the usage of those +% is hardly deprecated. +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@DeclareStandardOption[typearea]{a4paper}{paper=a4} +\KOMA@DeclareStandardOption[typearea]{a5paper}{paper=a5} +\KOMA@DeclareStandardOption[typearea]{b5paper}{paper=b5} +\KOMA@DeclareStandardOption[typearea]{letterpaper}{paper=letter} +\KOMA@DeclareStandardOption[typearea]{legalpaper}{paper=legal} +\KOMA@DeclareStandardOption[typearea]{executivepaper}{paper=executive} +\KOMA@DeclareStandardOption[typearea]{landscape}{paper=landscape} +\KOMA@DeclareStandardOption[typearea]{portrait}{paper=portrait} +% % \end{macrocode} +% \end{option} +% \end{option} +% \end{option} +% \end{option} +% \end{option} +% \end{option} +% \end{option} +% \end{option} % -% \begin{macro}{\x@paper} -% \begin{macro}{\x@@paper} -% \changes{v2.5}{1997/06/17}{neue Mustererkennung für die -% Papiergröße}^^A -% Diese Makros werden ebenfalls später benötigt, wenn die Papiergröße -% festgelegt wird. -% \begin{macro}{\isopaper} -% \changes{v2.5}{1997/06/17}{neu}^^A -% \changes{v2.95}{2002/12/03}{es sind auch Großbuchstaben erlaubt}^^A -% \changes{v3.23}{2017/02/22}{verwendet \cs{ISO@PaperNameToSize}}^^A -% Da das Makro \cs{isopaper} zur Berechnung unterschiedlicher -% ISO/DIN-Papierformate in der Mustererkennung für die Papiergröße -% benötigt wird, wurde dieses Makro ebenfalls vorgezogen. -% \begin{macrocode} -\newcommand\isopaper[2][a]{% -% \end{macrocode} -% Das Makro kennt zwei Parameter, von denen der erste und optionale -% die Grundgröße angibt. Die Angabe erfolgt über einen -% Buchstaben. Möglich sind -% \begin{description} -% \item[a] -- ISO/DIN-A-Format -% \item[b] -- ISO/DIN-B-Format -% \item[c] -- ISO/DIN-C-Format -% \item[d] -- ISO/DIN-D-Format -% \end{description} -% Der zweite Paremeter gibt dann die Skalierung an. -% \begin{macrocode} - \ISO@PaperNameToSize[typearea]#1#2\@nil -% \end{macrocode} -% Jetzt noch die gewünschte Ausrichtung beachten. -% \changes{v2.97e}{2007/10/23}{gewünschte Papierausrichtung wird -% beachtet}^^A -% \changes{v3.22}{2016/07/29}{Papierausrichtung entsprechend dem -% tatsächlichen Format}^^A -% \begin{macrocode} - \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax - \scr@setpaperorientation - \else - \if@landscape\scr@switchpapersizes\fi - \fi -} -% \end{macrocode} -% \textsf{typearea} verwendet eine eigene Fehlerausgabe. -% \begin{macro}{\scr@UnknownPaperSize@typearea} -% \changes{v3.23}{2017/02/22}{neu (intern)} -% \begin{macrocode} -\ProvideUnknownPaperSizeError{typearea}{% - \PackageError{typearea}{% - Unknown ISO/DIN-papersize-letter #1% - }{% - There are only four defined paper scalings:\MessageBreak - a = ISO/DIN-A, b = ISO/DIN-B, c = ISO/DIN-C, - d = ISO/DIN-D\MessageBreak - Read KOMA-Script-documentation for further information.% - }% - \setlength{\paperwidth}{841sp}% - \setlength{\paperheight}{1189sp}% -} -% \end{macrocode} -% \end{macro}^^A \scr@UnknownPaperSize@typearea -% \end{macro}^^A \isopaper -% \begin{macro}{\scr@setpaperorientation} -% \changes{v3.22}{2016/07/29}{neu (intern)} -% Stellt die Papierausrichtung entsprechend \cs{if@landscape} ein. -% \begin{macrocode} -\newcommand*\scr@setpaperorientation{% - \ifdim\paperheight>\paperwidth - \if@landscape\scr@switchpapersizes\fi - \else - \if@landscape\else\scr@switchpapersizes\fi - \fi -} -% \end{macrocode} -% \begin{macro}{\scr@switchpapersizes} -% \changes{v3.22}{2016/07/29}{neu (intern)} -% Vertauscht zwei Längen. -% \begin{macrocode} -\newcommand*\scr@switchpapersizes{% - \@tempdima\paperwidth\paperwidth\paperheight\paperheight\@tempdima -} -% \end{macrocode} -% \end{macro}^^A \scr@switchlength -% \end{macro}^^A \scr@setpaperorientation -% \begin{macro}{\iso@paper} -% \changes{v2.95}{2002/12/03}{neu (intern)}^^A -% Ein ganz ähnlicher interner Befehl erhält den gesamten Namen des -% ISO-Papierformats als einziges Argument. -% \begin{macro}{\iso@@paper} -% \changes{v2.95}{2002/12/03}{neu (intern)}^^A -% Dieses Argument wird dann über einen weiteren internen Befehl per -% Mustererkennung in den Kennbuchstaben und eine Zahl zerlegt. -% \begin{macrocode} -\newcommand*{\iso@paper}[1]{\expandafter\iso@@paper#1\@nil} -\newcommand*{\iso@@paper}{} -\def\iso@@paper#1#2\@nil{% - \@tempswafalse - \if #1a\@tempswatrue - \else\if #1A\@tempswatrue - \else\if #1b\@tempswatrue - \else\if #1B\@tempswatrue - \else\if #1c\@tempswatrue - \else\if #1C\@tempswatrue - \else\if #1d\@tempswatrue - \else\if #1D\@tempswatrue - \fi\fi\fi\fi\fi\fi\fi\fi - \if@tempswa - \ifnumber{#2}{\isopaper[#1]{#2}}{\@tempswafalse}% - \fi -} -% \end{macrocode} -% \end{macro}^^A \iso@@paper -% \end{macro}^^A \iso@paper -% -% Jetzt wird es wieder für alle interessant: -% \begin{macrocode} -% -%<*class|(package&typearea)> -%<*option> -% \end{macrocode} -% -% Zurück zur Mustererkennung. Diese ist tatsächlich etwas einfacher -% als die in den beiden Fällen zuvor. -% \changes{v2.97e}{2007/10/23}{Optionen werden nach der neuen Syntax an -% typearea weitergeleitet}^^A -% \begin{macrocode} -\newcommand*{\x@paper}{% - \expandafter\x@@paper\CurrentOption paper\x@@paper% -} -\newcommand*{\x@@paper}{} -\def\x@@paper #1#2paper#3\x@@paper{% - \ifstr{#3}{paper}{% - \ifnumber{#2}{% - \ifstr{#1}{a}{% -% \PassOptionsToPackage{#3=#1#2}{typearea}% -% \isopaper[a]{#2}% +% \begin{option}{paper} +% \changes{v2.95}{2002/12/03}{new implementation}^^A +% \changes{v3.01b}{2008/12/09}{height and width swapped}^^A +% \changes{v3.02c}{2009/02/12}{new \Option{paper!=seascape}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \changes{v3.22}{2016/07/29}{paper orientation depends on format name}^^A +% Normally, the paper size should be set using this option. It provides the +% ISO series A, B, C, D, value pairs +% \Option{(\meta{width},\meta{height})} and the orientations +% \Option{portrait}, \Option{landscape} and \Option{seascape}. +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{paper}{% + \ifstr{#1}{seascape}{% + \@seascapetrue + \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax + \@landscapetrue + \scr@setpaperorientation + \else + \if@landscape\else\scr@switchpapersizes\@landscapetrue\fi + \fi + \FamilyKeyStateProcessed + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{seascape}% + }{% + \ifstr{#1}{landscape}{% + \@seascapefalse + \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax + \@landscapetrue + \scr@setpaperorientation + \else + \if@landscape\else\scr@switchpapersizes\@landscapetrue\fi + \fi + \FamilyKeyStateProcessed + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{landscape}% + }{% + \ifstr{#1}{portrait}{% + \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax + \@landscapefalse + \scr@setpaperorientation + \else + \if@landscape\scr@switchpapersizes\@landscapefalse\fi + \fi + \FamilyKeyStateProcessed + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% + \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{portrait}% }{% - \ifstr{#1}{b}{% -% \PassOptionsToPackage{#3=#1#2}{typearea}% -% \isopaper[b]{#2}% + \ifstr{#1}{letter}{% + \if@landscape + \setlength\paperheight{8.5in}% + \setlength\paperwidth {11in}% + \else + \setlength\paperheight{11in}% + \setlength\paperwidth {8.5in}% + \fi + \FamilyKeyStateProcessed + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{letter}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \if@seascape seascape\else + \if@landscape landscape\else portrait\fi\fi + }% }{% - \ifstr{#1}{c}{% -% \PassOptionsToPackage{#3=#1#2}{typearea}% -% \isopaper[c]{#2}% + \ifstr{#1}{legal}{% + \if@landscape + \setlength\paperheight{8.5in}% + \setlength\paperwidth {14in}% + \else + \setlength\paperheight{14in}% + \setlength\paperwidth {8.5in}% + \fi + \FamilyKeyStateProcessed + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{legal}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \if@seascape seascape\else + \if@landscape landscape\else portrait\fi\fi + }% }{% - \ifstr{#1}{d}{% -% \PassOptionsToPackage{#3=#1#2}{typearea}% -% \isopaper[d]{#2}% - }{\scr@pti@nerr@r}% - }% - }% - }% - }{\scr@pti@nerr@r}% - }{% -% \@pt@scan -% \@headlines - }% -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\scr@pti@nerr@r} -% \changes{v2.95}{2002/06/20}{\cs{OptionNotUsed} statt -% \cs{PackageError}} -% Falls die zuätzliche Option nicht \texttt{BCOR}, \texttt{DIV}, -% \texttt{headlines} oder eine bekannte Papiergröße ist, ist die -% Option nicht verwendet. -% \begin{macrocode} -\newcommand*{\scr@pti@nerr@r}{ -% \OptionNotUsed -% \@unknownoptionerror -} -% \end{macrocode} -% \end{macro} -% -% Jetzt wieder nur für Pakete: -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \subsection{Optionen mit \textsf{keyval}} -% -% \subsubsection{Kopf-, Fuß-, Rand- und Textbereich} -% -% \begin{option}{headlines} -% \changes{v2.95}{2002/12/06}{mit \textsf{keyval} neu implementiert} -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}} -% \begin{option}{footlines} -% \changes{v3.12}{2013/03/26}{neue Option}^^A -% Neben der Auswertung der \meta{Wert}\texttt{headlines} Form über -% Pattern Matching wird hier auch noch eine \textsf{keyval}-Option -% definiert, die bevorzugt zu verwenden ist. Für den Fuß wird überhaupt nur -% diese Form bereit gestellt. -% \begin{macrocode} -\KOMA@key{headlines}{% - \begingroup - \setlength{\@tempdima}{#1\baselineskip}% - \endgroup - \def\ta@hh{#1\baselineskip}% - \FamilyKeyStateProcessed - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headlines}{#1}% - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headheight}{#1\baselineskip}% -} -\KOMA@key{footlines}{% - \begingroup - \setlength{\@tempdima}{#1\baselineskip}% - \endgroup - \def\ta@fh{#1\baselineskip}% - \FamilyKeyStateProcessed - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footlines}{#1}% - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footheight}{#1\baselineskip}% -} -% \end{macrocode} -% \end{option} -% \end{option} -% -% \begin{option}{headheight} -% \changes{v2.98c}{2008/04/06}{neue Option}^^A -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}} -% \begin{option}{footheight} -% \changes{v3.12}{2013/03/26}{neue Option}^^A -% Manchmal ist es nützlicher, wenn man die Höhe direkt setzen kann, statt sie -% über die Anzahl der Grundlinien zu setzen. In dem Fall nimmt man einfach -% diese Optionen. -% \begin{macrocode} -\KOMA@key{headheight}{% - \begingroup - \setlength{\@tempdima}{#1}% - \endgroup - \def\ta@hh{#1}% - \FamilyKeyStateProcessed - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headheight}{#1}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{headlines}% -} -\KOMA@key{footheight}{% - \begingroup - \setlength{\@tempdima}{#1}% - \endgroup - \def\ta@fh{#1}% - \FamilyKeyStateProcessed - \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footheight}{#1}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{footlines}% -} -% \end{macrocode} -% \end{option} -% \end{option} -% -% \begin{option}{headinclude} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \begin{option}{headexclude} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{deprecated}^^A -% Diese Optionen bestimmen, ob der Seitenkopf bereits zum Textbereich -% gehört. -% \begin{macro}{\if@hincl} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \changes{v2.97c}{2007/04/19}{direkte Initialisierung über \cs{if@hsl}, -% falls definiert} -% \begin{macro}{\@hincltrue} -% \begin{macro}{\@hinclfalse} -% Der Zustand selbst wird in einem Schalter gespeichert. -% \begin{macrocode} -\newif\if@hincl\@ifundefined{if@hsl}{}{\let\if@hincl\if@hsl} -\KOMA@ifkey{headinclude}{@hincl} -\KOMA@DeclareDeprecatedOption[typearea]{headexclude}{headinclude=false} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{option} -% \end{option} -% -% \begin{option}{headsepline} -% \changes{v3.20}{2015/12/12}{\textsf{typearea} reagiert selbst auf -% \texttt{headsepline}}^^A -% Bis \KOMAScript{} v3.20 konnte \textsf{typearea} nicht korrekt auf beliebige -% Abfolgen der Optionen \texttt{headsepline} und \texttt{headinclude} -% reagieren. Bis Version 3.18a gewann Option \texttt{headinclude} innerhalb -% der globalen Optionen immer über Option \texttt{headsepline}, während das -% innerhalb von \cs{KOMAoptions} nicht der Fall war. In Version 3.18a wurde -% ein Bug beseitigt, der dann dazu führte, dass \texttt{headsepline} innerhalb -% der globalen Optionen immer über \texttt{headinclude} siegte. Tatsächlich -% soll aber bei \texttt{headinclude=false,headsepline} oder bei -% \texttt{headinclude=true,headsepline=false} sowohl in den globalen Optionen -% als auch bei \cs{KOMAoptions} \texttt{headsepline} entscheidend sein, -% während bei \texttt{headsepline,headinclude=false} und -% \texttt{headsepline=false,headinclude} natürlich \texttt{headinclude} -% entscheidend sein soll. Das soll auch dann noch funktionieren, wenn sich die -% Optionen beliebig oft abwechseln. Damit das geht, muss \textsf{typearea} -% Option \texttt{headsepline} selbst als \texttt{headinclude} interpretieren. -% \begin{macrocode} -\KOMA@key{headsepline}[true]{% - \KOMA@set@ifkey{headinclude}{@hincl}{#1}% - \ifx\FamilyKeyState\FamilyKeyStateProcessed - \KOMA@kav@replacebool{.typearea.\scr@pkgextension}{headinclude}{@hincl}% - \fi + \ifstr{#1}{executive}{% + \if@landscape + \setlength\paperheight{7.25in}% + \setlength\paperwidth {10.5in}% + \else + \setlength\paperheight{10.5in}% + \setlength\paperwidth {7.25in}% + \fi + \FamilyKeyStateProcessed + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{executive}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \if@seascape seascape\else + \if@landscape landscape\else portrait\fi\fi + }% + }{% + \iso@paper{#1}% + \if@tempswa + \FamilyKeyStateProcessed + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{#1}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \if@seascape seascape\else + \if@landscape landscape\else portrait\fi\fi + }% + \else + \expandafter\maybe@pair#1::\@nil + \if@tempswa + \FamilyKeyStateProcessed + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% + \expandafter\ifnum \scr@ta@v@is@lt{3.01b}\relax + \PackageWarningNoLine{typearea}{% + You may have to exchange height and width!\MessageBreak + Until KOMA-Script version 3.01b the semantic\MessageBreak + of option `paper' was `paper=height:width'\MessageBreak + instead of `paper=width:height'.\MessageBreak + I've switched back to that old interpretation\MessageBreak + because of the given compatiblity settings}% + \setlength\paperwidth{\@tempb}% + \setlength\paperheight{\@tempa}% + \else + \setlength\paperwidth{\@tempa}% + \setlength\paperheight{\@tempb}% + \fi + \expandafter\ifnum \scr@ta@v@is@lt{3.22}\relax + \if@landscape + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{\@tempa:\@tempb}% + \else + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{\@tempb:\@tempa}% + \fi + \else + \scr@setpaperorientation + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \the\paperwidth:\the\paperheight}% + \fi + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% + \if@seascape seascape\else + \if@landscape landscape\else portrait\fi\fi + }% + \else + \KOMA@unknown@keyval{paper}{#1}{% + `letter', `legal', `executive', `a', `b', + `c', `d',\MessageBreak + `:', `landscape' and `portrait'% + }% + \fi + \fi + }% + }% + }% + }% + }% + }% } % \end{macrocode} -% \end{option}^^A headsepline -% -% \begin{option}{footinclude} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \begin{option}{footexclude} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{deprecated}^^A -% Diese Optionen bestimmen, ob die Fußzeilen noch zum Textbereich -% gehören. -% \begin{macro}{\if@fincl} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \changes{v2.97c}{2007/04/19}{direkte Initialisierung über \cs{if@fsl}, -% falls definiert} -% \begin{macro}{\@fincltrue} -% \begin{macro}{\@finclfalse} -% Der Zustand selbst wird in einem Schalter gespeichert. +% \begin{macro}{\if@seascape} +% \changes{v3.02c}{2009/02/12}{new}^^A +% \begin{macro}{\@seascapetrue} +% \changes{v3.02c}{2009/02/12}{new}^^A +% \begin{macro}{\@seascapefalse} +% \changes{v3.02c}{2009/02/12}{new}^^A +% This switch stores only whether or not the landscape orientation should be +% up-side-down. Currently this makes sense only using \File{dvips}. % \begin{macrocode} -\newif\if@fincl\@ifundefined{if@fsl}{}{\let\if@fincl\if@fsl} -\KOMA@ifkey{footinclude}{@fincl} -\KOMA@DeclareDeprecatedOption[typearea]{footexclude}{footinclude=false} +\newif\if@seascape % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -% \end{option} -% \end{option} -% -% \begin{option}{footsepline} -% \changes{v3.20}{2015/12/12}{\textsf{typearea} reagiert selbst auf -% \texttt{footsepline}}^^A -% \changes{v3.23}{2017/03/03}{muss natürlich \cs{if@fincl} statt -% \cs{if@hincl} entsprechend setzen}^^A -% Bis \KOMAScript{} v3.20 konnte \textsf{typearea} nicht korrekt auf beliebige -% Abfolgen der Optionen \texttt{footsepline} und \texttt{footinclude} -% reagieren. Bis Version 3.18a gewann Option \texttt{footinclude} innerhalb -% der globalen Optionen immer über Option \texttt{footsepline}, während das -% innerhalb von \cs{KOMAoptions} nicht der Fall war. In Version 3.18a wurde -% ein Bug beseitigt, der dann dazu führte, dass \texttt{footsepline} innerhalb -% der globalen Optionen immer über \texttt{footinclude} siegte. Tatsächlich -% soll aber bei \texttt{footinclude=false,footsepline} oder bei -% \texttt{footinclude=true,footsepline=false} sowohl in den globalen Optionen -% als auch bei \cs{KOMAoptions} \texttt{footsepline} entscheidend sein, -% während bei \texttt{footsepline,footinclude=false} und -% \texttt{footsepline=false,footinclude} natürlich \texttt{footinclude} -% entscheidend sein soll. Das soll auch dann noch funktionieren, wenn sich die -% Optionen beliebig oft abwechseln. Damit das geht, muss \textsf{typearea} -% Option \texttt{footsepline} selbst als \texttt{footinclude} interpretieren. -% \begin{macrocode} -\KOMA@key{footsepline}[true]{% - \KOMA@set@ifkey{footinclude}{@fincl}{#1}% - \ifx\FamilyKeyState\FamilyKeyStateProcessed - \KOMA@kav@replacebool{.typearea.\scr@pkgextension}{footinclude}{@fincl}% - \fi -} -% \end{macrocode} -% \end{option}^^A footsepline -% -% \begin{option}{mpinclude} -% \changes{v2.8q}{2002/03/28}{neue Option}^^A -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \begin{option}{mpexclude} -% \changes{v2.8q}{2002/03/28}{neue Option}^^A -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{deprecated}^^A -% Es gibt Dokumente mit sehr ausführlichen Randnotizen, bei denen die -% Randnotizen bei der Satzspiegelberechnung in den Satzspiegel -% eingerechnet werden sollten. Diese Optionen bestimmen, ob dies der -% Fall ist. -% \begin{macro}{\if@mincl} -% \changes{v2.95}{2002/07/08}{Verwendung von \textsf{scrkeyvl}} -% \begin{macro}{\@mincltrue} -% \begin{macro}{\@minclfalse} -% Der Zustand wird in einem Schalter gespeichert. \textbf{Achtung:} -% Bei Verwendung dieser Option müssen größere DIV-Werte verwendet -% werden. Siehe dazu weiter unten. +% \begin{macro}{\if@landscape} +% \begin{macro}{\@landscapetrue} +% \begin{macro}{\@landscapefalse} +% This switch stores whether using portrait or landscape orientation. % \begin{macrocode} -\KOMA@ifkey{mpinclude}{@mincl} -\KOMA@DeclareDeprecatedOption[typearea]{mpexclude}{mpinclude=false} +\newif\if@landscape % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -% \end{option} -% \end{option} -% -% \begin{option}{BCOR} -% \changes{v2.2a}{1995/01/25}{neue Option}^^A -% \changes{v2.95}{2002/12/04}{als \textsf{keyval}-Option -% implementiert} -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}} -% Der Wert wird einfach an die Länge \cs{ta@bcor} verfüttert, wobei -% symbolische Werte speziell behandelt werden, auch wenn sie beim -% Laden des Pakets absolut keinen Sinn ergeben! -% \begin{macrocode} -\KOMA@key{BCOR}{% - \ifstr{#1}{current}{}{% - \setlength{\ta@bcor}{#1}% - }% - \FamilyKeyStateProcessed - \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{BCOR}{#1}% -} -% \end{macrocode} -% Wenn allerdings der Satzspiegel bereits berechnet ist, dann muss er -% hier stattdessen neu berechnet werden. -% \changes{v3.13}{2014/06/30}{fehlendes \cs{FamilyKeyStateProcessed}^^A -% ergänzt}^^A -% \begin{macrocode} -\AtEndOfPackage{% - \KOMA@key{BCOR}{\typearea[{#1}]{last}\FamilyKeyStateProcessed}% -} -% \end{macrocode} -% \end{option} -% -% \begin{option}{DIV} -% \changes{v2.2a}{1995/01/25}{neue Option}^^A -% \changes{v2.95}{2002/12/04}{als \textsf{keyval}-Option -% implementiert} -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}} -% Der Wert wird einfach an den Zähler \cs{ta@div} verfüttert, wobei -% symbolische Werte speziell behandelt werden. Dabei werden auch die -% Werte "`\texttt{last}"' und "`\texttt{current}"' ausgewertet, auch -% wenn diese beim Laden des Pakets absolut keinen Sinn ergeben! +% \begin{macro}{\maybe@pair} +% \changes{v2.95}{2002/12/03}{new (internal)}^^A +% \changes{v2.97e}{2007/11/26}{works really}^^A +% Test whether the following parameter is of kind \texttt{\meta{first +% argument}:\meta{second argument}}. If so \cs{@tempa} will become \meta{first +% argument} and \cs{@tempb} will become \meta{second argument} and +% \cs{if@tempswa} will become \cs{iftrue}. Otherwise \cs{if@tempswa} is +% \cs{iffalse} and \cs{@tempa} and \cs{@tempb} are not specified. % \begin{macrocode} -\KOMA@key{DIV}[calc]{% - \edef\@tempa{#1}% - \def\@tempb{last}\ifx\@tempa\@tempb\let\@tempa=\@lastdiv\fi - \def\@tempb{current}\ifx\@tempa\@tempb\else - \def\@tempb{default}\ifx\@tempa\@tempb\ta@div=\z@ \else - \def\@tempb{calc}\ifx\@tempa\@tempb\ta@div=\tw@ \else - \def\@tempb{classic}\ifx\@tempa\@tempb\ta@div=\thr@@ \else - \ta@div=\@tempa - \fi - \fi - \fi +\newcommand*{\maybe@pair}{} +\def\maybe@pair#1:#2:#3\@nil{% + \edef\@tempa{#1}\edef\@tempb{#2}% + \ifx\@tempa\@empty\@tempswafalse\else + \ifx\@tempb\@empty\@tempswafalse\else\@tempswatrue\fi \fi - \FamilyKeyStateProcessed - \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{DIV}{#1}% -} -% \end{macrocode} -% Wenn allerdings der Satzspiegel bereits berechnet ist, dann muss er -% hier stattdessen neu berechnet werden. -% \changes{v3.13}{2014/06/30}{fehlendes \cs{FamilyKeyStateProcessed}^^A -% ergänzt}^^A -% \begin{macrocode} -\AtEndOfPackage{% - \KOMA@key{DIV}{\typearea[current]{#1}\FamilyKeyStateProcessed}% } +% % \end{macrocode} -% \end{option} -% -% \begin{option}{DIVcalc} -% \changes{v2.4g}{1996/11/04}{neue Option}^^A -% \changes{v2.95}{2002/12/04}{über Option \texttt{DIV} reimplementiert} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{DIVclassic} -% \changes{v2.4n}{1997/05/28}{neue Option}^^A -% \changes{v2.95}{2002/12/04}{über Option \texttt{DIV} reimplementiert} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% Dann gibt es da noch zwei alte Sonderfälle. -% \begin{macrocode} -\KOMA@DeclareDeprecatedOption[typearea]{DIVcalc}{DIV=calc} -\KOMA@DeclareDeprecatedOption[typearea]{DIVclassic}{DIV=classic} -% \end{macrocode} -% \end{option} -% \end{option} -% -% -% \begin{option}{areasetadvanced} -% \changes{v3.11}{2012/04/17}{new internal option}^^A -% Switch to advanced version of \cs{areaset}. This does calculate margins -% more like \cs{typearea}. Nevertheless, there's still a difference at the top -% margin, because \cs{typerea} doesn't balance differences in calculated -% height of margins and resulting height of margins but reduces only the -% bottom margin. -% \begin{macrocode} -\KOMA@ifkey{areasetadvanced}{@areasetadvanced} -% \end{macrocode} -% \end{option} -% -% -% \subsubsection{Sonstige Satzspiegel-Optionen} -% -% \begin{option}{oneside} -% \changes{v2.97e}{2007/11/23}{auf vielfachen Wunsch reicht die Klasse die -% Option an das Paket weiter}^^A -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{twoside} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt}^^A -% \changes{v2.97e}{2007/11/23}{auf vielfachen Wunsch reicht die Klasse die -% Option an das Paket weiter}^^A -% \changes{v3.00}{2008/07/09}{die Option kennt zusätzlich den Wert -% \texttt{semi}}^^A -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}}^^A -% \changes{v3.13a}{2014/04/09}{Die Klasse setzt signalisiert ebenfalls -% \cs{FamilyKeyStateProcessed}}^^A -% \changes{v3.17}{2015/03/17}{ab dieser Version werden \cs{flushbottom} und -% \cs{raggedbottom} automatisch gesetzt}^^A -% \changes{v3.17}{2015/03/17}{Voreinstellungen werden bereits hier -% gesetzt}^^A -% \changes{v3.17}{2015/03/18}{wenn möglich \cs{cleardoubleoddpage} -% verwenden}^^A -% \begin{macro}{\if@semitwoside} -% \changes{v3.00}{2008/07/09}{neuer Schalter (intern)}^^A -% \begin{macro}{\if@twoside} -% \changes{v3.00}{2008/07/09}{Schalter setzt auch \cs{if@semitwoside}}^^A -% Einseitiger oder zweiseitiger Satzspiegel? -% \begin{macrocode} -\newif\if@semitwoside -\g@addto@macro\@twosidetrue\@semitwosidefalse -\g@addto@macro\@twosidefalse\@semitwosidefalse -% -% \end{macrocode} -% \end{macro} % \end{macro} -% \begin{macrocode} -\KOMA@key{twoside}[true]{% -% \if@atdocument\else\PassOptionsToPackage{twoside=#1}{typearea}\fi% -%<*package> - \if@atdocument\if@twoside - \scr@ifundefinedorrelax{cleardoubleoddpage}{% - \cleardoublepage - }{% - \cleardoubleoddpage - }% - \else\clearpage\fi\fi -% - \ifstr{#1}{semi}{% - \@twosidetrue -% \@semitwosidetrue - \FamilyKeyStateProcessed - }{% - \def\FamilyElseValue{, `semi'}% - \KOMA@set@ifkey{twoside}{% -% \end{macrocode} -% \changes{v3.20}{2015/11/02}{nicht erfüllte Reihenfolgenabhängigkeit von -% Option \texttt{twocolumn} bevor \texttt{twoside} beseitigt}^^A -% Von Version~3.17 bis 3.19a wurde hier in den Klassen mit einem lokalen -% Schalter \cs{if@tempswa} gearbeitet. Dadurch konnte aber Option -% \texttt{twocolumn} nicht erkennen, dass doppelseitig gearbeitet -% wird. Deshalb hätte Option \texttt{twocolumn} vor \texttt{twoside} -% abgearbeitet werden müssen. Durch direkte Verwendung von \cs{if@twoside} -% auch in den Klassen, wurde die Abhängigkeit beseitigt. Die Alternative wäre -% gewesen, die Implementierung und Ausführung von \texttt{twocolumn} vor -% \texttt{twoside} zu verschieben. -% \begin{macrocode} - @twoside% - }{#1}% - }% - \ifx\FamilyKeyState\FamilyKeyStateProcessed -%<*class> - \expandafter\ifnum\scr@v@is@ge{3.17}% -%<*!letter> - \if@twoside\flushbottom - \else\if@twocolumn\flushbottom\else\raggedbottom\fi\fi -% -% \raggedbottom - \fi -% - \KOMA@kav@xreplacevalue{.% -% \KOMAClassFileName -% typearea.\scr@pkgextension - }{twoside}{#1}% -%<*package> - \if@twoside - \if@semitwoside - \@mparswitchfalse - \else - \@mparswitchtrue - \fi - \else - \@mparswitchfalse - \fi% - \csname recalctypearea\endcsname -% - \fi -} -%<*class> -%\KOMAExecuteOptions{twoside=true} -%\KOMAExecuteOptions{twoside=false} -% -%<*package> -\KOMA@kav@xadd{.typearea.\scr@pkgextension}{twoside}{% - \if@twoside true\else false\fi -} -% -\KOMA@DeclareStandardOption% -% [typearea]% - {oneside}{twoside=false} -%<*package> -% \end{macrocode} -% \end{option} % \end{option} % -% \begin{option}{onecolumn} -% \changes{v2.95}{2002/12/04}{Option in das \textsf{typearea}-Paket -% verlagert} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v2.97e}{2007/11/23}{auf vielfachen Wunsch reicht die Klasse die -% Option an das Paket weiter}^^A -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{twocolumn} -% \changes{v2.95}{2002/12/04}{Option in das \textsf{typearea}-Paket -% verlagert} -% \changes{v2.97e}{2007/11/23}{auf vielfachen Wunsch reicht die Klasse die -% Option an das Paket weiter}^^A -% \changes{v2.98a}{2007/01/08}{es wird die richtige Option an das Paket -% weitergereicht}^^A -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}} -% \changes{v3.13a}{2014/04/09}{Signallisierung korrigiert}^^A -% \changes{v3.20}{2016/02/16}{\cs{sloppy}, \cs{raggedbottom} und -% \cs{flushbottom} verzögert}^^A -% Einspaltiger oder zweispaltiger Satz? +% \subsection{Special handling of \Package{geometry}} +% +% \begin{option}{usegeometry} +% \changes{v3.17}{2015/02/07}{new}^^A +% \Package{typearea} optionally can pass several settings to package +% \Package{geometry}. The user decides whether or not to use this. % \begin{macrocode} -% -\KOMA@key{twocolumn}[true]{% -% \if@atdocument\else\PassOptionsToPackage{twocolumn=#1}{typearea}\fi% -%<*package> - \if@atdocument\clearpage\fi -% - \KOMA@set@ifkey{twocolumn}{@twocolumn}{#1}% - \ifx\FamilyKeyState\FamilyKeyStateProcessed - \KOMA@kav@replacebool{.% -% \KOMAClassFileName -% typearea.\scr@pkgextension - }{twocolumn}{@twocolumn}% -% \csname recalctypearea\endcsname -%<*class> - \if@atdocument\expandafter\@firstofone - \else\@ifpackageloaded{typearea}{\expandafter\@firstofone} - {\expandafter\AtEndOfClass}\fi - {\expandafter\ifnum\scr@v@is@ge{3.17}% - \if@twocolumn\twocolumn\sloppy\flushbottom - \else\onecolumn\if@twoside\flushbottom\else\raggedbottom\fi\fi - \fi}% -% - \fi -} -%<*class> -\AtEndOfClass{% - \expandafter\ifnum\scr@v@is@lt{3.17}% -%<*!letter> - \if@twocolumn\twocolumn\sloppy\flushbottom - \else\onecolumn\if@twoside\flushbottom\else\raggedbottom\fi\fi -% -% \raggedbottom - \fi -} -\KOMAExecuteOptions{twocolumn=false} -% -%<*package> -\KOMA@kav@xadd{.typearea.\scr@pkgextension}{twocolumn}{% - \if@twocolumn true\else false\fi -} -% -\KOMA@DeclareStandardOption% -% [typearea]% - {onecolumn}{twocolumn=false} +%<*package&typearea&options> +\KOMA@ifkey{usegeometry}{@ta@usegeometry} +% % \end{macrocode} % \end{option} -% \end{option} -% +% % -% \subsubsection{Ausgabeformat-Optionen} +% \subsection{Setting the output paper size} % -% Diese Optionen arbeiten in Abhänigkeit des Ausgabeformats. +% The document paper format of option \Option{paper} is one thing. It is used +% only for calculation of the dimensions used by \TeX{}. Originally +% \textsc{dvi} does not know something like a paper size. It just contained +% relative movements from the current position starting with the +% origin. Setting up a page size depends on the output driver or back-end. % % \begin{option}{pagesize} -% \changes{v2.7g}{2001/04/17}{neue Option}^^A -% \changes{v2.95}{2002/08/27}{neu implementiert}^^A -% \changes{v3.02c}{2009/02/14}{neuer Wert \texttt{false}}^^A -% \changes{v3.05a}{2010/03/18}{neuer Wert \texttt{dvipdfmx}}^^A -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}}^^A -% \changes{v3.17a}{2015/05/03}{Logik komplett neu geschrieben}^^A -% \changes{v3.20}{2015/07/10}{\texttt{luatex} als Synonym für -% \texttt{pdftex}}^^A -% Diese Option ist nun das zentrale Element für die Übermittlung der -% Seitengröße an pdf\TeX, \texttt{dvips} oder V\TeX. Sie wird auch von -% den obsoleten Optionen verwendet. Die Werte und ihre Bedeutung: -% \begin{labeling}[~--]{\texttt{automedia}} -% \item[\texttt{auto}] Kombination aus den Optionen \texttt{pdftex} -% und \texttt{dvips}. -% \item[\texttt{automedia}] wie \texttt{auto} allerdings werden -% zusätzlich \cs{mediawidth} und \cs{mediaheight} gesetzt, falls -% sie definiert sind. -% \item[\texttt{dvips}] das \cs{special} für \texttt{dvips} wird -% ausgegeben, falls \texttt{dvi}-Ausgabe erwartet wird oder -% \cs{if@dvips} erfüllt ist. Führt zu einer Warnung, wenn sie mehr -% als einmal oder nach der Präambel verwendet wird. -% \item[\texttt{dvipdfmx}] das \cs{special} für \texttt{dvipdfmx} wird -% ausgegeben, falls \texttt{dvi}-Ausgabe erwartet wird. -% \item[\texttt{false}] die automatische Anpassung bei Änderungen innerhalb -% des Dokuments abschalten. -% \item[\texttt{pdftex}] \cs{pdfpagewidth} und \cs{pdfpageheight} -% werden gesetzt, falls sie definiert sind. +% \changes{v2.7g}{2001/04/17}{new}^^A +% \changes{v2.95}{2002/08/27}{new implementation}^^A +% \changes{v3.02c}{2009/02/14}{new \Option{pagesize!=false}}^^A +% \changes{v3.05a}{2010/03/18}{new \Option{pagesize!=dvipdfmx}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \changes{v3.17a}{2015/05/03}{logic redesigned}^^A +% \changes{v3.20}{2015/07/10}{\File{luatex} as a synonym of +% \File{pdftex}}^^A +% This option is the main element for telling pdf\TeX, \File{dvips} or V\TeX{} +% which paper size to use. It is also used by some deprecated options. Here +% are the values and their meanings: +% \begin{labeling}[~--]{\Option{automedia}} +% \item[\Option{auto}] combination of options \Option{pdftex} and +% \Option{dvips}. +% \item[\Option{automedia}] like \Option{auto} with additional setting of +% \cs{mediawidth} and \cs{mediaheight} if available. +% \item[\Option{dvips}] adds a \File{dvips} \cs{special} to set the paper +% size. This should be done only once in the document preamble. Usage inside +% the document body is not fully supported and will raise a warning. +% \item[\Option{dvipdfmx}] adds a \File{dvipdfmx} \cs{special} to set the +% paper size. +% \item[\Option{false}] switch of the automatic driver page size setting, +% i.e., if there are changes inside the document. +% \item[\Option{pdftex}] set \cs{pdfpagewidth} and \cs{pdfpageheight} if +% available. % \end{labeling} % \begin{macrocode} -%<*package> +%<*package&typearea&options> \KOMA@key{pagesize}[auto]{% \KOMA@set@ncmdkey{pagesize}{@pagesizelast}{% {off}{-1},{no}{-1},{false}{-1},% @@ -1230,10 +710,9 @@ } % \end{macrocode} % \begin{macro}{\@pagesizelast} -% Das interne Makro speichert die aktuelle Einstellung von \texttt{pagesize} -% und wird nicht nur für das neu Setzen derselben in Option \texttt{paper}, -% sondern auch für die Parametereinstellung innerhalb von -% \texttt{\cs{begin}\{document\}}. +% This internal macro stores the current value of option \Option{pagesize} and +% is needed to use the correct signalling if option \Option{paper} is used +% inside the document and the initial setup in |\begin{document}|. % \begin{macrocode} \newcommand\@pagesizelast{auto} \AtBeginDocument{% @@ -1242,46 +721,42 @@ % \end{macro}^^A \@pagesizelast % % \begin{macro}{\set@pdftexpagesize} -% \changes{v2.95}{2002/08/27}{neu (intern)}^^A -% \changes{v3.20}{2015/07/10}{falls \cs{pdfpage\dots} nicht existiert wird -% \cs{page\dots} probiert (angekündigt für lua\TeX{}~0.80.1)}^^A +% \changes{v2.95}{2002/08/27}{new (internal)}^^A +% \changes{v3.20}{2015/07/10}{if \cs{pdfpage\dots} does not exist +% \cs{page\dots} will be tried (needed for lua\TeX{}~0.80.1)}^^A % \begin{macro}{\set@dvipspagesize} -% \changes{v2.95}{2002/08/27}{neu (intern)}^^A -% \changes{v3.02c}{2009/02/13}{\texttt{seascape} wird beachtet} -% \changes{v3.02c}{2009/02/14}{funktioniert auch im Dokument}^^A -% \changes{v3.12}{2012/02/06}{nicht ausgeführtes -% \cs{let}\cs{if@tempswa}\cs{if@dvips} funktioniert auch noch, wenn -% letzteres nicht definiert ist} +% \changes{v2.95}{2002/08/27}{new (internal)}^^A +% \changes{v3.02c}{2009/02/13}{respecting \Option{seascape}} +% \changes{v3.02c}{2009/02/14}{can be used inside the document}^^A +% \changes{v3.12}{2012/02/06}{not expanded +% \cs{let}\cs{if@tempswa}\cs{if@dvips} does even work is the later is not +% yet defined} % \begin{macro}{\setnot@dvipspagesize} -% \changes{v2.95}{2002/08/27}{neu (intern)}^^A +% \changes{v2.95}{2002/08/27}{new (internal)}^^A % \begin{macro}{\set@dvipdfmxpagesize} -% \changes{v3.05a}{2010/03/18}{neu (intern)}^^A +% \changes{v3.05a}{2010/03/18}{new (internal)}^^A % \begin{macro}{\set@vtexpagesize} -% \changes{v2.95}{2002/08/27}{neu (intern)}^^A +% \changes{v2.95}{2002/08/27}{new (internal)}^^A % \begin{macro}{\scr@updatedvipspagesize} -% \changes{v3.02c}{2009/02/14}{neu (intern)}^^A -% \changes{v3.12}{2013/05/10}{deaktiviert, wenn \cs{XeTeXversion} existiert} -% Damit die Option \texttt{pagesize} überhaupt funktionieren kann, -% werden einige interne Makros benötigt. +% \changes{v3.02c}{2009/02/14}{new (internal)}^^A +% \changes{v3.12}{2013/05/10}{deactivated, if \cs{XeTeXversion} exists}^^A +% Option \Option{pagesize} needs some internal macros. % \begin{description} -% \item{Achtung:} die Definition dieser Makros ändert sich teilweise -% bei ihrem Aufruf und insgesamt bei -% \texttt{\cs{begin}\{document\}}. +% \item{Attention:} The definition of these macros may change at usage of +% themselves or at |\begin{document}|. % \end{description} -% Hier zunächst ihre ggf. geänderte Definition nach -% \texttt{\cs{begin}\{document\}}: +% First of all the definition from |\begin{document}|: % \begin{macrocode} \expandafter\ifnum\scr@ta@v@is@gt{3.02b}\relax \renewcommand*{\set@dvipspagesize}{% % \end{macrocode} -% \changes{v3.12}{2012/11/23}{nur im DVI- und PS-Fall das Papierformatupdate -% durchführen}^^A -% \changes{v3.12}{2012/02/06}{nicht ausgeführtes -% \cs{let}\cs{if@tempswa}\cs{if@dvips} funktioniert auch noch, wenn -% letzteres nicht definiert ist} -% Es wird getestet, ob unspezfizierte DVI-Ausgabe oder spezifizierte -% PS-Ausgabe verwendet wird. Nur in diesen Fällen wird der PS-Code für das -% Papierformatupdate eingefügt. +% \changes{v3.12}{2012/11/23}{use paper size update only for DVI and PS}^^A +% \changes{v3.12}{2012/02/06}{not expanded +% \cs{let}\cs{if@tempswa}\cs{if@dvips} does even work is the later is not +% yet defined}^^A +% Test whether unspecified \textsc{DVI} output or specified \textsc{PS} output +% is used. Only in that cases the \textsc{PS} code for paper size updates will +% be used. % \begin{macrocode} \begingroup \@tempswafalse @@ -1301,13 +776,12 @@ \reserved@a }{% % \end{macrocode} -% Wenn \textsf{atbegshi} geladen wurde, bzw. \cs{AtBeginShipoutNext} zur -% Verfügung steht, dann soll dieser Code noch vor Code ausgeführt werden, der -% eventuell in \cs{shipout} eingeschleust wurde. Das funktioniert leider nicht -% wirklich zuverlässig. Sollte zwischen dem Aufruf von \cs{set@dvipspagesize} -% (also der Neuberechnung des Satzspiegels) und der Ausgabe der Seite doch -% noch etwas per \cs{AtBeginShipout} oder \cs{AtBeginShipoutNext} eingefügt -% werden, dann gehen diese Teile verloren! +% If \cs{AtBeginShipoutNext} is available (mostly because of loading package +% \Package{atbegshi}) use it so execute the code at least before other code +% that has been added to \cs{shipout}. Unfortunately this is not reliable. If +% \cs{AtBeginShipout} is used after \cs{set@dvipspagesize} (this means the +% recalculation of the typing area and the margins) but before the current +% page has been shipped out the code of such \cs{AtBeginShipout} will be lost! % \begin{macrocode} \begingroup \protected@edef\reserved@a{\endgroup @@ -1324,13 +798,13 @@ }% }{% % \end{macrocode} -% Wenn \textsf{everyshi} geladen wurde, bzw. \cs{AtNextShipout} zur -% Verfügung steht, dann soll dieser Code noch vor Code ausgeführt werden, der -% eventuell in \cs{shipout} eingeschleust wurde. Das funktioniert leider nicht -% wirklich zuverlässig. Sollte zwischen dem Aufruf von \cs{set@dvipspagesize} -% (also der Neuberechnung des Satzspiegels) und der Ausgabe der Seite doch -% noch etwas per \cs{AtNextShipout} oder \cs{EveryShipout} eingefügt -% werden, dann gehen diese Teile verloren! +% If \cs{AtNextShipout} is available (mostly because of loading package +% \Package{everyshi} use it to execute the code at least before other code +% that has been added to \cs{shipout}. Unfortunately this is not reliable. If +% \cs{AtNextShipout} or \cs{EveryShipout} is used after \cs{set@dvipspagesize} +% (this means the recalculation of the typing area and the margins) but before +% the current page has been shipped out the code of such \cs{AtNextShipout} or +% \cs{EveryShipout} will be lost! % \begin{macrocode} \begingroup \protected@edef\reserved@a{\endgroup @@ -1346,9 +820,9 @@ }% \else % \end{macrocode} -% In diesem Fall (nämlich weder DVI- noch PS-Ausgabe) muss nur die Gruppe, die -% eingefügt wurde, um die Änderung von \cs{if@tempswa} lokal zu halten, -% geschlossen werden. +% In this case (neither \textsc{DVI} nor \textsc{PS} output) we only have to +% finish the group that has been used to keep changes of \cs{if@tempswa} +% local. % \begin{macrocode} \endgroup \fi @@ -1363,12 +837,11 @@ }% } % \end{macrocode} -% Und jetzt die Definitionen bevor \texttt{\cs{begin}\{document\}}, die -% allerdings erst innerhalb von \texttt{\cs{begin}\{document\}} das erste Mal -% ausgeführt werden: -% \changes{3.21}{2016/05/27}{fehlender Backslash ergänzt (zweimal)} +% And now the definition that is used before |\begin{document}| but executed +% the first time inside |\begin{document}|. +% \changes{3.21}{2016/05/27}{two missing backslashs added} % \begin{macrocode} -\newcommand{\set@pdftexpagesize}{% +\newcommand*{\set@pdftexpagesize}{% \scr@ifundefinedorrelax{pdfpagewidth}{% \scr@ifundefinedorrelax{pagewidth}{}{\pagewidth=\paperwidth}% }{\pdfpagewidth=\paperwidth}% @@ -1376,7 +849,7 @@ \scr@ifundefinedorrelax{pageheight}{}{\pageheight=\paperheight}% }{\pdfpageheight=\paperheight}% } -\newcommand{\set@dvipspagesize}{% +\newcommand*{\set@dvipspagesize}{% \begingroup \@tempswafalse \scr@ifdvioutput{\@tempswatrue}{% @@ -1386,11 +859,11 @@ }{}% }{}% % \end{macrocode} -% \changes{v3.22}{2016/08/04}{\textsf{preview}-Notlösung}^^A -% Wenn Paket \textsf{preview} mit Option \texttt{tightpage} geladen wurde, was -% an dem Vorhandensein von \cs{pr@nextbb} erkannt werden kann, und das Paket -% überhaupt aktiv ist, dann verzichten wir hier auf das DVI-special, weil es -% dann bei Verwendung von Xe\LaTeX{} ggf. stört. +% \changes{v3.22}{2016/08/04}{\textsf{preview} workaround}^^A +% If package \Package{preview} has been loaded with option \Option{tightpage}, +% which can be recognized by a defined macro \cs{pr@nextbb}, and if the +% package is active, we do not add \textsc{DVI} specials, because it would +% disturb Xe\LaTeX. % \begin{macrocode} \scr@ifundefinedorrelax{pr@nextbb}{}{% \expandafter\ifx\csname ifPreview\expandafter\endcsname @@ -1403,537 +876,528 @@ \fi }% \if@tempswa - \endgroup - \AtBeginDvi{% - \special{papersize=\the\paperwidth,\the\paperheight}% - \if@seascape\special{! TeXDict begin /landplus90{true}store end }\fi - }% - \expandafter\ifnum\scr@ta@v@is@gt{3.02b}\relax - \let\set@dvipspagesize=\@empty - \else - \let\set@dvipspagesize=\setnot@dvipspagesize - \fi - \else - \endgroup - \fi -} -\newcommand{\setnot@dvipspagesize}{% - \scr@ifdvioutput{% - \PackageWarning{% - typearea% - }{% - With dvi output option `pagesize=auto',\MessageBreak - `pagesize=automedia' or `pagesize=dvips'\MessageBreak - may be used only once at preamble.\MessageBreak - Option ignored% - }% - }{}% -} -\newcommand*{\set@dvipdfmxpagesize}{% - \scr@ifdvioutput{% - \AtBeginDvi{% - \special{papersize=\the\paperwidth,\the\paperheight}% - }% - }{}% -} -\newcommand{\set@vtexpagesize}{% - \ifnotundefined{mediawith}{\mediawidth=\paperwidth}{}% - \ifnotundefined{mediaheight}{\mediaheight=\paperheight}{}% -} -\newcommand*{\scr@updatedvipspagesize}{% - \scr@ifundefinedorrelax{XeTeXversion}{% - \special{ps::\@percentchar\@percentchar - PageBoundingBox: 0 0 \the\numexpr\paperwidth/\dimexpr 1bp\relax\relax - \space \the\numexpr\paperheight/\dimexpr 1bp\relax\relax^^J% - \@percentchar\@percentchar BeginPageSetup^^J% - << /PageSize [\the\numexpr\paperwidth/\dimexpr 1bp\relax\relax\space - \the\numexpr\paperheight/\dimexpr 1bp\relax\relax] - >> setpagedevice^^J%<< - 0 0 bop^^J% - \@percentchar\@percentchar EndPageSetup}% - }{}% -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{option} -% -% -% \begin{option}{dvips} -% \changes{v2.7g}{2001/04/17}{neue Option}^^A -% \changes{v2.95}{2002/08/27}{neu implementiert}^^A -% \changes{v2.98c}{2008/04/09}{Ersatz geändert}^^A -% \changes{v2.98c}{2008/04/09}{Info statt Warnung}^^A -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% Die Option ist obsolete und wird nun über die Option -% \texttt{pagesize} implementiert. Obwohl die Verwendung von -% \texttt{pagesize=automedia} zu einer Warnung führen kann, wird hier nur -% informiert. -% \begin{macrocode} -\KOMA@DeclareStandardOption[typearea]{dvips}{% - pagesize=automedia% -} -% \end{macrocode} -% \end{option} -% -% \begin{option}{pdftex} -% \changes{v2.7g}{2001/04/17}{neue Option}^^A -% \changes{v2.95}{2002/08/27}{neu implementiert}^^A -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% Die Option ist obsolete und wird nun über die Option -% \texttt{pagesize} implementiert. -% \begin{macrocode} -\KOMA@DeclareStandardOption[typearea]{pdftex}{% - pagesize=pdftex% -} -% \end{macrocode} -% \end{option} -% -% -% \subsubsection{Papiergrößen-Optionen} -% -% Die folgende Option bestimmt die Papiergröße und -ausrichtung. Aus -% der Papiergröße wird später mit \cs{typearea} der Satzspiegel -% berechnet. Darüber hinaus wäre das eine passende Gelegenheit -% \cs{SetDIVList} anzuwenden, darauf wird aber verzichtet, da die -% Verwendung der Liste ohnehin als veraltete Methode betrachtet werden -% kann. -% -% \begin{option}{a4paper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{a5paper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{b5paper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{letterpaper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{legalpaper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{executivepaper} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{landscape} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% \begin{option}{portrait} -% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} durch \cs{PackageInfoNoLine} -% ersetzt} -% \changes{v3.01a}{2008/11/21}{standard statt obsolet}^^A -% Die Formate, die auch bei den Standardklassen definiert sind, werden -% als Sonderfall explizit definiert. Dadurch ist ein Wechsel der -% Klasse bzw. die Verwendung von \textsf{typearea} mit den -% Standardklassen einfacher. Aus Kompatibilitätsgründen werden auch -% die übrigen Papiergrößenoptionen später noch per Mustererkennung -% verarbeitet. -% \begin{macrocode} -\KOMA@DeclareStandardOption[typearea]{a4paper}{paper=a4} -\KOMA@DeclareStandardOption[typearea]{a5paper}{paper=a5} -\KOMA@DeclareStandardOption[typearea]{b5paper}{paper=b5} -\KOMA@DeclareStandardOption[typearea]{letterpaper}{paper=letter} -\KOMA@DeclareStandardOption[typearea]{legalpaper}{paper=legal} -\KOMA@DeclareStandardOption[typearea]{executivepaper}{paper=executive} -\KOMA@DeclareStandardOption[typearea]{landscape}{paper=landscape} -\KOMA@DeclareStandardOption[typearea]{portrait}{paper=portrait} -% \end{macrocode} -% \end{option} -% \end{option} -% \end{option} -% \end{option} -% \end{option} -% \end{option} -% \end{option} -% \end{option} -% -% \begin{option}{paper} -% \changes{v2.95}{2002/12/03}{neu implementiert}^^A -% \changes{v3.01b}{2008/12/09}{Höhe und Breite vertauscht}^^A -% \changes{v3.02c}{2009/02/12}{neuer Wert \texttt{seascape}} -% \changes{v3.12}{2013/03/05}{Verwendung der Status-Signalisierung mit -% \cs{FamilyKeyState}}^^A -% \changes{v3.22}{2016/07/29}{Papierausrichtung entsprechend dem -% tatsächlichen Format}^^A -% Im Normalfall wird die Papiergröße jedoch über diese Option -% gesetzt. Dabei sind neben den Standard- und den ISO-Reihen A, B, C -% und D auch Wertepaare der Form -% "`\texttt{(\meta{Breite},\meta{Höhe})}"' und die Angaben -% "`\texttt{portrait}"' und "`\texttt{landscape}"' erlaubt. -% \begin{macrocode} -\KOMA@key{paper}{% - \ifstr{#1}{seascape}{% - \@seascapetrue - \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax - \@landscapetrue - \scr@setpaperorientation - \else - \if@landscape\else\scr@switchpapersizes\@landscapetrue\fi - \fi - \FamilyKeyStateProcessed - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{seascape}% - }{% - \ifstr{#1}{landscape}{% - \@seascapefalse - \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax - \@landscapetrue - \scr@setpaperorientation - \else - \if@landscape\else\scr@switchpapersizes\@landscapetrue\fi - \fi - \FamilyKeyStateProcessed - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{landscape}% - }{% - \ifstr{#1}{portrait}{% - \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax - \@landscapefalse - \scr@setpaperorientation - \else - \if@landscape\scr@switchpapersizes\@landscapefalse\fi - \fi - \FamilyKeyStateProcessed - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{landscape}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{portrait}% - \KOMA@kav@remove{.typearea.\scr@pkgextension}{paper}{seascape}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{portrait}% - }{% - \ifstr{#1}{letter}{% - \if@landscape - \setlength\paperheight{8.5in}% - \setlength\paperwidth {11in}% - \else - \setlength\paperheight{11in}% - \setlength\paperwidth {8.5in}% - \fi - \FamilyKeyStateProcessed - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{letter}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \if@seascape seascape\else - \if@landscape landscape\else portrait\fi\fi - }% - }{% - \ifstr{#1}{legal}{% - \if@landscape - \setlength\paperheight{8.5in}% - \setlength\paperwidth {14in}% - \else - \setlength\paperheight{14in}% - \setlength\paperwidth {8.5in}% - \fi - \FamilyKeyStateProcessed - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{legal}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \if@seascape seascape\else - \if@landscape landscape\else portrait\fi\fi - }% - }{% - \ifstr{#1}{executive}{% - \if@landscape - \setlength\paperheight{7.25in}% - \setlength\paperwidth {10.5in}% - \else - \setlength\paperheight{10.5in}% - \setlength\paperwidth {7.25in}% - \fi - \FamilyKeyStateProcessed - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{paper}{executive}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \if@seascape seascape\else - \if@landscape landscape\else portrait\fi\fi - }% - }{% - \iso@paper{#1}% - \if@tempswa - \FamilyKeyStateProcessed - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{#1}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \if@seascape seascape\else - \if@landscape landscape\else portrait\fi\fi - }% - \else - \expandafter\maybe@pair#1::\@nil - \if@tempswa - \FamilyKeyStateProcessed - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{paper}% - \expandafter\ifnum \scr@ta@v@is@lt{3.01b}\relax - \PackageWarningNoLine{typearea}{% - You may have to exchange height and width!\MessageBreak - Until KOMA-Script version 3.01b the semantic\MessageBreak - of option `paper' was `paper=height:width'\MessageBreak - instead of `paper=width:height'.\MessageBreak - I've switched back to that old interpretation\MessageBreak - because of the given compatiblity settings}% - \setlength\paperwidth{\@tempb}% - \setlength\paperheight{\@tempa}% - \else - \setlength\paperwidth{\@tempa}% - \setlength\paperheight{\@tempb}% - \fi - \expandafter\ifnum \scr@ta@v@is@lt{3.22}\relax - \if@landscape - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{\@tempa:\@tempb}% - \else - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{\@tempb:\@tempa}% - \fi - \else - \scr@setpaperorientation - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \the\paperwidth:\the\paperheight}% - \fi - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{paper}{% - \if@seascape seascape\else - \if@landscape landscape\else portrait\fi\fi - }% - \else - \KOMA@unknown@keyval{paper}{#1}{% - `letter', `legal', `executive', `a', `b', - `c', `d',\MessageBreak - `:', `landscape' and `portrait'% - }% - \fi - \fi - }% - }% - }% + \endgroup + \AtBeginDvi{% + \special{papersize=\the\paperwidth,\the\paperheight}% + \if@seascape\special{! TeXDict begin /landplus90{true}store end }\fi }% + \expandafter\ifnum\scr@ta@v@is@gt{3.02b}\relax + \let\set@dvipspagesize=\@empty + \else + \let\set@dvipspagesize=\setnot@dvipspagesize + \fi + \else + \endgroup + \fi +} +\newcommand*{\setnot@dvipspagesize}{% + \scr@ifdvioutput{% + \PackageWarning{% + typearea% + }{% + With dvi output option `pagesize=auto',\MessageBreak + `pagesize=automedia' or `pagesize=dvips'\MessageBreak + may be used only once at preamble.\MessageBreak + Option ignored% }% - }% + }{}% } -% \end{macrocode} -% \begin{macro}{\if@seascape} -% \changes{v3.02c}{2009/02/12}{neu}^^A -% \begin{macro}{\@seascapetrue} -% \changes{v3.02c}{2009/02/12}{neu}^^A -% \begin{macro}{\@seascapefalse} -% \changes{v3.02c}{2009/02/12}{neu}^^A -% In diesem Schalter wird nur gespeichert, ob Breitformat ggf. umgekehrt -% verwendet werden soll. Dies macht derzeit nur bei Verwendung von dvips einen -% Unterschied! -% \begin{macrocode} -\newif\if@seascape +\newcommand*{\set@dvipdfmxpagesize}{% + \scr@ifdvioutput{% + \AtBeginDvi{% + \special{papersize=\the\paperwidth,\the\paperheight}% + }% + }{}% +} +\newcommand*{\set@vtexpagesize}{% + \ifnotundefined{mediawith}{\mediawidth=\paperwidth}{}% + \ifnotundefined{mediaheight}{\mediaheight=\paperheight}{}% +} +\newcommand*{\scr@updatedvipspagesize}{% + \scr@ifundefinedorrelax{XeTeXversion}{% + \special{ps::\@percentchar\@percentchar + PageBoundingBox: 0 0 \the\numexpr\paperwidth/\dimexpr 1bp\relax\relax + \space \the\numexpr\paperheight/\dimexpr 1bp\relax\relax^^J% + \@percentchar\@percentchar BeginPageSetup^^J% + << /PageSize [\the\numexpr\paperwidth/\dimexpr 1bp\relax\relax\space + \the\numexpr\paperheight/\dimexpr 1bp\relax\relax] + >> setpagedevice^^J%<< + 0 0 bop^^J% + \@percentchar\@percentchar EndPageSetup}% + }{}% +} +% % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -% \begin{macro}{\if@landscape} -% \begin{macro}{\@landscapetrue} -% \begin{macro}{\@landscapefalse} -% In diesem Schalter wird gespeichert, ob Hoch- oder Breitformat -% verwendet wird. -% \begin{macrocode} -\newif\if@landscape -% \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -% \begin{macro}{\maybe@pair} -% \changes{v2.95}{2002/12/03}{neu (intern)}^^A -% \changes{v2.97e}{2007/11/26}{funktioniert zum ersten Mal}^^A -% Testet, ob der nachfolgende Parameter die Form -% "`\meta{erstes Argument}:\meta{zweites Argument}"' hat. -% Wenn ja, wird \cs{@tempa} mit dem ersten und \cs{@tempb} mit dem -% zweiten Argument definiert. -% \begin{macrocode} -\newcommand*{\maybe@pair}{} -\def\maybe@pair#1:#2:#3\@nil{% - \edef\@tempa{#1}\edef\@tempb{#2}% - \ifx\@tempa\@empty\@tempswafalse\else - \ifx\@tempb\@empty\@tempswafalse\else\@tempswatrue\fi - \fi +% \end{option} +% +% \begin{option}{dvips} +% \changes{v2.7g}{2001/04/17}{new}^^A +% \changes{v2.95}{2002/08/27}{new implementation}^^A +% \changes{v2.98c}{2008/04/09}{replacement changed}^^A +% \changes{v2.98c}{2008/04/09}{info instead of warning}^^A +% \changes{v3.01a}{2008/11/21}{it's a standard option not deprecated}^^A +% This option is a kind of obsolete. It is now implemented using +% \Option{pagesize}. But because this is a standard option using several other +% packages we only show a standard option information instead of a deprecated +% option warning. Note: Usage of \Option{pagesize=automedia} can still result +% in a warning message! +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@DeclareStandardOption[typearea]{dvips}{% + pagesize=automedia% } +% % \end{macrocode} -% \end{macro} % \end{option} % -% \subsubsection{\textsf{geometry} Berücksichtigung]} -% -% \begin{option}{usegeometry} -% \changes{v3.17}{2015/02/07}{neue Option}^^A -% Mit dieser Option kann eingestellt werden, dass \cs{activateareas} die -% Einstellungen außerdem an das Paket \textsf{geometry} übergeben soll. -% \begin{macrocode} -\KOMA@ifkey{usegeometry}{@ta@usegeometry} +% \begin{option}{pdftex} +% \changes{v2.7g}{2001/04/17}{new}^^A +% \changes{v2.95}{2002/08/27}{new implementation}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{it's a standard option not deprecated}^^A +% This option is a kind of obsolete. It is now implemented using +% \Option{pagesize}. But because this is a standard option using several other +% packages we only show a standard option information instead of a deprecated +% option warning. +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@DeclareStandardOption[typearea]{pdftex}{% + pagesize=pdftex% +} +% % \end{macrocode} % \end{option} % +% \subsection{Influencing left and right margin proportions} +% +% Options like \Option{twoside} or \Option{twocolumn} influence the +% proportions of the left and right margin and indirectly also the top and the +% bottom margin. They are also very important for the document classes. +% +% \begin{option}{oneside} +% \changes{v2.97e}{2007/11/23}{pass option from class to +% \Package{typearea}}^^A +% \changes{v3.01a}{2008/11/21}{it's a standard option not deprecated}^^A +% \begin{option}{twoside} +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v2.97e}{2007/11/23}{pass option from class to +% \Package{typearea}}^^A +% \changes{v3.00}{2008/07/09}{new option \Option{twoside!=semi}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \changes{v3.13a}{2014/04/09}{the class also uses status signaling with +% \cs{FamilyKeyStateProcessed}}^^A +% \changes{v3.17}{2015/03/17}{automatic usage of \cs{flushbottom} and +% \cs{raggedbottom}}^^A +% \changes{v3.17}{2015/03/17}{early setting of default}^^A +% \changes{v3.17}{2015/03/18}{use \cs{cleardoubleoddpage} if available}^^A +% \begin{macro}{\if@semitwoside} +% \changes{v3.00}{2008/07/09}{new boolean switch (intern)}^^A +% \begin{macro}{\if@twoside} +% \changes{v3.00}{2008/07/09}{switch also sets \cs{if@semitwoside}}^^A +% Do we have a single sided or double sided layout? % \begin{macrocode} +%<*package&typearea&options> +\newif\if@semitwoside +\g@addto@macro\@twosidetrue\@semitwosidefalse +\g@addto@macro\@twosidefalse\@semitwosidefalse +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macrocode} +%<*(class|(package&typearea))&options> +\KOMA@key{twoside}[true]{% +% \if@atdocument\else\PassOptionsToPackage{twoside=#1}{typearea}\fi% +%<*package> + \if@atdocument\if@twoside + \scr@ifundefinedorrelax{cleardoubleoddpage}{% + \cleardoublepage + }{% + \cleardoubleoddpage + }% + \else\clearpage\fi\fi % + \ifstr{#1}{semi}{% + \@twosidetrue +% \@semitwosidetrue + \FamilyKeyStateProcessed + }{% + \def\FamilyElseValue{, `semi'}% + \KOMA@set@ifkey{twoside}{% % \end{macrocode} -% -% -% \subsubsection{Geparste Optionen} -% -% Die Behandlung für \texttt{BCOR\emph{Wert}}, \texttt{DIV\emph{Wert}} und -% \texttt{a\emph{Wert}paper}, \texttt{b\emph{Wert}paper}, -% \texttt{c\emph{Wert}paper} sowie \texttt{d\emph{Wert}paper} und -% \texttt{\emph{Wert}headlines}. -% \changes{v2.97c}{2007/09/12}{\cs{lco@test} bei den geparsten Optionen -% eingefügt} +% \changes{v3.20}{2015/11/02}{not existing order dependency of +% \Option{twocolumn} and \Option{twoside} fixed}^^A +% From v3.17 until 3.19a the classes used a local switch +% \Macro{if@tempswa}. As a result of this option \Option{twocolumn} was not +% able to recognize double sided layout. Because of this it was essential to +% handle option \Option{twocolumn} before option \Option{twoside}. This has +% been solved using \Macro{if@twoside} in the classes too. Another solution +% could have been to move the implementation and execution of +% \Option{twocolumn} before \Option{twoside}. But I don't know whether or not +% this would have been reliable and the solution here is more simple. % \begin{macrocode} -\DeclareOption*{% -% \lco@test - \x@paper} + @twoside% + }{#1}% + }% + \ifx\FamilyKeyState\FamilyKeyStateProcessed +%<*class> + \expandafter\ifnum\scr@v@is@ge{3.17}% +%<*!letter> + \if@twoside\flushbottom + \else\if@twocolumn\flushbottom\else\raggedbottom\fi\fi +% +% \raggedbottom + \fi +% + \KOMA@kav@xreplacevalue{.% +% \KOMAClassFileName +% typearea.\scr@pkgextension + }{twoside}{#1}% +%<*package> + \if@twoside + \if@semitwoside + \@mparswitchfalse + \else + \@mparswitchtrue + \fi + \else + \@mparswitchfalse + \fi% + \csname recalctypearea\endcsname +% + \fi +} +%<*class> +%\KOMAExecuteOptions{twoside=true} +%\KOMAExecuteOptions{twoside=false} +% +%<*package> +\KOMA@kav@xadd{.typearea.\scr@pkgextension}{twoside}{% + \if@twoside true\else false\fi +} +% +\KOMA@DeclareStandardOption% +% [typearea]% + {oneside}{twoside=false} +% % \end{macrocode} +% \end{option}^^A twoside +% \end{option}^^A oneside % -% \iffalse -% Der Rest gehört nicht mehr zu den Optionen. -% -%<*body> +% \begin{option}{onecolumn} +% \changes{v2.95}{2002/12/04}{option moved to package \Package{typearea}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v2.97e}{2007/11/23}{the classes pass the option to +% \Package{typearea}}^^A +% \changes{v3.01a}{2008/11/21}{standard option but not deprecated}^^A +% \begin{option}{twocolumn} +% \changes{v2.95}{2002/12/04}{option moved to package \Package{typearea}}^^A +% \changes{v2.97e}{2007/11/23}{the classes pass the option to +% \Package{typearea}}^^A +% \changes{v2.98a}{2007/01/08}{passing the correct option}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \changes{v3.13a}{2014/04/09}{the class also uses status signaling with +% \cs{FamilyKeyStateProcessed}}^^A +% \changes{v3.20}{2016/02/16}{\cs{sloppy}, \cs{raggedbottom} and +% \cs{flushbottom} delayed}^^A +% Do we have a single column or two columns layout? +% \begin{macrocode} +%<*(class|(package&typearea))&options> +\KOMA@key{twocolumn}[true]{% +% \if@atdocument\else\PassOptionsToPackage{twocolumn=#1}{typearea}\fi% +%<*package> + \if@atdocument\clearpage\fi +% + \KOMA@set@ifkey{twocolumn}{@twocolumn}{#1}% + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \KOMA@kav@replacebool{.% +% \KOMAClassFileName +% typearea.\scr@pkgextension + }{twocolumn}{@twocolumn}% +% \csname recalctypearea\endcsname +%<*class> + \if@atdocument\expandafter\@firstofone + \else\@ifpackageloaded{typearea}{\expandafter\@firstofone} + {\expandafter\AtEndOfClass}\fi + {\expandafter\ifnum\scr@v@is@ge{3.17}% + \if@twocolumn\twocolumn\sloppy\flushbottom + \else\onecolumn\if@twoside\flushbottom\else\raggedbottom\fi\fi + \fi}% +% + \fi +} +%<*class> +\AtEndOfClass{% + \expandafter\ifnum\scr@v@is@lt{3.17}% +%<*!letter> + \if@twocolumn\twocolumn\sloppy\flushbottom + \else\onecolumn\if@twoside\flushbottom\else\raggedbottom\fi\fi +% +% \raggedbottom + \fi +} +\KOMAExecuteOptions{twocolumn=false} +% %<*package> -% \fi +\KOMA@kav@xadd{.typearea.\scr@pkgextension}{twocolumn}{% + \if@twocolumn true\else false\fi +} +% +\KOMA@DeclareStandardOption% +% [typearea]% + {onecolumn}{twocolumn=false} +% +% \end{macrocode} +% \end{option}^^A twocolumn +% \end{option}^^A onecolumn % % -% \subsubsection{Konfigurationsdatei} +% \subsection{Influencing size of head and foot and margins} % -% \changes{v2.0e}{1994/10/28}{Konfigurationsdatei -% \texttt{typearea.cfg} zur Definition weiterer Optionen -% bzw. Papiergrößen} -% Es ist möglich in einer Datei \texttt{typearea.cfg} z.\,B. weitere -% Optionen zu definieren, die dann automatisch eingeladen werden. +% We have several options to influence the head hight and the foot height and +% whether or not these are part of the typing area or the margins. We have also +% an option to decide whether or not the margin notes are part of the typing +% area or not. +% +% \begin{option}{headlines} +% \changes{v2.95}{2002/12/06}{new implementation using \textsf{keyval}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \begin{option}{footlines} +% \changes{v3.12}{2013/03/26}{new}^^A +% These are two of the recommended options to set the height of the page head +% and footer. Here we set the height by the number of base lines. The number +% is a factor to \cs{baselineskip} and therefore a real number. % \begin{macrocode} -\InputIfFileExists{typearea.cfg}{% - \typeout{% - ***************************************^^J% - * Local config file typearea.cfg used^^J% - ***************************************% - } -}{} +%<*package&typearea&options> +\KOMA@key{headlines}{% + \begingroup + \setlength{\@tempdima}{#1\baselineskip}% + \endgroup + \def\ta@hh{#1\baselineskip}% + \FamilyKeyStateProcessed + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headlines}{#1}% + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headheight}{#1\baselineskip}% +} +\KOMA@key{footlines}{% + \begingroup + \setlength{\@tempdima}{#1\baselineskip}% + \endgroup + \def\ta@fh{#1\baselineskip}% + \FamilyKeyStateProcessed + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footlines}{#1}% + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footheight}{#1\baselineskip}% +} +% +% \end{macrocode} +% \end{option} +% \end{option} +% +% \begin{option}{headheight} +% \changes{v2.98c}{2008/04/06}{new}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% \begin{option}{footheight} +% \changes{v3.12}{2013/03/26}{new}^^A +% Instead of setting the height of the page head or footer by the number of +% base lines, we can set it also using a length or length value. Note, via +% \Macro{documenclass} or \Macro{usepackage} only length values are supported +% (due to an expansion problem by the \LaTeX{} kernel with both commands). +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{headheight}{% + \begingroup + \setlength{\@tempdima}{#1}% + \endgroup + \def\ta@hh{#1}% + \FamilyKeyStateProcessed + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{headheight}{#1}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{headlines}% +} +\KOMA@key{footheight}{% + \begingroup + \setlength{\@tempdima}{#1}% + \endgroup + \def\ta@fh{#1}% + \FamilyKeyStateProcessed + \KOMA@kav@replacevalue{.typearea.\scr@pkgextension}{footheight}{#1}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{footlines}% +} +% % \end{macrocode} +% \end{option} +% \end{option} % -% -% \subsubsection{Standardoptionen} -% -% Als Standardoptionen sind \texttt{headinclude=false}, -% \texttt{footinclude=false} und die Papiergröße \texttt{paper=A4} -% eingestellt. Diese Optionen können selbstverständlich durch -% explizite Angaben überladen werden. -% \changes{v2.3h}{1995/01/19}{\cs{relax} nach \cs{ProcessOptions} -% ergänzt.}^^A -% \changes{v2.96}{2006/08/18}{Optionen werden in Reihenfolge der Angabe statt -% in Reihenfolge der Deklaration abgearbeitet.}^^A -% \changes{v2.97c}{2007/04/19}{Verwendung von \cs{KOMAExecuteOptions} an -% Stelle von \cs{KOMAoptions} und \cs{KOMAProcessOptions} an Stelle von -% \cs{ProcessOptions}}^^A -% \changes{v2.97c}{2007/04/19}{Optionen, die der Voreinstellung ohnehin -% entsprechen, werden nicht explizit gesetzt}^^A -% \changes{v2.97c}{2007/07/18}{Option \texttt{twoside} wird explizit passend -% gesetzt}^^A -% \changes{v3.12}{2013/11/11}{die voreingestellte Papiergröße kann via -% \cs{defaultpagesize} auch in \texttt{typearea.cfg} verändert werden}^^A -% \changes{v3.17}{2015/03/02}{Defaulteinstellung \texttt{pagesize}}^^A -% \begin{macro}{\defaultpapersize} -% \changes{v3.12}{2013/11/11}{Neue Anweisung}^^A +% \begin{option}{headinclude} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% This options determines whether or not the head is part of the typing +% area. +% \begin{option}{headexclude} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{deprecated}^^A +% \begin{macro}{\if@hincl} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \changes{v2.97c}{2007/04/19}{direct initialization via \cs{if@hsl}, +% if already defined}^^A +% \begin{macro}{\@hincltrue} +% \begin{macro}{\@hinclfalse} +% We use a boolean switch to store the decision. % \begin{macrocode} -\providecommand*{\defaultpapersize}{A4} +%<*package&typearea&options> +\newif\if@hincl\@ifundefined{if@hsl}{}{\let\if@hincl\if@hsl} +\KOMA@ifkey{headinclude}{@hincl} +\KOMA@DeclareDeprecatedOption[typearea]{headexclude}{headinclude=false} +% % \end{macrocode} % \end{macro} -% \begin{macrocode} -\KOMAExecuteOptions{paper=\defaultpapersize,pagesize} -\if@twoside - \if@semitwoside - \KOMAExecuteOptions{twoside=semi} - \else - \KOMAExecuteOptions{twoside} +% \end{macro} +% \end{macro} +% \end{option} +% \end{option} +% +% \begin{option}{headsepline} +% \changes{v3.20}{2015/12/12}{\Package{typearea} itself reacts on +% \Option{headsepline}}^^A +% Until \KOMAScript{} v3.20 \Package{typearea} was not able to handle +% sequences of options \Option{headsepline} and \Option{headinclude} to get +% always a correct result. Until v3.18a \Option{headinclude} was prioritized +% against \Option{headsepline} if used as global options but not if used via +% \Macro{KOMAoptions}. In v3.18a a bug has been fixed with the result that +% \Option{headsepline} was prioritized against \Option{headinclude} if used +% as global options. But intentionally +% \Option{headinclude=false,}\Option{headsepline} or +% \Option{headinclude=true,}\Option{headsepline=false} always should use the +% setting of option \Option{headsepline} independent of setting this as +% global options or using \Macro{KOMAoptions}. Similar with +% \Option{headsepline,}\Option{headinclude=false} or +% \Option{headsepline=false,},\Option{headinclude} the setting of +% \Option{headinclude} should be used. To achieve this \Package{typearea} +% itself has to interpret not only \Option{headinclude} but also +% \Option{headsepline} (as an alias of \Option{headinclude}). +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{headsepline}[true]{% + \KOMA@set@ifkey{headinclude}{@hincl}{#1}% + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \KOMA@kav@replacebool{.typearea.\scr@pkgextension}{headinclude}{@hincl}% \fi -\else - \KOMAExecuteOptions{twoside=false} -\fi -\KOMAProcessOptions\relax +} +% % \end{macrocode} +% \end{option}^^A headsepline % -% -% \subsection{Schriftgrößenabhängige Voreinstellungen für \emph{DIV}} -% -% \begin{macro}{\ta@divlist} -% \changes{v2.0e}{1994/10/28}{neu (intern)}^^A -% \changes{v2.6}{2000/01/04}{die Liste umfasst nun Werte ab 1\,pt -% statt ab 10\,pt.}^^A -% \begin{macro}{\ta@divlistelse} -% \changes{v2.6}{2000/01/04}{neu (intern)}^^A -% An dieser Stelle muss noch für die Standardeinstellung der -% \textit{DIV}-Liste gesorgt werden, falls eine solche noch nicht -% definiert wurde. +% \begin{option}{footinclude} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \begin{option}{footexclude} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{deprecated}^^A +% This options determines whether or not the page footer is part of the typing +% area. +% \begin{macro}{\if@fincl} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \changes{v2.97c}{2007/04/19}{direct initialization via \cs{if@fsl}, +% if already defined}^^A +% \begin{macro}{\@fincltrue} +% \begin{macro}{\@finclfalse} +% We use a boolean switch to store the decision. % \begin{macrocode} -\providecommand\ta@divlist{{}{}{}{}{}{}{}{}{}{8}{10}{12}} +%<*package&typearea&options> +\newif\if@fincl\@ifundefined{if@fsl}{}{\let\if@fincl\if@fsl} +\KOMA@ifkey{footinclude}{@fincl} +\KOMA@DeclareDeprecatedOption[typearea]{footexclude}{footinclude=false} +% % \end{macrocode} % \end{macro} -% Wenn kein Defaultwert definiert ist, wird dieser Wert verwendet: -% \begin{macrocode} -\providecommand\ta@divlistelse{1} -% \end{macrocode} % \end{macro} +% \end{macro} +% \end{option} +% \end{option} % -% -% Das waren die Optionen für das Paket oder im ersten Durchlauf der -% Klassen. -% \begin{macrocode} -% +% \begin{option}{footsepline} +% \changes{v3.23}{2017/03/03}{has to set \cs{if@fincl} instead of +% \cs{if@hincl}}^^A +% \changes{v3.20}{2015/12/12}{\Package{typearea} itself reacts on +% \Option{footsepline}}^^A +% Until \KOMAScript{} v3.20 \Package{typearea} was not able to handle +% sequences of options \Option{footsepline} and \Option{footinclude} to get +% always a correct result. Until v3.18a \Option{footinclude} was prioritized +% against \Option{footsepline} if used as global options but not if used via +% \Macro{KOMAoptions}. In v3.18a a bug has been fixed with the result that +% \Option{footsepline} was prioritized against \Option{footinclude} if used +% as global options. But intentionally +% \Option{footinclude=false,}\Option{footsepline} or +% \Option{footinclude=true,}\Option{footsepline=false} always should use the +% setting of option \Option{footsepline} independent of setting this as +% global options or using \Macro{KOMAoptions}. Similar with +% \Option{footsepline,}\Option{footinclude=false} or +% \Option{footsepline=false,},\Option{footinclude} the setting of +% \Option{footinclude} should be used. To achieve this \Package{typearea} +% itself has to interpret not only \Option{footinclude} but also +% \Option{footsepline} (as an alias of \Option{footinclude}). +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{footsepline}[true]{% + \KOMA@set@ifkey{footinclude}{@fincl}{#1}% + \ifx\FamilyKeyState\FamilyKeyStateProcessed + \KOMA@kav@replacebool{.typearea.\scr@pkgextension}{footinclude}{@fincl}% + \fi +} +% % \end{macrocode} +% \end{option}^^A footsepline % -% -% \subsection{Laden des Pakets} -% -% Das Folgende wird nur in einem zweiten Durchlauf in die Klassen -% eingefügt und sorgt für das Laden des \textsf{typearea} Pakets. -% \begin{macrocode} -%<*class> -% \end{macrocode} -% Vor dem Laden müssen noch diverse Makros zurückgesetzt werden, damit -% sie überhaupt in \textsf{typearea} definiert werden können: -% \begin{macrocode} -\let\@BCOR =\relax -\let\@@BCOR =\relax -\let\@DIV =\relax -\let\@@DIV =\relax -\let\@headlines =\relax -\let\@@headlines =\relax -\let\x@paper =\relax -\let\x@@paper =\relax -\let\scr@pti@nerr@r =\relax -% \end{macrocode} -% Jetzt kann geladen werden: -% \changes{v2.95}{2002/06/22}{Beim Laden von \textsf{typearea} wird -% \cs{KOMAScriptVersion} verwendet} -% Die Überprüfung auf die korrekte \KOMAScript-Version geschieht in -% dem Paket (siehe dazu \texttt{scrkernel-version.dtx}). +% \begin{option}{mpinclude} +% \changes{v2.8q}{2002/03/28}{new}^^A +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \begin{option}{mpexclude} +% \changes{v2.8q}{2002/03/28}{new}^^A +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{deprecated}^^A +% Some documents have a lot of large margin notes. Optical these margin notes +% are more part of the typing area than the margin. This options determines +% whether or not margin notes should be part of the typing area. +% \begin{macro}{\if@mincl} +% \changes{v2.95}{2002/07/08}{new implementation using \textsf{keyval}}^^A +% \begin{macro}{\@mincltrue} +% \begin{macro}{\@minclfalse} +% We use a boolean switch to store the decision. Note, if the margin notes are +% part of the typing area, you should increase the divisor. % \begin{macrocode} -\RequirePackage{typearea}[\KOMAScriptVersion] +%<*package&typearea&options> +\KOMA@ifkey{mpinclude}{@mincl} +\KOMA@DeclareDeprecatedOption[typearea]{mpexclude}{mpinclude=false} +% % \end{macrocode} -% Auf diese Art ist sichergestellt, dass immer die Version von -% \textsf{typearea} verlangt wird, die zur gleichen Release wie -% die Klassen gehört. Wobei die Warnungen je nach Zusammentreffen der -% Versionen unterschiedlich ausfallen können. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{option} +% \end{option} +% % -% Für die Kompatibilität mit den Standardklassen muss jetzt ggf. noch der -% Seitenspiegel angepasst werden. Dies geschieht aber nur, wenn ein -% vordefinierter Wert verwendet wurde: +% \subsection{Typing area for the emulation of the standard classes} +% +% For the emulation of the standard classes we need a dedicated size of the +% typing area, if and only if no explicit \Option{DIV} has been given by +% option. The emulation of the standard classes is a class feature. We could +% do it before \Package{typearea} and then deactivate initial setting of +% margins and typing area. But it is more easy to use \cs{areaset} after +% loading \Package{typearea}. The standard letter class cannot be emulated. % \begin{macrocode} -%<*!letter> +%<*class&body&!letter> \if@scr@emulatestandardclasses \ifnum\@lastdiv=\z@ \setlength{\textwidth}{\dimexpr \paperwidth-2in\relax} @@ -1967,74 +1431,310 @@ }\reserved@a \fi \fi -% +% % \end{macrocode} % +% \subsection{Using a predefined divisor depending on the font size} +% +% Some years ago \Package{typearea} provides the feature to use a hard coded +% or user defined divisor depending on the document font size. The feature to +% define such predefined divisors is deprecated, because it can be used only +% for integer font sizes in pt. Nevertheless, for compatibility reasons it is +% still implemented. +% +% \begin{macro}{\ta@divlist} +% \changes{v2.0e}{1994/10/28}{new (internal)}^^A +% \changes{v2.6}{2000/01/04}{the list provides values from font size +% 1\,pt}^^A +% \begin{macro}{\ta@divlistelse} +% \changes{v2.6}{2000/01/04}{neu (internal)}^^A +% We need a default settings for 10\,pt, 11\,pt and 12\,pt. But we define it +% only if they has not been defined before. So classes could define other +% defaults before loading \Package{typearea}. % \begin{macrocode} -% +%<*package&typearea&init> +\providecommand\ta@divlist{{}{}{}{}{}{}{}{}{}{8}{10}{12}} +% \end{macrocode} +% \end{macro} +% If a font size does not have a predefined divisor, the following default +% will be used: +% \begin{macrocode} +\providecommand\ta@divlistelse{1} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ta@divfor} +% We also need a macro to get one of the values stored at \cs{ta@divlist} +% depending on the font size given by the real number argument. The real +% number will be rounded to the nearest integer. +% \changes{v2.4g}{1996/11/04}{usage of the default value list} +% \changes{v2.6}{2000/01/04}{usage of the extended list}^^A +% \changes{v2.8q}{2002/03/28}{respect option \Option{mpinclude}}^^A +% \changes{v2.96}{2006/08/11}{font size does not need to be an integer}^^A +% \begin{macrocode} +%<*package&typearea&body> +\newcommand*{\ta@divfor}[1]{% + \if@mincl + \PackageInfo{typearea}{% + With option `mpinclude' there are no predefined\MessageBreak + DIV values. Using DIV calculation for good line\MessageBreak + width% + }% + \ta@div=\tw@ + \else + \xdef\@tempa{\ta@divlist{}}% + \@tempdima=#1pt + \addtolength{\@tempdima}{.5\p@}% + \divide\@tempdima by\p@ + \setlength{\@tempdimb}{\@tempdima}% + \multiply\@tempdimb by\p@ + \ifdim \@tempdimb=#1pt + \ta@div=#1\relax + \@whilenum \ta@div >-9 \do {% + \ifx\@tempa\empty + \else \xdef\@tempa{\expandafter\@cdr\@tempa\@nil}\fi + \advance\ta@div by-1 + }% + \else + \let\@tempa\empty + \fi + \ifx\@tempa\empty +% \end{macrocode} +% If there is not default in the list we use the general default. +% \begin{macrocode} + \setlength{\@tempdima}{#1\p@}% + \addtolength{\@tempdima}{10\p@}% + \PackageWarningNoLine{typearea}{% + DIV for \the\@tempdima\space and used papersize\MessageBreak + not defined!\MessageBreak + Using DIV=\ta@divlistelse + }% + \ta@div=\ta@divlistelse\relax + \else +% \end{macrocode} +% Otherwise we use the default of the list. +% \begin{macrocode} + \xdef\@tempa{\expandafter\@car\@tempa\@nil}% + \ifx\@tempa\empty + \ta@div=\ta@divlistelse\relax + \else + \ta@div=\@tempa\relax + \fi + \fi + \fi +} +% % \end{macrocode} +% \end{macro} +% +% The documentation of the deprecated part of the feature is still in German. +% \selectlanguage{ngerman} % +% \begin{macro}{\SetDIVList} +% \changes{v2.1a}{1994/10/28}{neu}^^A +% \changes{v2.6}{2000/01/04}{\cs{ta@divlist} enthält Werte für +% Schriftgrößen ab 1pt}^^A +% \changes{v3.24}{2017/07/23}{deprecated command}^^A +% Der Befehl \cs{SetDIVList} tut nichts weiter als die innere Variable +% für die schriftgrößenabhängige \emph{DIV}-Liste \cs{ta@divlist} neu +% zu definieren. Dabei können \emph{DIV}-Werte für Größen ab 10\,pt +% gesetzt werden. +% \begin{macrocode} +%<*package&typearea&body> +\newcommand*\SetDIVList[1]{% + \PackageWarning{typearea}{\string\SetDIVList\space is + deprecated!\MessageBreak + This command supports only integer font sizes\MessageBreak + in pt equal or greater than 10pt.\MessageBreak + Since version 2.6 the command is implemented\MessageBreak + for compatibility only. You should not use it\MessageBreak + any longer}% + \def\ta@divlist{{}{}{}{}{}{}{}{}{}#1}} +% \end{macrocode} +% \end{macro} % -% Ab hier ist alles nur noch für das Paket. +% \begin{macro}{\SetXDIVList} +% \changes{v2.6}{2000/01/04}{neu}^^A +% \changes{v3.24}{2017/07/23}{deprecated command}^^A +% Da mit \cs{SetDIVList} aus Kompatibilitätsgründen nur Werte für +% Größen ab 10\,pt gesetzt werden können, wird für Werte ab 1\,pt +% ein neuer Befehl benötigt. % \begin{macrocode} -%<*package> +\newcommand*\SetXDIVList[1]{% + \PackageWarning{typearea}{\string\SetXDIVList\space is + deprecated!\MessageBreak + This command supports only integer font sizes\MessageBreak + in pt equal or greater than 10pt.\MessageBreak + Since version 3.0 the command is implemented\MessageBreak + for compatibility only. You should not use it\MessageBreak + any longer}% + \def\ta@divlist{#1}} +% % \end{macrocode} +% \end{macro} +% +% \selectlanguage{english} +% +% \subsection{Calculation of typing area and margins} +% +% The main purpose of the package is the calculation of the size of the +% typeing area and the margins depending on a divisor. As an addition a +% binding correction is included. +% +% The parameters and the calculation is needed before the options can be +% processed. +% +% \begin{Length}{\ta@bcor} +% \changes{v2.2a}{1995/01/25}{definition of the dimension before option +% \Option{BCOR}}^^A +% \changes{v2.7g}{2001/04/17}{definition using \cs{newlength} instead of +% \cs{newdimen}}^^A +% We need a length to store the binding correction. It is initializes to 0\,pt +% implicitly by \Macro{newlength}. +% \begin{macrocode} +%<*package&typearea&options> +\newlength{\ta@bcor} +% \end{macrocode} +% \end{Length} % -% \subsection{Einige interne Register} +% \begin{macro}{\ta@div} +% \changes{v2.2a}{1995/01/25}{definition of the dimension before option +% \Option{BCOR}}^^A +% We need a counter for the divisor (aka \emph{DIV}). It is initializes to +% 0\,pt implicitly by \Macro{newcount}. +% \begin{macrocode} +\newcount\ta@div +% +% \end{macrocode} +% \end{macro} % % \begin{Length}{\ta@hblk} % \begin{Length}{\ta@vblk} -% \begin{Length}{\ta@temp} -% Diese Größsenparameter und werden intern für verschiedene Befehle -% benötigt. (Die Zähler \cs{ta@bcor} und \cs{ta@div} werden bereits -% bei der Optionenauswertung benötigt und sind deshalb vorgezogen.) +% Width of one horizontal resp. height of one vertical block. % \begin{macrocode} +%<*package&typearea&body> \newlength{\ta@hblk} \newlength{\ta@vblk} -\newlength{\ta@temp} +% % \end{macrocode} +% \end{Length} % \end{Length} -% \end{Length} +% +% \begin{Length}{\ta@temp} +% Used several times instead of \cs{@tempdima}, \cs{@tempdimb} or another +% temporary dimension or glue of the LaTeX{} kernel. Nevertheless I should +% think about not using this temporary length any longer. +% \begin{macrocode} +%<*package&typearea&body> +\newlength{\ta@temp} +% +% \end{macrocode} % \end{Length} % +% \begin{option}{BCOR} +% \changes{v2.2a}{1995/01/25}{new}^^A +% \changes{v2.95}{2002/12/04}{new implementation using \textsf{keyval}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% The value is written into the length \cs{ta@bcor}. Several symbolic values +% are supported that have to be converted into a length. Note, while loading +% the package symbolic values are nonsense. +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{BCOR}{% + \ifstr{#1}{current}{}{% + \setlength{\ta@bcor}{#1}% + }% + \FamilyKeyStateProcessed + \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{BCOR}{#1}% +} +% \end{macrocode} +% After loading the package we have to do a little bit more, because we need +% to recalculate the areas. +% \changes{v3.13}{2014/06/30}{\cs{FamilyKeyStateProcessed} added}^^A +% \changes{v3.24}{2017/07/23}{\cs{KOMA@kav@xreplacevalue} added}^^A +% \begin{macrocode} +\AtEndOfPackage{% + \KOMA@key{BCOR}{% + \typearea[{#1}]{last} + \FamilyKeyStateProcessed + \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{BCOR}{#1}% + }% +} +% +% \end{macrocode} +% \end{option} % -% \subsection{Die Berechnung des Satzspiegels} +% \begin{option}{DIV} +% \changes{v2.2a}{1995/01/25}{neue Option}^^A +% \changes{v2.95}{2002/12/04}{new implementation using \textsf{keyval}}^^A +% \changes{v3.12}{2013/03/05}{status signaling using \cs{FamilyKeyState}}^^A +% The value is written into the counter \cs{ta@div}. Several symbolic values +% are supported and have to be converted into a counter. Note, while loading +% the package symbolic values are nonsense. +% \begin{macrocode} +%<*package&typearea&options> +\KOMA@key{DIV}[calc]{% + \edef\@tempa{#1}% + \def\@tempb{last}\ifx\@tempa\@tempb\let\@tempa=\@lastdiv\fi + \def\@tempb{current}\ifx\@tempa\@tempb\else + \def\@tempb{default}\ifx\@tempa\@tempb\ta@div=\z@ \else + \def\@tempb{calc}\ifx\@tempa\@tempb\ta@div=\tw@ \else + \def\@tempb{classic}\ifx\@tempa\@tempb\ta@div=\thr@@ \else + \ta@div=\@tempa + \fi + \fi + \fi + \fi + \FamilyKeyStateProcessed + \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{DIV}{#1}% +} +% \end{macrocode} +% After loading the package we have to do a little bit more, because we need +% to recalculate the areas. +% \changes{v3.13}{2014/06/30}{\cs{FamilyKeyStateProcessed} added}^^A +% \changes{v3.24}{2017/07/23}{\cs{KOMA@kav@xreplacevalue} added}^^A +% \begin{macrocode} +\AtEndOfPackage{% + \KOMA@key{DIV}{% + \typearea[current]{#1}% + \FamilyKeyStateProcessed + \KOMA@kav@xreplacevalue{.typearea.\scr@pkgextension}{DIV}{#1}% + }% +} +% +% \end{macrocode} +% \end{option} % % \begin{macro}{\typearea} -% Die Berechnung des Satzspiegels, wie sie in der Anleitung -% beschrieben ist, findet mit Hilfe des Befehls \cs{typearea} statt, -% der hier definiert wird. Die Berechnung selbst benötigt mehreren -% Stufen. -% +% This is the real reason for the package: calculation of typing area and +% margins providing an optional binding correction and depending on a +% divisor. % \begin{macro}{\@typearea} -% \changes{v2.4n}{1997/05/28}{eigentliche Satzspiegelberechnung in -% \cs{@typearea} ausgegliedert} -% \changes{v2.95}{2002/08/20}{\cs{selectfont} eingefügt} -% Die eigentliche Satzspiegelberechnung geschieht über das Hilfsmakro -% \cs{@typearea}, das dann auch von \cs{typearea} genutzt wird. Dieses -% Hilfsmakro benötigt keine Parameter, da diese bereits zuvor von -% \cs{typearea} in die entsprechenden Variablen geschrieben wurden. +% \changes{v2.4n}{1997/05/28}{moved main calculation into \cs{@typearea}}^^A +% \changes{v2.95}{2002/08/20}{\cs{selectfont} added}^^A +% The calculation itself is done in \cs{@typearea}. This command does not need +% any parameters because it uses \cs{ta@div} and \cs{ta@bcor}. % \begin{macrocode} +%<*package&typearea&body> \newcommand*\@typearea{% % \end{macrocode} -% Bevor irgend etwas anderes gemacht wird, sogen wir dafür, dass die -% gewählte Schrift auch gesetzt wird. Dies ist notwendig, falls jemand -% vor \cs{typearea} einen Befehl wie \cs{linespread} verwendet. +% First of all we have to take care to select the correct font. Because +% otherwise we cannot depend on, e.g., \cs{baselineskip}. % \begin{macrocode} \selectfont % \end{macrocode} -% Zunächst werden die horizontalen Maße berechnet. Dazu wird als -% erstes die Größe einer horizontalen Längeneinheit (\emph{HLE}) -% ermittelt: +% First calculation is about the horizontal block element size: % \begin{macrocode} \ta@hblk=\paperwidth \advance \ta@hblk by-\ta@bcor \divide\ta@hblk by\ta@div % \end{macrocode} -% Die Größe des Bereichs für die Randnotizen ist ebenfalls von der -% Streifenbreite abhängig. -% \changes{v2.8q}{2002/03/28}{Textbreite berücksichtigt Option -% \texttt{mpinclude}} +% The with of the margin note column depends in the horizontal block size, +% whether or not is should be part of the typing area and whether of not we +% have a double sided document. +% \changes{v2.8q}{2002/03/28}{\cs{marginparwidth} depends on +% \Option{mpinclude}}^^A % \begin{macrocode} \if@mincl \marginparwidth=\ta@hblk @@ -2051,12 +1751,9 @@ \fi \fi % \end{macrocode} -% Der linke und rechte Rand wird relativ zur benutzbaren Seitenbreite -% berechnet. Dabei muss auch der Rand berücksichtigt werden, der vom -% Druckertreiber standardmäßig hinzugefügt wird. Außerdem ist der -% Rand abhängig davon, ob es sich um ein einseitiges oder beidseitiges -% Layout handelt. Bei Option \texttt{mpinclude} sind im beidseitigen -% Satz zusätzlich die Randnotizen zu beachten. +% The left and right margin resp. the left margin of odd and even pages +% depends also on the horizontal block width. The relation depends on whether +% or not the document is double sided. % \begin{macrocode} \oddsidemargin=-1in \evensidemargin=-1in @@ -2067,9 +1764,10 @@ % \end{macrocode} % \changes{v3.12}{2013/10/15}{use alternating \texttt{BCOR} with % \texttt{twoside!=semi}} -% Wenn \texttt{twoside=semi} verwendet wird, wird der Binderand ab -% \KOMAScript~3.12 dem inneren Rand zugeschlagen. Bei Kompatibilität zu -% älteren Versionen wird hingegen immer der linke Rand verwendet. +% From v3.12 the binding correction is part of the inner margin also for +% \Option{twoside=semi}. If compatibility to earlier release is selected the +% binding correction with \Option{twoside=semi} is always added to the left +% margin. % \begin{macrocode} \expandafter\ifnum\scr@ta@v@is@lt{3.12}\relax \evensidemargin=\oddsidemargin @@ -2091,19 +1789,18 @@ \evensidemargin=\oddsidemargin \fi % \end{macrocode} -% Der Rest steht nun für den Textbereich zur Verfügung: +% The width of the typing area is the paper width without the three blocks +% used for the margins and without the binding correction. % \begin{macrocode} \textwidth=\paperwidth \advance\textwidth by-\ta@bcor \advance\textwidth by-3\ta@hblk % \end{macrocode} -% Falls die Randnotizen für die Satzspiegelberechnung zum Textbereich -% gehören, müssen sie zusammen mit ihrem Abstand vom Text nun von -% diesem abgezogen werden. Es wird dabei davon ausgegangen, dass die -% Randnotizen immer außen gesetzt werden. Sollte der Textbereich für -% Randnotizen zu schmal sein, so wird der Bereich der Randnotizen so -% lange verkleinert, bis dies nicht mehr der Fall ist. Am einfachsten -% geht dies, indem gegebenfalls die Breiten vertauscht werden. +% But, if the margin note column should be part of the typing area, it's width +% has to be subtracted from the width of the typing area. We assume to place +% the margin notes at the outer margin. But if the typing area is to narrow +% for the margin note column, the width of margin note column will be +% reduced. This can be done easily be swapping the two lengths. % \begin{macrocode} \if@mincl \advance\textwidth by-\marginparwidth @@ -2122,30 +1819,28 @@ \fi \fi % \end{macrocode} -% Danach folgen die vertikalen Maße. Auch dafür wird zunächst die Höhe -% eines Streifens benötigt. +% Next the vertical size of a block. % \begin{macrocode} \ta@vblk=\paperheight \divide\ta@vblk by\ta@div % \end{macrocode} -% Davon ausgehend kann der obere Rand berechnet werden, wobei zu -% berücksichtigen ist, dass {\TeX} diesen selbständig um ein Inch -% vergrößert. +% The top margin depends on this vertical block size. But note, \TeX{} will +% increase it by 1\,in. % \begin{macrocode} \topmargin=-1in \advance\topmargin by\ta@vblk % \end{macrocode} -% Außerdem ist zu berücksichtigen, ob der Kopf zum Textbereich oder -% zum Rand gehört. +% And if head is not part of the typing area, the top margin has to be reduced +% by the head size. % \begin{macrocode} \if@hincl \else \advance\topmargin by-\headheight \advance\topmargin by-\headsep \fi % \end{macrocode} -% Bei der Berechnung des Textbereichs sind von der Papierhöhe die -% Ränder abzuziehen und es ist ebenfalls zu berücksichtigen, ob Kopf- -% und Fuß zu den Rändern oder zum Textbereich selbst gezählt werden. +% For the height of the typing area we use the paper size without the height +% of head and footer. The head and footer may be part of the typing area or +% not. If they are part of the typing area they reduce the height of it. % \begin{macrocode} \ta@temp=\paperheight \advance\ta@temp by-3\ta@vblk @@ -2157,10 +1852,10 @@ \advance\ta@temp by-\footskip \fi % \end{macrocode} -% Als Sonderbedingung ist dann noch zu beachten, dass die Größse des -% Textbereichs nicht zu einer vertikalen Aufweitung führt. -% \changes{v2.96}{2006/09/12}{\cs{topskip} wird gesetzt} -% \changes{v2.97c}{2007/07/04}{\cs{maxdepth} wird gesetzt} +% Last but not least we have take care that the typing area consists of an +% integer number of text lines. +% \changes{v2.96}{2006/09/12}{setting \cs{topskip}} +% \changes{v2.97c}{2007/07/04}{setting \cs{maxdepth}} % \begin{macrocode} \scr@ifundefinedorrelax{@ptsize}{% \topskip=\f@size\p@ @@ -2174,13 +1869,12 @@ \do{\advance\textheight by\baselineskip}% } % \end{macrocode} -% \end{macro} +% \end{macro}^^A \@typearea % % \begin{macro}{\ta@modiv} -% Dieses Hilfsmakro wird weiter unten benötigt. Es dividiert den -% ersten Parameter durch den zweiten und liefert das gerundete -% Ergebnis in \cs{ta@div} zurück. Für die Berechnung werden -% \cs{@tempdima} und \cs{@tempdimb} verwendet. +% Needed by \cs{typearea}. The first parameter will be divided by the second +% one. \cs{ta@div} is set to the rounded result. Internally \cs{@tempdima} and +% \cs{@tempdimb} are used. % \begin{macrocode} \newcommand*\ta@modiv[2]{ \setlength{\@tempdima}{#1} @@ -2197,7 +1891,7 @@ \setlength{\@tempdimb}{#1}% \divide\@tempdimb by\ta@div % \end{macrocode} -% \changes{v2.5a}{1997/06/22}{\cs{ifdim} statt \cs{ifnum}} +% \changes{v2.5a}{1997/06/22}{\cs{ifdim} instead of \cs{ifnum}} % \begin{macrocode} \ifdim \@tempdima<\@tempdimb \advance\ta@div by\m@ne @@ -2208,17 +1902,16 @@ % \end{macro} % % \begin{macro}{\ta@temp@goodwidth} -% Dieses Makro setzt die Hilfdimension \cs{ta@temp} auf den Wert einer -% optimalen Zeilenbreite in der aktuellen Schrift. Voraussetzung für -% diese Berechnung ist, dass Zeilenbreiten von ca. 66 bis 72 Zeichen -% optimal sind. Zur Vereinfachung wird mit dem Mittelwert 69 -% gerechnet. Eine solche Zeile besteht dann aus 66 durchschnittlichen -% Klein- und 3 durchschnittlichen Großbuchstaben. -% \changes{v2.7i}{2001/05/17}{Berechnung ist robuster gegen -% arithmetischen Überlauf bei sehr großen Schriften} -% \changes{v2.8q}{2002/03/06}{\cs{normalfont} \cs{normalsize} -% hinzugefügt} -% \changes{v2.95a}{2006/07/20}{Berechnung für große Schriften korrigiert}^^A +% Sets \cs{ta@temp} to the heuristic optimal line width depending on the +% current font. An optimal line width has 66 up to 72 characters. Here we use +% a value of 69 characters. We assume that such a line consists of 66 lower +% case letters (minors) and three upper case letters (majors). Normally the +% weight of a letter depends on the language but we use same weight for each +% letter. +% \changes{v2.7i}{2001/05/17}{avoid overflows if a very large font is +% used}^^A +% \changes{v2.8q}{2002/03/06}{\cs{normalfont} \cs{normalsize} added}^^A +% \changes{v2.95a}{2006/07/20}{fix of large font calculation}^^A % \begin{macrocode} \newcommand*\ta@temp@goodwidth{% \settowidth{\ta@temp}{\normalfont\normalsize @@ -2242,80 +1935,54 @@ % \end{macro} % % \begin{macro}{\AfterCalculatingTypearea} -% \changes{v2.96a}{2006/11/29}{neu}^^A -% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} -% ersetzt}^^A -% Neuerdings besteht die Möglichkeit, auf Benutzerebene das Verhalten von -% \cs{typearea} zu beeinflussen. In der Sternvariante wird dabei lokal -% gearbeitet. +% \changes{v2.96a}{2006/11/29}{new}^^A +% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by +% \cs{kernel@ifstar}}^^A +% Users can influence the behaviour of \cs{typearea} by a hook. The star +% variation adds the code locally the non-star variation globally. % \begin{macrocode} \newcommand*{\AfterCalculatingTypearea}{% \kernel@ifstar \l@addto@macro \g@addto@macro \@typearea@end } % \end{macrocode} % \begin{macro}{\@typearea@end} -% \changes{v2.96a}{2006/11/29}{wird wieder immer aber mit neuer Bedeutung -% definiert}^^A -% Das Makro \cs{@typearea@end} dient als Hook, um am Ende von \cs{typearea} -% noch irgendwelche Änderungen vornehmen zu können. Dies geschieht ggf. noch -% vor der Aktivierung der Einstellungen innerhalb eines Dokuments. +% \changes{v2.96a}{2006/11/29}{defined again but completely different}^^A +% Macro \cs{@typearea@end} is a hook that is executed at the end of +% \cs{typearea} but before the activation of the new settings. So you can +% change the result of \cs{typearea}. % \begin{macrocode} \newcommand*{\@typearea@end}{} % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}{\AfterSettingArea} -% \changes{v3.11}{2012/04/17}{new}^^A -% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} -% ersetzt}^^A -% The user may influence the result of \cs{areaset}. The star version works -% local while the non-star version is global. -% \begin{macrocode} -\newcommand*{\AfterSettingArea}{% - \kernel@ifstar \l@addto@macro \g@addto@macro \@areaset@end -} -% \end{macrocode} -% \begin{macro}{\@areaset@end} -% \changes{v3.11}{2012/04/17}{new}^^A -% Macro \cs{@areaset@end} is a hook to make it possible to add some -% instructions to the end of the \cs{areaset} command. This will be executed -% before the activation of the settings inside a document. -% \begin{macrocode} -\newcommand*{\@areaset@end}{} -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}{\activateareas} -% \changes{v2.96a}{2006/11/29}{Neuer Name für alte Anweisung}^^A -% \changes{v3.17}{2015/02/07}{Beachte Option \texttt{usegeometry}}^^A -% Dieses Makro wird verwendet, um mit einem gewaltigen Hack die Änderung des -% Satzspiegels innerhalb eines Dokuments zu ermöglichen. Es stellt selbst -% sicher, dass es nur innerhalb des Dokuments ausgeführt wird. +% \changes{v2.96a}{2006/11/29}{new name for old macro}^^A +% \changes{v3.17}{2015/02/07}{respect option \texttt{usegeometry}}^^A +% This macro is used to activate the new typing area and margin settings +% inside the document body. It is a hack, because is uses internal \LaTeX{} +% kernel code. % \begin{macrocode} \newcommand*{\activateareas}{% % \end{macrocode} -% Als erstes wird getestet, ob wir überhaupt innerhalb des Dokuments sind und -% nur dann wird etwas getan. +% First of all test, whether or not we are inside the document body. If not do +% nothing. % \begin{macrocode} \if@atdocument % \end{macrocode} -% \changes{v3.23}{2017/04/03}{Info statt Warnung bei Verwendung im -% Dokument}^^A -% Wenn dem so ist, wird jedoch eine Info ausgegeben, weil es wirklich sehr -% unsauber ist, so zu verfahren. Das ganze ist absolut abhängig von der -% \LaTeX-Version. Frühere Versionen haben hier noch eine Warnung ausgegeben. -% Da das aber seit Jahrzehnten problemlos läuft, gehe ich nun davon aus, dass -% das auch weiterhin so sein wird. +% \changes{v3.23}{2017/04/03}{info instead of warning if used inside the +% document body}^^A +% But if, we show an info, because it is a hack. It depends in the \LaTeX{} +% release. Nevertheless, it seems to be stable from the very first \LaTeXe{} +% release. So we use an info only. Before v3.23 we have used a warning. % \begin{macrocode} \PackageInfo{typearea}{% Using dirty hack to recalculate internal output\MessageBreak dimensions of LaTeX% }% % \end{macrocode} -% Dann können endlich die Dimensionen, die z.\,B. von der Ausgaberoutine -% benötigt werden, neu berechnet werden. +% Now, set several internal and none internal \LaTeX{}lengths to the new +% dimensions. % \begin{macrocode} \@colht=\textheight \@colroom=\textheight @@ -2333,17 +2000,22 @@ \KOMAoptions{pagesize=\@pagesizelast}% }% % \end{macrocode} -% \changes{v3.17}{2015/03/18}{Anpassung der \texttt{parskip}-Einstellungen}^^A -% Ab Version~3.17 wird bei Änderung des Satzspiegels auch Absatzabstand, -% -Einzug und Endzeilenfreiraum angepasst. Dies geschieht hier, weil es erst -% nach \cs{begin{document}} notwendig ist. Zuvor erfolgt dies noch automatisch. +% \changes{v3.17}{2015/03/18}{adapt the \Option{parskip} settings}^^A +% From v3.17 changes of the typing area can immediately change some of the +% \Option{parskip} settings. Before |\begin{document}| the change will be done +% automatically at |\begin{document}| and therefore adding it here is correct. % \begin{macrocode} \expandafter\ifnum\scr@ta@v@is@ge{3.17}% \csname par@updaterelative\endcsname \fi \fi % \end{macrocode} -% \changes{v3.17}{2015/02/07}{neuer Code für Option \texttt{usegeometry}} +% \changes{v3.17}{2015/02/07}{new code for option \Option{usegeometry}} +% If option \Option{usegeometry} is active we need to setup several options of +% package \Package{geometry}. We use \cs{scr@geometryargs} to store them. And +% we either have to pass these options to \Package{geometry} or define a new +% geometry. In the second case we also need some hacks to make the new paper +% size available for \Package{geometry}. % \begin{macrocode} \edef\scr@geometryargs{% bindingoffset=\the\ta@bcor, @@ -2356,67 +2028,509 @@ includehead=false,% top=\the\dimexpr 1in+\topmargin+\headheight+\headsep\relax, \fi - headheight=\the\headheight, - headsep=\the\headsep, - textheight=\the\textheight, - \if@fincl - includefoot, + headheight=\the\headheight, + headsep=\the\headsep, + textheight=\the\textheight, + \if@fincl + includefoot, + \else + includefoot=false, + \fi + footskip=\the\footskip, + \if@mincl + includemp, + \else + includemp=false, + \fi + marginparwidth=\the\marginparwidth, + marginparsep=\the\marginparsep + }% + \if@ta@usegeometry + \@ifundefined{Gm@save}{% + \if@atdocument\else + \edef\scr@geometryargs{% + paperwidth=\the\paperwidth,paperheight=\the\paperheight,% + \scr@geometryargs + }% + \PassOptionsToPackage{\scr@geometryargs}{geometry}% + \fi + }{% + \edef\Gm@restore@org{\Gm@restore}% + \if@atdocument + \expandafter\newgeometry\expandafter{\scr@geometryargs}% + \else + \edef\scr@geometryargs{% + paperwidth=\the\paperwidth,paperheight=\the\paperheight,% + \scr@geometryargs + }% + \expandafter\geometry\expandafter{\scr@geometryargs}% + \fi + }% + \fi +} +% \end{macrocode} +% \begin{macro}{scr@geometryargs} +% \changes{v3.16}{2015/02/07}{neu (intern)}^^A +% The initialization of the \Package{geometry} options is empty. It will be +% filled automatically by \cs{activateareas}. +% \begin{macrocode} +\newcommand*{\scr@geometryargs}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v2.4g}{1996/11/04}{waste comments removed}^^A +% \changes{v2.7g}{2001/04/17}{new symbolic values \texttt{current}, +% \texttt{default}, \texttt{calc}, \texttt{classic}}^^A +% \changes{v2.8q}{2001/11/06}{new symbolic value \texttt{last}}^^A +% \changes{v2.96}{2006/08/21}{warn if \cs{typearea} is used inside a +% group}^^A +% \changes{v3.10}{2011/09/13}{using \cs{scr@grouplevel@test}} +% \changes{v3.12}{2013/03/26}{page footer height configurable}^^A +% +% The symbolic values of the obligatory argument of \cs{typearea}: +% \begin{center}\begin{tabular}{lll} +% Symbol & Value & Meaning \\\hline\\[-2ex] +% \texttt{calc} & 2 & calculate a good value \\ +% \texttt{classic} & 3 & \emph{mittelalterlicher Buchseitenkanon} \\ +% \texttt{current} & --- & use the current value \\ +% \texttt{default} & 0 & use a value from the list \\ +% \texttt{last} & --- & use the value from the last usage of +% \cs{typearea} \\ +% \texttt{areaset} & --- & replace the current typing area \\ +% \end{tabular}\end{center} +% +% There is only one symbolic value that can be used as the optional argument: +% \texttt{current}. +% \begin{macrocode} +\newcommand*\typearea[2][\z@]{% + \scr@grouplevel@test\typearea + \edef\@tempa{#1}\edef\@tempb{current}\ifx\@tempa\@tempb\else + \setlength{\ta@bcor}{#1}% + \fi + \edef\@tempa{#2}% + \def\@tempb{last}\ifx\@tempa\@tempb\let\@tempa=\@lastdiv + \ifx\csname @tempa\endcsname\relax + \def\@tempa{current}% + \fi + \fi + \def\@tempb{areaset}\ifx\@tempa\@tempb + \areaset[current]{\textwidth}{\textheight}% + \else + \def\@tempb{current}\ifx\@tempa\@tempb\else + \def\@tempb{default}\ifx\@tempa\@tempb\ta@div=\z@ \else + \def\@tempb{calc}\ifx\@tempa\@tempb\ta@div=\tw@ \else + \def\@tempb{classic}\ifx\@tempa\@tempb\ta@div=\thr@@ \else + \ta@div=\@tempa + \fi + \fi + \fi + \fi + \edef\@lastdiv{\the\ta@div}% +% \end{macrocode} +% Before we do the calculation we need to start a new page if we are inside +% the document's body. And we need to select the document font size. +% \changes{v2.95a}{2006/07/20}{select document font size}^^A +% \begin{macrocode} + \if@atdocument\newpage\fi + \normalsize +% \end{macrocode} +% Is the height of the page head already given or do we need to calculate +% it. If we need to calculate it we use 1.25 of the base lines distance. This +% gives enough room for optional separation lines (which are set outside if +% use \Package{scrlayer-scrpage}). +% \changes{v2.4n}{1997/05/28}{page head height depends on base line +% distance}^^A +% \begin{macrocode} + \@ifundefined{ta@hh}{% + \headheight=1.25\baselineskip + }{% + \headheight=\ta@hh + }% +% \end{macrocode} +% The distance between the head and the text is always the same. Different +% typographers recommend different values. A good value would result in a grid +% that would be used for all lines of the page. But the distance should not to +% large. Supposedly a good value would be the height of one text line. But +% with head separation rule this wouldn't be a good value. So we use a +% compromise. +% \begin{macrocode} + \headsep=1.5\baselineskip +% \end{macrocode} +% The foot is a similar problem. But we have to setup also \cs{footskip} not +% only \cs{footheight}. +% \begin{macrocode} + \@ifundefined{footheight}{% + \newlength\footheight + }{}% + \@ifundefined{ta@fh}{% + \footheight=1.25\baselineskip + }{% + \footheight=\ta@fh + }% + \footskip=\dimexpr\footheight+2.25\baselineskip +% \end{macrocode} +% Some values also independent from the divisor and the binding correction. +% \begin{macrocode} + \marginparsep=1cc + \marginparpush=0.45\baselineskip +% \end{macrocode} +% \changes{v2.4g}{1996/11/04}{\textit{DIV}=0 tries to use a value from the +% default list} +% Before we do the calculation we test, whether the resulting divisor is +% 0. Values from 0 up to 3 are not possible because we use three parts for the +% margins. So we can use 0 to get a value from the default value list if +% available. +% \changes{v2.5h}{1999/12/29}{warning message changed}^^A +% \begin{macrocode} + \ifnum\ta@div=\z@ + \@ifundefined{@ptsize}{% + \@tempdima=\f@size\p@ + \advance\@tempdima by.5pt + \ta@div=\@tempdima + \divide\ta@div by65536 + \advance\ta@div by-10 + \xdef\@ptsize{\the\ta@div}% + \PackageWarningNoLine{typearea}{% + \string\@ptsize\space not defined!\MessageBreak + Fontsize is \f@size pt.\MessageBreak + Defining \string\@ptsize\space to \@ptsize% + }% + }{}% + \ta@divfor{\@ptsize}% + \fi +% \end{macrocode} +% \changes{v2.4n}{1997/05/28}{optional \emph{klassischer +% Buchseitenkanon}}^^A +% Another special case is if the divisor is 3. In this case we calculate a +% divisor near to the \emph{klassischer Buchseitenkanon}. This means we try to +% have the height of the typing area is as near as possible the width of the +% paper. For classic paper size this should be a harmonious result. +% \begin{macrocode} + \ifnum\ta@div=3 + \typeout{DIV calculation for classic typearea.}% + \setlength{\ta@temp}{\paperwidth}% + \addtolength{\ta@temp}{-\ta@bcor}% +% \end{macrocode} +% Here we also need to take care for whether the head is part of the typing +% area or the margin. +% \begin{macrocode} + \if@hincl\else + \addtolength{\ta@temp}{\headheight}% + \addtolength{\ta@temp}{\headsep}% + \fi + \if@fincl\else + \addtolength{\ta@temp}{\footskip}% + \fi +% \end{macrocode} +% Sometimes we need more vertical space than available. In this case we use +% another calculation. This will be defined later. +% \changes{v2.5a}{1997/06/22}{\cs{ifdim} instead of \cs{ifnum}} +% \begin{macrocode} + \ifdim \ta@temp >\paperheight + \PackageWarningNoLine{typearea}{% + No classic typearea with this papersize!\MessageBreak + Using calculated DIV% + }% + \ta@div=\@ne +% \end{macrocode} +% Otherwise we can calculate the height of all vertical margins by the height +% of the paper width (without binding correction) +% \begin{macrocode} + \else + \setlength{\ta@temp}{\paperheight}% + \addtolength{\ta@temp}{-\paperwidth}% + \addtolength{\ta@temp}{\ta@bcor}% +% \end{macrocode} +% and from this the height of one block +% \begin{macrocode} + \divide\ta@temp by3 +% \end{macrocode} +% and this will result in a divisor. +% \begin{macrocode} + \ta@modiv{\paperheight}{\ta@temp}% + \fi +% \end{macrocode} +% Here we do not need to respect \Option{mpinclude} because we do not use the +% width of the typing area but the height of the paper. +% \begin{macrocode} + \fi +% \end{macrocode} +% If we did not found a good value until this point, we try to calculate the +% optimal divisor. +% \changes{v2.4n}{1997/05/28}{improved optimal divisor calculation}^^A +% \begin{macrocode} + \ifnum\ta@div <4 + \typeout{DIV calculation for typearea with good linewidth.}% +% \end{macrocode} +% The width of the typing area could at most be the width of the paper without +% the binding correction. +% \begin{macrocode} + \setlength{\textwidth}{\paperwidth}% + \addtolength{\textwidth}{-\ta@bcor}% +% \end{macrocode} +% The optimal width would be the optimal line width. +% \begin{macrocode} + \ta@temp@goodwidth +% \end{macrocode} +% In two column mode each text line has two such columns plus the column +% separation width. +% \changes{v2.8q}{2001/12/13}{\texttt{DIVcalc} uses wider columns in two +% column mode}^^A +% \begin{macrocode} + \if@twocolumn + \addtolength{\ta@temp}{\ta@temp}% + \addtolength{\ta@temp}{\columnsep}% + \fi +% \end{macrocode} +% Former releases used an iterative approach to get the best +% divisor. Depending on the \TeX{} implementation and the paper size this +% could be more or less slow. So we do a direct calculation starting with the +% width of the left and right margin. +% \begin{macrocode} + \setlength{\ta@hblk}{\paperwidth}% + \addtolength{\ta@hblk}{-\ta@temp}% +% \end{macrocode} +% This can be used to calculate the width of a block. +% \begin{macrocode} + \divide\ta@hblk by3 +% \end{macrocode} +% If this width is negative, we use a minimum width of 5\,mm. +% \changes{v2.5a}{1997/06/22}{\cs{ifdim} instead of \cs{ifnum}.} +% \begin{macrocode} + \ifdim \ta@hblk <\z@ + \setlength{\ta@hblk}{5mm}% + \fi +% \end{macrocode} +% The width of block and the width of the paper can be used to calculate the +% divisor. +% \changes{v2.8q}{2002/03/28}{respect \Option{mpinclude} at the calculation +% of the best divisor}^^A +% If option \Option{mpinclude} is active, we have to multiply the divisor with +% $\frac{3}{3+m}$. $m$ is the number of blocks used for the margin notes. If +% $m=1$ we have an factor of $\frac{3}{4}=0.75$. More difficult would be not +% to use a number of blocks for the margin note column but a dedicated value +% for the width of the margin note column. +% \begin{macrocode} + \if@mincl + \setlength{\ta@temp}{.75\ta@hblk}% + \else + \setlength{\ta@temp}{\ta@hblk}% + \fi + \ta@modiv{\paperwidth}{\ta@temp}% +% \end{macrocode} +% Another difficulty would be, if the divisor now is optimal for the width but +% result in a to large height. To find this out, we first calculate the typing +% area and margins with the found divisor. +% \begin{macrocode} + \@typearea +% \end{macrocode} +% Now, we test the vertical sizes. Again a minimum block size is of 5\,mm will +% be used. But we have to take care the 1\,in of \TeX! +% \changes{v2.5a}{1997/06/22}{\cs{ifdim} instead of \cs{ifnum}} +% \begin{macrocode} + \setlength{\ta@temp}{-1in}% + \addtolength{\ta@temp}{5mm}% + \ifdim\topmargin <\ta@temp +% \end{macrocode} +% This would be the minimum top margin. If the margin is less, we need another +% divisor. In this case we also have to recognize whether the page head and +% footer are part of the margins or the typing area. +% \changes{v2.5b}{1997/06/29}{take care for \Option{headinclude} and +% \Option{footinclude} while calculating the divisor for minimum top +% margin}^^A +% \begin{macrocode} + \setlength{\ta@temp}{15mm}% + \if@hincl\else + \addtolength{\ta@temp}{\headheight}% + \addtolength{\ta@temp}{\headsep}% + \fi + \if@fincl\else + \addtolength{\ta@temp}{\footskip}% + \fi + \divide\ta@temp by3 + \ta@modiv{\paperheight}{\ta@temp}% + \fi +% \end{macrocode} +% A solution for this difficulty has been found. +% \begin{macrocode} + \fi +% \end{macrocode} +% So now we have the final divisor and can do the final calculation. +% \begin{macrocode} + \@typearea +% \end{macrocode} +% \changes{v2.0e}{1994/10/28}{write layout values to the \File{log} file}^^A +% \changes{v2.4i}{1996/11/11}{write to the \File{log} file later}^^A +% \changes{v2.4i}{1996/11/11}{execute \cs{@typearea@end} at the end of +% \cs{typearea}}^^A +% \changes{v2.4j}{1996/12/04}{\File{log} output with only one +% \cs{textheight} but additional \cs{baselineskip}}^^A +% \changes{v2.5}{1997/06/17}{"`arithmetic overflow"' with \Option{landscape} +% fixed}^^A +% \changes{v2.95}{2004/01/30}{warning in two column mode fixed}^^A +% \changes{v3.00}{2008/10/08}{use \cs{ta@layoutinfo} to write the layout +% values into the \File{log} file}^^A +% \changes{v3.01b}{2008/12/09}{warning for sub-optimal settings changed}^^A +% Last but not least we write some layout values into the \File{log} file. For +% some of the information we need additional calculations, e.g., of a good +% line width. +% \begin{macrocode} + \ta@temp@goodwidth + \if@twocolumn + \addtolength{\ta@temp}{\ta@temp}% + \addtolength{\ta@temp}{\columnsep}% + \fi + \setlength{\@tempdima}{\ta@temp}% + \addtolength{\ta@temp}{-\textwidth}% + \divide\@tempdima by100 + \divide\ta@temp by\@tempdima + \@tempcnta=\ta@temp + \ifnum\@tempcnta <5 + \ifnum\@tempcnta >-5 + \@tempcnta=0 + \else + \advance\@tempcnta by4 + \fi \else - includefoot=false, + \advance\@tempcnta by-4 \fi - footskip=\the\footskip, - \if@mincl - includemp, + \ifnum\@tempcnta <-15 + \@tempcnta=-\@tempcnta + \PackageWarningNoLine{typearea}{% + Bad type area settings!\MessageBreak + The detected line width is about + \the\@tempcnta\@percentchar\MessageBreak + larger than the heuristically detected line width.\MessageBreak + You should e.g. decrease DIV, increase fontsize\MessageBreak + or change papersize% + }% + \@tempcnta=-\@tempcnta \else - includemp=false, + \ifnum\@tempcnta>15 + \PackageWarningNoLine{typearea}{% + Maybe no optimal type area settings!\MessageBreak + The maximum limit of line width is about + \the\@tempcnta\@percentchar\MessageBreak + larger than the heuristically detected line width.\MessageBreak + You may e.g. increase DIV, decrease fontsize\MessageBreak + or change the papersize% + } + \fi\fi + \ifnum\ta@div <6 + \PackageWarningNoLine{typearea}{% + Very low DIV value!\MessageBreak + DIV values less than 6 result in textwidth/-height\MessageBreak + smaller than total marginwidth/-height.\MessageBreak + You should e.g. increase DIV, increase fontsize or\MessageBreak + change papersize% + } + \fi + \ta@layoutinfo{\number\ta@div}{\the\@tempcnta}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{DIV}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{DIV}{\@lastdiv}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{BCOR}% + \KOMA@kav@xadd{.typearea.\scr@pkgextension}{BCOR}{\the\ta@bcor}% + \@typearea@end + \activateareas + \ifdim \dimexpr 1in+\topmargin + +\headheight+\headsep + +\textheight + +\footskip+\dp\strutbox\relax + >\paperheight + \PackageWarningNoLine{typearea}{% + page content and margins higher than paper.\MessageBreak + This may result in page footer out of paper.\MessageBreak + You should decrease DIV, decrease foot height,\MessageBreak + or include footer into type area% + }% \fi - marginparwidth=\the\marginparwidth, - marginparsep=\the\marginparsep - }% - \if@ta@usegeometry - \@ifundefined{Gm@save}{% - \if@atdocument\else - \edef\scr@geometryargs{% - paperwidth=\the\paperwidth,paperheight=\the\paperheight,% - \scr@geometryargs - }% - \PassOptionsToPackage{\scr@geometryargs}{geometry}% - \fi - }{% - \edef\Gm@restore@org{\Gm@restore}% - \if@atdocument - \expandafter\newgeometry\expandafter{\scr@geometryargs}% - \else - \edef\scr@geometryargs{% - paperwidth=\the\paperwidth,paperheight=\the\paperheight,% - \scr@geometryargs - }% - \expandafter\geometry\expandafter{\scr@geometryargs}% - \fi - }% \fi } % \end{macrocode} -% \begin{macro}{scr@geometryargs} -% \changes{v3.16}{2015/02/07}{neu (intern)}^^A -% Dieses Makro nimmt innerhalb von \cs{activateareas} die Optionen für -% \textsf{geometry} auf. Initialisiert wird es einfach leer. +% +% \begin{macro}{\ta@layoutinfo} +% \changes{v3.00}{2008/10/08}{new (internal)}^^A +% Write several layout information into the \File{log} file. The first +% argument is the current divisor and the second the discrepancy from the +% optimal divisor or empty or \cs{relax}. % \begin{macrocode} -\newcommand*{\scr@geometryargs}{} +\newcommand*{\ta@layoutinfo}[2]{% + \PackageInfo{typearea}{% + These are the values describing the layout:\MessageBreak + DIV\space\space=\space#1\MessageBreak + BCOR\space=\space\the\ta@bcor\MessageBreak + \string\paperwidth\space\space\space\space\space\space=% + \space\the\paperwidth\MessageBreak + \space\string\textwidth\space\space\space\space\space\space=% + \space\the\textwidth\MessageBreak + \ifx\relax#2\relax\else + \space DIV departure\space\space\space=% + \space#2\@percentchar\MessageBreak + \fi + \space\string\evensidemargin\space=% + \space\the\evensidemargin\MessageBreak + \space\string\oddsidemargin\space\space=% + \space\the\oddsidemargin\MessageBreak + \string\paperheight\space\space\space\space\space=% + \space\the\paperheight\MessageBreak + \space\string\textheight\space\space\space\space\space=% + \space\the\textheight\MessageBreak + \space\string\topmargin\space\space\space\space\space\space=% + \space\the\topmargin\MessageBreak + \space\string\headheight\space\space\space\space\space=% + \space\the\headheight\MessageBreak + \space\string\headsep\space\space\space\space\space\space\space\space=% + \space\the\headsep\MessageBreak + \space\string\topskip\space\space\space\space\space\space\space\space=% + \space\the\topskip\MessageBreak + \space\string\footskip\space\space\space\space\space\space\space=% + \space\the\footskip\MessageBreak + \space\string\baselineskip\space\space\space=% + \space\the\baselineskip\MessageBreak + }% +} % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}{\recalctypearea} +% \changes{v2.95}{2002/12/04}{new}^^A +% This command can be used to recalculate the typing area and the margins with +% the divisor and the binding correction that has been used last. The command +% is available only after loading the package. So it is an indicator if we +% are in the load or the run-time phase of the package. +% \begin{macrocode} +\AtEndOfPackage{\newcommand*{\recalctypearea}{\typearea[current]{last}}} +% +% \end{macrocode} +% \end{macro} +% +% Initially \cs{ta@bcor} and \cs{ta@div} are zero if is has not been set using +% one of the options. The 0 divisor stands for using a value from the default +% list. So the final initialization of the typing area and margins is very +% easy. +% \changes{v2.8q}{2001/11/06}{initialization using symbolic values +% \texttt{current}}^^A +% \begin{macrocode} +%<*package&typearea&final> +\typearea[current]{current} +% +% \end{macrocode} +% +% \subsection{Storage and reactivation of typing area and margin settings} +% % \begin{macro}{\storeareas} -% \changes{v3.10}{2011/09/13}{neue Anweisung}^^A -% \changes{v3.18}{2015/05/20}{Hooks am Anfang und Ende der erzeugten -% Anweisungen}^^A -% Die aktuellen Einstellungen können in einem Makro gespeichert -% werden. Dieses Makro kann anschließend genutzt werden, um die -% Einstellungen wieder her zu stellen. +% \changes{v3.10}{2011/09/13}{new}^^A +% \changes{v3.18}{2015/05/20}{Hooks at the beginning and end of the defined +% macro}^^A +% You can store the current settings of the typing area and the margins in a +% macro. If you use the macro later the stored settings will be restored. % \begin{macro}{\scr@grouplevel@test} -% \changes{v3.10}{2011/09/13}{neu (intern)}^^A +% \changes{v3.10}{2011/09/13}{new (internal)}^^A +% Warn if restoring the settings is used inside a group. % \begin{macrocode} +%<*package&typearea&body> \newcommand*{\scr@grouplevel@test}[1]{% \ifcase\currentgrouptype\else \PackageWarning{typearea}{% @@ -2479,27 +2593,26 @@ } % \end{macrocode} % \begin{macro}{\BeforeRestoreareas} -% \changes{v3.18}{2015/05/20}{neue Anweisung}^^A -% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} -% ersetzt}^^A +% \changes{v3.18}{2015/05/20}{new}^^A +% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by +% \cs{kernel@ifstar}}^^A % \begin{macro}{\AfterRestoreareas} -% \changes{v3.18}{2015/05/20}{neue Anweisung}^^A -% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} -% ersetzt}^^A +% \changes{v3.18}{2015/05/20}{new}^^A +% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by +% \cs{kernel@ifstar}}^^A % \begin{macro}{\scr@storeareashook} -% \changes{v3.18}{2015/05/20}{neue Anweisung (intern)}^^A +% \changes{v3.18}{2015/05/20}{new (internal)}^^A % \begin{macro}{\scr@storeareas@before@hook} -% \changes{v3.18}{2015/05/20}{neue Anweisung (intern)}^^A +% \changes{v3.18}{2015/05/20}{new (internal)}^^A % \begin{macro}{\scr@storeareas@before@current@hook} -% \changes{v3.18}{2015/05/20}{neue Anweisung (intern)}^^A +% \changes{v3.18}{2015/05/20}{new (internal)}^^A % \begin{macro}{\scr@storeareas@after@hook} -% \changes{v3.18}{2015/05/20}{neue Anweisung (intern)}^^A +% \changes{v3.18}{2015/05/20}{new (internal)}^^A % \begin{macro}{\scr@storeareas@after@current@hook} -% \changes{v3.18}{2015/05/20}{neue Anweisung (intern)}^^A -% Fügt Code einem Haken für die per \cs{storeareas} definierten Anweisungen -% hinzu. Der Code der Sternversion wird dabei nur für noch nicht definierte -% Anweisungen verwendet, während der Code der Version ohne Stern auch für -% bereits definierte Anweisungen gilt. +% \changes{v3.18}{2015/05/20}{new (internal)}^^A +% Adds code to one of the hooks of the macros defined by \cs{storeareas}. +% The star variants adds code only to not yet defined macros. The non-star +% variant also changes already defined macros. % \begin{macrocode} \newcommand*{\BeforeRestoreareas}{% \kernel@ifstar{\scr@storeareashook{before@current}}% @@ -2516,6 +2629,7 @@ \newcommand*{\scr@storeareas@before@current@hook}{} \newcommand*{\scr@storeareas@after@hook}{} \newcommand*{\scr@storeareas@after@current@hook}{} +% % \end{macrocode} % \end{macro}^^A \scr@storeareas@after@current@hook % \end{macro}^^A \scr@storeareas@after@hook @@ -2527,737 +2641,663 @@ % \end{macro}^^A \scr@grouplevel@test % \end{macro}^^A \storeareas % -% \begin{macro}{\ta@divfor} -% Der Standardseitenspiegel ist abhängig von den mit \cs{SetDIVList} -% vorgegebenen Einstellungen. Dazu muss aus einer eventuell -% vorhandenen inneren Liste \cs{ta@divlist} der von der Schriftgröße -% abhängige \textit{DIV}-Wert ausgelesen werden. Dies geschieht mit -% Hilfe des \cs{ta@divfor}-Befehls, der sich wiederum einiger interner -% Befehle zur Listenbearbeitung bedient. -% \changes{v2.4g}{1996/11/04}{Satzspiegel wird nicht mehr direkt -% berechnet, sondern nur der \textit{DIV}-Wert aus der -% Defaultliste ermittelt} -% \changes{v2.6}{2000/01/04}{Berücksichtigung der erweiterten -% Liste}^^A -% \changes{v2.8q}{2002/03/28}{Berücksichtigung der Option -% `mpinclude'}^^A -% \changes{v2.96}{2006/08/11}{Schriftgröße muss nicht in ganzen pt sein}^^A +% \subsection{Calculation of margins for a given typing area} +% +% Beside the calculation of the typing area and the margins by a divisor +% \Package{typearea} also provides the calculation of margins for a given +% typing area. +% +% \begin{option}{areasetadvanced} +% \changes{v3.11}{2012/04/17}{new}^^A +% Switch to advanced version of \cs{areaset}. This does calculate margins +% more like \cs{typearea}. Nevertheless, there's still a difference at the top +% margin, because \cs{typerea} doesn't balance differences in calculated +% height of margins and resulting height of margins but reduces only the +% bottom margin. % \begin{macrocode} -\newcommand*{\ta@divfor}[1]{% - \if@mincl - \PackageInfo{typearea}{% - With option `mpinclude' there are no predefined\MessageBreak - DIV values. Using DIV calculation for good line\MessageBreak - width% - }% - \ta@div=\tw@ - \else - \xdef\@tempa{\ta@divlist{}}% - \@tempdima=#1pt - \addtolength{\@tempdima}{.5\p@}% - \divide\@tempdima by\p@ - \setlength{\@tempdimb}{\@tempdima}% - \multiply\@tempdimb by\p@ - \ifdim \@tempdimb=#1pt - \ta@div=#1\relax - \@whilenum \ta@div >-9 \do {% - \ifx\@tempa\empty - \else \xdef\@tempa{\expandafter\@cdr\@tempa\@nil}\fi - \advance\ta@div by-1 - }% - \else - \let\@tempa\empty - \fi - \ifx\@tempa\empty +%<*package&typearea&options> +\KOMA@ifkey{areasetadvanced}{@areasetadvanced} +% +% \end{macrocode} +% \end{option} +% +% \begin{macro}{\areaset} +% \changes{v2.1b}{1994/12/31}{\cs{headheight} depends on \cs{@ptsize}}^^A +% \changes{v2.6}{2000/01/04}{\cs{headheight} depends on \cs{f@size} instead +% of \cs{@ptsize}}^^A +% \changes{v2.7g}{2001/04/17}{symbolic value \texttt{current} for the +% optional argument}^^A +% \changes{v2.95}{2002/12/05}{execute \cs{@typearea@end} at the end of +% \cs{areaset}}^^A +% If we have given width and height of the typing area we still can calculate +% the margins. Again we want to use this not only in the document preamble but +% also in the document body. +% \begin{macrocode} +%<*package&typearea&body> +\newcommand*\areaset[3][\z@]{% + \edef\@tempa{#1}\edef\@tempb{current}\ifx\@tempa\@tempb\else + \setlength{\ta@bcor}{#1}% + \fi % \end{macrocode} -% Wenn keine Voreinstellung gefunden werden konnte, so wird immer -% der Optimalwert berechnet. Mit einer Warnung wird darauf -% hingewiesen. +% We have to start a new page if we are inside the document body. % \begin{macrocode} - \setlength{\@tempdima}{#1\p@}% - \addtolength{\@tempdima}{10\p@}% - \PackageWarningNoLine{typearea}{% - DIV for \the\@tempdima\space and used papersize\MessageBreak - not defined!\MessageBreak - Using DIV=\ta@divlistelse - }% - \ta@div=\ta@divlistelse\relax - \else + \if@atdocument\newpage\fi % \end{macrocode} -% Ansonsten wird der vorgegebene Wert verwendet. +% Then we do the calculation. +% \changes{v2.96}{2006/09/12}{set \cs{topskip}} +% \changes{v3.00}{2008/10/08}{use \cs{ta@layoutinfo} to write layout +% information into the \File{log} file}^^A % \begin{macrocode} - \xdef\@tempa{\expandafter\@car\@tempa\@nil}% - \ifx\@tempa\empty - \ta@div=\ta@divlistelse\relax - \else - \ta@div=\@tempa\relax - \fi - \fi - \fi -} + \setlength{\textwidth}{#2}% + \setlength{\textheight}{#3}% + \def\@lastdiv{areaset}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{DIV}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{DIV}{areaset}% + \KOMA@kav@removekey{.typearea.\scr@pkgextension}{BCOR}% + \KOMA@kav@add{.typearea.\scr@pkgextension}{BCOR}{\the\ta@bcor}% + \ta@hblk=\paperwidth + \advance\ta@hblk by-\ta@bcor + \advance\ta@hblk by-\textwidth % \end{macrocode} -% \end{macro} -% -% \changes{v2.4g}{1996/11/04}{überflüssigen Kommentar gelöscht}^^A -% \changes{v2.7g}{2001/04/17}{die neuen Werte \texttt{current}, -% \texttt{default}, \texttt{calc}, \texttt{classic} werden -% verstanden} -% \changes{v2.8q}{2001/11/06}{der Wert \texttt{last} wird -% verstanden} -% \changes{v2.96}{2006/08/21}{Warnung, wenn \cs{typearea} innerhalb einer -% Gruppe verwendet wird} -% \changes{v3.10}{2011/09/13}{Verwendung von \cs{scr@grouplevel@test}} -% \changes{v3.12}{2013/03/26}{konfigurierbare Höhe des Fußes}^^A -% -% Die symbolischen Werte für das obligatorische Argument von -% \cs{typearea} haben folgende Bedeutung: -% \begin{center}\begin{tabular}{lll} -% Symbol & Wert & Bedeutung \\\hline\\[-2ex] -% \texttt{calc} & 2 & guten Wert berechnen \\ -% \texttt{classic} & 3 & mittelalterlicher Buchseitenkanon \\ -% \texttt{current} & --- & aktuellen Wert beibehalten \\ -% \texttt{default} & 0 & Wert aus der Liste verwenden \\ -% \texttt{last} & --- & Argument des letzten Aufrufs verwenden \\ -% \texttt{areaset} & --- & Satzspiegel beibehalten nur neu anordnen \\ -% \end{tabular}\end{center} -% Das optionale Argument kennt hingegen nur den symbolischen Wert -% \texttt{current}. +% \changes{v3.11}{2012/04/17}{advanced version with different margin widths}% +% With v3.11 we will have an advanced version of \cs{areaset}. This +% version takes care to option \texttt{mpinclude}. % \begin{macrocode} -\newcommand*\typearea[2][\z@]{% - \scr@grouplevel@test\typearea - \edef\@tempa{#1}\edef\@tempb{current}\ifx\@tempa\@tempb\else - \setlength{\ta@bcor}{#1}% - \fi - \edef\@tempa{#2}% - \def\@tempb{last}\ifx\@tempa\@tempb\let\@tempa=\@lastdiv - \ifx\csname @tempa\endcsname\relax - \def\@tempa{current}% - \fi - \fi - \def\@tempb{areaset}\ifx\@tempa\@tempb - \areaset[current]{\textwidth}{\textheight}% - \else - \def\@tempb{current}\ifx\@tempa\@tempb\else - \def\@tempb{default}\ifx\@tempa\@tempb\ta@div=\z@ \else - \def\@tempb{calc}\ifx\@tempa\@tempb\ta@div=\tw@ \else - \def\@tempb{classic}\ifx\@tempa\@tempb\ta@div=\thr@@ \else - \ta@div=\@tempa - \fi - \fi - \fi + \if@areasetadvanced + \if@mincl + \divide\ta@hblk by4 + \else + \divide\ta@hblk by3 \fi - \edef\@lastdiv{\the\ta@div}% + \else + \divide\ta@hblk by3 + \fi + \oddsidemargin=-1in + \evensidemargin=-1in + \if@twoside + \if@semitwoside + \advance\oddsidemargin by1.5\ta@hblk + \advance\oddsidemargin by\ta@bcor % \end{macrocode} -% Bevor nun irgendeine Berechnung durchgeführt wird, muss ggf. eine -% neue Seite begonnen werden. Außerdem wird sichergestellt, dass die aktuelle -% Schriftgröße die Grundschriftgröße ist und auch mit dem aktuellen -% Durchschuss gerechnet wird. -% \changes{v2.95a}{2006/07/20}{Grundschriftgröße einstellen}^^A +% \changes{v3.12}{2013/10/15}{use alternating \texttt{BCOR} with +% \texttt{twoside!=semi}} +% If \Option{twoside=semi} is used, form v3.12 we add the binding correction +% to the inner margin. If compatibility to version less than 3.12 has been +% selected the binding correction will be added to the left margin. % \begin{macrocode} - \if@atdocument\newpage\fi - \normalsize + \expandafter\ifnum\scr@ta@v@is@lt{3.12}\relax + \evensidemargin=\oddsidemargin + \else + \advance\evensidemargin by1.5\ta@hblk + \fi + \else + \advance\oddsidemargin by\ta@hblk + \advance\oddsidemargin by\ta@bcor + \advance\evensidemargin by2\ta@hblk + \fi + \else + \advance\oddsidemargin by1.5\ta@hblk + \advance\oddsidemargin by\ta@bcor + \evensidemargin\oddsidemargin + \fi + \scr@ifundefinedorrelax{@ptsize}{% + \topskip=\f@size\p@ + }{% + \topskip=\@ptsize\p@ + \advance\topskip by 10\p@ + }% % \end{macrocode} -% Nun muss festgestellt werden, ob die Höhe des Kopfbereichs bereits -% vorgegeben ist, oder ob diese selbst berechnet werden soll. Im Falle -% der Berechnung wird als Höhe für den Kopf das 1,25-Fache des -% Grundzeilenabstandes gewählt. Damit sollte auch noch genug Raum für die -% optionale Trennlinie vorhanden sein. -% \changes{v2.4n}{1997/05/28}{berechnete Kopfhöhe vom -% Grundzeilenabstand abhängig}^^A +% \changes{v3.11}{2012/04/17}{advanced version with different margin widths}% +% With v3.11 we will have an advanced version of \cs{areaset}. This +% version uses the head height algorithm of \cs{typearea}. % \begin{macrocode} + \if@areasetadvanced + \normalsize \@ifundefined{ta@hh}{% \headheight=1.25\baselineskip }{% \headheight=\ta@hh }% + \else + \headheight=15\p@ + \advance\headheight by\f@size\p@ + \advance\headheight by-10\p@ + \fi + \headsep=1.5\baselineskip % \end{macrocode} -% Auch der Abstand zwischen Kopf und Text ist immer -% gleich. Verschiedene Typographen geben hier verschiedene Werte -% an. Ein guter Wert sollte erreicht werden, wenn dadurch eine -% Kopfzeile in das normale Zeilenraster eingepasst wird. Der Abstand -% soll aber auch nicht zu groß, werden. Optimal ist angeblich ein Wert -% von einer Zeile. Dies führt jedoch zu einem klaren Konflikt bei -% unterstrichenen Kopfzeilen. Deshalb wird ein Kompromiss gebildet. -% \begin{macrocode} - \headsep=1.5\baselineskip -% \end{macrocode} -% Für den Fuß muss ähnlich verfahren werden. Dabei muss aber nicht nur -% ggf. \cs{footheight}, sondern auch \cs{footskip} angepasst werden. +% \changes{v3.12}{2013/03/26}{changes for height of foot}^^A % \begin{macrocode} - \@ifundefined{footheight}{% - \newlength\footheight - }{}% + \@ifundefined{footheight}{\newlength\footheight}{} + \if@areasetadvanced \@ifundefined{ta@fh}{% \footheight=1.25\baselineskip + \footskip=3.5\baselineskip }{% \footheight=\ta@fh + \footskip=\dimexpr \footheight+2.25\baselineskip\relax }% - \footskip=\dimexpr\footheight+2.25\baselineskip -% \end{macrocode} -% Es folgen die restlichen von \textit{DIV} und \textit{BCOR} -% unabhängigen Werte. -% \begin{macrocode} - \marginparsep=1cc - \marginparpush=0.45\baselineskip -% \end{macrocode} -% \changes{v2.4g}{1996/11/04}{\textit{DIV}=0 versucht den Wert aus -% der Default-Liste zu verwenden} -% Vor der eigentlichen Berechnung des Satzspiegels wird nun zunächst -% überprüft, ob der übergebene \textit{DIV}-Wert 0 ist. Da Werte von 0 -% bis 3 nicht möglich sind (Minimum sind drei Teile Rand und ein Teil -% Text), wird der Wert 0 dafür verwendet, den Defaultwert aus der -% Liste zu ermitteln, falls ein solcher vorhanden ist. -% \changes{v2.5h}{1999/12/29}{Text der Warnung korrigiert}^^A -% \begin{macrocode} - \ifnum\ta@div=\z@ - \@ifundefined{@ptsize}{% - \@tempdima=\f@size\p@ - \advance\@tempdima by.5pt - \ta@div=\@tempdima - \divide\ta@div by65536 - \advance\ta@div by-10 - \xdef\@ptsize{\the\ta@div}% - \PackageWarningNoLine{typearea}{% - \string\@ptsize\space not defined!\MessageBreak - Fontsize is \f@size pt.\MessageBreak - Defining \string\@ptsize\space to \@ptsize% - }% - }{}% - \ta@divfor{\@ptsize}% + \else + \footheight=1.25\baselineskip + \footskip=3.5\baselineskip + \fi + \ta@vblk=\paperheight + \advance\ta@vblk by-\textheight + \divide\ta@vblk by3 + \if@hincl + \advance\textheight by-\headheight + \advance\textheight by-\headsep + \fi + \if@fincl + \advance\textheight by-\footskip + \fi + \topmargin=-1in + \advance\topmargin by\ta@vblk + \if@hincl \else + \advance\topmargin by-\headheight + \advance\topmargin by-\headsep + \fi + \if@twoside + \if@semitwoside + \marginparwidth=\ta@hblk + \else + \marginparwidth=1.5\ta@hblk \fi + \else + \marginparwidth=\ta@hblk + \fi + \marginparsep=1cc % \end{macrocode} -% \changes{v2.4n}{1997/05/28}{optionale, klassische Kreisberechnung -% für \texttt{DIV}} -% Als zweiter Sonderfall wird für einen \textit{DIV}-Wert von 3 die -% \emph{Kreisberechnung} durchgeführt. Dabei wird versucht, den -% Textbereich genau so hoch zu wählen, wie das Papier breit ist. Ein -% solches Verhältnis wird bei klassischen Papierformaten als -% harmonisch betrachtet. -% \begin{macrocode} - \ifnum\ta@div=3 - \typeout{DIV calculation for classic typearea.}% - \setlength{\ta@temp}{\paperwidth}% - \addtolength{\ta@temp}{-\ta@bcor}% -% \end{macrocode} -% Bei der Berechnung des vertikal benötigten Platzes, ist zu -% beachten, ob Kopf und Fuß zum Textbereich oder zu den Rändern -% gehören. -% \begin{macrocode} - \if@hincl\else - \addtolength{\ta@temp}{\headheight}% - \addtolength{\ta@temp}{\headsep}% - \fi - \if@fincl\else - \addtolength{\ta@temp}{\footskip}% - \fi -% \end{macrocode} -% Wird vertikal mehr Platz benötigt, als vorhanden ist, wird eine -% andere Berechnung versucht, die weiter unten erfolgt. -% \changes{v2.5a}{1997/06/22}{\cs{ifdim} statt \cs{ifnum}} -% \begin{macrocode} - \ifdim \ta@temp >\paperheight - \PackageWarningNoLine{typearea}{% - No classic typearea with this papersize!\MessageBreak - Using calculated DIV% - }% - \ta@div=\@ne -% \end{macrocode} -% Ansonsten wird mittels des belegten Textbereichs und der Papierhöhe -% der obere und untere Rand zusammen, -% \begin{macrocode} - \else - \setlength{\ta@temp}{\paperheight}% - \addtolength{\ta@temp}{-\paperwidth}% - \addtolength{\ta@temp}{\ta@bcor}% -% \end{macrocode} -% daraus die Streifenhöhe -% \begin{macrocode} - \divide\ta@temp by3 -% \end{macrocode} -% und schließlich erneut mit Hilfe der Papierhöhe der genaue -% \textit{DIV}-Wert berechnet. -% \begin{macrocode} - \ta@modiv{\paperheight}{\ta@temp}% - \fi -% \end{macrocode} -% An dieser Stelle muss \texttt{mpinclude} nicht berücksichtigt -% werden, da nicht die Breite des Textbereichs, sondern die Breite des -% Papiers als Kriterium verwendet wird. +% \changes{v3.11}{2012/04/17}{advanced version with different +% \cs{marginparwidth} and unchanged \cs{marginparsep}}% +% With version 3.11 we will have an advanced version of \cs{areaset}. This +% version supports \texttt{mpinclude} option like \cs{typearea}. % \begin{macrocode} + \if@areasetadvanced + \if@mincl + \marginparwidth=\ta@hblk + \if@twoside\if@semitwoside\else + \advance\evensidemargin by\marginparwidth + \fi\fi + \advance\marginparwidth by-\marginparsep \fi + \fi + \marginparpush=0.45\baselineskip + \ta@layoutinfo{areaset}{}% % \end{macrocode} -% Wurde bisher kein Wert gefunden oder ein \textit{DIV}-Wert von 1 bis -% 2 angegeben, so wird nun ein möglichst optimaler \textit{DIV}-Wert -% ermittelt. -% \changes{v2.4n}{1997/05/28}{optimale \textit{DIV}-Berechnung -% verbessert} +% \changes{v3.11}{2012/04/17}{using \cs{@areaset@end}}^^A +% \changes{v3.16a}{2015/02/11}{using \cs{footheight} for calculation of +% page usage}^^A +% Since v3.11 we also support \cs{AfterSettingArea} analogous to +% \cs{AfterCalculatingTypearea}: % \begin{macrocode} - \ifnum\ta@div <4 - \typeout{DIV calculation for typearea with good linewidth.}% + \@areaset@end + \activateareas + \ifdim \dimexpr 1in+\topmargin + +\headheight+\headsep + +\textheight + +\footskip+\footheight-\ht\strutbox\relax + >\paperheight + \PackageWarningNoLine{typearea}{% + page content and margins higher than paper.\MessageBreak + This may result in page footer out of paper.\MessageBreak + You should decrease DIV, decrease foot height,\MessageBreak + or decreate height of text area% + }% + \fi +} % \end{macrocode} -% Zunächst könnte die Textbreite die gesamte Sichtbare Papierbreite -% einnehmen: +% \end{macro} +% +% \begin{macro}{\AfterSettingArea} +% \changes{v3.11}{2012/04/17}{new}^^A +% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} +% ersetzt}^^A +% The user may influence the result of \cs{areaset}. The star version works +% local while the non-star version is global. % \begin{macrocode} - \setlength{\textwidth}{\paperwidth}% - \addtolength{\textwidth}{-\ta@bcor}% +\newcommand*{\AfterSettingArea}{% + \kernel@ifstar \l@addto@macro \g@addto@macro \@areaset@end +} % \end{macrocode} -% Als Sollbreite wird hier die ideale Zeilenfüllung verwendet: +% \begin{macro}{\@areaset@end} +% \changes{v3.11}{2012/04/17}{new}^^A +% Macro \cs{@areaset@end} is a hook to make it possible to add some +% instructions to the end of the \cs{areaset} command. This will be executed +% before the activation of the settings inside a document. % \begin{macrocode} - \ta@temp@goodwidth +\newcommand*{\@areaset@end}{} +% % \end{macrocode} -% Im Zweispaltenmodus besteht jede Zeile aus zwei solchen Spalten -% zuzüglich dem Spaltenabstand: -% \changes{v2.8q}{2001/12/13}{\texttt{DIVcalc} liefert im -% zweispaltigen Satz (wie dokumentiert) breitere Spalten} +% \end{macro} +% \end{macro} +% +% \subsection{Deprecated options} +% +% Former versions of \KOMAScript{} had some options that are completely +% deprecated since \KOMAScript{} 3.00. Most of them but not all are pattern +% matching options. +% +% \begin{option}{DIVcalc} +% \changes{v2.4g}{1996/11/04}{new}^^A +% \changes{v2.95}{2002/12/04}{implemented using option \Option{DIV}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{deprecated}^^A +% \begin{option}{DIVclassic} +% \changes{v2.4n}{1997/05/28}{new}^^A +% \changes{v2.95}{2002/12/04}{implemented using option \Option{DIV}}^^A +% \changes{v2.97d}{2007/10/03}{\cs{PackageInfo} replaced by +% \cs{PackageInfoNoLine}}^^A +% \changes{v3.01a}{2008/11/21}{deprecated}^^A +% The former form of \Option{DIV=}\Option{calc} and +% \Option{DIV=}\Option{classic}. % \begin{macrocode} - \if@twocolumn - \addtolength{\ta@temp}{\ta@temp}% - \addtolength{\ta@temp}{\columnsep}% - \fi +%<*package&typearea&options> +\KOMA@DeclareDeprecatedOption[typearea]{DIVcalc}{DIV=calc} +\KOMA@DeclareDeprecatedOption[typearea]{DIVclassic}{DIV=classic} +% +% \end{macrocode} +% \end{option}^^A DIVclassic +% \end{option}^^A DIVcalc +% +% \begin{option}{a\meta{integer}paper} +% \begin{option}{b\meta{integer}paper} +% \begin{option}{c\meta{integer}paper} +% \begin{option}{d\meta{integer}paper} +% Formerly \Option{a}\meta{integer}\Option{paper}, +% \Option{b}\meta{integer}\Option{paper}, +% \Option{c}\meta{integer}\Option{paper}, +% \Option{d}\meta{integer}\Option{paper} has been documented. Since +% \KOMAScript{} v3.00 most of them are deprecated and has been replaced by +% option \Option{paper}. Nevertheless, for compatibility these options and the +% commands needed to recognize and handle them are still implemented. +% +% The documentation of the deprecated part of the feature is still in German. +% \selectlanguage{ngerman} +% +% \begin{macro}{\x@paper} +% \begin{macro}{\x@@paper} +% \changes{v2.5}{1997/06/17}{neue Mustererkennung für die +% Papiergröße}^^A +% Diese Makros werden ebenfalls später benötigt, wenn die Papiergröße +% festgelegt wird. +% \begin{macro}{\isopaper} +% \changes{v2.5}{1997/06/17}{neu}^^A +% \changes{v2.95}{2002/12/03}{es sind auch Großbuchstaben erlaubt}^^A +% \changes{v3.23}{2017/02/22}{verwendet \cs{ISO@PaperNameToSize}}^^A +% Da das Makro \cs{isopaper} zur Berechnung unterschiedlicher +% ISO/DIN-Papierformate in der Mustererkennung für die Papiergröße +% benötigt wird, wurde dieses Makro ebenfalls vorgezogen. +% \begin{macrocode} +%<*package&typearea&options> +\newcommand\isopaper[2][a]{% % \end{macrocode} -% In früheren Versionen erfolgte nun eine iterative Annäherung an den -% optimalen \textit{DIV}-Wert. Je nach {\TeX}-Implementierung und -% Papierformat, kann das aber recht lange dauern. Die obere Berechnung -% zum Vorbild nehmend, wird deshalb nun ebenfalls versucht, den -% optimalen Wert direkt zu berechnen. Dazu wird zunächst wie oben die -% Größe der horizontalen Ränder zusammen ermittelt: +% Das Makro kennt zwei Parameter, von denen der erste und optionale +% die Grundgröße angibt. Die Angabe erfolgt über einen +% Buchstaben. Möglich sind +% \begin{description} +% \item[a] -- ISO/DIN-A-Format +% \item[b] -- ISO/DIN-B-Format +% \item[c] -- ISO/DIN-C-Format +% \item[d] -- ISO/DIN-D-Format +% \end{description} +% Der zweite Paremeter gibt dann die Skalierung an. % \begin{macrocode} - \setlength{\ta@hblk}{\paperwidth}% - \addtolength{\ta@hblk}{-\ta@temp}% + \ISO@PaperNameToSize[typearea]#1#2\@nil % \end{macrocode} -% Daraus dann die Breite eines Streifens. +% Jetzt noch die gewünschte Ausrichtung beachten. +% \changes{v2.97e}{2007/10/23}{gewünschte Papierausrichtung wird +% beachtet}^^A +% \changes{v3.22}{2016/07/29}{Papierausrichtung entsprechend dem +% tatsächlichen Format}^^A % \begin{macrocode} - \divide\ta@hblk by3 + \expandafter\ifnum\scr@ta@v@is@ge{3.22}\relax + \scr@setpaperorientation + \else + \if@landscape\scr@switchpapersizes\fi + \fi +} % \end{macrocode} -% Ist die Breite negativ, so wird die Mindestbreite von 5mm eingesetzt. -% \changes{v2.5a}{1997/06/22}{\cs{ifdim} statt \cs{ifnum}.} +% \textsf{typearea} verwendet eine eigene Fehlerausgabe. +% \begin{macro}{\scr@UnknownPaperSize@typearea} +% \changes{v3.23}{2017/02/22}{neu (intern)} % \begin{macrocode} - \ifdim \ta@hblk <\z@ - \setlength{\ta@hblk}{5mm}% - \fi +\ProvideUnknownPaperSizeError{typearea}{% + \PackageError{typearea}{% + Unknown ISO/DIN-papersize-letter #1% + }{% + There are only four defined paper scalings:\MessageBreak + a = ISO/DIN-A, b = ISO/DIN-B, c = ISO/DIN-C, + d = ISO/DIN-D\MessageBreak + Read KOMA-Script-documentation for further information.% + }% + \setlength{\paperwidth}{841sp}% + \setlength{\paperheight}{1189sp}% +} % \end{macrocode} -% Nun kann wieder der \textit{DIV}-Wert ermittelt werden. -% \changes{v2.8q}{2002/03/28}{Berüchsichtigung von Option -% \texttt{mpinclude} bei der \textit{DIV}-Berechnung} -% Im Falle der Option \texttt{mpinclude} gilt allgemein, dass -% der Nenner mit $\frac{3}{3+m}$ zu multiplizieren ist. Dabei ist $m$ -% die Anzahl an Längeneinheiten, die für die Randnotizen verwendet -% werden sollen. Mit $m=1$ ist also der Faktor $\frac{3}{4}=0.75$ zu -% verwenden. Schwieriger wird es, wenn hier nicht die Anzahl -% Längeneinheiten, sondern ein konkreter Wert für die Breite der -% Randnotizen verwendet wird. +% \end{macro}^^A \scr@UnknownPaperSize@typearea +% \end{macro}^^A \isopaper +% \begin{macro}{\scr@setpaperorientation} +% \changes{v3.22}{2016/07/29}{neu (intern)} +% Stellt die Papierausrichtung entsprechend \cs{if@landscape} ein. % \begin{macrocode} - \if@mincl - \setlength{\ta@temp}{.75\ta@hblk}% - \else - \setlength{\ta@temp}{\ta@hblk}% - \fi - \ta@modiv{\paperwidth}{\ta@temp}% +\newcommand*\scr@setpaperorientation{% + \ifdim\paperheight>\paperwidth + \if@landscape\scr@switchpapersizes\fi + \else + \if@landscape\else\scr@switchpapersizes\fi + \fi +} % \end{macrocode} -% Als Erschwernis kommt jetzt jedoch hinzu, dass nun zwar der -% \textit{DIV}-Wert für die Breite optimal ist, jedoch u.\,U. zu einer -% zu großen Höhe führt. Deshalb wird zunächst ein Satzspiegel für -% diesen \textit{DIV}-Wert berechnet. +% \begin{macro}{\scr@switchpapersizes} +% \changes{v3.22}{2016/07/29}{neu (intern)} +% Vertauscht zwei Längen. % \begin{macrocode} - \@typearea +\newcommand*\scr@switchpapersizes{% + \@tempdima\paperwidth\paperwidth\paperheight\paperheight\@tempdima +} % \end{macrocode} -% Nun wird überprüft, ob die vertikalen Ausmaße in Ordnung sind. Auch -% hier ist wieder eine minimale Streifenbreite vorteilhaft. Die -% Streifenbreite ergibt sich direkt aus dem oberen Rand. Wobei jedoch -% noch das {\TeX}-Offset von 1\,in zu berücksichtigen ist. -% \changes{v2.5a}{1997/06/22}{\cs{ifdim} statt \cs{ifnum}} +% \end{macro}^^A \scr@switchlength +% \end{macro}^^A \scr@setpaperorientation +% \begin{macro}{\iso@paper} +% \changes{v2.95}{2002/12/03}{neu (intern)}^^A +% Ein ganz ähnlicher interner Befehl erhält den gesamten Namen des +% ISO-Papierformats als einziges Argument. +% \begin{macro}{\iso@@paper} +% \changes{v2.95}{2002/12/03}{neu (intern)}^^A +% Dieses Argument wird dann über einen weiteren internen Befehl per +% Mustererkennung in den Kennbuchstaben und eine Zahl zerlegt. % \begin{macrocode} - \setlength{\ta@temp}{-1in}% - \addtolength{\ta@temp}{5mm}% - \ifdim\topmargin <\ta@temp +\newcommand*{\iso@paper}[1]{\expandafter\iso@@paper#1\@nil} +\newcommand*{\iso@@paper}{} +\def\iso@@paper#1#2\@nil{% + \@tempswafalse + \if #1a\@tempswatrue + \else\if #1A\@tempswatrue + \else\if #1b\@tempswatrue + \else\if #1B\@tempswatrue + \else\if #1c\@tempswatrue + \else\if #1C\@tempswatrue + \else\if #1d\@tempswatrue + \else\if #1D\@tempswatrue + \fi\fi\fi\fi\fi\fi\fi\fi + \if@tempswa + \ifnumber{#2}{\isopaper[#1]{#2}}{\@tempswafalse}% + \fi +} +% % \end{macrocode} -% Ist der Minimalrand nicht eingehalten, so wird für diesen ein neuer -% \textit{DIV}-Wert ermittelt. Dabei muss ebenfalls berücksichtigt -% werden, ob Kopf- und Fußbereich zum Text oder zum Rand gehören. -% \changes{v2.5b}{1997/06/29}{bei der Mindestrandbetrachtung -% \texttt{headinclude} und \texttt{footinclude} berücksichtigen} +% \end{macro}^^A \iso@@paper +% \end{macro}^^A \iso@paper +% \selectlanguage{english} +% +% \begin{option}{DIV\meta{integer}} +% \begin{option}{BCOR\meta{length}} +% Formerly \Option{DIV}\meta{integer}, \Option{BCOR}\meta{length}, +% \Option{headlines}\meta{real} has been documented as options. Since +% \KOMAScript{} 3.00 these have been replaced by \Option{DIV=}\meta{integer}, +% \Option{BCOR=}\meta{length} and +% \Option{headlines=}\meta{real}. Nevertheless, for compatibility the +% deprecated options are still handled by \Macro{DeclareOption*} and so we +% need several helper macros to recognize them. +% +% The documentation of the deprecated part of the feature is still in German. +% \selectlanguage{ngerman} +% +% \begin{macro}{\@BCOR} +% \begin{macro}{\@@BCOR} +% \changes{v2.5}{1997/06/17}{Einzelzeichenscanner durch +% Mustererkennung ersetzt}^^A +% Das Makro \cs{@BCOR} wird später benötigt, um die Option +% \texttt{BCOR\emph{BCOR}} zu erkennen. Die Option wird über ihr +% Muster erkannt. % \begin{macrocode} - \setlength{\ta@temp}{15mm}% - \if@hincl\else - \addtolength{\ta@temp}{\headheight}% - \addtolength{\ta@temp}{\headsep}% - \fi - \if@fincl\else - \addtolength{\ta@temp}{\footskip}% - \fi - \divide\ta@temp by3 - \ta@modiv{\paperheight}{\ta@temp}% - \fi +%<*(class|(package&typearea))&options> +\newcommand*{\@BCOR}{\expandafter\@@BCOR\CurrentOption BCORBCOR\@@BCOR} +\newcommand*{\@@BCOR}{} +\def\@@BCOR #1BCOR#2BCOR#3\@@BCOR{% % \end{macrocode} -% Dieser Sonderfall ist somit abschließend behandelt. +% Handelt es sich um die Option \texttt{BCOR}, so ist der erste +% Parameter leer. % \begin{macrocode} - \fi + \ifstr{#1}{}{% % \end{macrocode} -% Damit steht jetzt also der \textit{DIV}-Wert fest, und die -% eigentliche Berechnung kann folgen. +% Außerdem ist der dritte Parameter dann \texttt{BCOR}. % \begin{macrocode} - \@typearea + \ifstr{#3}{BCOR}{% % \end{macrocode} -% \changes{v2.0e}{1994/10/28}{Seitenaufteilung wird in die log-Datei -% geschrieben}^^A -% \changes{v2.4i}{1996/11/11}{Seitenaufteilung wird etwas später in -% die log-Datei geschrieben}^^A -% \changes{v2.4i}{1996/11/11}{am Ende von \cs{typearea} wird noch -% \cs{@typeare@end} ausgeführt} -% \changes{v2.4j}{1996/12/04}{bei der Seitenaufteilung wird -% \cs{textheight} nicht mehr doppelt, dafür zusätzlich -% \cs{baselineskip} ausgegeben} -% \changes{v2.5}{1997/06/17}{"`arithmetic overflow"' bei landscape -% behoben}^^A -% \changes{v2.95}{2004/01/30}{Warnung im Zweispaltenmodus korrigiert}^^A -% \changes{v3.00}{2008/10/08}{Layout-Infos werden per \cs{ta@layoutinfo}^^A -% in die \texttt{log}-Datei geschrieben} -% \changes{v3.01b}{2008/12/09}{Warnungen vor ungünstigen Einstellungen -% geändert}^^A -% Zum Schluss soll die Seitenaufteilung noch in die \texttt{log}-Datei -% geschrieben werden. +% Der zweite Parameter sollte dann die Größe enthalten. Ist dies +% nicht der Fall, wird ein Fehler gemeldet (Fehlerzeile ist dann +% \cs{ProcessOptions}). +% \changes{v3.22}{2016/07/29}{missing deprecated option warning added}^^A % \begin{macrocode} - \ta@temp@goodwidth - \if@twocolumn - \addtolength{\ta@temp}{\ta@temp}% - \addtolength{\ta@temp}{\columnsep}% - \fi - \setlength{\@tempdima}{\ta@temp}% - \addtolength{\ta@temp}{-\textwidth}% - \divide\@tempdima by100 - \divide\ta@temp by\@tempdima - \@tempcnta=\ta@temp - \ifnum\@tempcnta <5 - \ifnum\@tempcnta >-5 - \@tempcnta=0 - \else - \advance\@tempcnta by4 - \fi - \else - \advance\@tempcnta by-4 - \fi - \ifnum\@tempcnta <-15 - \@tempcnta=-\@tempcnta - \PackageWarningNoLine{typearea}{% - Bad type area settings!\MessageBreak - The detected line width is about - \the\@tempcnta\@percentchar\MessageBreak - larger than the heuristically detected line width.\MessageBreak - You should e.g. decrease DIV, increase fontsize\MessageBreak - or change papersize% - }% - \@tempcnta=-\@tempcnta - \else - \ifnum\@tempcnta>15 - \PackageWarningNoLine{typearea}{% - Maybe no optimal type area settings!\MessageBreak - The maximum limit of line width is about - \the\@tempcnta\@percentchar\MessageBreak - larger than the heuristically detected line width.\MessageBreak - You may e.g. increase DIV, decrease fontsize\MessageBreak - or change the papersize% - } - \fi\fi - \ifnum\ta@div <6 - \PackageWarningNoLine{typearea}{% - Very low DIV value!\MessageBreak - DIV values less than 6 result in textwidth/-height\MessageBreak - smaller than total marginwidth/-height.\MessageBreak - You should e.g. increase DIV, increase fontsize or\MessageBreak - change papersize% - } - \fi - \ta@layoutinfo{\number\ta@div}{\the\@tempcnta}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{DIV}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{DIV}{\@lastdiv}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{BCOR}% - \KOMA@kav@xadd{.typearea.\scr@pkgextension}{BCOR}{\the\ta@bcor}% - \@typearea@end - \activateareas - \ifdim \dimexpr 1in+\topmargin - +\headheight+\headsep - +\textheight - +\footskip+\dp\strutbox\relax - >\paperheight - \PackageWarningNoLine{typearea}{% - page content and margins higher than paper.\MessageBreak - This may result in page footer out of paper.\MessageBreak - You should decrease DIV, decrease foot height,\MessageBreak - or include footer into type area% - }% - \fi - \fi -} +% \PassOptionsToPackage{BCOR#2}{typearea}% +%<*package> + \ifdimen{#2}{% + \KOMA@UseDeprecatedOption{% + \PackageWarningNoLine{typearea}}{BCOR#2}{BCOR=#2}% + }{\scr@pti@nerr@r}% +% % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\ta@layoutinfo} -% \changes{v3.00}{2008/10/08}{neu (intern)}^^A -% Schreibt die Layout-Information in die \texttt{log}-Datei. Dabei ist das -% erste Argument die Ausgabe für den DIV-Wert und das zweite Argument die -% DIV-Abweichung. Letztere wird nur ausgegeben, wenn das Argument nicht leer -% und nicht \cs{relax} ist. +% In allen anderen Fällen ist es nicht diese Option, dann wird ein +% Fehler ausgegeben. Stattdessen könnte hier auch auf weitere Optionen +% getestet werden. % \begin{macrocode} -\newcommand*{\ta@layoutinfo}[2]{% - \PackageInfo{typearea}{% - These are the values describing the layout:\MessageBreak - DIV\space\space=\space#1\MessageBreak - BCOR\space=\space\the\ta@bcor\MessageBreak - \string\paperwidth\space\space\space\space\space\space=% - \space\the\paperwidth\MessageBreak - \space\string\textwidth\space\space\space\space\space\space=% - \space\the\textwidth\MessageBreak - \ifx\relax#2\relax\else - \space DIV departure\space\space\space=% - \space#2\@percentchar\MessageBreak - \fi - \space\string\evensidemargin\space=% - \space\the\evensidemargin\MessageBreak - \space\string\oddsidemargin\space\space=% - \space\the\oddsidemargin\MessageBreak - \string\paperheight\space\space\space\space\space=% - \space\the\paperheight\MessageBreak - \space\string\textheight\space\space\space\space\space=% - \space\the\textheight\MessageBreak - \space\string\topmargin\space\space\space\space\space\space=% - \space\the\topmargin\MessageBreak - \space\string\headheight\space\space\space\space\space=% - \space\the\headheight\MessageBreak - \space\string\headsep\space\space\space\space\space\space\space\space=% - \space\the\headsep\MessageBreak - \space\string\topskip\space\space\space\space\space\space\space\space=% - \space\the\topskip\MessageBreak - \space\string\footskip\space\space\space\space\space\space\space=% - \space\the\footskip\MessageBreak - \space\string\baselineskip\space\space\space=% - \space\the\baselineskip\MessageBreak - }% + }{\scr@pti@nerr@r}% + }{\scr@pti@nerr@r}% } % \end{macrocode} % \end{macro} -% -% \begin{macro}{\recalctypearea} -% \changes{v2.95}{2002/12/04}{Neu}^^A -% Dieses Anweisung dient der Neuberechnung des Satzspiegels mit den -% zuletzt eingestellten Werten. Dieser Befehl existiert erst, nachdem -% das Paket geladen wurde. -% \begin{macrocode} -\AtEndOfPackage{\newcommand*{\recalctypearea}{\typearea[current]{last}}} -% \end{macrocode} % \end{macro} % -% \begin{macro}{\areaset} -% \changes{v2.1b}{1994/12/31}{\cs{headheight} von \cs{@ptsize} -% abhängig gemacht} -% \changes{v2.6}{2000/01/04}{\cs{headheight} von \cs{f@size} statt -% von \cs{@ptsize} abhängig gemacht} -% \changes{v2.7g}{2001/04/17}{auch hier existiert der symbolische -% Wert \texttt{current} für BCOR} -% \changes{v2.95}{2002/12/05}{am Ende von \cs{areaset} wird noch -% \cs{@typeare@end} ausgeführt} -% Zur Berechnung eines Satzspiegels mit fester Breite und Höhe dient -% der Befehl \cs{areaset}. Der Algorithmus ist ähnlich dem vorherigen -% Verfahren, aber einfacher. Auch hier soll ein Wechsel innerhalb des -% Dokuments ermöglicht werden. -% \begin{macrocode} -\newcommand*\areaset[3][\z@]{% - \edef\@tempa{#1}\edef\@tempb{current}\ifx\@tempa\@tempb\else - \setlength{\ta@bcor}{#1}% - \fi -% \end{macrocode} -% Bevor nun irgendeine Berechnung durchgeführt wird, muss ggf. eine -% neue Seite begonnen werden. +% \begin{macro}{\@DIV} +% \begin{macro}{\@@DIV} +% \changes{v2.5}{1997/06/17}{Einzelzeichenscanner durch +% Mustererkennung ersetzt}^^A +% \changes{v3.22}{2016/07/29}{missing deprecated option warning added}^^A +% Die grundsätzliche Funktion ist die gleiche wie bei \cs{@BCOR}, +% \cs{@@BCOR}. % \begin{macrocode} - \if@atdocument\newpage\fi +\newcommand*{\@DIV}{\expandafter\@@DIV\CurrentOption DIVDIV\@@DIV} +\newcommand*{\@@DIV}{} +\def\@@DIV #1DIV#2DIV#3\@@DIV{% + \edef\@tempa{#1}\ifx\@tempa\@empty + \edef\@tempa{#3}\def\@tempb{DIV}\ifx\@tempa\@tempb +% \PassOptionsToPackage{DIV#2}{typearea}% +%<*package> + \ifnumber{#2}{% + \KOMA@UseDeprecatedOption{% + \PackageWarningNoLine{typearea}}{DIV#2}{DIV=#2}% + }{\scr@pti@nerr@r}% +% + \else\scr@pti@nerr@r\fi % \end{macrocode} -% Erst dann folgt die eigentlich Berechnung: -% \changes{v2.96}{2006/09/12}{\cs{topskip} wird gesetzt} -% \changes{v3.00}{2008/10/08}{Layout-Infos werden per \cs{ta@layoutinfo}^^A -% in die \texttt{log}-Datei geschrieben} +% Der Unterschied liegt darin, dass bei einem Fehlschlag der +% Mustererkennung kein Fehler vorliegt, sondern u.\,U. noch auf +% \texttt{BCOR} getestet werden muss. % \begin{macrocode} - \setlength{\textwidth}{#2}% - \setlength{\textheight}{#3}% - \def\@lastdiv{areaset}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{DIV}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{DIV}{areaset}% - \KOMA@kav@removekey{.typearea.\scr@pkgextension}{BCOR}% - \KOMA@kav@add{.typearea.\scr@pkgextension}{BCOR}{\the\ta@bcor}% - \ta@hblk=\paperwidth - \advance\ta@hblk by-\ta@bcor - \advance\ta@hblk by-\textwidth + \else\@BCOR\fi +} % \end{macrocode} -% \changes{v3.11}{2012/04/17}{advanced version with different margin widths}% -% With version 3.11 we will have an advanced version of \cs{areaset}. This -% version takes care to option \texttt{mpinclude}. +% \end{macro}^^A \@@DIV +% \end{macro}^^A \@DIV +% +% \begin{option}{headlines\meta{integer}} +% \begin{macro}{\@headlines} +% \begin{macro}{\@@headlines} +% \changes{v2.7g}{2001/04/17}{neue Mustererkennung für die Anzahl +% der Kopfzeilen}^^A +% Das Macro \cs{@headlines} wird benötigt, um die Option +% \texttt{headlines} zu erkennen. % \begin{macrocode} - \if@areasetadvanced - \if@mincl - \divide\ta@hblk by4 - \else - \divide\ta@hblk by3 - \fi - \else - \divide\ta@hblk by3 - \fi - \oddsidemargin=-1in - \evensidemargin=-1in - \if@twoside - \if@semitwoside - \advance\oddsidemargin by1.5\ta@hblk - \advance\oddsidemargin by\ta@bcor +\newcommand{\@headlines}{% + \expandafter\@@headlines\CurrentOption headlines\@@headlines% +} +\newcommand*{\@@headlines}{} +\def\@@headlines #1headlines#2\@@headlines{ + \edef\@tempa{#2}\edef\@tempb{headlines}\ifx\@tempa\@tempb +% \PassOptionsToPackage{#1headlines}{typearea} +% \setlength{\@tempdima}{#1\baselineskip}% +% \def\ta@hh{#1\baselineskip}% + \else\@DIV\fi +} +% % \end{macrocode} -% \changes{v3.12}{2013/10/15}{use alternating \texttt{BCOR} with -% \texttt{twoside!=semi}} -% Wenn \texttt{twoside=semi} verwendet wird, wird der Binderand ab -% \KOMAScript~3.12 dem inneren Rand zugeschlagen. Bei Kompatibilität zu -% älteren Versionen wird hingegen immer der linke Rand verwendet. +% \end{macro}^^A \@headlines +% \end{macro}^^A \@@headlines +% +% \selectlanguage{english} +% Starting point for all the deprecated pattern matching options is +% \Macro{DeclareOption*} for command \Macro{x@paper} that uses pattern +% matching with \Macro{x@@paper} to recognize the deprecated options. These +% are needed not only for package \Package{typearea} but also for the classes. +% +% The documentation of the deprecated part of the feature is still in German. +% \selectlanguage{ngerman} +% Zurück zur Mustererkennung. Diese ist tatsächlich etwas einfacher +% als die in den beiden Fällen zuvor. +% \changes{v2.97e}{2007/10/23}{Optionen werden nach der neuen Syntax an +% typearea weitergeleitet}^^A % \begin{macrocode} - \expandafter\ifnum\scr@ta@v@is@lt{3.12}\relax - \evensidemargin=\oddsidemargin - \else - \advance\evensidemargin by1.5\ta@hblk - \fi - \else - \advance\oddsidemargin by\ta@hblk - \advance\oddsidemargin by\ta@bcor - \advance\evensidemargin by2\ta@hblk - \fi - \else - \advance\oddsidemargin by1.5\ta@hblk - \advance\oddsidemargin by\ta@bcor - \evensidemargin\oddsidemargin - \fi - \scr@ifundefinedorrelax{@ptsize}{% - \topskip=\f@size\p@ +%<*(class|(package&typearea))&options> +\newcommand*{\x@paper}{% + \expandafter\x@@paper\CurrentOption paper\x@@paper% +} +\newcommand*{\x@@paper}{} +\def\x@@paper #1#2paper#3\x@@paper{% + \ifstr{#3}{paper}{% + \ifnumber{#2}{% + \ifstr{#1}{a}{% +% \PassOptionsToPackage{#3=#1#2}{typearea}% +% \isopaper[a]{#2}% + }{% + \ifstr{#1}{b}{% +% \PassOptionsToPackage{#3=#1#2}{typearea}% +% \isopaper[b]{#2}% + }{% + \ifstr{#1}{c}{% +% \PassOptionsToPackage{#3=#1#2}{typearea}% +% \isopaper[c]{#2}% + }{% + \ifstr{#1}{d}{% +% \PassOptionsToPackage{#3=#1#2}{typearea}% +% \isopaper[d]{#2}% + }{\scr@pti@nerr@r}% + }% + }% + }% + }{\scr@pti@nerr@r}% }{% - \topskip=\@ptsize\p@ - \advance\topskip by 10\p@ +% \@pt@scan +% \@headlines }% +} % \end{macrocode} -% \changes{v3.11}{2012/04/17}{advanced version with different margin widths}% -% With version 3.11 we will have an advanced version of \cs{areaset}. This -% version uses the head height algorithm of \cs{typearea}. +% +% \begin{macro}{\scr@pti@nerr@r} +% \changes{v2.95}{2002/06/20}{\cs{OptionNotUsed} statt +% \cs{PackageError}} +% Falls die zuätzliche Option nicht \texttt{BCOR}, \texttt{DIV}, +% \texttt{headlines} oder eine bekannte Papiergröße ist, ist die +% Option nicht verwendet. % \begin{macrocode} - \if@areasetadvanced - \normalsize - \@ifundefined{ta@hh}{% - \headheight=1.25\baselineskip - }{% - \headheight=\ta@hh - }% - \else - \headheight=15\p@ - \advance\headheight by\f@size\p@ - \advance\headheight by-10\p@ - \fi - \headsep=1.5\baselineskip +\newcommand*{\scr@pti@nerr@r}{ +% \OptionNotUsed +% \@unknownoptionerror +} % \end{macrocode} -% \changes{v3.12}{2013/03/26}{changes for height of foot}^^A +% \end{macro} +% +% \changes{v2.97c}{2007/09/12}{\cs{lco@test} bei den geparsten Optionen +% eingefügt} % \begin{macrocode} - \@ifundefined{footheight}{\newlength\footheight}{} - \if@areasetadvanced - \@ifundefined{ta@fh}{% - \footheight=1.25\baselineskip - \footskip=3.5\baselineskip - }{% - \footheight=\ta@fh - \footskip=\dimexpr \footheight+2.25\baselineskip\relax - }% - \else - \footheight=1.25\baselineskip - \footskip=3.5\baselineskip - \fi - \ta@vblk=\paperheight - \advance\ta@vblk by-\textheight - \divide\ta@vblk by3 - \if@hincl - \advance\textheight by-\headheight - \advance\textheight by-\headsep - \fi - \if@fincl - \advance\textheight by-\footskip - \fi - \topmargin=-1in - \advance\topmargin by\ta@vblk - \if@hincl \else - \advance\topmargin by-\headheight - \advance\topmargin by-\headsep - \fi - \if@twoside - \if@semitwoside - \marginparwidth=\ta@hblk - \else - \marginparwidth=1.5\ta@hblk - \fi - \else - \marginparwidth=\ta@hblk - \fi - \marginparsep=1cc +\DeclareOption*{% +% \lco@test + \x@paper} +% % \end{macrocode} -% \changes{v3.11}{2012/04/17}{advanced version with different -% \cs{marginparwidth} and unchanged \cs{marginparsep}}% -% With version 3.11 we will have an advanced version of \cs{areaset}. This -% version supports \texttt{mpinclude} option like \cs{typearea}. +% \end{option}^^A headline... +% \end{option}^^A DIV... +% \end{option}^^A BCOR... +% \end{macro}^^A \x@paper +% \end{macro}^^A \x@@paper +% \end{option}^^A d...paper +% \end{option}^^A c...paper +% \end{option}^^A b...paper +% \end{option}^^A a...paper +% +% \selectlanguage{english} +% +% ^^A This part should stay at the end of the source file! +% \subsection{Configuration file} +% +% At the very ending of the option section just before executing and +% processing the options you can add additional options the +% \Package{typearea}. This is a very seldom used feature and I recommend to +% not use it any longer. If you need additional options use +% |\BeforeFamilyProcessOptions[.typearea.sty]{KOMA}{...}|. +% +% \changes{v2.0e}{1994/10/28}{configuration file \File{typearea.cfg}}^^A % \begin{macrocode} - \if@areasetadvanced - \if@mincl - \marginparwidth=\ta@hblk - \if@twoside\if@semitwoside\else - \advance\evensidemargin by\marginparwidth - \fi\fi - \advance\marginparwidth by-\marginparsep - \fi - \fi - \marginparpush=0.45\baselineskip - \ta@layoutinfo{areaset}{}% -% \end{macrocode} -% \changes{v3.11}{2012/04/17}{using \cs{@areaset@end}}^^A -% \changes{v3.16a}{2015/02/11}{using \cs{footheight} for calculation of -% page usage}^^A -% Since version~3.11 we also support \cs{AfterSettingArea} analogous to -% \cs{AfterCalculatingTypearea}: +%<*package&typearea&options> +\InputIfFileExists{typearea.cfg}{% + \typeout{% + ***************************************^^J% + * Local config file typearea.cfg used^^J% + ***************************************% + } +}{} +% +% \end{macrocode} +% +% \subsection{Option execution} +% +% The paper size and telling the back-end driver information about the paper +% size are default. The default for the default paper size will be \Option{A4} +% if nothing else was defined by a class. Execution of option \Option{twoside} +% depends already on the setting of \cs{if@twoside} and +% \cs{if@semitwoside}. This may be surprising but nevertheless is correct. +% \changes{v2.3h}{1995/01/19}{\cs{relax} after \cs{ProcessOptions} added}^^A +% \changes{v2.96}{2006/08/18}{processing options in order of usage instead of +% order of declaration}^^A +% \changes{v2.97c}{2007/04/19}{Usage of \cs{KOMAExecuteOptions} instead of +% \cs{KOMAoptions}}^^A +% \changes{v2.97c}{2007/04/19}{Usage of \cs{KOMAProcessOptions} instead of +% \cs{ProcessOptions}}^^A +% \changes{v2.97c}{2007/04/19}{set only options that are not an implicit +% default}^^A +% \changes{v2.97c}{2007/07/18}{explicit setting of a valid value to +% \texttt{twoside}}^^A +% \changes{v3.12}{2013/11/11}{the default paper size is given by +% \cs{defaultpagesize}}^^A +% \changes{v3.17}{2015/03/02}{\Option{pagesize} is default}^^A +% \begin{macro}{\defaultpapersize} +% \changes{v3.12}{2013/11/11}{new}^^A +% The default paper size. Defined using \cs{providecommand} so it can be +% changed by a class or wrapper package or \File{typearea.cfg} or somewhere +% else before loading \Package{typearea}. % \begin{macrocode} - \@areaset@end - \activateareas - \ifdim \dimexpr 1in+\topmargin - +\headheight+\headsep - +\textheight - +\footskip+\footheight-\ht\strutbox\relax - >\paperheight - \PackageWarningNoLine{typearea}{% - page content and margins higher than paper.\MessageBreak - This may result in page footer out of paper.\MessageBreak - You should decrease DIV, decrease foot height,\MessageBreak - or decreate height of text area% - }% - \fi -} +%<*package&typearea&options> +\providecommand*{\defaultpapersize}{A4} +% % \end{macrocode} % \end{macro} -% -% -% \subsection{Berechnung des Standardsatzspiegels} -% -% \changes{v2.8q}{2001/11/06}{Initialisierung mit Hilfe der -% symbolischen Werte \texttt{current}} -% Nun fehlt nur noch die eigentliche Initialisierung. Dazu wird -% einfach der Satzspiegel mit den getroffenen Voreinstellungen -% berechnet. Da der \textit{DIV}-Wert 0 für einen Wert aus der -% Default-Liste steht, bleibt die Kompatibilität zu älteren Versionen -% erhalten. Der aktuelle Wert für \textit{DIV} und \textit{BCOR} wurde -% über die Optionen bereits gesetzt. Dabei kann abweichend zu sonst -% der aktuelle Wert auch 0, 1, 2 oder 3 sein. Die Initialisierung des -% Pakets ist damit sehr einfach. % \begin{macrocode} -\typearea[current]{current} +%<*package&typearea&options> +\KOMAExecuteOptions{paper=\defaultpapersize,pagesize} +\if@twoside + \if@semitwoside + \KOMAExecuteOptions{twoside=semi} + \else + \KOMAExecuteOptions{twoside} + \fi +\else + \KOMAExecuteOptions{twoside=false} +\fi +\KOMAProcessOptions\relax +% % \end{macrocode} % -% \iffalse -% -% -% -% \fi -% % \Finale % \endinput -- cgit v1.2.3