§ 1 Kein Witz ohne
Publikum
Ein Witz kann nur dort witzig
sein, wo er auf ein Publikum
trifft.
§ 2 Komik der Kultur
(1) Die Komik eines Witzes
kann durch das kulturelle
Umfeld, in dem er erzählt
wird, bestimmt sein.
(2) Die Komik eines Witzes
kann durch das kulturelle
Umfeld, in dem er spielt,
bestimmt sein.
1
383
Chapter 20.
Additional Information about package typearea
This chapter gives additional information about package typearea. Some parts of the chapter
are subject to the KOMA-Script book [
Koh14a
] only. This should not be a problem, because
the average user, who only want to use the package, does not need the information that is
addressed to users with non-standard requirements or who want to write their own packages
using typearea. Another part of the information describes features of typearea that exist only
because of compatibility to former releases of KOMA-Script or the standard classes. The
features, that exist only because of compatibility to former KOMA-Script releases, are printed
with a sans serif font. You should not use them any longer.
20.1. Expert Commands
This section describes commands that are not of interest for average users. Nevertheless these
commands provide additional features for experts. Because the information is addressed to
experts it’s condensed.
\activateareas
Package typearea uses this command to assign settings of typing area and margins to internal
L
A
TEX lengths, whenever the type area is newly calculated inside of the document, i˙e., after
\begin{document}
. If option pagesize has been used, it will be executed again afterward.
With this, e. g., the page size may vary inside of a PDF document.
Experts may use this command, if they change lengths like \textwidth or \textheight
inside a document manually for any reason. Nevertheless the expert himself is responsible for
eventually needed page breaks before or after usage of \activateareas. Moreover all changes
of \activateareas are local!
\storeareas{\command}
\BeforeRestoreareas{code }
\BeforeRestoreareas*{code }
\AfterRestoreareas{code }
\AfterRestoreareas*{code }
With \storeareas a \command will be defined that may be used to restore all current settings
of typing area and margins. This provides to store the current settings, change them, do
anything with valid changed settings and restore the previous settings afterwards.
Example: You want a landscape page inside a document with portrait format. No problem
using \storeareas:
384
Chapter 20.
\documentclass[pagesize]{scrartcl}
\begin{document}
\noindent\rule{\textwidth}{\textheight}
\storeareas\MySavedValues
\KOMAoptions{paper=landscape,DIV=current}
\noindent\rule{\textwidth}{\textheight}
\clearpage
\MySavedValues
\noindent\rule{\textwidth}{\textheight}
\end{document}
Command \clearpage before calling \MySavedValues is important to restore the
saved values at the next page.
In the example \noindent has been used to avoid the paragraph indent of the black boxes.
Without these commands the boxes would not show the typing area correctly.
Please note that neither \storeareas nor the defined \command should be used inside a
group. Internally \newcommand is used to define the \command. So re-usage of a \command to
store settings again would result in a corresponding error message.
Often
v3.18
it is useful to automatically execute commands like \cleardoubleoddpage be-
fore restoring the settings of a \command generated by \storeareas.
You can do
so using \BeforeRestoreareas or \BeforeRestoreareas*.
Analogously you can use
\AfterRestoreareas
or \AfterRestoreareas* to automatically execute code after restoring
the settings. The variants with and without star differs so that the star variant changes only
the auto-execution code of future command s and the variant without star also changes the
auto-execution code of already defined command s.
\AfterCalculatingTypearea{instructions }
\AfterCalculatingTypearea*{instructions }
\AfterSettingArea{instructions }
\AfterSettingArea*{instructions }
These commands manage hooks. \AfterCalculatingTypearea and it’s star version pro-
vide experts to execute instructions every time typearea has recalculated the typing
area and margins either implicitly or because of an explicit usage of \typearea. Similar
\AfterSettingArea
v3.11
and it’s star version provide execution of instructions every time
\areaset
has been used. While normal versions work globally the influence of the star
versions is only local. The instructions will be executed instantly before execution of
\activateareas
.
385
Chapter 20.
20.2. Local Settings with File typearea.cfg
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
20.3. More or Less Obsolete Options and Commands
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
386
Chapter 21.
Additional Information about the Main Classes scrbook, scrreprt,
and scrartcl as well as the Package scrextend
This chapter gives additional information about the KOMA-Script classes scrbook, scrreprt,
and scrartcl. Some of the features are also available for package scrextend. Some parts of the
chapter are subject to the KOMA-Script book [
Koh14a
] only. This should not be a problem,
because the average user, who only want to use the package, will not need the information, that
is addressed to users with non-standard requirements or who want to write their own classes
using a KOMA-Script class. Another part of the information describes features of the classes
that exist only because of compatibility to former releases of KOMA-Script or the standard
classes. The features, that exist only because of compatibility to former KOMA-Script releases,
are printed with a sans serif font. You should not use them any longer.
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
21.1. Additional Information to User Commands
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
21.2. Cooperation and Coexistence of KOMA-Script and Other Packages
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
21.3. Expert Commands
This sections described commands, that are more or less out of average user’s interest. Nev-
ertheless these commands provide additional features for experts. Because the information is
addressed to experts it’s condensed.
\KOMAClassName
\ClassName
\KOMAClassName
stores the name of the currently used KOMA-Script class. If someone wants
to know, whether or not or a KOMA-Script class is used or which KOMA-Script is used this
may be tested with this command. In difference to this, \ClassName tells which would be the
standard class, that has been replaced by a KOMA-Script class.
Please note, that the existence of \KOMAScript is not a indication for the usage of a KOMA-
Script class. First of all: Every KOMA-Script package and not only KOMA-Script classes
387
Chapter 21.
define \KOMAScript. Furthermore other packages may also define the KOMA-Script word
mark with this name.
\addtocentrydefault{level }{number }{heading }
The
v3.08
KOMA-Script classes do not use \addcontentsline directly.
Instead they call
\addtocentrydefault
with similar arguments. The command may be used for both, en-
tries with and without number. Thereby level is the textual sectioning level, i. e., part,
chapter
, section, subsection, subsubsection, paragraph, or subparagraph. The already
formatted sectioning number is given by the second argument, number . This argument may
be empty. The text of the entry is given by argument heading . It is recommended to protect
fragile commands inside this argument with prefix \protect.
There’s one speciality for argument number . An empty argument signalizes, that an entry
without number should be generated. KOMA-Script uses
\addcontentsline{toc}{level }{heading }
for this. Nevertheless, if the argument is not empty an entry with number will be made and
number
is the already formatted heading number. KOMA-Script uses
\addcontentsline{toc}{level }{%
\protect\numberline{number }heading %
}
to make this.
Package authors an authors of wrapper classes may redefined this command to manipulate
the entries. For example one could suggest
\renewcommand{\addtocentrydefault}[3]{%
\ifstr{#3}{}{%
\ifstr{#2}{}{%
\addcontentsline{toc}{#1}{#3}%
}{%
\addcontentsline{toc}{#1}{\protect\numberline{#2}#3}%
}%
}%
}%
to omit entries with empty heading . In real live this would not be needed, because the KOMA-
Script classes already use another method to suppress empty entries. See the description of
the structuring commands in
section 3.16
from
page 89
onward for this.
388
Chapter 21.
\addparttocentry{number }{heading }
\addchaptertocentry{number }{heading }
\addsectiontocentry{number }{heading }
\addsubsectiontocentry{number }{heading }
\addsubsubsectiontocentry{number }{heading }
\addparagraphtocentry{number }{heading }
\addsubparagraphtocentry{number }{heading }
The
v3.08
KOMA-Script classes call the previously described command \addtocentrydefault di-
rectly only if no individual command for the level has been defined or if that command
is \relax. Nevertheless, the default definition of all these individual commands simply call
\addtocentrydefault
with their own level passing their arguments through.
\raggedchapterentry
Previous
v3.21
versions of KOMA-Script provide a feature for printing chapter entries at the table
of contents left-aligned instead of justified by defining command \raggedchapterentry to be
\raggedright
. Officially this feature has been removed from KOMA-Script version 3.21 on.
Indeed attribute raggedentrytext of toc-entry style tocline of package tocbasic has been
implemented to use such a macro \raggedentry level entry as an indicator for left-aligned
text. If such a macro is \raggedright, the text is printed left-aligned. With any other
definition the text is printed justified.
With this implementation of raggedentrytext full compatibility to the previous docu-
mentation of \raggedchapterentry is reached. As stated formerly, other definitions of
\raggedchapterentry
— and now also of \raggedsectionentry and similar macros for other
entry levels — could result in the potentially unexpected effect of justified text.
Nevertheless, it is recommended to use the attribute of style tocline to select justified or
left-aligned text.
\@fontsizefilebase
\changefontsizes{font size }
The prefix scrsize for file names of font size files, that has been mentioned in
section 21.1
at
page 386
is only the default of the internal macro \@fontsizefilebase. This default
is used only, if the macro has not already be defined when loading a KOMA-Script class
or package scrextend. Authors of wrapper classes may define this macro with another file
name prefix to use completely different font size files. Also authors of wrapper classes could
change or deactivate the fallback solution for unknown font sizes by redefinition of macro
\changefontsizes
. This macro has exactly one argument: the wanted font size .
\newkomafont[warning message ]{element }{default }
\aliaskomafont{alias name }{element }
Experts may use \newkomafont to define a default for the font style of an element . After
this that default may be changed using commands \setkomafont and \addtokomafont (see
389
Chapter 21.
section 3.6
,
page 53
). Of course this is not enough to use the defined font style. The expert
himself has to prepare his code to use command \usekomafont (see
page 53
) with that element
at his code definitions.
The optional argument warning message defines a warning message, that KOMA-Script
will show whenever the default font style of that element will be changed. The sender of the
warning in such cases will be the used KOMA-Script class or package scrextend.
Command \aliaskomafont defines an alias name to an already defined element . KOMA-
Script will inform the user automatically about the real name of the element, whenever an
alias name
will be used. An alias name may be used, e. g., if a developer finds a better
name for an element, that has been defined formerly with another name, if the old name
should still be usable because of compatibility. Also an alias name s may increase usability,
because different users may find different names more or less intuitive. KOMA-Script itself
defines a lot of alias name s for several element s.
\addtokomafontrelaxlist{macro }
\addtokomafontgobblelist{macro }
As already mentioned in
part I
of this manual, font settings of elements should consist only
in commands to select the size, family, coding, series, shape, or colour. At least changing the
colour is not always transparent in L
A
TEX and therefore could result in unwanted effects if
someone uses \usekomafont at an inappropriate state.
Users tend to use different, somehow critical things in the font setting of an element, e. g.,
\MakeUppercase
at the very end of the setting. As long as possible, the internal usage of font
settings has been implemented so that such forbidden settings do not matter. Even using a
command that expects an argument, e. g., \textbf instead of \bfseries, would work mostly,
if it the last one in the font setting of an element — but without warranty.
Inside KOMA-Script, sometimes, it was necessary to restrict the font change to real font
settings. This has been done, e. g., using \usefontofkomafont instead of \usekomafont (see
section 3.6
,
page 57
).
Nevertheless, command \usefontofkomafont and it’s siblings have some limitations.
Therefore you must not use a command that always needs a fully expandable argument inside
the font setting of an element. But this is exactly what \MakeUppercase needs. Therefore
v3.17
KOMA-Script holds a list of macros, which should become \relax inside \usefontofkomafont
and it’s siblings. Amongst others, \normalcolor, \MakeUppercase, and \MakeLowercase are
part of that list. More macros can be added one by one using \addtokomafontrelaxlist.
Note that macro will be set simply to \relax.
So if macro really has an argu-
ment, the argument will be execute locally. Therefore you must not add commands like
\setlength
to the list. The user himself is responsible for all errors resulting in the usage
of \addtokomafontrelaxlist. Additionally this command should not be misunderstood as a
legitimation for adding all kind of commands to the font setting of an element!
If
v3.19
a macro and it’s first argument should be ignored locally inside \usefontofkomafont and
it’s siblings, you can use \addtokomafontgobblelist instead of \addtokomafontrelaxlist.
390
Chapter 21.
An example for this is the command \color, that has to be ignored with the colour name and
therefore is a default member of the gobble-list.
\IfExistskomafont{element }{then code }{else code }
Which
v3.15
elements are defined depends on the version of KOMA-Script. So sometimes it may
be useful to be able to test, whether or not an element exists. The command executes the
then code
only if an element has been defined using \newkomafont or \aliaskomafont and
therefore can be changed using \setkomafont or \addtokomafont and can be used by one of
the \use...komafont commands. Otherwise it executes the else code .
\setparsizes{indent }{distance }{last line end space }
With this command KOMA-Script provides to set the indent of the first line of a new para-
graph, the distance between paragraphs and the white space that has to be at the end of the
last line of each paragraph. This command should be used whenever changes should also be
recognized by option parskip=relative. KOMA-Script itself uses this command, e. g., with
\setparsizes{0pt}{0pt}{0pt plus 1fil}
to switch of paragraph indent and distance between paragraphs and to allow any white space
at the end of the last line of paragraphs. This make sense, if a paragraph consists of a box
only, that should be printed without vertical distance but with the whole column width. If,
in opposite to that, the box should only span the whole width but should be printed with the
current settings of paragraph indent and distance between paragraphs, usage of
\setlength{\parfillskip}{0pt plus 1fil}
would be recommended.
Since KOMA-Script 3.17
v3.17
changing or reactivation of the typing area or the margins (see
chapter 2
) will also reactivate the values of \setparsizes if they have not been changed
since the last usage of this command. This is one more reason not to change these values
without using KOMA-Script. With compatibility to a KOMA-Script version prior to 3.17
(see
section 3.2
,
page 29
, option version) this reactivation of the \setparsizes values is
deactivated.
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
\DeclareSectionCommand[ attributes ]{ name }
\DeclareNewSectionCommand[attributes ]{name }
\RedeclareSectionCommand[attributes ]{name }
\ProvideSectionCommand[attributes ]{name }
With
v3.15
these commands you can either define a new section-like command \ name or change
an already defined sectioning command \name . To do so you use the optional argument
to setup several attributes . The attributes are a comma-separated list of key =value
391
Chapter 21.
assignments. Beside the style-independent attributes shown in
table 21.1
, there are style
dependent attributes, too. Currently the following styles are provided:
chapter
:
v3.18
Style of chapter headings. This style is currently used for \chapter and indirectly
for \addchap. You can define new section-like commands using this style. To
define new or to reconfigure existing commands you can also use the additional
attributes of
table 21.3
,
page 394
. Note that command \addchap and the star
variants are configured automatically together with \chapter and should not be
changed independently. Note that scrartcl does not provide this style.
scrbook
,
scrreprt
part
:
v3.18
Style part headings. This style is currently used for \part and indirectly for
\addpart
. You can define new section-like commands using this style. To define
new or to reconfigure existing commands you can also use the additional attributes
of
table 21.4
,
page 395
. Note that command \addpart and the star variants are
configured automatically together with \part and should not be changed indepen-
dently.
section
: Style of section headings. This style is currently used for \section, \subsection,
\subsubsection
, \paragraph, and \subparagraph. You can define new section-
like commands using this style. To define new or to reconfigure existing commands
you can also use the additional attributes of
table 21.2
,
page 393
. Definitions of new
commands need at least the key s style, afterskip, beforeskip, font, indent,
level
, tocindent, and tocnumwidth. This is also true if a command that was not
a section-like command before will be redefined as a section-like command using
\RedeclareSectionCommand
. Note that command \addsec and the star variants
are configured automatically together with \section and should not be changed
independently. Defining a new section-like command with this style will also de-
fine an element with the same name and the possibility to change its font using
\setkomafont
or \addtokomafont (see
section 3.6
,
page 53
), if such an element
does not already exist.
\DeclareNewSectionCommand
defines a new section-like command. If the same name is
already used by TEX for something else, the command will result in an error message and will
not define anything.
\ProvideSectionSommand
is similar but does not show any error message.
\RedeclareSectionCommand
can only change an existing command to a section-like com-
mand with given attributes . There is no pre-validation to make sure that \name was a
section-like command before. However, it has to be an already used command sequence name .
\DeclareSectionCommand
does not check whether or not name is an already used TEX
command sequence. It just defines a section-like command \name with the given attributes .
Every section-like command has also a corresponding counter with the same name , that
will be allocated using \newcounter if necessary. The same rule applies to the corresponding
392
Chapter 21.
Table 21.1.: Available key s and value s for the style-independent attributes declaring a section-like
command
key
value
Description
counterwithin
counter name
The value of the counter of the heading should de-
pend on counter name . Whenever \stepcounter
or \refstepcounter increases the value of counter
name
, the value of the counter of this heading should
be set to 0. Also the output of the value of this head-
ing should be prefixed by \thecounter name followed
by a dot.
v3.19
counterwithout
counter name
Cancels a prior counterwithin setting. Therefore it
makes sense only if you re-define an existing section-
like command.
expandtopt
switch
If the switch is on, all following values for lengths will
be completely expanded, evaluated and stored as pt
values. If the switch is off, all following values for
lengths will be completely expanded, tentatively eval-
uated but only expanded stored. Any values from
ta-
ble 2.5
,
page 38
may be used. Default is false.
level
integer
A number, denoting depth of section (see counter
secnumdepth
,
section 3.16
,
page 100
); the value should
be unique.
style
name
Defines the style of the heading.
Beta-
Feature
tocstyle
name
Defines the style of the entries into the table of con-
tents. You can use every already defined toc-entry style
(see
section 15.3
). An empty name prevents a new def-
inition of the toc-entry command.
Beta-
Feature
tocoption
value
Additional options depending on the TOC-entry style
given by tocstyle. See
section 15.3
,
page 310
for ad-
ditional information about TOC-entry styles. See
ta-
ble 15.1
,
page 314
for information about the attributes
of the predefined TOC-entry styles of package tocbasic,
that can be used as option .
393
Chapter 21.
Table 21.2.: Additional keys and value s of attributes declaring a section-like command with style
section
key
value
Description
afterskip
length
A negative value activates a run-in heading. The absolute
value is the skip to leave to right of the run-in heading. A
positive value is the vertical skip below the heading.
beforeskip
length
The absolute value of the vertical skip before the heading.
If the value is negative, then the paragraph indent of the
text following the heading is suppressed.
font
font commands
The initial font setting that should be used beside
disposition
for the heading. You can use all settings,
that are allowed for \setkomafont and \addtokomafont
for the element of the heading.
indent
length
Indentation of heading from the left margin.
output of the counter: \thename , the output format: \name format, the command to generate
a running head: \name mark, the counter format of the running head: \name markformat, the
font element: name , and the section depth number: \name numdepth. The command for the
running head \name mark will be defined to not generate any running head. The output of the
counter, \thename , will show an Arabic number. If the key counterwithin defines a counter
the heading number depends on, the output of the counter will be prefixed by the output of
that counter followed by a dot.
Beside
Beta-
Feature
the section-like command, a command for corresponding entries to the table of
contents is defined also. This is done using package tocbasic. Attribute tocstyle defines the
style of those entries. If you set an empty name , e. g., using tocstyle= or tocstyle={}, the
entry command will not be changed. This is important, if you use another package to modify
the table of contents. If you do not set attribute tocstyle the already configured style will
be used again.
The
Beta-
Feature
different toc-entry styles also have different, additional attributes. You can set them
here too, if you prefix them with toc. For example, you can setup the level of the toc-
entries, level, using toclevel, the indention, indent, using tocindent, or the number width,
numwidth
, using tocnumwidth. For more toc-entry style attributes see
section 15.3
,
page 310
.
Dostları ilə paylaş: |