With
headings=small
:
Attribute
Default Value
afterskip
1.35\baselineskip plus .09\baselineskip minus .15\baselineskip
beforeskip
-2.8\baselineskip-\parskip
font
\Large
\chapterheadstartvskip
\chapterheadmidvskip
\chapterheadendvskip
\partheadstartvskip
\partheadmidvskip
\partheadendvskip
\partheademptypage
These commands are used inside of the definition of the headings
\chapter
,
\part
,
\addchap
,
\addpart
and their star-variations.
Thereby \chapterheadstartvskip is designed to
be a command, that inserts a vertical distance before the chapter heading. Analogues
\chapterheadendvskip
is designed to be a command, that inserts a vertical distance after the
chapter heading. If
v3.15
the chapter heading has a prefix number line (see option
chapterprefix
in
section 3.16
,
page 91
), \chapterheadmidvskip will be used between the number line and
the heading text.
Vertical distance above and below part headings will be inserted using the commands
\partheadstartvskip
and \partheadendvskip. A page break would be interpreted to be
part of the vertical distance and therefore is already part of the default of \partheadendvskip
Chapter 21: Additional Information about the Main Classes and scrextend
456
in scrbook and scrreprt. Command \partheademptypage
v3.02
is used to produce the empty page
scrbook
,
scrreprt
after the part heading page of scrbook and scrreprt.
Since KOMA-Script 3.15
v3.15
the defaults of these seven commands are independent from option
headings
(see
section 3.16
,
page 91
). The original definitions of the chapter heading reads
since KOMA-Script 3.157
v3.17
:
\newcommand*{\chapterheadstartvskip}{\vspace{\@tempskipa}}
\ newcommand*{\chapterheadmidvskip}{\ par\ nobreak\ vskip\@tempskipa}
\newcommand*{\chapterheadendvskip}{\vskip\@tempskipa}
Every usage of
headings=big
,
headings=normal
, or
headings=small
reactivates these default
definitions.
Command
\chapter
automatically sets the internal length \@tempskipa to the value of the
\DeclareSectionCommand
attribute beforeskip before calling \chapterheadstartvskip.
Correspondingly it sets the length to the value of attribute afterskip before calling
\chapterheadendvskip
and innerskip before calling \chapterheadmidvskip. If you re-
define \chapterheadstartvskip, \chapterheadmidvskip, or \chapterheadendvskip you
should also correspond the new definition to \@tempskipa to respect the values of
\DeclareSectionCommand
.
The default values of the distances of
\part
do not depend on option
headings
. So the
corresponding commands will not be redefined using the options. The
v3.17
original definitions of
these commands of scrbook and scrreprt read:
\newcommand*{\partheadstartvskip}{%
\null\vskip-\baselineskip\vskip\@tempskipa
}
\newcommand*{\partheadmidvskip}{%
\ par\ nobreak
\vskip\@tempskipa
}
\newcommand*{\partheadendvskip}{%
\ vskip\@tempskipa\ newpage
}
and of scrartcl:
\ newcommand*{\partheadstartvskip}{ %
\addvspace{\@tempskipa}%
}
\newcommand*{\partheadmidvskip}{%
\ par\ nobreak
}
\newcommand*{\partheadendvskip}{%
\ vskip\@tempskipa
}
Chapter 21: Additional Information about the Main Classes and scrextend
457
Again
\part
sets \@tempskipa to the values of
\DeclareSectionCommand
before the internal
usage of the command.
It
v3.17
is not recommended to redefine the command for the distances above or below the
headings only for changing these distances, because you can reconfigure these distances
much easier using
\RedeclareSectionCommand
. Redefinition of the commands should be
reserved to more complex changes. An example that redefines \chapterheadstartvskip and
\chapterheadendvskip
to print extra rules above and below the chapter heading may be
found at [
KDP
] (in German).
\chapterlineswithprefixformat{level }{number }{text }
\chapterlinesformat{level }{number }{text }
These
v3.19
commands are used by headings with style chapter to output the heading number and
heading text depending on option
chapterprefix
(see
section 3.16
,
page 91
). If the option is
true \chapterlineswithprefixformat
is used, otherwise \chapterlinesformat.
The arguments number and text are already formatted, i. e., they contain font selections.
At least the order and layout of both has to be done with these commands. If a heading
has no number argument number will be completely empty also without any format or font
commands.
The default definitions are very simple:
\newcommand{\chapterlinesformat}[3]{%
\@hangfrom{#2}{#3}%
}
\newcommand{\chapterlineswithprefixformat}[3]{%
#2#3 %
}
Example: You want to have chapter headings with yellow background. For the headings
without prefix line you use the follow definition in the document preamble:
\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
\colorbox{yellow}{%
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}{%
\@hangfrom{#2}#3%
}%
}%
}
\makeatother
For chapter headings without prefix line you use:
\renewcommand{\chapterlineswithprefixformat}[3]{%
\colorbox{yellow}{%
Chapter 21: Additional Information about the Main Classes and scrextend
458
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}{%
#2#3%
}%
}%
}
Unfortunately you will find, that these re-definitions result in justified text
for the headings. The reason is the \parbox command. To change this,
you can use
\raggedchapter
(see
section 3.16
,
page 102
) inside the argu-
ment of \parbox.
Otherwise \raggedchapter would be used only before
\chapterlineswithprefixformat
and \chapterlinesformat:
\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
\colorbox{yellow}{%
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}{%
\raggedchapter
\@hangfrom{#2}#3%
}%
}%
}
\makeatother
\ renewcommand{\ chapterlineswithprefixformat}[3]{ %
\colorbox{yellow}{%
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}{%
\raggedchapter
#2#3%
}%
}%
}
Remember to use \makeatletter and \makeatother only at the document pream-
ble. Do not use it inside your own wrapper-class or package. It is only needed
because of \@hangfrom in the definition of \chapterlinesformat.
As the example shows, users, who change the definition of one of the commands, should
take care of several side effects. The alignment of the text is only one thing. They also have
to prevent page breaks in the headings, e. g., if they add extra space into the output. The
example above does not have page break problems. Not only the boxes prevent page breaks.
KOMA-Script itself also changes \interlinepenalty as part of text to prevent page breaks.
It also finishes text with an internal paragraph break using \@par.
Command
\raggedchapter
is
not
part
of
text
but
executed
before
\chapterlineswithprefixformat
or \chapterlinesformat. This makes it much eas-
ier to use, e. g., \MakeUppercase at a re-definition. Please note, typographers use individual
letter spacing at majuscule text, but L
A
TEX command \MakeUppercase does not.
Chapter 21: Additional Information about the Main Classes and scrextend
459
The first argument, level , is not used by the default definition and also not needed in
the example above. It is of interest only, if a user would define several commands with
chapter
style and need to distinguish the different levels. The predefined commands
\chapter
,
\chapter*
,
\addchap
, and
\addchap*
all share the same level chapter .
\sectionlinesformat{level }{indent }{number }{text }
\sectioncatchphraseformat{level }{indent }{number }{text }
These
v3.19
commands are used by headings with style section to output the heading number and
heading text. If the heading is printed as catch phrase at the very beginning of the following
paragraph text \sectioncatchphraseformat is used, otherwise \sectionlinesformat.
In both cases indent is the value of the horizontal indention of the heading relative to the
text area. If the value is negative the heading should even move into the left margin.
The arguments number and text are already formatted, i. e., they contain font selections.
At least the order and layout of both has to be done with these commands. If a heading
has no number argument number will be completely empty also without any format or font
commands.
The default definitions are:
\newcommand{\sectionlinesformat}[4]{%
\@hangfrom{\hskip #2#3}{#4}%
}
\newcommand{\sectioncatchphraseformat}[4]{%
\ hskip #2#3#4 %
}
If the user re-defines one of these commands, he has to take care to prevent page breaks
inside the printing of the heading. KOMA-Script itself only changes \interlinepenalty to
impede page breaks.
Example: Like chapter headings in the previous example, headings of level section should
be printed with a background colour. The lower levels should be affected:
\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
\@tempswafalse
\ifstr{#1}{section}{%
\hspace*{#2}%
\colorbox{yellow}{%
\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep-#2}{%
\raggedsection
\@hangfrom{#3}{#4}%
}%
}%
}{%
Chapter 21: Additional Information about the Main Classes and scrextend
460
\@hangfrom{\hskip #2#3}{#4}%
}%
}
\makeatother
With this code the indention part of indented headings would not be coloured, but
with negative indention the background of the margin part of the headings will
also become yellow. You can move the \hspace* command into the \colorbox to
change this.
Again remember to use \makeatletter and \makeatother only at the document
preamble. Do not use it inside your own wrapper-class or package. It is only
needed because of \@hangfrom in the definition of \sectionlinesformat.
The first argument, level , is not used by the default definition. The example shows how
to use it to distinguish different heading levels of the same style section.
\SecDef{star command }{command }
\scr@startsection{name }{level }{indent }{beforeskip }{afterskip }{style commands }
[short version ]{heading }
\scr@startsection{name }{level }{indent }{beforeskip }{afterskip }{style commands }*
{heading }
\At@startsection{code }
\Before@ssect{code }
\Before@sect{code }
As
v3.15
already explained in
section 3.16
in the description of the sectioning commands beginning
with
page 95
, KOMA-Script provides additional features for the optional argument of those
commands. Therefore, it was necessary to replace some L
A
TEX kernel commands, especially
\secdef
and \@startsection. The meaning of the parameters of these commands can be
found in the L
A
TEX kernel manual [
BCJ
+
05
].
Unfortunately these commands are often redefined by other packages in a way that col-
lides with the functionality of KOMA-Script. So KOMA-Script not only changes the defini-
tion of these commands but also defines the additional, alternative commands \SecDef and
\scr@startsection
. Package authors are permitted to use these commands like they would
use the corresponding L
A
TEX kernel commands and therefore participate in the additional fea-
tures of KOMA-Script. Nevertheless these commands should not be redefined, because they
could be changed in future and so the redefinition would impair KOMA-Script again.
KOMA-Script internally uses \SecDef and \scr@startsection instead of \secdef and
\@startsection
, e. g., defining section-like commands by
\DeclareSectionCommand
. So later
redefinition of \secdef or \@startsection will not influence the sectioning commands of
KOMA-Script.
Chapter 21: Additional Information about the Main Classes and scrextend
461
As an alternative to the redefinition of such commands, KOMA-Script provides the execution
of additional code at several states of the KOMA-Script replacements. The code of each usage
of \At@startsection, \Before@sect, or \Before@ssect will be cumulated independently.
Later removing of added code is not provided.
The code of \At@startsection is executed immediately after the evaluation of beforeskip
and calculation of the resulting \@tempskipa, before adding the vertical gap itself. So you
still may change the value of \@tempskipa.
The code of \Before@sect and \Before@ssect is executed just before \@sect and \@ssect
inside \scr@startsection, respectively. At this state the vertical gap of \@tempskipa has
already been added using \addvspace.
The commands \At@startsection, \Before@sect, and \Before@ssect are suggested for
package authors.
\appendixmore
There is a peculiarity within the
\appendix
command in the KOMA-Script classes. If
the command \appendixmore is defined, this command is executed also by the
\appendix
command. Internally the KOMA-Script classes scrbook and scrreprt take advantage of this
scrbook
,
scrreprt
behaviour to implement the options
appendixprefix
(see
section 3.16
,
page 91
). You
should take note of this in case you decide to define or redefine the macro \appendixmore.
In case one of this option has been used, you will receive an error message when using
\newcommand{\appendixmore}{
. . . }. This behaviour is intended to prevent you from dis-
abling options without noticing it.
Example: You do not want the chapters in the main part of the classes scrbook or scrreprt to
be introduced by a prefix line (see layout options
chapterprefix
in
section 3.16
,
page 91
). For consistency you also do not want such a line in the appendix either.
Instead, you would like to see the word “Chapter” in the language of your choice
written in front of the chapter letter and, simultaneously, in the page headings.
Instead of using layout option
appendixprefix
, you would define in the document
preamble:
\newcommand*{\appendixmore}{%
\renewcommand*{\chapterformat}{%
\appendixname~\thechapter\autodot\enskip}
\renewcommand*{\chaptermarkformat}{%
\appendixname~\thechapter\autodot\enskip}
}
In case you subsequently change your mind and decide to use the option
appendixprefix
at a later stage, you will get an error message because of the
already defined \appendixmore command. This behaviour prevents the definition
made above from invisibly changing the settings intended with the option.
Chapter 21: Additional Information about the Main Classes and scrextend
462
It is also possible to get a similar behaviour of the appendix for the class scrartcl.
You can write in the preamble of your document:
\newcommand*{\appendixmore}{%
\renewcommand*{\sectionformat}{%
\appendixname~\thesection\autodot\enskip}%
\renewcommand*{\sectionmarkformat}{%
\appendixname~\thesection\autodot\enskip}}
Redefined commands are explained in more detail in
section 3.16
,
page 103
and
page 105
.
\newbibstyle[parent style ]{name }{instructions }
\newblock
\@openbib@code
\bib@beginhook
\bib@endhook
The standard classes already provide command \newblock for structuring of bibliography
entries. The exact purpose of this command depends on the class options. Using option
openbib
redefine commands \@openbib@code and \newblock at the end of the used standard
class. These classes execute command \@openbib@code at the begin — or more precise: at the
specification of the parameters of the — list environment, that will be used for the bibliography.
It should be assumed, that many packages will execute this command in the same kind, if
they redefine the bibliography.
The KOMA-Script classes do something similar. Nevertheless, they do not redefine
\@openbib@code
at the end of the class. Instead of, the bibliography style openstyle is defined
using \newbibstyle. The instructions , that has been defined as part of the implementation,
contain the appropriate redefinition of \@openbib@code and \newblock. Now, if this bibliog-
raphy style will be selected using option
bibliography=openstyle
, then the instructions
will be executed immediately. This will redefine \@openbib@code and \newblock.
Beside \@openbib@code and \newblock also \bib@beginhook and \bib@endhook may be
redefined by the instructions of the style. Command \bib@beginhook will be executed
immediately after heading and preamble of the bibliography, but before the begin of the list
with the bibliography entries. Command \bib@endhook will be executed immediately after
this list at the end of the bibliography. If
\BreakBibliography
(see
section 3.23
,
page 139
)
intercepts the bibliography, these commands will also executed at the begin and end of each
part of the bibliography, this would be immediately before and after
\BreakBibliography
.
The commands \newblock, \@openbib@code, \bib@beginhook, and \bib@endhook will
be reset to an empty definition at the start of each new bibliography style. After this the
instructions
of the parent style of the bibliography style will be executed. After this the
Chapter 21: Additional Information about the Main Classes and scrextend
463
instructions
of the bibliography style itself will be executed. Because of this these commands
has to be defined using \renewcommand not \newcommand inside of argument instructions .
If the user declares additional instructions using
\AtEndBibliography
and
\AfterBibliographyPreamble
to be executed after the preamble or at the end of the bib-
liography, the instructions of
\AfterBibliographyPreamble
will be executed only once
at the begin of the bibliography but after the \bib@beginhook instructions , and the
instructions
of
\AtEndBibliography
will be executed only once at the end of the bibli-
ography but before \bib@endhook.
Package multicol (see [
Mit11
]) could be used to define a bibliography style for printing the
bibliography with two columns:
\newbibstyle{twocolumstyle}{%
\renewcommand*{\bib@beginhook}{\begin{multicols}{2}}%
\renewcommand*{\bib@endhook}{\end{multicols}}}%
If also an open-variation of this style should be defined, one may use the provided heredity
feature and specify a parent style :
\newbibstyle{twocolumopenstyle}[openstyle]{%
\renewcommand*{\bib@beginhook}{\begin{multicols}{2}}%
\renewcommand*{\bib@endhook}{\end{multicols}}}%
These new defined styles may be selected using option
bibliography
as usual.
Dostları ilə paylaş: |