Debian Codegraph @

texmf-dist/source/latex/koma-script/doc/scrlayer-scrpage-en.tex

raw
1 % ======================================================================
2 % scrlayer-scrpage-en.tex
3 % Copyright (c) Markus Kohm, 2013-2023
4 %
5 % This file is part of the LaTeX2e KOMA-Script bundle.
6 %
7 % This work may be distributed and/or modified under the conditions of
8 % the LaTeX Project Public License, version 1.3c of the license.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3c or later is part of all distributions of LaTeX
12 % version 2005/12/01 or later and of this work.
13 %
14 % This work has the LPPL maintenance status "author-maintained".
15 %
16 % The Current Maintainer and author of this work is Markus Kohm.
17 %
18 % This work consists of all files listed in MANIFEST.md.
19 % ======================================================================
20 %
21 % Chapter about scrlayer-scrpage of the KOMA-Script guide
22 %
23 % ============================================================================
24
25 \KOMAProvidesFile{scrlayer-scrpage-en.tex}%
26 [$Date: 2023-04-06 09:06:52 +0200 (Do, 06. Apr 2023) $
27 KOMA-Script guide (chapter: scrlayer-scrpage)]
28 \translator{Markus Kohm\and Jana Schubert\and Jens Hühne\and Karl Hagen}
29
30 \chapter[{Headers and Footers with \Package{scrlayer-scrpage}}]
31 {Headers\ChangedAt{v3.12}{\Package{scrlayer-scrpage}} and
32 Footers with \Package{scrlayer-scrpage}}
33 \labelbase{scrlayer-scrpage}
34 %
35 \BeginIndexGroup
36 \BeginIndex{Package}{scrlayer-scrpage}%
37 \begin{Explain}
38 Until version 3.11b of \KOMAScript, the \Package{scrpage2}%
39 \IndexPackage[indexmain]{scrpage2}\important{\Package{scrpage2}} package was
40 the recommended way to customise headers and footers beyond the options
41 provided by the \PageStyle{headings}, \PageStyle{myheadings},
42 \PageStyle{plain}, and \PageStyle{empty} page styles of the \KOMAScript{}
43 classes.
44 \iffalse%
45 The still older \Package{scrpage}\IndexPackage{scrpage} package was marked
46 obsolete in 2001 and removed from the regular \KOMAScript{} distribution in
47 2013.\par
48 \fi%
49 Since 2013, the \hyperref[cha:scrlayer]{\Package{scrlayer}}%
50 \important{\hyperref[cha:scrlayer]{\Package{scrlayer}}}%
51 \IndexPackage{scrlayer} package has been included as a basic module of
52 \KOMAScript. This package provides a layer model and a new page-style model
53 based upon it. However, the package's interface is almost too flexible and
54 consequently not easy for the average user to comprehend. For more
55 information about this interface, see \autoref{cha:scrlayer} in
56 \autoref{part:forExperts}. However, a few of the options that are actually
57 part of \Package{scrlayer}, and which are therefore taken up again in that
58 chapter, are also documented here because they are required to use
59 \Package{scrlayer-scrpage}.
60
61 Many users are already familiar with the commands from \Package{scrpage2}.
62 For this reason, \Package{scrlayer-scrpage} provides a method for
63 manipulating headers and footers which is based on \Package{scrlayer}, is
64 largely compatible with \Package{scrpage2}, and at the same time greatly
65 expands the user interface. If you are already familiar with
66 \Package{scrpage2} and refrain from direct calls to its internal commands,
67 you can usually use \Package{scrlayer-scrpage} as a drop-in replacement.
68 This also applies to most examples using \Package{scrpage2} found in
69 \LaTeX{} books or on the Internet.%
70 \iffalse%
71 \iffree{}{\par With the release of this book, \Package{scrlayer-scrpage}
72 for \KOMAScript{} is recommended as the tool of choice when it comes to
73 changing the predefined page styles. Using the obsolete package
74 \Package{scrpage2}\IndexPackage[indexmain]{scrpage2}%
75 \important{\Package{scrpage2}} is now deprecated. Therefore, the
76 commands for this outdated package are no longer part of this book. If
77 you encounter older documents that still use \Package{scrpage2},
78 consider switching to \Package{scrlayer-scrpage}. Notwithstanding, this
79 chapter does contain some hints for using \Package{scrpage2}.}%
80 \fi
81 \end{Explain}
82
83 In addition to \Package{scrlayer-scrpage}\iffree{ or \Package{scrpage2}}{},
84 you could also use \Package{fancyhdr}\IndexPackage{fancyhdr} (see
85 \cite{package:fancyhdr}) to configure the headers and footers of pages.
86 However, this package has no support for several \KOMAScript{} features,
87 for example the element scheme (see \DescRef{\LabelBase.cmd.setkomafont},
88 \DescRef{\LabelBase.cmd.addtokomafont}, and
89 \DescRef{\LabelBase.cmd.usekomafont} in \autoref{sec:maincls.textmarkup},
90 \DescPageRef{maincls.cmd.setkomafont}) or the configurable numbering format
91 for dynamic headers (see the \DescRef{maincls.option.numbers} option and,
92 for example, \DescRef{\LabelBase.cmd.chaptermarkformat} in
93 \autoref{sec:maincls.structure}, \DescPageRef{maincls.option.numbers} and
94 \DescPageRef{maincls.cmd.chaptermarkformat}). Hence, if you are using a
95 \KOMAScript{} class, you should use the new \Package{scrlayer-scrpage}
96 package. \iffree{If you have problems, you can still use
97 \Package{scrpage2}.}{\ignorespaces} Of course, you can also use
98 \Package{scrlayer-scrpage} with other classes, such as the standard \LaTeX{}
99 ones.
100
101 Apart from the features described in this chapter, \Package{scrlayer-scrpage}
102 provides several more functions that are likely only of interest to a very
103 small number of users and therefore are described in
104 \autoref{cha:scrlayer-scrpage-experts} of \autoref{part:forExperts}, starting
105 at \autopageref{cha:scrlayer-scrpage-experts}. Nevertheless, if the options
106 described in \autoref{part:forAuthors} are insufficient for your purposes, you
107 should examine \autoref{cha:scrlayer-scrpage-experts}.
108
109 \LoadCommonFile{options} % \section{Early or late Selection of Options}
110
111 \LoadCommonFile{headfootheight} % \section{Header and Footer Height}
112
113 \LoadCommonFile{textmarkup} % \section{Text Markup}
114
115 \section{Using Predefined Page Styles}
116 \seclabel{predefined.pagestyles}
117
118 The easiest way to create custom headers and footers with
119 \Package{scrlayer-scrpage} is to use one of the predefined page styles.
120 %
121 \iffalse % Umbruchoptimierung
122 This section introduces the page styles defined by the
123 \Package{scrlayer-scrpage} package as it loads. It also explains the
124 commands that you can use to create basic settings for these page
125 styles. You can find further options, commands, and background information
126 in the following sections and in
127 \autoref{sec:scrlayer-scrpage-experts.pagestyle.pairs} in
128 \autoref{part:forExperts}.%
129 \fi
130
131 \begin{Declaration}
132 \PageStyle{scrheadings}%
133 \PageStyle{plain.scrheadings}
134 \end{Declaration}
135 The \Package{scrlayer-scrpage} package provides two page styles that you can
136 reconfigure to your liking. The first page style is
137 \PageStyle{scrheadings}\important{\PageStyle{scrheadings}}, which is intended
138 as a page style with running heads. Its defaults are similar to the page style
139 \PageStyle{headings}\IndexPagestyle{headings} of the standard \LaTeX{} or
140 \KOMAScript{} classes. You can configure exactly what appears in the header or
141 footer with the commands and options described below.
142
143 The second page style is \PageStyle{plain.scrheadings}%
144 \important{\PageStyle{plain.scrheadings}}, which is intended to be a style
145 with no running head. Its defaults resemble those of the
146 \PageStyle{plain}\IndexPagestyle{plain} page style of the standard or
147 \KOMAScript{} classes. You can configure exactly what appears in the header or
148 footer with the commands and options described below.
149
150 You could, of course, configure \PageStyle{scrheadings} to be a page style
151 without a running head and \PageStyle{plain.scrheadings} to be a page style
152 with a running head. It is, however, advisable to adhere to the conventions
153 mentioned above. The two page styles mutually influence one another. Once you
154 apply one of these page styles, \PageStyle{scrheadings} will become accessible
155 as \PageStyle{headings}\important{\PageStyle{headings}}%
156 \IndexPagestyle{headings} and the page style \PageStyle{plain.scrheadings}
157 will become accessible as \PageStyle{plain}\important{\PageStyle{plain}}%
158 \IndexPagestyle{plain}. Thus, if you use a class or package that automatically
159 switches between \PageStyle{headings} and \PageStyle{plain}, you only need to
160 select \PageStyle{scrheadings} or \PageStyle{plain.scrheadings} once. Direct
161 patches to the corresponding classes or packages are not necessary. This pair
162 of page styles can thus serve as a drop-in replacement for
163 \PageStyle{headings} and \PageStyle{plain}. If you need more such pairs,
164 please refer to \autoref{sec:scrlayer-scrpage-experts.pagestyle.pairs} in
165 \autoref{part:forExperts}.%
166 \EndIndexGroup
167
168
169 \begin{Declaration}
170 \Macro{lehead}\OParameter{plain.scrheadings content}%
171 \Parameter{scrheadings content}%
172 \Macro{cehead}\OParameter{plain.scrheadings content}%
173 \Parameter{scrheadings content}%
174 \Macro{rehead}\OParameter{plain.scrheadings content}%
175 \Parameter{scrheadings content}%
176 \Macro{lohead}\OParameter{plain.scrheadings content}%
177 \Parameter{scrheadings content}%
178 \Macro{cohead}\OParameter{plain.scrheadings content}%
179 \Parameter{scrheadings content}%
180 \Macro{rohead}\OParameter{plain.scrheadings content}%
181 \Parameter{scrheadings content}
182 \end{Declaration}
183 You can set the contents of the header for the
184 \DescRef{\LabelBase.pagestyle.plain.scrheadings} and
185 \DescRef{\LabelBase.pagestyle.scrheadings} page styles with these commands.
186 The optional argument sets the content of an element of the
187 \DescRef{\LabelBase.pagestyle.plain.scrheadings} page style, while the
188 mandatory argument sets the content of the corresponding element of the
189 \DescRef{\LabelBase.pagestyle.scrheadings} page style.
190
191 The contents of even\,---\,or left-hand\,---\,pages\textnote{left-hand pages}
192 can be set with \Macro{lehead}, \Macro{cehead}, and \Macro{rehead}. The
193 ``\texttt{e}'' appearing as the second letter of the commands' names stands
194 for ``\emph{even}''.
195
196 The contents of odd\,---\,or right-hand\,---\,pages\textnote{right-hand pages}
197 can be set with \Macro{lohead}, \Macro{cohead}, and \Macro{rohead}. The
198 ``\texttt{o}'' appearing as the second letter of the commands' names stands
199 for ``\emph{odd}''.
200
201 Note\textnote{Attention!} that in one-sided printing, only right-hand pages
202 exist, and \LaTeX{} designates these as odd pages regardless of their page
203 number.
204
205 Each header consists of a left-aligned\textnote{left aligned} element that can
206 be set with \Macro{lehead} or \Macro{lohead}. The ``\texttt{l}'' appearing as
207 the first letter of the commands' names stands for ``\emph{left aligned}''.
208
209 Similarly, each header has a centred\textnote{centred} element that can be set
210 with \Macro{cehead} or \Macro{cohead}. The ``\texttt{c}'' appearing as the
211 first letter of the command' names stands for ``\emph{centred}''.
212
213 Likewise, each header has a right-aligned\textnote{right aligned} element that
214 can be set with \Macro{rehead} or \Macro{rohead}. The ``\texttt{r}'' appearing
215 as the first letter of the commands' names stands for ``\emph{right
216 aligned}''.
217
218 \BeginIndexGroup
219 \BeginIndex{FontElement}{pagehead}\LabelFontElement{pagehead}%
220 \BeginIndex{FontElement}{pageheadfoot}\LabelFontElement{pageheadfoot}%
221 These elements do not have individual font attributes that you can
222 change using the commands \DescRef{\LabelBase.cmd.setkomafont} and
223 \DescRef{\LabelBase.cmd.addtokomafont} (see \autoref{sec:maincls.textmarkup},
224 \DescPageRef{maincls.cmd.setkomafont}). Instead, they use an element named
225 \FontElement{pagehead}. Before this element is applied, the
226 \FontElement{pageheadfoot} element will also be applied. See
227 \autoref{tab:scrlayer-scrpage.fontelements} for the defaults of these
228 elements.%
229 \EndIndexGroup
230
231 The meaning of each command for headers in two-sided printing is illustrated
232 in \autoref{fig:scrlayer-scrpage.head}.%
233 %
234 \begin{figure}[tp]
235 \centering
236 \begin{picture}(\textwidth,30mm)(0,-10mm)
237 \thinlines
238 \small\ttfamily
239 % left/even page
240 \put(0,20mm){\line(1,0){.49\textwidth}}%
241 \put(0,0){\line(0,1){20mm}}%
242 \multiput(0,0)(0,-1mm){10}{\line(0,-1){.5mm}}%
243 \put(.49\textwidth,5mm){\line(0,1){15mm}}%
244 \put(.05\textwidth,10mm){%
245 \color{ImageRed}%
246 \put(-.5em,0){\line(1,0){4em}}%
247 \multiput(3.5em,0)(.25em,0){5}{\line(1,0){.125em}}%
248 \put(-.5em,0){\line(0,1){\baselineskip}}%
249 \put(-.5em,\baselineskip){\line(1,0){4em}}%
250 \multiput(3.5em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
251 \makebox(4em,5mm)[l]{\Macro{lehead}}%
252 }%
253 \put(.465\textwidth,10mm){%
254 \color{ImageBlue}%
255 \put(-4em,0){\line(1,0){4em}}%
256 \multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
257 \put(0,0){\line(0,1){\baselineskip}}%
258 \put(-4em,\baselineskip){\line(1,0){4em}}%
259 \multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
260 \put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rehead}}}%
261 }%
262 \put(.2525\textwidth,10mm){%
263 \color{ImageGreen}%
264 \put(-2em,0){\line(1,0){4em}}%
265 \multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
266 \multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
267 \put(-2em,\baselineskip){\line(1,0){4em}}%
268 \multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
269 \multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
270 \put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cehead}}}%
271 }%
272 % right/odd page
273 \put(.51\textwidth,20mm){\line(1,0){.49\textwidth}}%
274 \put(.51\textwidth,5mm){\line(0,1){15mm}}%
275 \put(\textwidth,0){\line(0,1){20mm}}%
276 \multiput(\textwidth,0)(0,-1mm){10}{\line(0,-1){.5mm}}%
277 \put(.5325\textwidth,10mm){%
278 \color{ImageBlue}%
279 \put(0,0){\line(1,0){4em}}%
280 \multiput(4em,0)(.25em,0){5}{\line(1,0){.125em}}%
281 \put(0,0){\line(0,1){\baselineskip}}%
282 \put(0em,\baselineskip){\line(1,0){4em}}%
283 \multiput(4em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
284 \put(.5em,0){\makebox(4em,5mm)[l]{\Macro{lohead}}}%
285 }%
286 \put(.965\textwidth,10mm){%
287 \color{ImageRed}%
288 \put(-4em,0){\line(1,0){4em}}%
289 \multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
290 \put(0,0){\line(0,1){\baselineskip}}%
291 \put(-4em,\baselineskip){\line(1,0){4em}}%
292 \multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
293 \put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rohead}}}%
294 }%
295 \put(.75\textwidth,10mm){%
296 \color{ImageGreen}%
297 \put(-2em,0){\line(1,0){4em}}%
298 \multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
299 \multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
300 \put(-2em,\baselineskip){\line(1,0){4em}}%
301 \multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
302 \multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
303 \put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cohead}}}%
304 }%
305 % commands for both pages
306 \color{ImageBlue}%
307 \put(.5\textwidth,0){\makebox(0,\baselineskip)[c]{\Macro{ihead}}}%
308 \color{ImageGreen}%
309 \put(.5\textwidth,-5mm){\makebox(0,\baselineskip)[c]{\Macro{chead}}}
310 \color{ImageRed}%
311 \put(.5\textwidth,-10mm){\makebox(0,\baselineskip)[c]{\Macro{ohead}}}
312 \put(\dimexpr.5\textwidth-2em,.5\baselineskip){%
313 \color{ImageBlue}%
314 \put(0,0){\line(-1,0){1.5em}}%
315 \put(-1.5em,0){\vector(0,1){5mm}}%
316 \color{ImageGreen}%
317 \put(0,-1.25\baselineskip){\line(-1,0){\dimexpr .25\textwidth-2em\relax}}%
318 \put(-\dimexpr
319 .25\textwidth-2em\relax,-1.25\baselineskip){\vector(0,1){\dimexpr
320 5mm+1.25\baselineskip\relax}}
321 \color{ImageRed}%
322 \put(0,-2.5\baselineskip){\line(-1,0){\dimexpr .45\textwidth-4em\relax}}%
323 \put(-\dimexpr
324 .45\textwidth-4em\relax,-2.5\baselineskip){\vector(0,1){\dimexpr
325 5mm+2.5\baselineskip\relax}}
326 }%
327 \put(\dimexpr.5\textwidth+2em,.5\baselineskip){%
328 \color{ImageBlue}%
329 \put(0,0){\line(1,0){1.5em}}%
330 \put(1.5em,0){\vector(0,1){5mm}}%
331 \color{ImageGreen}%
332 \put(0,-1.25\baselineskip){\line(1,0){\dimexpr .25\textwidth-2em\relax}}
333 \put(\dimexpr
334 .25\textwidth-2em\relax,-1.25\baselineskip){\vector(0,1){\dimexpr
335 5mm+1.25\baselineskip\relax}}
336 \color{ImageRed}%
337 \put(0,-2.5\baselineskip){\line(1,0){\dimexpr .45\textwidth-4em\relax}}
338 \put(\dimexpr
339 .45\textwidth-4em\relax,-2.5\baselineskip){\vector(0,1){\dimexpr
340 5mm+2.5\baselineskip\relax}}
341 }%
342 \end{picture}
343 \caption[Commands for setting the page header]%
344 {The meaning of the commands for setting the contents of page headers
345 shown on a two-page schematic}
346 \label{fig:scrlayer-scrpage.head}
347 \end{figure}
348 %
349 \begin{Example}
350 Suppose you're writing a short article and you want the author's name to
351 appear on the left side of the page and the article's title to appear
352 right. You can write, for example:
353 \begin{lstcode}
354 \documentclass{scrartcl}
355 \usepackage{scrlayer-scrpage}
356 \lohead{John Doe}
357 \rohead{Page style with \KOMAScript}
358 \pagestyle{scrheadings}
359 \begin{document}
360 \title{Page styles with \KOMAScript}
361 \author{John Doe}
362 \maketitle
363 \end{document}
364 \end{lstcode}
365 But what happens? On the first page there's only a page number in the
366 footer, while the header remains empty!
367
368 The explanation is simple: The \Class{scrartcl} class, like the default
369 \Class{article} class, switches to the \PageStyle{plain} page style for the
370 page which contains the title. After the command
371 \DescRef{maincls.cmd.pagestyle}\PParameter{scrheadings} in the preamble of
372 our example, this actually refers to the
373 \DescRef{\LabelBase.pagestyle.plain.scrheadings} page style. The default for
374 this page style when using a \KOMAScript{} class is an empty page header and
375 a page number in the footer. In the example, the optional arguments of
376 \Macro{lohead} and \Macro{rohead} are omitted, so the
377 \DescRef{\LabelBase.pagestyle.plain.scrheadings} page style remains
378 unchanged and the result for the first page is actually correct.
379
380 The explicit use of \DescRef{maincls.cmd.pagestyle}\PParameter{scrheadings}
381 is not even necessary. The package already executes this command itself when
382 loading, so it automatically sets the page style to
383 \DescRef{\LabelBase.pagestyle.scrheadings}\IndexPagestyle{scrheadings}. This
384 also changes not only the page style
385 \DescRef{maincls.pagestyle.headings}\IndexPagestyle{headings} automatically
386 to \DescRef{\LabelBase.pagestyle.scrheadings}, but also
387 \DescRef{maincls.pagestyle.plain}\IndexPagestyle{plain} to
388 \DescRef{\LabelBase.pagestyle.plain.scrheadings}%
389 \IndexPagestyle{plain.scrheadings}.
390
391 Now add enough text to the example after \DescRef{maincls.cmd.maketitle}
392 so that a second page is printed. You can simply add
393 \Macro{usepackage}\PParameter{lipsum}\IndexPackage{lipsum} to the document
394 preamble and \Macro{lipsum}\IndexCmd{lipsum} below
395 \DescRef{maincls.cmd.maketitle}. You will see that the header of the second
396 page now contains the author and the document title as we wanted.
397
398 For comparison, you should also add the optional argument to
399 \Macro{lohead} and \Macro{rohead}. Change the example as follows:
400 \begin{lstcode}
401 \documentclass{scrartcl}
402 \usepackage{scrlayer-scrpage}
403 \lohead[John Doe]
404 {John Doe}
405 \rohead[Page style with \KOMAScript]
406 {Page style with \KOMAScript}
407 \begin{document}
408 \title{Page styles with \KOMAScript}
409 \author{John Doe}
410 \maketitle
411 \end{document}
412 \end{lstcode}
413 Now you have a header on the first page just above the title itself.
414 That is because you have reconfigured page style
415 \DescRef{\LabelBase.pagestyle.plain.scrheadings} with the two optional
416 arguments. As you probably appreciate, it would be better to leave this page
417 style unchanged, as a running head above the document title is rather
418 annoying.
419
420 By the way, as an alternative to configuring
421 \DescRef{\LabelBase.pagestyle.plain.scrheadings} you could, if you were
422 using a \KOMAScript{} class, have changed the page style for pages that
423 contain title headers. See \DescRef{maincls.cmd.titlepagestyle}%
424 \important{\DescRef{maincls.cmd.titlepagestyle}}%
425 \IndexCmd{titlepagestyle} in \autoref{sec:maincls.pagestyle},
426 \DescPageRef{maincls.cmd.titlepagestyle}.
427 \end{Example}
428
429 Note\textnote{Attention!} that you should never put a section
430 heading or section number directly into the header using one of these
431 commands. Because of the asynchronous way that \TeX{} lays out and outputs
432 pages, doing so can easily result in the wrong number or heading text in the
433 running head. Instead you should use the mark mechanism, ideally in
434 conjunction with the procedures explained in the next section.%
435 \EndIndexGroup
436
437 \begin{Declaration}
438 \Macro{lehead*}\OParameter{plain.scrheadings content}%
439 \Parameter{scrheadings content}%
440 \Macro{cehead*}\OParameter{plain.scrheadings content}%
441 \Parameter{scrheadings content}%
442 \Macro{rehead*}\OParameter{plain.scrheadings content}%
443 \Parameter{scrheadings content}%
444 \Macro{lohead*}\OParameter{plain.scrheadings content}%
445 \Parameter{scrheadings content}%
446 \Macro{cohead*}\OParameter{plain.scrheadings content}%
447 \Parameter{scrheadings content}%
448 \Macro{rohead*}\OParameter{plain.scrheadings content}%
449 \Parameter{scrheadings content}
450 \end{Declaration}
451 The starred versions\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} of the
452 previously described commands differ from the ordinary versions only if you
453 omit the optional argument \PName{plain.scrheadings content}. In this case,
454 the version without the star does not change the contents of
455 \DescRef{\LabelBase.pagestyle.plain.scrheadings}. The starred version, on the
456 other hand, uses the mandatory argument \PName{scrheading content}
457 for \DescRef{\LabelBase.pagestyle.plain.scrheadings} as well. So if both
458 arguments should be the same, you can simply use the starred version with only
459 the mandatory argument.%
460
461 \begin{Example}
462 You can shorten the previous example using the starred versions of
463 \DescRef{\LabelBase.cmd.lohead} and \DescRef{\LabelBase.cmd.rohead}:
464 \begin{lstcode}
465 \documentclass{scrartcl}
466 \usepackage{scrlayer-scrpage}
467 \lohead*{John Doe}
468 \rohead*{Page style with \KOMAScript}
469 \begin{document}
470 \title{Page styles with \KOMAScript}
471 \author{John Doe}
472 \maketitle
473 \end{document}
474 \end{lstcode}%
475 \end{Example}%
476 \EndIndexGroup
477 \ExampleEndFix
478
479
480 \begin{Declaration}
481 \Macro{lefoot}\OParameter{plain.scrheadings content}%
482 \Parameter{scrheadings content}%
483 \Macro{cefoot}\OParameter{plain.scrheadings content}%
484 \Parameter{scrheadings content}%
485 \Macro{refoot}\OParameter{plain.scrheadings content}%
486 \Parameter{scrheadings content}%
487 \Macro{lofoot}\OParameter{plain.scrheadings content}%
488 \Parameter{scrheadings content}%
489 \Macro{cofoot}\OParameter{plain.scrheadings content}%
490 \Parameter{scrheadings content}%
491 \Macro{rofoot}\OParameter{plain.scrheadings content}%
492 \Parameter{scrheadings content}
493 \end{Declaration}
494 You can define the contents of the footer for
495 \DescRef{\LabelBase.pagestyle.scrheadings} and
496 \DescRef{\LabelBase.pagestyle.plain.scrheadings} with these commands. The
497 optional argument defines the content of an element of
498 \DescRef{\LabelBase.pagestyle.plain.scrheadings}, while the mandatory argument
499 sets the content of the corresponding element of
500 \DescRef{\LabelBase.pagestyle.scrheadings}.
501
502 The contents of even\,---\,or left-hand\,---\,pages\textnote{left-hand page}
503 are set with \Macro{lefoot}, \Macro{cefoot}, and \Macro{refoot}. The
504 ``\texttt{e}'' appearing as the second letter of the commands' names stands
505 for ``\emph{even}''.
506
507 The contents of odd\,---\,or right-hand\,---\,pages\textnote{right-hand page}
508 are set with \Macro{lofoot}, \Macro{cofoot}, and \Macro{rofoot}. The
509 ``\texttt{o}'' appearing as the second letter of the commands' names stands
510 for ``\emph{odd}''.
511
512 Note\textnote{Attention!} that in one-sided printing, only right-hand pages
513 exist, and \LaTeX{} designates these as odd pages regardless of their page
514 number.
515
516 Each footer consists of a left-aligned\textnote{left aligned} element that can
517 be set with \Macro{lefoot} or \Macro{lofoot}. The ``\texttt{l}'' appearing as
518 the first letter of the commands' names stands for ``\emph{left aligned}''.
519
520 Similarly, each footer has a centred\textnote{centred} element that can be set
521 with \Macro{cefoot} or \Macro{cofoot}. The ``\texttt{c}'' in the first letter
522 of the command' names stands for ``\emph{centred}''.
523
524 Likewise, each footer has a right-aligned\textnote{right aligned} element that
525 can be set with \Macro{refoot} or \Macro{rofoot}. The ``\texttt{r}'' in the
526 first letter of the commands' names stands for ``\emph{right aligned}''.
527
528 \BeginIndexGroup
529 \BeginIndex{FontElement}{pagefoot}\LabelFontElement{pagefoot}%
530 \BeginIndex{FontElement}{pageheadfoot}\LabelFontElement[foot]{pageheadfoot}%
531 However, these elements do not have individual font attributes that can be
532 changed with the \DescRef{\LabelBase.cmd.setkomafont} and
533 \DescRef{\LabelBase.cmd.addtokomafont} commands (see
534 \autoref{sec:maincls.textmarkup}, \DescPageRef{maincls.cmd.setkomafont}).
535 Instead, they use an element named
536 \FontElement{pagefoot}\important{\FontElement{pagefoot}}. Before this element
537 is applied, the font element
538 \FontElement{pageheadfoot}\important{\FontElement{pageheadfoot}} is also
539 applied. See \autoref{tab:scrlayer-scrpage.fontelements} for the defaults of
540 the fonts of these elements.%
541 \EndIndexGroup
542
543 The meaning of each command for footers in two-sided printing is illustrated
544 in \autoref{fig:scrlayer-scrpage.foot}.%
545 %
546 \begin{figure}[bp]
547 \centering
548 \begin{picture}(\textwidth,30mm)
549 \thinlines
550 \small\ttfamily
551 % left page
552 \put(0,0){\line(1,0){.49\textwidth}}%
553 \put(0,0){\line(0,1){20mm}}%
554 \multiput(0,20mm)(0,1mm){10}{\line(0,1){.5mm}}%
555 \put(.49\textwidth,0){\line(0,1){15mm}}%
556 \put(.05\textwidth,5mm){%
557 \color{ImageRed}%
558 \put(-.5em,0){\line(1,0){4em}}%
559 \multiput(3.5em,0)(.25em,0){5}{\line(1,0){.125em}}%
560 \put(-.5em,0){\line(0,1){\baselineskip}}%
561 \put(-.5em,\baselineskip){\line(1,0){4em}}%
562 \multiput(3.5em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
563 \makebox(4em,5mm)[l]{\Macro{lefoot}}%
564 }%
565 \put(.465\textwidth,5mm){%
566 \color{ImageBlue}%
567 \put(-4em,0){\line(1,0){4em}}%
568 \multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
569 \put(0,0){\line(0,1){\baselineskip}}%
570 \put(-4em,\baselineskip){\line(1,0){4em}}%
571 \multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
572 \put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{refoot}}}%
573 }%
574 \put(.2525\textwidth,5mm){%
575 \color{ImageGreen}%
576 \put(-2em,0){\line(1,0){4em}}%
577 \multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
578 \multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
579 \put(-2em,\baselineskip){\line(1,0){4em}}%
580 \multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
581 \multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
582 \put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cefoot}}}%
583 }%
584 % right page
585 \put(.51\textwidth,0){\line(1,0){.49\textwidth}}%
586 \put(.51\textwidth,0){\line(0,1){15mm}}%
587 \put(\textwidth,0){\line(0,1){20mm}}%
588 \multiput(\textwidth,20mm)(0,1mm){10}{\line(0,1){.5mm}}%
589 \put(.5325\textwidth,5mm){%
590 \color{ImageBlue}%
591 \put(0,0){\line(1,0){4em}}%
592 \multiput(4em,0)(.25em,0){5}{\line(1,0){.125em}}%
593 \put(0,0){\line(0,1){\baselineskip}}%
594 \put(0em,\baselineskip){\line(1,0){4em}}%
595 \multiput(4em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
596 \put(.5em,0){\makebox(4em,5mm)[l]{\Macro{lofoot}}}%
597 }%
598 \put(.965\textwidth,5mm){%
599 \color{ImageRed}%
600 \put(-4em,0){\line(1,0){4em}}%
601 \multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
602 \put(0,0){\line(0,1){\baselineskip}}%
603 \put(-4em,\baselineskip){\line(1,0){4em}}%
604 \multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
605 \put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rofoot}}}%
606 }%
607 \put(.75\textwidth,5mm){%
608 \color{ImageGreen}%
609 \put(-2em,0){\line(1,0){4em}}%
610 \multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
611 \multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
612 \put(-2em,\baselineskip){\line(1,0){4em}}%
613 \multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
614 \multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
615 \put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cofoot}}}%
616 }%
617 % both pages
618 \color{ImageBlue}%
619 \put(.5\textwidth,15mm){\makebox(0,\baselineskip)[c]{\Macro{ifoot}}}%
620 \color{ImageGreen}%
621 \put(.5\textwidth,20mm){\makebox(0,\baselineskip)[c]{\Macro{cfoot}}}
622 \color{ImageRed}%
623 \put(.5\textwidth,25mm){\makebox(0,\baselineskip)[c]{\Macro{ofoot}}}
624 \put(\dimexpr.5\textwidth-2em,.5\baselineskip){%
625 \color{ImageBlue}%
626 \put(0,15mm){\line(-1,0){1.5em}}%
627 \put(-1.5em,15mm){\vector(0,-1){5mm}}%
628 \color{ImageGreen}%
629 \put(0,20mm){\line(-1,0){\dimexpr .25\textwidth-2em\relax}}%
630 \put(-\dimexpr .25\textwidth-2em\relax,20mm){\vector(0,-1){10mm}}%
631 \color{ImageRed}%
632 \put(0,25mm){\line(-1,0){\dimexpr .45\textwidth-4em\relax}}%
633 \put(-\dimexpr .45\textwidth-4em\relax,25mm){\vector(0,-1){15mm}}%
634 }%
635 \put(\dimexpr.5\textwidth+2em,.5\baselineskip){%
636 \color{ImageBlue}%
637 \put(0,15mm){\line(1,0){1.5em}}%
638 \put(1.5em,15mm){\vector(0,-1){5mm}}%
639 \color{ImageGreen}%
640 \put(0,20mm){\line(1,0){\dimexpr .25\textwidth-2em\relax}}%
641 \put(\dimexpr .25\textwidth-2em\relax,20mm){\vector(0,-1){10mm}}%
642 \color{ImageRed}%
643 \put(0,25mm){\line(1,0){\dimexpr .45\textwidth-4em\relax}}%
644 \put(\dimexpr .45\textwidth-4em\relax,25mm){\vector(0,-1){15mm}}%
645 }%
646 \end{picture}
647 \caption[Commands for setting the page footer]%
648 {The meaning of the commands for setting the contents of page
649 footers shown on a two-page schematic}%
650 \label{fig:scrlayer-scrpage.foot}
651 \end{figure}
652 %
653 \begin{Example}
654 Let's return to the example of the short article. Let's say you want to
655 specify the publisher in the left side of the footer. You would change the
656 example above to:
657 \begin{lstcode}
658 \documentclass{scrartcl}
659 \usepackage{scrlayer-scrpage}
660 \lohead{John Doe}
661 \rohead{Page style with \KOMAScript}
662 \lofoot{Smart Alec Publishing}
663 \usepackage{lipsum}
664 \begin{document}
665 \title{Page styles with \KOMAScript}
666 \author{John Doe}
667 \maketitle
668 \lipsum
669 \end{document}
670 \end{lstcode}
671 Once again the publisher is not printed on the first page with the title.
672 The reason is the same as in the example with
673 \DescRef{\LabelBase.cmd.lohead} above. And the solution for getting the
674 publisher on the first page is similar:
675 \begin{lstcode}
676 \lofoot[Smart Alec Publishing]
677 {Smart Alec Publishing}
678 \end{lstcode}
679 Now you decide\textnote{font change}\important{\FontElement{pageheadfoot}}%
680 \IndexFontElement{pageheadfoot} that the header and footer should use an
681 upright but smaller font in place of the default slanted font:
682 \begin{lstcode}
683 \setkomafont{pageheadfoot}{\small}
684 \end{lstcode}
685 In addition, the header, but not the footer, should be bold:
686 \begin{lstcode}
687 \setkomafont{pagehead}{\bfseries}
688 \end{lstcode}
689 It is important\textnote{Attention!} that this command does not occur until
690 after \Package{scrpage-scrlayer} has been loaded because the \KOMAScript{}
691 class defines \DescRef{\LabelBase.fontelement.pagehead} as an alias for
692 \DescRef{\LabelBase.fontelement.pageheadfoot}. Only by loading
693 \Package{scrpage-scrlayer} will \DescRef{\LabelBase.fontelement.pagehead}
694 become an element independent of
695 \DescRef{\LabelBase.fontelement.pageheadfoot}.
696
697 Now add one more \Macro{lipsum} and the
698 \Option{twoside}\IndexOption{twoside}\important{\Option{twoside}} option
699 when loading \Class{scrartcl}. First of all, you will see the page number
700 moves from the centre to the outer margin of the page footer, due to the
701 changed defaults of \DescRef{\LabelBase.pagestyle.scrheadings} and
702 \DescRef{\LabelBase.pagestyle.plain.scrheadings} for two-sided printing with
703 a \KOMAScript{} class.
704
705 Simultaneously, the author, document title, and publisher will vanish from
706 page~2. They only appear on page~3. That's because we've only used
707 commands for odd pages. You can recognise this by the ``\texttt{o}'' in the
708 second position of the command names.
709
710 Now, we could simply copy those commands and replace the ``\texttt{o}'' with
711 an ``\texttt{e}'' to define the contents of \emph{even} pages. But with
712 two-sided printing, it makes more sense to use mirror-inverted elements,
713 i.\,e. the left element of an even page should become the right element of
714 the odd page and visa versa. To achieve this, we also replace the first
715 letter ``\texttt{l}'' with ``\texttt{r}'':
716 \begin{lstcode}
717 \documentclass[twoside]{scrartcl}
718 \usepackage{scrlayer-scrpage}
719 \lohead{John Doe}
720 \rohead{Page style with \KOMAScript}
721 \lofoot[Smart Alec Publishing]
722 {Smart Alec Publishing}
723 \rehead{John Doe}
724 \lohead{Page style with \KOMAScript}
725 \refoot[Smart Alec Publishing]
726 {Smart Alec Publishing}
727 \usepackage{lipsum}
728 \begin{document}
729 \title{Page styles with \KOMAScript}
730 \author{John Doe}
731 \maketitle
732 \lipsum\lipsum
733 \end{document}
734 \end{lstcode}
735 \end{Example}
736 %
737 Since it is a bit cumbersome to define left and right pages separately in
738 cases such as the previous example, a simpler solution for this common case is
739 introduced below.
740
741 Allow me once again an important note:\textnote{Attention!} you should
742 never put a section heading or section number directly into the footer using
743 one of these commands. Because of the asynchronous way that \TeX{} lays out and
744 outputs pages, doing so can easily result in the wrong number or heading text
745 in the running head. Instead you should use the mark mechanism, ideally in
746 conjunction with the procedures explained in the next section.%
747 \EndIndexGroup
748
749
750 \begin{Declaration}
751 \Macro{lefoot*}\OParameter{plain.scrheadings content}%
752 \Parameter{scrheadings content}%
753 \Macro{cefoot*}\OParameter{plain.scrheadings content}%
754 \Parameter{scrheadings content}%
755 \Macro{refoot*}\OParameter{plain.scrheadings content}%
756 \Parameter{scrheadings content}%
757 \Macro{lofoot*}\OParameter{plain.scrheadings content}%
758 \Parameter{scrheadings content}%
759 \Macro{cofoot*}\OParameter{plain.scrheadings content}%
760 \Parameter{scrheadings content}%
761 \Macro{rofoot*}\OParameter{plain.scrheadings content}%
762 \Parameter{scrheadings content}
763 \end{Declaration}
764 The starred versions\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} of the
765 previously described commands differ only if you omit the optional argument
766 \OParameter{plain.scrheadings content}. In this case, the version without the
767 star does not change the contents of
768 \DescRef{\LabelBase.pagestyle.plain.scrheadings}. The starred version, on the
769 other hand, uses the mandatory argument \PName{scrheading content} for
770 \DescRef{\LabelBase.pagestyle.plain.scrheadings} as well. So if both arguments
771 should be the same, you can simply use the starred version with just the
772 mandatory argument.%
773
774 \begin{Example}
775 You can shorten the previous example using the star versions of
776 \DescRef{\LabelBase.cmd.lofoot} and \DescRef{\LabelBase.cmd.refoot}:
777 \begin{lstcode}
778 \documentclass[twoside]{scrartcl}
779 \usepackage{scrlayer-scrpage}
780 \lohead{John Doe}
781 \rohead{Page style with \KOMAScript}
782 \lofoot*{Smart Alec Publishing}
783 \rehead{John Doe}
784 \lohead{Page style with \KOMAScript}
785 \refoot*{Smart Alec Publishing}
786 \usepackage{lipsum}
787 \begin{document}
788 \title{Page styles with \KOMAScript}
789 \author{John Doe}
790 \maketitle
791 \lipsum\lipsum
792 \end{document}
793 \end{lstcode}
794 \end{Example}
795 %
796 \EndIndexGroup
797 \ExampleEndFix
798
799
800 \begin{Declaration}
801 \Macro{ohead}\OParameter{plain.scrheadings content}%
802 \Parameter{scrheadings content}%
803 \Macro{chead}\OParameter{plain.scrheadings content}%
804 \Parameter{scrheadings content}%
805 \Macro{ihead}\OParameter{plain.scrheadings content}%
806 \Parameter{scrheadings content}%
807 \Macro{ofoot}\OParameter{plain.scrheadings content}%
808 \Parameter{scrheadings content}%
809 \Macro{cfoot}\OParameter{plain.scrheadings content}%
810 \Parameter{scrheadings content}%
811 \Macro{ifoot}\OParameter{plain.scrheadings content}%
812 \Parameter{scrheadings content}
813 \end{Declaration}
814 To configure the headers and footers for two-sided printing with the
815 previously described commands, you would have to configure the left and right
816 sides separately from one another. In most cases, however, the left and right
817 sides are more or less symmetrical. An item that appears on the left of an
818 even page should appear on the right of an odd page and vice versa. Centred
819 elements are usually centred on both sides.
820
821 To simplify the definition of such symmetric page styles,
822 \Package{scrlayer-scrpage} has shortcuts. The \Macro{ohead} command
823 corresponds to a call to both \DescRef{\LabelBase.cmd.lehead} and
824 \DescRef{\LabelBase.cmd.rohead}. The \Macro{chead} command corresponds to a
825 call to both \DescRef{\LabelBase.cmd.cehead} and
826 \DescRef{\LabelBase.cmd.cohead}. And the \Macro{ihead} command corresponds to
827 a call to both \DescRef{\LabelBase.cmd.rehead} and
828 \DescRef{\LabelBase.cmd.lohead}. The same applies to the equivalent commands
829 for the page footer. An outline of these relationships can also be found in
830 \autoref{fig:scrlayer-scrpage.head} on \autopageref{fig:scrlayer-scrpage.head}
831 and \autoref{fig:scrlayer-scrpage.foot} on
832 \autopageref{fig:scrlayer-scrpage.foot}.
833 %
834 \begin{Example}
835 You can simplify the previous example using the new commands:
836 \begin{lstcode}
837 \documentclass[twoside]{scrartcl}
838 \usepackage{scrlayer-scrpage}
839 \ihead{John Doe}
840 \ohead{Page style with \KOMAScript}
841 \ifoot[Smart Alec Publishing]
842 {Smart Alec Publishing}
843 \usepackage{lipsum}
844 \begin{document}
845 \title{Page styles with \KOMAScript}
846 \author{John Doe}
847 \maketitle
848 \lipsum\lipsum
849 \end{document}
850 \end{lstcode}
851 \iffalse%
852 As you can see, you can use half the number of commands but get the same
853 result. %
854 \fi%
855 \end{Example}%
856 Because one-sided printing treats all pages as odd pages, these commands are
857 synonymous with the corresponding right-side commands when in one-sided mode.
858 Therefore in most cases you will only need these six commands instead of the
859 twelve described before.
860
861 Allow me once again an important note:\textnote{Attention!} you should never
862 put a section heading or section number directly into the footer using one of
863 these commands. Because of the asynchronous way that \TeX{} lays out and
864 outputs pages, doing so can easily result in the wrong number or heading text
865 in the running head. Instead you should use the mark mechanism, ideally in
866 conjunction with the procedures explained in the next section.%
867 \EndIndexGroup
868
869
870 \begin{Declaration}
871 \Macro{ohead*}\OParameter{plain.scrheadings content}%
872 \Parameter{scrheadings content}%
873 \Macro{chead*}\OParameter{plain.scrheadings content}%
874 \Parameter{scrheadings content}%
875 \Macro{ihead*}\OParameter{plain.scrheadings content}%
876 \Parameter{scrheadings content}%
877 \Macro{ofoot*}\OParameter{plain.scrheadings content}%
878 \Parameter{scrheadings content}%
879 \Macro{cfoot*}\OParameter{plain.scrheadings content}%
880 \Parameter{scrheadings content}%
881 \Macro{ifoot*}\OParameter{plain.scrheadings content}%
882 \Parameter{scrheadings content}
883 \end{Declaration}
884 The previously described commands also have starred
885 versions\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} that differ only if you
886 omit the optional argument \OParameter{plain.scrheadings content}. In this
887 case, the version without a star does not change the content of
888 \DescRef{\LabelBase.pagestyle.plain.scrheadings}. The version with the star,
889 on the other hand, also uses the mandatory argument \PName{scrheadings
890 content} for \DescRef{\LabelBase.pagestyle.plain.scrheadings}. So if both
891 arguments should be the same, you can simply use the starred version with only
892 the mandatory argument.%
893
894 \begin{Example}
895 You can shorten the previous example using the star version of
896 \DescRef{\LabelBase.cmd.ifoot}:
897 \begin{lstcode}
898 \documentclass[twoside]{scrartcl}
899 \usepackage{scrlayer-scrpage}
900 \ihead{John Doe}
901 \ohead{Page style with \KOMAScript}
902 \ifoot*{Smart Alec Publishing}
903 \usepackage{lipsum}
904 \begin{document}
905 \title{Page styles with \KOMAScript}
906 \author{John Doe}
907 \maketitle
908 \lipsum\lipsum
909 \end{document}
910 \end{lstcode}%
911 \end{Example}%
912 \EndIndexGroup
913
914
915 \begin{Declaration}
916 \OptionVName{pagestyleset}{setting}
917 \end{Declaration}
918 \BeginIndex{Option}{pagestyleset~=KOMA-Script}%
919 \BeginIndex{Option}{pagestyleset~=standard}%
920 The examples above refer several times to the default settings of the page
921 styles \DescRef{\LabelBase.pagestyle.scrheadings}\IndexPagestyle{scrheadings}
922 and \DescRef{\LabelBase.pagestyle.plain.scrheadings}%
923 \IndexPagestyle{plain.scrheadings}. In fact, \Package{scrlayer-scrpage}
924 currently provides two different defaults for these page styles. You can
925 select them manually with the \Option{pagestyleset} option.
926
927 The
928 \PValue{KOMA-Script}\important{\OptionValue{pagestyleset}{KOMA-Script}}
929 \PName{setting} selects the defaults, which are also set automatically if the
930 option is not specified and a \KOMAScript{} class is detected. In two-sided
931 printing, \DescRef{\LabelBase.pagestyle.scrheadings} uses outer-aligned
932 running heads in the header and outer-aligned page numbers in the footer.
933 In one-sided printing, the running head will be printed in the
934 middle of the header and the page number in the middle of the footer. Upper-
935 and lower-case letters are used in the automatic running heads as they
936 actually appear in the sectioning headings. This corresponds to the
937 \OptionValueRef{\LabelBase}{markcase}{used}\IndexOption{markcase~=used}%
938 \important{\OptionValueRef{\LabelBase}{markcase}{used}} option. The
939 \DescRef{\LabelBase.pagestyle.plain.scrheadings} page style has no running
940 heads, but the page numbers are printed in the same manner.
941
942 However, if the \hyperref[cha:scrlttr2]{\Class{scrlttr2}}%
943 \important{\hyperref[cha:scrlttr2]{\Class{scrlttr2}}}%
944 \IndexClass{scrlttr2} class is detected, the default settings are based on the
945 page styles of that class. See \autoref{sec:scrlttr2.pagestyle},
946 \autopageref{sec:scrlttr2.pagestyle}.
947
948 The
949 \PValue{standard}\important{\OptionValue{pagestyleset}{standard}}
950 \PName{setting} selects defaults that match the page styles of the standard
951 classes. This is also activated automatically if the option has not been
952 specified and no \KOMAScript{} class is detected. In this case, for two-sided
953 printing \DescRef{\LabelBase.pagestyle.scrheadings} uses running heads
954 inner-aligned in the header, and the page numbers will be printed\,---\,also
955 in the header\,---\,outer-aligned. One-sided printing uses the same settings,
956 but since only right-hand pages exist in this mode, the running head will
957 always be left-aligned and the page number right-aligned. The automatic
958 running heads\,---\,despite considerable typographic objections\,---\,are
959 converted to capital letters, as they would be with
960 \OptionValueRef{\LabelBase}{markcase}{upper}\IndexOption{markcase~=upper}%
961 \important{\OptionValueRef{\LabelBase}{markcase}{upper}}. In one-sided
962 printing, the \DescRef{\LabelBase.pagestyle.plain.scrheadings} page style
963 differs considerably from \DescRef{\LabelBase.pagestyle.scrheadings} because
964 the page number is printed in the middle of the footer.
965 Unlike\textnote{\KOMAScript{} vs. standard classes} the \PageStyle{plain} page
966 style in the standard classes,
967 \DescRef{\LabelBase.pagestyle.plain.scrheadings} omits the page number in
968 two-sided printing. The standard classes print the page number in the middle
969 of the footer, which does not match the rest of the page styles in two-sided
970 printing.
971 \iffalse % Umbruchkorrekturtext
972 If you want the page number back
973 \begin{lstcode}
974 \cfoot[\pagemark]{}
975 \end{lstcode}
976 will restore it. %
977 \fi%
978 The running head is omitted in \DescRef{\LabelBase.pagestyle.plain.scrheadings}.
979
980 Note\textnote{Attention!} that using this option activates the
981 \DescRef{\LabelBase.pagestyle.scrheadings}\IndexPagestyle{scrheadings}%
982 \important{\DescRef{\LabelBase.pagestyle.scrheadings}} page style.
983 \iffalse% Umbruchkorrektur
984 This also applies if you use the option within the document.%
985 \fi
986 %
987 \EndIndexGroup
988
989
990 \LoadCommonFile{pagestylemanipulation} % \section{Manipulating Defined Page Styles}
991
992 \begin{Declaration}
993 \OptionVName{headwidth}{width\textup{:}offset\textup{:}offset}%
994 \OptionVName{footwidth}{width\textup{:}offset\textup{:}offset}
995 \end{Declaration}
996 By default the header\Index{header>width} and footer\Index{footer>width} are
997 as wide as the type area. However, you can change this using these
998 \KOMAScript{} options. The value \PName{width} is the desired width of the
999 header or footer. The \PName{offset} defines how far the header or footer
1000 should be moved towards the outer\,---\,in one-sided printing to the
1001 right\,---\,margin. All three\ChangedAt{v3.14}{\Package{scrlayer-scrpage}}
1002 values are optional and can be omitted. If you omit a value, you can also omit
1003 the associated colon to the left of it. If only one \PName{offset} is
1004 specified, it is used for both odd and even pages. Otherwise, the first
1005 \PName{offset} is used for odd and the second \PName{offset} for even pages in
1006 two-sided mode. If you only use one value without a colon, this will be the
1007 \PName{width}.
1008
1009 For both the \PName{width} and the \PName{offset} you can use any valid length
1010 value, \LaTeX{} length, \TeX{} dimension, or \TeX{} skip. In addition, you can
1011 use an \eTeX{} dimension expression with the basic arithmetic operations
1012 \texttt{+}, \texttt{-}, \texttt{*}, \texttt{/}, and parentheses. See
1013 \cite[section~3.5]{manual:eTeX} for more information on such expressions. See
1014 \autoref{sec:scrlayer-scrpage.options} for more information on using a
1015 \LaTeX{} length as an option value. The \PName{width} can also be one of the
1016 symbolic values shown in \autoref{tab:scrlayer-scrpage.symbolic.values}.
1017
1018 By default the header and the footer are the width of the text area. The
1019 default \PName{offset} depends on the selected \PName{width}. One-sided
1020 printing typically uses half the difference between \PName{width} and the
1021 width of the text area. This centres the header horizontally above the text
1022 area. Two-sided printing, on the other hand, uses only a third of the
1023 difference between \PName{width} and the width of the text area. However, if
1024 \PName{width} is the width of the whole text area and the marginal note
1025 column, the default \PName{offset} will be zero. If this is too complicated
1026 for you, you should simply specify the desired \PName{offset} yourself.
1027 %
1028 \begin{table}
1029 \centering
1030 \caption[Symbolic values for the \Option{headwidth} and \Option{footwidth}
1031 options]{Available symbolic values for the \PName{width} value of options
1032 \Option{headwidth} and \Option{footwidth}}
1033 \label{tab:scrlayer-scrpage.symbolic.values}
1034 \begin{desctabular}
1035 \entry{\PValue{foot}}{%
1036 the current width of the footer%
1037 }%
1038 \entry{\PValue{footbotline}}{%
1039 the current length of the horizontal line below the footer%
1040 }%
1041 \entry{\PValue{footsepline}}{%
1042 the current length of the horizontal line above the footer%
1043 } \entry{\PValue{head}}{%
1044 the current width of the header%
1045 }%
1046 \entry{\PValue{headsepline}}{%
1047 the current length of the horizontal line below the header%
1048 }%
1049 \entry{\PValue{headtopline}}{%
1050 the current length of the horizontal line above the header%
1051 }%
1052 \entry{\PValue{marginpar}}{%
1053 the width of the marginal note column including the distance
1054 between the text area and the marginal note column%
1055 }%
1056 \entry{\PValue{page}}{%
1057 the width of the page taking into account any binding correction defined
1058 with the help of the \Package{typearea} package (see the
1059 \DescRef{typearea.option.BCOR} option in
1060 \autoref{sec:typearea.typearea}, \DescPageRef{typearea.option.BCOR})%
1061 }%
1062 \entry{\PValue{paper}}{%
1063 the width of the paper without considering any binding correction%
1064 }%
1065 \entry{\PValue{text}}{%
1066 the width of the text area%
1067 }%
1068 \entry{\PValue{textwithmarginpar}}{%
1069 the width of the text area including the marginal note column and
1070 the distance between the two (Note: only in this case is
1071 the default for \PName{offset} zero)%
1072 }%
1073 \end{desctabular}
1074 \end{table}
1075 %
1076 \EndIndexGroup
1077
1078
1079 \begin{Declaration}
1080 \OptionVName{headtopline}{thickness\textup{:}length}%
1081 \OptionVName{headsepline}{thickness\textup{:}length}%
1082 \OptionVName{footsepline}{thickness\textup{:}length}%
1083 \OptionVName{footbotline}{thickness\textup{:}length}
1084 \end{Declaration}
1085 \BeginIndex{Option}{headtopline~=\PName{thickness\textup{:}length}}%
1086 \BeginIndex{Option}{headsepline~=\PName{thickness\textup{:}length}}%
1087 \BeginIndex{Option}{footsepline~=\PName{thickness\textup{:}length}}%
1088 \BeginIndex{Option}{footbotline~=\PName{thickness\textup{:}length}}%
1089 The \KOMAScript{} classes provide only one separation line below the header
1090 and another above the footer, and you can only switch these lines on or off.
1091 But the \Package{scrlayer-scrpage} package also lets you place lines above the
1092 header and below the footer. And for all four lines, you can not only switch
1093 them on an off but also configure their \PName{length} and \PName{thickness}.
1094
1095 Both values are optional. If you omit the \PName{thickness}, a default value
1096 of 0.4\Unit{pt} is used, producing a so-called \emph{hairline}. If you omit
1097 the \PName{length}, the width of the header or footer will be used. If you
1098 omit both, you can also omit the colon. If you use only one value without
1099 colon, this is the \PName{thickness}.
1100
1101 Of course, the \PName{length} can be not just shorter than the current width
1102 of the header or footer but also longer. See also the options
1103 \DescRef{\LabelBase.option.ilines}\IndexOption{ilines}%
1104 \important{\DescRef{\LabelBase.option.ilines},
1105 \DescRef{\LabelBase.option.clines}, \DescRef{\LabelBase.option.olines}},
1106 \DescRef{\LabelBase.option.clines}\IndexOption{clines} and
1107 \DescRef{\LabelBase.option.olines}\IndexOption{olines} later in this section.
1108
1109 \BeginIndexGroup
1110 \BeginIndex{FontElement}{headtopline}\LabelFontElement{headtopline}%
1111 \BeginIndex{FontElement}{headsepline}\LabelFontElement{headsepline}%
1112 \BeginIndex{FontElement}{footsepline}\LabelFontElement{footsepline}%
1113 \BeginIndex{FontElement}{footbotline}\LabelFontElement{footbotline}%
1114 In addition to the length and thickness, you can also change the colour of the
1115 lines. Initially the colour depends on the colour of the header or footer. In
1116 addition to this, however, the settings of the corresponding elements
1117 \important[i]{\FontElement{headtopline}\\
1118 \FontElement{headsepline}\\
1119 \FontElement{footsepline}\\
1120 \FontElement{footbotline}} \FontElement{headtopline},
1121 \FontElement{headsepline}, \FontElement{footsepline} and
1122 \FontElement{footbotline} are applied. You can
1123 change these using the \DescRef{\LabelBase.cmd.setkomafont} or
1124 \DescRef{\LabelBase.cmd.addtokomafont} commands (see
1125 \autoref{sec:maincls.textmarkup}, \DescPageRef{maincls.cmd.setkomafont}).
1126 By default these elements are empty, so they do not change the current font or
1127 colour. Font changes at this point, unlike colour changes, make little sense
1128 anyway and are therefore not recommended for these elements.%
1129 \EndIndexGroup
1130 %
1131 \EndIndexGroup
1132
1133
1134 \begin{Declaration}
1135 \OptionVName{plainheadtopline}{simple switch}%
1136 \OptionVName{plainheadsepline}{simple switch}%
1137 \OptionVName{plainfootsepline}{simple switch}%
1138 \OptionVName{plainfootbotline}{simple switch}
1139 \end{Declaration}
1140 You can use these options to apply the settings for the lines to the
1141 \PageStyle{plain} page style. You can find the available values for
1142 \PName{simple switch} in \autoref{tab:truefalseswitch} on
1143 \autopageref{tab:truefalseswitch}. If one of these options is activated, the
1144 \PageStyle{plain} page style will use the line settings given by the options
1145 and commands described above. If the option is deactivated, the
1146 \PageStyle{plain} will not show the corresponding line.%
1147 \EndIndexGroup
1148
1149
1150 \begin{Declaration}
1151 \Option{ilines}%
1152 \Option{clines}%
1153 \Option{olines}
1154 \end{Declaration}
1155 As previously explained, dividing lines for the header or footer can be longer
1156 or shorter than the width of the header or footer respectively. But the
1157 question remains how these lines are aligned. By default, all lines are
1158 aligned to the left margin in one-sided printing and to the inner margin in
1159 two-sided printing. This corresponds to using the \Option{ilines} option.
1160 Alternatively, you can use the \Option{clines} option to centre the lines with
1161 respect to the width of the header or footer, or the \Option{olines} option to
1162 align them to the outer (or right) margin.%
1163 \EndIndexGroup
1164 %
1165 \EndIndexGroup
1166
1167 %%% Local Variables:
1168 %%% mode: latex
1169 %%% TeX-master: "scrguide-en.tex"
1170 %%% coding: utf-8
1171 %%% ispell-local-dictionary: "en_GB"
1172 %%% eval: (flyspell-mode 1)
1173 %%% End: