415
\righttopmark
\rightbotmark
\rightfirstmark
\lefttopmark
\leftbotmark
\leftfirstmark
For page styles L
A
TEX
v3.16
uses a bipartite TEX mark. Running heads can use the left part of that
mark by
\leftmark
and the right part by
\rightmark
. Indeed, it seems that it was suggested
to use
\leftmark
for the running head of left, even pages and
\rightmark
for the running
head of right, odd pages of double-sided documents. Within single-sided layouts the standard
classes even do not set the left part of the mark.
TEX itself knows three alternatives to make usage of a mark. The \botmark is the last
valid mark of the page that has been build last. If there has not been set any mark on the
page, it is the last mark of the already shipped out pages. L
A
TEX command
\leftmark
uses
exactly this mark. So it shows the left part of the last mark of the page. This is the same like
\leftbotmark
. In opposite to this \rightbotmark shows the right part of that mark.
\firstmark
is the first mark of the page that has been build last. This means the first
mark, that has been set on the page. If there has not been set any mark on the page, this
is the last mark of the already shipped out pages. L
A
TEX command
\rightmark
uses exaclty
this mark. So it shows the right part of the first mark of the page. This is the same like
\rightfirstmark
. In opposite to this \leftfirstmark shows the left part of that mark.
\topmark
is the content of \botmark before building the current page. L
A
TEX itself does
not use it. Nevertheless, scrlayer provides \lefttopmark to show the left part of it and
\righttopmark
to show the right part of it.
Note that the left part and the right part of the mark can be made all together only.
Even if you use
\markright
to change only the right part, the left part will be made again
(unchanged). Accordingly in double-side mode using page style headings the higher section
levels always make both parts. For example
\chaptermark
uses
\markboth
with an empty
right argument in this case. This is the reason why
\rightmark
or \rightfirstmark always
shows an empty value on pages with chapter beginnings, even if there was a
\sectionmark
or
\section
on the same page to make the right part of the mark.
Please note that using any of these commands to show the left or right part of the mark as
part of the page content could have unexpected results. They are recommended to be used in
the head or foot of a page style only. So with scrlayer they should be part of the contents of
a layer. But it does not matter whether or not a layer is restricted to the background or the
foreground. Both kind of layers are shipped out after building the current page.
If you need more information about the mark mechanism of TEX, please have a look at
[
Knu90
, chapter 23]. You will find, that marks are an issue for real experts. So if the expla-
nation above was at least more confusing than illuminative: Please don’t worry.
Chapter 18: Additional Features of scrlayer-scrpage
416
\@mkleft{left mark }
\@mkright{right mark }
\@mkdouble{mark }
\@mkboth{left mark }{right mark }
Sometimes inside classes and packages the marks for running heads should be filled up only
if automatic running heads are active (see option
automark
and command
\automark
on
page 241
). In the L
A
TEX standard classes only \@mkboth has been used for this. This command
is either \@gobbletwo, that simply destroys both mandatory arguments, or
\markboth
, a
command that fills up the left and left mark and the right mark. Packages like babel also
change \mkboth, i. e., to add language switching to the running head.
But if a class or package author only wants to change either the left mark or the right
mark
without the other one, a proper command is missing. Package scrlayer itself needs such
commands for the implementation of all cases of automatic running heads. So if command
\@mkleft
to fill up only the left mark or \@mkright to fill up only the right mark or \@mkdouble
to fill up both marks with the same content is undefined while loading scrlayer, the package will
define them. Thereby the actual definition of \@mkboth will be used as an indicator whether
or not automatic running heads should be used. The new commands will full up the marks
only in the case of automatic running heads.
Class and package authors can use these commands too, if they want to fill up only one
of the marks or both marks with the same content but only if automatic running heads are
activated. This condition is also the difference to the commands \markleft, \markright, and
\markboth
.
18.2. Definition of new Pairs of Page Styles
In
section 5.4
the page styles scrheadings and plain.scrheadings have been described.
These can be seen as a pair of page styles, with scrheadings being the main page style with
a running head and plain.scrheadings being the corresponding plain page style without
running head but generally with pagination. Additionally to the configuration of these page
styles, scrlayer-scrpage provides also the feature of defining new such pairs of page styles.
Thereby the name of the main page style, e. g., scrheadings, can be seen as the name of the
pair of page styles.
Most users will not need more than the predefined pair scrheadings. So the commands
of this section may be understood as an addition for special cases. And as each such case is
very special, this section also lacks of handsome examples. Nevertheless, if the support will
show me a real nice example in the future, I perhaps could use it in the future. However, I’m
almost sure that all such cases could also be solved using the predefined pair only.
Chapter 18: Additional Features of scrlayer-scrpage
417
\defpairofpagestyles[parent pair ]{name }{definition }
\newpairofpagestyles[parent pair ]{name }{definition }
\renewpairofpagestyles[parent pair ]{name }{definition }
\providepairofpagestyles[parent pair ]{name }{definition }
With these commands you may define pairs of page styles similar to scrheadings and
plain.scrheadings
. Thereby name is the name of the main page style that is similar to
scrheadings
. The name of the corresponding plain page style will be prefixed by plain.
automatically. So name is not only the name of the pair of page styles, but also the name of
the main page style of that pair, while plain.name is the name of the plain page style of
this pair.
If the optional argument parent pair is given, the settings of the pair of page styles with
that name are the initial settings of the new pair of page styles. So the new pair inherits the
configuration of the parent pair .
Reading
section 5.4
might have created the impression that the described commands are
related to scrheadings and plain.scrheadings only. However, if there exist more pairs of
page styles, these commands are related to the pair that has been activated last. In fact, this
is the case for
\lehead
,
\cehead
,
\rehead
,
\lohead
,
\cohead
,
\rohead
,
\lefoot
,
\cefoot
,
\refoot
,
\lofoot
,
\cofoot
,
\rofoot
,
\ihead
,
\chead
,
\ohead
,
\ifoot
,
\cfoot
, and
\ofoot
of
section 5.4
.
All those commands and the below described commands
\clearmainofpairofpagestyles
,
\clearplainofpairofpagestyles
, and
\clearpairofpagestyles
are also designed to be
used inside the argument definition . In that case, they are a kind of default configuration
of the pair of page styles that is executed each time the pair will be activated. A pair of page
styles is activated, if one of the page styles of the pair will be activated, which is mostly done
by using
\pagestyle
.
Please note that the commands of
section 5.5
are for general purpose. Therefore, they are
related to every page style that has been defined using scrlayer-scrpage.
Whereas \defpairofpagestyles will define a pair no matter if the corresponding page
styles are already defined, \newpairofpagestyles and \providepairofpagestyles will de-
fine the pair only, if the page styles are currently undefined. If at least one of the page styles is
already defined, the new definition of \providepairofpagestyles will be ignored, but usage
of \newpairofpagestyles would result in an error message. To redefine already existing pairs
of page styles you may use \renewpairofpagestyles. With this an error would be thrown,
if at least one of the page styles of the pair does not already exist.
Chapter 18: Additional Features of scrlayer-scrpage
418
\clearmainofpairofpagestyles
\clearplainofpairofpagestyles
\clearpairofpagestyles
Command \clearmainofpairofpagestyles will configure the main page style of the lastly ac-
tivated pair of page styles to be empty. In contrast to this \clearplainofpairofpagestyles
will configure the plain page style of the lastly activated pair of page styles to be empty. Last
but not least \clearpairofpagestyle will configure both page styles of the lastly activated
pair of page styles to be empty.
But please note that none of these commands will remove the definitions of argument
definition
that has been used when defining the pair of page styles (see above). So if
you activate the pair of page styles again, those definitions will be used again!
These commands may be used inside of definition themselves. But you may use them
outside the definition of a pair of page styles too. In this case they are related to the lastly
activated pair of page styles.
The commands \clearscrheadings, \clearscrplain, and \clearscrheadfoot are aliases
for these commands provided only for compatibility with scrpage2. Nevertheless, they are
deprecated and should not be used.
18.3. Definition of Simple Page Styles with Three Parts in Head and Foot
Beside predefined page styles and the definition of new pairs of page styles, package
scrlayer-scrpage also provides the definition of page styles with three parts in head and foot.
But this user interface exists for compatibility with scrpage2 only. However, it has been ex-
tended beyond the functionality of scrpage2 to provide a more consistent set of commands.
Nevertheless, for new documents it is recommended to instead use the advanced features
described in the previous section.
Chapter 18: Additional Features of scrlayer-scrpage
419
\deftriplepagestyle{name of the page style }[thickness of the outer line ][thickness
of the inner line ]{ inner head element }{ centre head element }
{outer head element }{inner foot element }{centre foot element }
{outer foot element }
\newtriplepagestyle{name of the page style }[thickness of the outer linen ][thickness
of the inner linen ]{ inner head element }{ centre head element }
{outer head element }{inner foot element }{centre foot element }
{outer foot element }
\renewtriplepagestyle{name of the page style }[thickness of the outer line ][thickness
of the inner line ]{ inner head element }{ centre head element }
{outer head element }{inner foot element }{centre foot element }
{outer foot element }
\providetriplepagestyle{name of the page style }[thickness of the outer line ]
[thickness of the inner line ]{inner head element }{centre head
element }{outer head element }{inner foot element }{centre foot
element }{outer foot element }
With these commands you can define a single page style, whose head and foot are parted into
three elements: an inner element, a centre element, and an outer element. The contents of
the elements are stated via three mandatory arguments for the head and three mandatory
arguments for the foot.
Each of the two inner elements will be printed right aligned on left pages and left aligned
on right pages. The centre elements will be printed centred in the head respectively foot of
left and right pages. Each of the two outer elements will be printed left aligned on left pages
and right aligned on right pages.
Please note once again: There are only right pages in single side layout!
The two optional arguments can be used to activate horizontal lines in the head and foot of
the page style. To do so, you put the wanted thickness of the line as an optional argument.
The first optional argument is the thickness of the outer line in both, the page head
and footer. In the page head it will be printed above the head contents. In the page footer it
will be printed below the foot contents. The second optional argument is the thickness of
the inner line
. This will be printed below the page head and additionally above the page
footer. If you have only one optional argument, this is the thickness of the inner line .
In this case no outer line will be printed. And if you omit both optional arguments, both lines
will be omitted.
Please note, an empty optional argument is not the same like omitting the optional argu-
ment! Empty optional arguments are not allowed in this case. But you may use simple dimen-
sion expressions as explained for KOMA-Script option
headwidth
(see
section 5.5
,
page 249
)
for the optional arguments.
Figure 18.1
shows a sketch for the interpretation of the arguments on a schematic double
page. Thereby “outer”, “inner”, and “centre” are example contents. The corresponding
arrows illustrate the expansion of those contents. The coloured texts inside the pages are only
Chapter 18: Additional Features of scrlayer-scrpage
420
outer−→
←−inner
←−centre−→
inner−→
←−outer
←−centre−→
inner head element
centre head element
outer head element
6
6
6
6
6
6
outer−→
←−inner
←−centre−→
inner−→
←−outer
←−centre−→
inner foot element
centre foot element
outer foot element
?
?
?
?
?
?
6
6
?
?
thickness of the inner lines
-
-
thickness of the outer lines
Figure 18.1.: Schematic double page with the elements of a tripartite page style of com-
mands \deftriplepagestyle, \newtriplepagestyle, \providetriplepagestyle, and
\renewtriplepagestyle
the names of the arguments of these commands. The related arrows in the same colour point
to the corresponding elements of the page.
Using the described commands it is not possible to draw only a single line, e. g., only below
the page head but not above the page footer. If you need to do so, please consult the previous
or following section.
The length of a single element is not limited by the existence of a neighbour element. So
in unfortunate circumstances it can happen that one elements overwrites a neighbour element
or even both of them. The user himself is responsible to avoid such inappropriate usage.
With automatic running heads this could, e. g., be done using the optional argument of the
section commands. See the manual of the document class for more information about those
commands.
Command \deftriplepagestyle defines a page style independent from whether or not
a page style with the same name of the page style already exists. In difference to this
\newtriplepagestyle
and \providetriplepagestyle define the page style only, if the
name of the page style
is not the name of an already defined page style. Otherwise
\providepagestyle
simply does nothing, but \newtriplepagestyle throws an error. Com-
mand \renewtriplepagestyle is something like the opposite of \newtriplepagestyle. It
throws an error, if there has not been a page style with the name of the page style before,
Chapter 18: Additional Features of scrlayer-scrpage
421
and defines the page style only, if there has been already a page style with the given name.
The command \deftriplestyle of scrpage2 corresponds to \deftriplepagestyle. Be-
cause of unification reasons it has been renamed and should not be used with it’s old name
any longer. Using the old name would result in a warning message. Nevertheless, the result
would be the expected one.
18.4. Definition of Complex Page Styles
Beside predefined page styles, the definition of new pairs of page styles and the deprecated
definition of page styles with tripartite head and foot, the package scrlayer-scrpage additionally
provides basic features to define new page styles. All already described page style definitions
of scrlayer-scrpage use internally these basic features. Because of the complexity of this user
interface it is recommended for advanced users only. As all most all imaginable use cases of
page styles can handled using the features described previous section, less advanced users may
skip this section.
\defpagestyle{name }{head specification }{foot specification }
\newpagestyle{name }{head specification }{foot specification }
\providepagestyle{name }{head specification }{foot specification }
\renewpagestyle{name }{head specification }{foot specification }
These commands can be used to define a single page style with maximum flexibility. Thereby
name
is the name of the page style that should be defined.
The arguments head specification and foot specification have identical structure:
(length of the line above ,thickness of the line above )%
{specification for the left page in two-side layout }%
{specification for the right page in two-side layout }%
{specification for all pages in one-side laypout }%
(length of the line below ,thickness of the line below )
The arguments in the round brackets are options. This means, you may omit them together
with the brackets. In that case, the length and thickness of the corresponding horizontal line
would be given by the KOMA-Script options
headtopline
,
headsepline
,
footsepline
or
footbotline
(see
section 5.5
,
page 249
).
All three arguments in the curly brackets are mandatory. They hold arbitrary content
specifications depending on the page and the layout settings. But for page styles with running
heads usage of
\headmark
,
\leftmark
, or
\rightmark
is recommended inside the specification.
Section numbers or section headings must not be used in the specifications. Due to the
asynchronous page building of L
A
TEX, using them could result in wrong numbers or texts in
the page header or footer.
Chapter 18: Additional Features of scrlayer-scrpage
422
Table 18.1.: The layers scrlayer-scrpage defines to a page style name
Name of the layer
Meaning of the layer
Name .head.above.line
horizontal line above the page head
Name .head.odd
page head of odd pages in two-side layout
Name .head.even
page head of even pages in two-side layout
Name .head.oneside
page head in single-side layout
Name .head.below.line
horizontal line below the page head
Name .foot.above.line
horizontal line above the page foot
Name .foot.odd
page foot of odd pages in two-side layout
Name .foot.even
page foot of even pages in two-side layout
Name .foot.oneside
page foot in single-side layout
Name .foot.below.line
horizontal line below the page foot
Command \defpagestyle defines the page style no matter if a page style with the same
name
already exists. Command \newpagestyle would throw an error, if such a page style
already exists. In contrast to this, \providepagestyle simple does nothing in such a case. In
contrast to \newpagestyle command \renewpagestyle throws an error, if a page style with
the name does not already exist, and therefore may be used to redefine an existing page style.
All these commands are based on the command
\DeclarePageStyleByLayers
of package
scrlayer.
Table 18.1
shows the layers that are defined for a page style name . More information
about layers and layer page styles can be found starting on
page 382
in
chapter 17
of
part II
.
Example: Assume you want to colour the whole background of page style scrheadings’ head.
Because you read the introduction to this chapter, you know, that scrheadings
last but not least is a layer page style with, e. g., layers scrheadings.head.even,
scrheadings.head.odd
, and scrheadings.head.oneside. So you define three
more layers for the backgrounds and add them at the very beginning of the page
style:
\documentclass{scrartcl}
\ usepackage[automark]{scrlayer-scrpage}
\usepackage{xcolor}
\usepackage{blindtext}
\DeclareLayer[clone=scrheadings.head.oneside,
contents={%
\color{yellow}\rule[-\dp\strutbox]{\layerwidth}{\layerheight}%
}%
]{scrheadings.head.oneside.background}
\DeclareLayer[clone=scrheadings.head.odd,
contents={%
Chapter 18: Additional Features of scrlayer-scrpage
423
\color{yellow}\rule[-\dp\strutbox]{\layerwidth}{\layerheight}%
}%
]{scrheadings.head.odd.background}
\DeclareLayer[clone=scrheadings.head.even,
contents={%
\color{yellow}\rule[-\dp\strutbox]{\layerwidth}{\layerheight}%
}%
]{scrheadings.head.even.background}
\AddLayersAtBeginOfPageStyle{scrheadings}{%
scrheadings.head.oneside.background,%
scrheadings.head.odd.background,%
scrheadings.head.even.background%
}
\pagestyle{scrheadings}
\ begin{document}
\blinddocument
\end{document}
As you can see, the example uses three layers, so the position and size of that
background layers may simply be copied from the corresponding head layer using
option clone. This is much easier than using only one background layer and
dynamically calculate the position time by time.
In this example the coloured background is printed using a \rule command. The
size arguments of this \rule are given by
\layerwidth
and
\layerheight
which
contain the current width and height of the layer itself. The optional argument of
\rule
is used to move the rule down by the height of a descender.
Instead of using new layers to colour the background in the example above, \colorbox and
\chead
could have been used. It is recommended to build such a solution as an exercise.
Another approach could be to add the background layers one by one and just before the
contents layers. You may do this as an exercise too.
hmode=simple switch
Package scrpage2 outputs page heads and page foots in horizontal mode always. In opposite
to this scrlayer-scrpage does not switch into horizontal mode itself, but the output of horizontal
material will do so. Nevertheless, you can activate option hmode gain compatibility to scrpage2
in this aspect. But this would have side effects, i. e., white spaces at the start of the output
or the vertical alignment of the output.
The options allows for the standard values for simple switches that are given at
table 2.5
on
page 39
. The option is deactivated by default.
Chapter 19: Note Columns with scrlayer-notecolumn
424
Note Columns with scrlayer-notecolumn
Up to version 3.11b KOMA-Script supported note columns only by marginal notes that get
their contents from
\marginpar
and
\marginline
(see
section 3.21
,
page 136
). This kind of
note columns has several disadvantages:
• Marginal notes can be output only completely on one page. Page breaks inside marginal
notes are not possible. Sometimes this results in margin notes located close to the lower
page margin.
• Marginal notes near page breaks sometimes float to the next page and then in case of two-
sided layout with alternating marginal notes can be output at the wrong margin.. This
problem can be solved by additional packages like mparhack or usage of \marginnote
provided by package marginnote.
• Marginal notes inside floating environments or footnotes are not possible. This problem
can be solved using \marginnote of package marginnote, too.
• There is only one marginal note column or at most two, if you work
with \reversemarginpar and \normalmarginpar.
You should know, that
\reversemarginpar
is of less usability on two-sided documents.
Usage of marginnote results in one more problem. Because the package does not have any
collision detection, marginal notes that are set near to each other can partially or totally
overlap. Moreover, usage of \marginnote sometimes and depending on the used settings can
result in changes of the baseline distance of the normal text.
Package scrlayer-notecolumn should solve all these problems. To do so, it uses the basic
functionality of scrlayer. Nevertheless, there is a disadvantage of using this package: Notes
can be output only on pages that use a scrlayer based page style. This disadvantage may be
easily resolved and maybe changed into an advantage using scrlayer-scrpage.
19.1. Note about the State of Development
Originally the package has been made as a so called proof of concept to demonstrate the
potential of scrlayer. Despite the fact that it currently is in a very early state of development,
the stability of most parts is less a question of scrlayer-notecolumn but of scrlayer. Nevertheless
it is assumed that there are still bugs in scrlayer-notecolumn. You are welcome to report such
bugs whenever you find one. Some of the disabilities are caused by minimisation of complexity.
As an example note columns can break to several pages, but there is not a new line break of
the paragraphs. TEX itself does not provide this.
Because the package is more experimental, the user manual belongs to the second part of
the KOMA-Script manual, recommended for experienced users. If you are a beginner or a user
Chapter 19: Note Columns with scrlayer-notecolumn
425
on the way to become an expert, some explanations could be ambiguous or incomprehensible.
Please understand that I try to minimise the effort in time and work for the manual of an
experimental package.
19.2. Early or late Selection of Options
All of what is described in
section 2.4
is generally applicable. So if you have alread read and
understood
section 2.4
you can switch to
section 19.3
,
page 426
.
In this section a peculiarity of KOMA-Script is presented, which, apart from the
scrlayer-notecolumn package, is also relevant to other KOMA-Script packages and classes. Such
that the user can find all information corresponding to a single package or a single class in the
relevant chapter, this section is found almost identically in several chapters. Users who are not
only interested in a particular package or class, but wish to gain an overview of KOMA-Script
as a whole, may read the section in one chapter and may thereafter skip it wherever coming
across it in the document.
\documentclass[option list ]{KOMA - Script class }
\usepackage[option list ]{package list }
In L
A
TEX, provision is made for the user to pass class options as a comma-separated list of
keywords as optional arguments to \documentclass. Apart from being passed to the class,
these options are also passed on to all packages which can understand the options. Provision
is also made for the user to pass optional arguments as a comma-separated list of keywords
as optional arguments to \usepackage. KOMA-Script expands
v3.00
the option mechanism for the
KOMA-Script classes and various packages to use further possibilities. Thus, most KOMA-
Script options can also take a value. An option may have not only the form Option , but
may also have the form option =value . Apart from this difference \documentclass and
\usepackage
function the same in KOMA-Script as described in [
Tea05b
] or any introduction
to L
A
TEX, for example [
OPHS11
].
You should note, that in opposite to the interface described below the options interface of
\documentclass
and \usepackage is not robust. So commands, lengths, counters and such
constructs may break inside the optional argument of these commands. Because of this, the
usage of a L
A
TEX length inside the value of an option would cause an error before KOMA-Script
can get the control over the option execution. So, if you want to use a L
A
TEX length, counter
or command a part of the value of an option, you have to use
\KOMAoptions
or
\KOMAoption
.
These commands will be described next.
Chapter 19: Note Columns with scrlayer-notecolumn
426
\KOMAoptions{option list }
\KOMAoption{option }{value list }
KOMA-Script
v3.00
offers most class and package options the opportunity to change the value of
options even after loading of the class or package. One may then change the values of a list of
options at will with the \KOMAoptions command. Each option in the option list has the
form option =value .
Some options also have a default value. If one does not give a value, i. e., gives the option
simply in the form option , then the default value will be used.
Some options can assume several values simultaneously. For such options there exists the
possibility, with the help of \KOMAoption, to pass a single option a list of values. The
individual values are given as a comma-separated value list .
To implement this possibility KOMA-Script uses the commands
\FamilyOptions
and
\FamilyOption
with the family “KOMA”. For more information in these commands see
part II
,
section 12.2
,
page 313
.
19.3. Text Markup
What is described in
section 3.6
applies, mutatis mutandis. So if you have alread read and
understood
section 3.7
you can switch to
page 427
.
L
A
TEX offers different possibilities for logical and direct markup of text. Selection of the font
family commands, as well as choosing the font size and width is supported. More information
about the standard font facilities may be found at [
OPHS11
], [
Tea05b
], and [
Tea05a
].
\setkomafont{element }{commands }
\addtokomafont{element }{commands }
\usekomafont{element }
With
v2.8p
the help of the two commands \setkomafont and \addtokomafont, it is possible to
define the commands that change the characteristics of a given element . Theoretically, all
possible statements including literal text could be used as commands . You should, however,
absolutely limit yourself to those statements that really switch only one font attribute. This
will usually be the commands \normalfont, \rmfamily, \sffamily, \ttfamily, \mdseries,
\bfseries
, \upshape, \itshape, \slshape, and \scshape, as well as the font size commands
\Huge
, \huge, \LARGE, \Large, \large, \normalsize, \small, \footnotesize, \scriptsize,
and \tiny. The description of these commands can be found in [
OPHS11
], [
Tea05b
], or
[
Tea05a
]. Color switching commands like \normalcolor (see [
Car05
] and [
Ker07
]) are also
acceptable. The behavior when using other commands, especially those that make redefinitions
or generate output, is not defined. Strange behavior is possible and does not represent a bug.
The command \setkomafont provides a font switching command with a completely new
definition. In contrast to this, the \addtokomafont command merely extends an existing
Chapter 19: Note Columns with scrlayer-notecolumn
427
definition. It is recommended to not use both commands inside the document body, but
only in the document preamble. Usage examples can be found in the paragraphs on the
corresponding element.
With command \usekomafont the current font style may be changed into the font style of
the selected element .
\usefontofkomafont{element }
\useencodingofkomafont{element }
\usesizeofkomafont{element }
\usefamilyofkomafont{element }
\useseriesofkomafont{element }
\useshapeofkomafont{element }
Sometimes
v3.12
and despite the recommendation users use the font setting feature of elements
not only for font settings but for other settings too. In this case it may be useful to
switch only to the font setting of an element but not to those other settings. You may
use \usefontofkomafont in such cases. This will activate the font size and baseline skip, the
font encoding, the font family, the font series, and the font shape of an element, but no further
settings as long as those further settings are local.
You may also switch to one of those attributes only using one of the other commands. Note,
that \usesizeofkomafont will activate both, the font size and the baseline skip.
You should not misunderstand these commands as a legitimation of using all kind of com-
mands at the font setting of an element. Hence this would result in errors sooner or later (see
section 21.3
,
page 444
).
19.4. Declaration of new Note Columns
Loading the package already declares a note column named marginpar automatically. The
name already adumbrates that this note column is placed in the area of the normal marginal
note column used by
\marginpar
and
\marginline
. It even recognises the setting of
\reversemarginpar
and \normalmarginpar page by page instead of note by note. So these
switches are irrelevant when the user defines a note but relevant when the package outputs
the note during L
A
TEX’s page building. If you want to use notes at the left and at the right
margin within one page, you should declare at least one more note column.
The default settings for every newly declared note column is the same like that of the
predefined marginpar. But you can easily change them during declaration.
You should note that note columns can be output only on pages that use a page style
made with package scrlayer. Package scrlayer-notecolumn automatically loads scrlayer, which
by default provides only page style empty. If you need additional page styles, the use of
scrlayer-scrpage is recommended.
Chapter 19: Note Columns with scrlayer-notecolumn
428
\DeclareNoteColumn[option list ]{note column name }
\DeclareNewNoteColumn[option list ]{note column name }
\ProvideNoteColumn[option list ]{note column name }
\RedeclareNoteColumn[option list ]{note column name }
These commands can be used to declare note columns. \DeclareNoteColumn declares the
note column independent of whether or not they already exist. \DeclareNewNoteColumn
throws an error message if note column name has already been used for another note column.
\ProvideNoteColumn
simply does nothing in the same case. \RedeclareNoteColumn can be
used only to declare an already existing note column again.
By the way: Already existing notes of a already existing note column are not lost if you
re-declare it using \DeclareNoteColumn or \RedeclareNoteColumn.
Declaring a new note column does also define a new element of which you can change the
font attributes using
\setkomafont
and
\addtokomafont
if such a element does not already
exist. The name of the new element is notecolumn.note column name . Because of this
the predefined note column marginnote has a element notecolumn.marginpar. The initial
setting of the element’s font can be done using option font as part of the option list .
The option list is a comma separated list of keys with or without values, also known as
options. The available options are shown in
table 19.1
. Option marginpar is set by default.
But you can overwrite this default with your individual settings.
Because note columns are implemented using scrlayer, each note column also defines a layer.
The name of the layer is the same as the name of the element, notecolumn.note column
name
. For more information about layers see
section 17.4
, from
page 385
.
Example: Assuming, you are a German professor of weird rights and like to write a paper
about the new “Gesetz über die ausgelassene Verbreitung allgemeiner Späße e”,
GüdaVaS. The main focus of the work should consist of comments to each section.
So you use a two-columned layout. The comments would be the main text in the
main column. The sections should be placed in a smaller note column on the right
side of the main column using a smaller font and a different colour.
\documentclass{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{selinput}
\SelectInputMappings{
adieresis={ä},
germandbls={ß},
}
\usepackage[T1]{fontenc}
\ usepackage{lmodern}
\usepackage{xcolor}
\usepackage{scrjura}
\setkomafont{contract.Clause}{\bfseries}
Chapter 19: Note Columns with scrlayer-notecolumn
429
Table 19.1.: Options for the declaration of note columns
font=font declaration
The initial font attributes to be used for the note column. Everything, that is allowed
to be set by
\setkomafont
or
\addtokomafont
can be used as font declaration
(see
section 3.6
,
page 57
). Note that \normalfont\normalsize will be used before.
So you don’t need one of them at your own initialisation.
Default: empty
marginpar
Sets up position and width to use the marginal note column of
\marginpar
. Note
that this option does not expect or allow any value.
Default: yes
normalmarginpar
Sets up position and width to use the normal marginal note column and ignore
\reversemarginpar
and \normalmarginpar. Note that this option does not expect
or allow any value.
Default: no
position=offset
Sets up the horizontal offset of the note column from the left edge of the paper. The
horizontal offset
can be either a L
A
TEX length, a TEX dimension, a TEX skip, a
length value, or a dimensional expression using +, -, *, / and parenthesis (see [
Tea98
,
section 3.5] for more information about dimensional expressions). The value will be
calculated at usage time not at definition time.
Default: by option marginpar
reversemarginpar
Sets up position and width to use the reverse marginal note column and ignore
\reversemarginpar
and \normalmarginpar. Note that this option does not expect
or allow any value.
Default: no
width=length
Sets up the horizontal size of the note column. You can use the same values for size
like for offset of option position.
Default: by option marginpar
Chapter 19: Note Columns with scrlayer-notecolumn
430
\setkeys{contract}{preskip=-\dp\strutbox}
\usepackage{scrlayer-scrpage}
\usepackage{scrlayer-notecolumn}
\newlength{\paragraphscolwidth}
\AfterCalculatingTypearea{%
\setlength{\paragraphscolwidth}{%
.333\textwidth}%
\addtolength{\paragraphscolwidth}{%
-\marginparsep}%
}
\recalctypearea
\ DeclareNewNoteColumn[ %
position=\oddsidemargin+1in
+.667\textwidth
+\marginparsep,
width=\paragraphscolwidth,
font=\raggedright\footnotesize
\color{blue}
]{paragraphs}
The paper should be a single-sided article. The German language (new spelling)
is selected with package babel. The input encoding is selected and detected with
package selinput automatically. The font is Latin Modern in 8-bit coding. The
colour selection uses package xcolor.
For usage of package scrjura to typeset laws and contracts see the German manual
of that package.
Next package scrlayer-notecolumn is loaded. The required width of the note column
is calculated within
\AfterCalculatingTypearea
after package typearea’s each
new calculation of the typing area. It should be one third of the typing area minus
the distance between the main text and the note column.
With all this information we define the new note column. For the positions we
simply use a dimension expression. Doing so, we have to note that \oddsidemargin
is not the total left margin but for historical reasons the left margin minus 1 inch.
So we have to add this value.
That is all of the declaration. But we have to note that currently the note column
would be output inside the typing area. This means that the note column would
overwrite the text.
\begin{document}
\title{Kommentar zum GüdaVaS}
Chapter 19: Note Columns with scrlayer-notecolumn
431
\author{Professor R. O. Tenase}
\date{11.\,11.~2011}
\maketitle
\tableofcontents
\section{Vormerkung}
Das GüdaVaS ist ohne jeden Zweifel das wichtigste
Gesetz, das in Spaßmanien in den letzten eintausend
Jahren verabschiedet wurde. Die erste Lesung fand
bereits am 11.\,11.~1111 im obersten spaßmanischen
Kongress statt, wurde aber vom damaligen Spaßvesier
abgelehnt. Erst nach Umwandlung der spaßmanischen,
aberwitzigen Monarchie in eine repräsentative,
witzige Monarchie durch W. Itzbold,
den Urkomischen, am 9.\,9.~1999 war der Weg für
dieses Gesetz endlich frei.
Because the text area has not been reduced, the preamble is output with the whole
width of the typing area. To test this, you can temporarily add:
\end{document}
Until now, the example does not give any answer to the question, how the text of the comments
will be printed with a smaller width. You will find this in the continuation of the example
below.
19.5. Making a Note
After having declared a note column, we can make notes for this column. But these notes will
not be output immediately. Instead of this, they are written into a helper file with extension
“.slnc”. If you want to know the exactly workout: First they are written to the aux-file
and while reading the aux-file inside of \end{document} they will be copied to the slnc-file.
Thereby setting of \nofiles will be respected. At the next L
A
TEX run, the helper file will be
read step by step depending on the progress of the document and at the end of the page the
note will be output.
But you should note that note columns are output only in pages with a page style of
package scrlayer. This package will be loaded by scrlayer-notecolumn automatically and by
default provides only one page style, empty. Usage of additional package scrlayer-scrpage is
recommended, if you need more page styles.
Chapter 19: Note Columns with scrlayer-notecolumn
432
\makenote[note column name ]{note }
This command may be used to make a new note . The current vertical position is used
as the vertical position of the start of the note . The horizontal position depends only on
the defined position of the note column. To work correct, the package needs \pdfsavepos,
\pdflastypos
, and \pdfpageheight. Without these primitives scrlayer-notecolumn cannot be
used. The primitives should act exactly as they would using PDFTEX.
However, if the package recognises a collision with the output of a former note , then the
new note will be delayed until the end of the former note . If the note does not fit into the
page, it will be moved at whole or only at part to the next page.
The optional argument note column name determines which note column should be used
for the note . The predefined note column marginpar is used, if the optional argument is
omitted.
Example: Let’s add a commented section into the example of the previous section. The
section itself is put into the note column:
\section{Analyse}
\begin{addmargin}[0pt]{.333\textwidth}
\makenote[paragraphs]{%
\protect\begin{contract}
\protect\Clause{%
title={Kein Witz ohne Publikum}%
}
Ein Witz kann nur dort witzig sein, wo er
auf ein Publikum trifft.
\protect\end{contract}%
}
Dies ist eine der zentralsten Aussagen des
Gesetzes. Sie ist derart elementar, dass es
durchaus angebracht ist, sich vor der Weisheit
der Verfasser zu verbeugen.
Environment
addmargin
, which is described in
section 3.18
,
page 118
, is used to
reduce the width of the main text by the width of the section column.
Here you can see one of the few problems of using \makenote. Because the manda-
tory argument will be written into a helper file, commands inside this argument
unfortunately can break. To avoid this, it is recommended to use \protect in front
of all commands that should not expand while writing the helper file. Otherwise
using a command inside this argument could result in an error message.
In principle you could finish this example already with:
\end{addmargin}
\end{document}
Chapter 19: Note Columns with scrlayer-notecolumn
433
to see a first result.
If you’ll test this example, you will see that the paragraphs column is longer than the com-
ment. If you would add one more paragraph with one more section and comment, you may
have the problem, that the new command will be put immediately after the comment above
and not after the section. So the new section would move away from the corresponding com-
ment. Next we will get a solution of this problem.
\syncwithnotecolumn[note column name ]
This command adds a synchronisation point into the note column and into the main text of
the document. Whenever a synchronisation point is found while output of a note column or
the main text, a mark will be generated that consists of the current page and the current
vertical position.
Together with the generation of synchronisation points it is recognised whether a mark has
been set into the note column or the main text while the previous L
A
TEX run. If so, the values
will be compared. If the mark of the note column is lower at the current page or on a later
page, the main text will be moved down to the position of the mark.
It is recommended to use synchronisation points not inside paragraphs of the main text
but only between paragraphs. If you use \syncwithnotecolumn inside a paragraph, the
synchronisation point will be delayed until the current line has been output. This behaviour
is similar to the usage of, e. g., \vspace.
Because recognition of synchronisation points can be done first at the next L
A
TEX run,,
the mechanism needs at least three L
A
TEX runs. Because of the new synchronisation later
synchronisation points may be moved. This would result in the need of additional L
A
TEX runs.
You should have a look at the message: “L
A
TEX Warning: Label(s) may have changed. Rerun
to get cross-references right.”to find out whether or not additional L
A
TEX runs are needed.
If you do not use the optional argument, the predefined note column marginpar will be used.
Please note, an empty optional argument is not the same as omitting the optional argument!
You must not use \syncwithnotecolumn inside a note itself, this means inside the manda-
tory Argument of \makenote! Currently the package cannot recognise such a mistake and
would result in synchronisation point movement at each L
A
TEX run. So the process will never
terminate. So synchronise two or more note columns, you have to synchronise each of them
with the main text. The recommended command for this will be described next.
Example: Let’s extend the example above, now by adding a synchronisation point and one
more section with one more comment:
\syncwithnotecolumn[paragraphs]\bigskip
\makenote[paragraphs]{%
\protect\begin{contract}
\protect\Clause{title={Komik der Kultur}}
\setcounter{par}{0}%
Chapter 19: Note Columns with scrlayer-notecolumn
434
Die Komik eines Witzes kann durch das
kulturelle Umfeld, in dem er erzählt wird,
bestimmt sein.
Die Komik eines Witzes kann durch das
kulturelle Umfeld, in dem er spielt,
bestimmt sein.
\protect\end{contract}
}
Die kulturelle Komponente eines Witzes ist
tatsächlich nicht zu vernachlässigen. Über die
politische Korrektheit der Nutzung des
kulturellen Umfeldes kann zwar trefflich
gestritten werden, nichtsdestotrotz ist die
Treffsicherheit einer solchen Komik im
entsprechenden Umfeld frappierend. Auf der
anderen Seite kann ein vermeintlicher Witz im
falschen kulturellen Umfeld auch zu einer
echten Gefahr für den Witzeerzähler werden.
Beside the synchronisation point a vertical distance is added by \bigskip to better
separate the section and the corresponding comments.
Again, one more potential problem is shown. Because the note columns uses boxes,
that are build and split, counters inside note columns can sometimes jitter. In the
example the first paragraph would be numbered 2 instead of 1. This can easily be
fixed by a courageous reset of the counter.
Now, the example is almost finished. You just have to finish the environments:
\end{addmargin}
\end{document}
In fact, all other section of the law should also be commented. But let us focus on
the main purpose.
But stop! What, if the section in the paragraphs note column wouldn’t fit to the last page?
Would it be output on the next pages? We will answer this question in the next paragraph.
\syncwithnotecolumns[list of note column names ]
This command will synchronise the main text with all note columns of the comma-separated
list of note column names
. To do so, the main text will be synchronised with the note
column, that have the mark closest to the end of the document. As a side effect the note
columns will be synchronised with each other.
If the optional argument is omitted or empty (or begins with \relax), synchronisation will
be done with all currently declared note columns.
Chapter 19: Note Columns with scrlayer-notecolumn
435
19.6. Force Output of Note Columns
Sometimes it is necessary to have not only the normal note column output but to be able to
output all notes that haven’t been output already. An example for this effort could be that
large notes result in moving lots of notes to new pages. A good occasion to force the output
could be the end of a chapter or the end of the document.
\clearnotecolumn[note column name ]
This command can be used to force the output of all notes of a selected note column that
haven’t been output until the end of the current page, but has been made in this page or
previous pages. To force the output empty pages will be generated. During the output of the
delayed notes of the selected note column, notes of other note columns are also output, but
only as long as there are still delayed notes of the selected note column.
During the output of the delayed notes, notes may be output by mistake that have been
placed to one of the inserted empty pages in the previous L
A
TEX run. This will be solved
automatically by one of the next L
A
TEX runs. You can realise such movement of notes by the
message: “L
A
TEX Warning: Label(s) may have changed. Rerun to get cross-references right.”
The note column related to the output, is given by the optional argument, note column
name
. If this argument is omitted, the notes of the predefined note column marginpar will be
output.
Attentive readers will have noticed that the forced output is something similar to the syn-
chronisation. But if the forced output really results in an output you will be at the start of
a new page and not just at the end of the output afterwards. Nevertheless, a forced output
terminates with less L
A
TEX runs.
\clearnotecolumns[ list of note column names ]
This command is similar to
\clearnotecolumn
with the difference that the optional argu-
ment is not only the name of one note column but a comma-separated list of note column
names
. It forces the output of the notes of all these note columns.
If you omit the optional argument, all delayed notes of all note columns will be output.
autoclearnotecolumns=simple switch
Usually you would like to force the output of notes whenever a document implicitly — e. g.
because of a
\chapter
command — or explicitly executes
\clearpage
. Note that this is also
the case at the end of the document inside \end{document}. Option autoclearnotecolumns
manages whether or not
\clearpage
should also executes
\clearnotecolumns
without any
optional argument.
According to the author’s preference the option is active by default. But you can change
this with proper values for simple switches (see
table 2.5
,
page 39
) at any time.
Chapter 19: Note Columns with scrlayer-notecolumn
436
Figure 19.1.: An example page to the example of
this chapter
Kommentar zum GüdaVaS
Professor R. O. Tenase
11. 11. 2011
Inhaltsverzeichnis
1 Vormerkung
1
2 Analyse
1
1 Vormerkung
Das GüdaVaS ist ohne jeden Zweifel das wichtigste Gesetz, das in Spaßmaniern in
den letzten eintausend Jahren verabschiedet wurde. Die erste Lesung fand bereits am
11. 11 1111 im obersten spaßmanischen Kongress statt, wurde aber vom damalige Spaß-
vesier abgelehnt. Erst nach Umwandlung der spaßmanischen, aberwitzigen Monarchie in
eine repräsentative, witzige Monarchie durch W. Itzbold, den urkomischen, am 9. 9. 1999
war der Weg für dieses Gesetz endlich frei.
2 Analyse
Dies ist eine der zentralsten Aussagen des Gesetzes. Sie ist
derart elementar, dass es durchaus angebracht ist, sich vor
der Weisheit der Verfasser zu verbeugen.
Die kulturelle Komponente eines Witzes ist tatsächlich
nicht zu vernachlässigen. Über die politische Korrektheit
der Nutzung des kulturellen Umfeldes kann zwar trefflich
gestritten werden, nichtsdestotrotz ist die Treffsicherheit
einer solchen Komik im entsprechenden Umfeld frappie-
rend. Auf der anderen Seite kann ein vermeintlicher Witz
im falschen kulturellen Umfeld auch zu einer echten Gefahr
für den Witzeerzähler werden.
Dostları ilə paylaş: |