1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
|
% ======================================================================
% scrlayer-scrpage.tex
% Copyright (c) Markus Kohm, 2013-2015
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
% ----------------------------------------------------------------------
% scrlayer-scrpage.tex
% Copyright (c) Markus Kohm, 2013-2015
%
% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
% Version 1.3c, verteilt und/oder veraendert werden.
% Die neuste Version dieser Lizenz ist
% http://www.latex-project.org/lppl.txt
% und Version 1.3c ist Teil aller Verteilungen von LaTeX
% Version 2005/12/01 oder spaeter und dieses Werks.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
% (allein durch den Autor verwaltet).
%
% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
%
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
% ======================================================================
%
% Chapter about scrlayer-scrpage of the KOMA-Script guide
%
% ----------------------------------------------------------------------
%
% Kapitel ueber scrlayer-scrpage in der KOMA-Script-Anleitung
%
% ============================================================================
\KOMAProvidesFile{scrlayer-scrpage.tex}%
[$Date: 2015-03-31 11:10:59 +0200 (Tue, 31 Mar 2015) $
KOMA-Script guide (chapter: scrlayer-scrpage)]
\translator{Markus Kohm\and Jana Schubert\and Jens H\"uhne}
% Date version of the translated file: 2015-03-31
\chapter[{Adapting Page Headers and Footers with \Package{scrlayer-scrpage}}]
{Adapting\ChangedAt{v3.12}{\Package{scrlayer-scrpage}} Page Headers and
Footers with \Package{scrlayer-scrpage}}
\labelbase{scrlayer-scrpage}
%
\BeginIndex{Package}{scrlayer-scrpage}%
Until version 3.11b of \KOMAScript, package \Package{scrpage2} has been the
recommended way to customise page headers and footers beyond the options
provided by the page styles \Pagestyle{headings}, \Pagestyle{myheadings},
\Pagestyle{plain}, and \Pagestyle{empty} of the standard \KOMAScript{}
classes. Until 2001 there was also package \Package{scrpage} as a supported
solution for the same purpose. It was then made obsolete and in 2013, more
than ten years later, it was finally removed from the regular
\KOMAScript~distribution.
In 2013 package \Package{scrlayer}\IndexPackage{scrlayer} became a basic
module of \KOMAScript. That package provides a layer scheme and a new page
style scheme based upon the layer scheme. Nevertheless, the flexibility it
provides and the resulting complexity may be too demanding for the average
user to handle. More about \Package{scrlayer} may be found in
\autoref{cha:scrlayer} of \autoref{part:forExperts}. Potential problems with
the controllability of \Package{scrlayer} apart, there are lots of users who
are already familiar with the user interface of package \Package{scrpage2}.
As a consequence the additional package \Package{scrlayer-scrpage} provides a
user interface, which is largely compatible with \Package{scrpage2} and based
on \Package{scrlayer}. Thus, if you are already familiar with \Package{scrpage2}
and refrain from using dirty tricks, like calling internal commands of
\Package{scrpage2} directly, it should be easy for you to use
\Package{scrlayer-scrpage} as a drop-in replacement. Most examples covering
\Package{scrpage2} in \LaTeX{} books or online resources should also work
with \Package{scrlayer-scrpage} either directly or with only minor
code changes provided that they stick to the standard interfaces.
Apart from the aforementioned \KOMAScript{} packages, you could in principle
also use \Package{fancyhdr}\IndexPackage{fancyhdr} (see
\cite{package:fancyhdr}) in conjunction with a \KOMAScript{} class. However,
\Package{fancyhdr}\ has no support for several \KOMAScript{} features, e.\,g.,
the element scheme (see \Macro{setkomafont}, \Macro{addtokomafont}, and
\Macro{usekomafont} in \autoref{sec:maincls.textmarkup}, from
\autopageref{desc:maincls.cmd.setkomafont}) or the configurable numbering
format for dynamic headers (see option \Option{numbers} and, e.\,g.,
\Macro{chaptermarkformat} in \autoref{sec:maincls.structure},
\autopageref{desc:maincls.option.numbers} and
\autopageref{desc:maincls.cmd.chaptermarkformat}). Hence, if you are using a
\KOMAScript{} class, the usage of package \Package{scrlayer-scrpage} is
recommended. Of course you can use \Package{scrlayer-scrpage} with other
classes, namely the \LaTeX{} standard classes, too.
Besides the features described in this chapter, \Package{scrlayer-scrpage}
provides several more that are likely only of minor interest to the average
user and for this reason are described from
\autopageref{cha:scrlayer-scrpage-experts} onwards in
\autoref{cha:scrlayer-scrpage-experts} of \autoref{part:forExperts}.
Nevertheless, should the options described in \autoref{part:forAuthors} be
insufficient for your purposes you are encouraged to examine
\autoref{cha:scrlayer-scrpage-experts}.
\LoadCommon{0} % \section{Early or late Selection of Options}
\LoadCommon{20} % \section{Head and Foot Width}
\LoadCommon{5} % \section{Text Markup}
\section{Usage of Predefined Page Styles}
\seclabel{predefined.pagestyles}
The easiest way to your desired design for page header and footer with
\Package{scrlayer-scrpage} is to use one of the predefined page styles.
\begin{Declaration}
\Pagestyle{scrheadings}\\
\Pagestyle{plain.scrheadings}
\end{Declaration}
\BeginIndex{Pagestyle}{scrheadings}%
\BeginIndex{Pagestyle}{plain.scrheadings}%
Package \Package{scrlayer-scrpage} provides two page styles, which may be
reconfigured to meet your individual reqirements. Let's first of all discuss
page style \Pagestyle{scrheadings} which has been designed as a style using
running heads. Its defaults are similar to the page style
\Pagestyle{headings}\IndexPagestyle{headings} of the \LaTeX standard classes
or the \KOMAScript{} classes. What exactly gets printed in the header or
footer can be configured via the commands and otions described hereafter.
The second page style to be mentioned here is \Pagestyle{plain.scrheadings},
which has been designed to be a style with no running head. Its defaults are
very similar to page style \Pagestyle{plain}\IndexPagestyle{plain} of \LaTeX's
standard classes or the \KOMAScript{} classes. The following will describe the
commands and options you may use to adjust the contents of the header and
footer .
You could of course configure \Pagestyle{scrheadings} to be a page style
without a running head and \Pagestyle{plain.scrheadings} to be a page style
using running heads. It is, however, far more expedient to adhere to the
conventions mentioned above, if for the only reason that both page styles
mutually influence one another. Once you have opted to apply one of these
page styles, \Pagestyle{scrheadings} will become accessible as
\Pagestyle{headings} and the page style \Pagestyle{plain.scrheadings} will
become accessible as \Pagestyle{plain}. Thus, if you use a class or package
that automatically switches between \Pagestyle{headings} and
\Pagestyle{plain}, you only need to select \Pagestyle{scrheadings} or
\Pagestyle{plain.scrheadings} once and the switching class or package will
then switch between \Pagestyle{scrheadings} and \Pagestyle{plain.scrheadings}
without even being aware of these page styles. Patches or other adaptions of
classes (or packages) will not be necessary. This pair of page styles may thus
serve as a drop-in replacement for \Pagestyle{headings} and \Pagestyle{plain}.
Should additional similar pairs be required I'd like to point you to
\autoref{sec:scrlayer-scrpage-experts.pagestyle.pairs} in
\autoref{part:forExperts} for further reference.
For users of the older \Package{scrpage2}, I'd like to mention that, for
compatibility with \Package{scrpage2}, page style
\Pagestyle{plain.scrheadings} may also be used under its alias name of
\Pagestyle{scrplain}\IndexPagestyle[indexmain]{scrplain}.%
\iffree{}{ If you use \Package{scrpage2}\IndexPackage{scrpage2}, however,
\Pagestyle{plain.scrheadings} will not be available. Its function is
completely taken over by pagestyle \Pagestyle{scrplain}.}
%
\EndIndex{Pagestyle}{plain.scrheadings}%
\EndIndex{Pagestyle}{scrheadings}%
\begin{Declaration}
\Macro{lehead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cehead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rehead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{lohead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cohead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rohead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{lehead}%
\BeginIndex{Cmd}{cehead}%
\BeginIndex{Cmd}{rehead}%
\BeginIndex{Cmd}{lohead}%
\BeginIndex{Cmd}{cohead}%
\BeginIndex{Cmd}{rohead}%
The contents of the header of page style \Pagestyle{plain.scrheadings} and
\Pagestyle{scrheadings} can be defined using these commands. Thereby the
optional argument defines the content of an element of page style
\Pagestyle{plain.scrheadings}, while the mandatory argument sets the content
of the corresponding element of page style \Pagestyle{scrheadings}.
Contents of left\,---\,so called even\,---\,pages can be set with
\Macro{lehead}, \Macro{cehead}, and \Macro{rohead}. Remark: The ``\texttt{e}''
at the second position of the commands' names means ``\emph{even}''.
Contents of right\,---\,so called odd\,---\,pages can be set with
\Macro{lohead}, \Macro{cohead}, and \Macro{rohead}. Remark: The ``\texttt{o}''
at the second position of the commands' names means ``\emph{odd}''.
Please note\textnote{Attention!} that there are only odd pages within single
side layouts independent of whether or not they have an odd page number.
Each header consists of a left aligned element that will be defined by
\Macro{lehead} respectively \Macro{lohead}. Remark: The ``\texttt{l}'' at the
first position of the commands' names means ``\emph{left aligned}''.
Similarly each header has a centred element that will be defined by
\Macro{cehead} respectively \Macro{cohead}. Remark: The ``\texttt{c}'' at the
first position of the command' names means ``\emph{centred}''.
Similarly each header has a right aligned element that will be defined by
\Macro{rehead} respectively \Macro{rohead}. Remark: The ``\texttt{r}'' at the
first position of the commands' names means ``\emph{right aligned}''.
\BeginIndex{FontElement}{pagehead}%
\BeginIndex{FontElement}{pageheadfoot}%
However, these elements do not have their own font attributes that may be
changed using commands \Macro{setkomafont} and \Macro{addtokomafont} (see
\autoref{sec:maincls.textmarkup}, \autopageref{desc:maincls.cmd.setkomafont}),
but are grouped in an element named \FontElement{pagehead}. And before the
font of that element additionally the font of element
\FontElement{pageheadfoot} will be used. See
\autoref{tab:scrlayer-scrpage.fontelements} for the font default of these
elements.%
\EndIndex{FontElement}{pageheadfoot}%
\EndIndex{FontElement}{pagehead}%
The semantics of the described commands within two-sided layouts are also
sketched in \autoref{fig:scrlayer-scrpage.head}.%
%
\begin{figure}[tp]
\centering
\begin{picture}(\textwidth,30mm)(0,-10mm)
\thinlines
\small\ttfamily
% left/even page
\put(0,20mm){\line(1,0){.49\textwidth}}%
\put(0,0){\line(0,1){20mm}}%
\multiput(0,0)(0,-1mm){10}{\line(0,-1){.5mm}}%
\put(.49\textwidth,5mm){\line(0,1){15mm}}%
\put(.05\textwidth,10mm){%
\iffree{\color{red}}{}%
\put(-.5em,0){\line(1,0){4em}}%
\multiput(3.5em,0)(.25em,0){5}{\line(1,0){.125em}}%
\put(-.5em,0){\line(0,1){\baselineskip}}%
\put(-.5em,\baselineskip){\line(1,0){4em}}%
\multiput(3.5em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\makebox(4em,5mm)[l]{\Macro{lehead}}%
}%
\put(.465\textwidth,10mm){%
\iffree{\color{blue}}{}%
\put(-4em,0){\line(1,0){4em}}%
\multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(-4em,\baselineskip){\line(1,0){4em}}%
\multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rehead}}}%
}%
\put(.2525\textwidth,10mm){%
\iffree{\color{green}}{}%
\put(-2em,0){\line(1,0){4em}}%
\multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,\baselineskip){\line(1,0){4em}}%
\multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cehead}}}%
}%
% right/odd page
\put(.51\textwidth,20mm){\line(1,0){.49\textwidth}}%
\put(.51\textwidth,5mm){\line(0,1){15mm}}%
\put(\textwidth,0){\line(0,1){20mm}}%
\multiput(\textwidth,0)(0,-1mm){10}{\line(0,-1){.5mm}}%
\put(.5325\textwidth,10mm){%
\iffree{\color{blue}}{}%
\put(0,0){\line(1,0){4em}}%
\multiput(4em,0)(.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(0em,\baselineskip){\line(1,0){4em}}%
\multiput(4em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\put(.5em,0){\makebox(4em,5mm)[l]{\Macro{lohead}}}%
}%
\put(.965\textwidth,10mm){%
\iffree{\color{red}}{}%
\put(-4em,0){\line(1,0){4em}}%
\multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(-4em,\baselineskip){\line(1,0){4em}}%
\multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rohead}}}%
}%
\put(.75\textwidth,10mm){%
\iffree{\color{green}}{}%
\put(-2em,0){\line(1,0){4em}}%
\multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,\baselineskip){\line(1,0){4em}}%
\multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cohead}}}%
}%
% commands for both pages
\iffree{\color{blue}}{}%
\put(.5\textwidth,0){\makebox(0,\baselineskip)[c]{\Macro{ihead}}}%
\iffree{\color{green}}{}%
\put(.5\textwidth,-5mm){\makebox(0,\baselineskip)[c]{\Macro{chead}}}
\iffree{\color{red}}{}%
\put(.5\textwidth,-10mm){\makebox(0,\baselineskip)[c]{\Macro{ohead}}}
\put(\dimexpr.5\textwidth-2em,.5\baselineskip){%
\iffree{\color{blue}}{}%
\put(0,0){\line(-1,0){1.5em}}%
\put(-1.5em,0){\vector(0,1){5mm}}%
\iffree{\color{green}}{}%
\put(0,-1.25\baselineskip){\line(-1,0){\dimexpr .25\textwidth-2em\relax}}%
\put(-\dimexpr
.25\textwidth-2em\relax,-1.25\baselineskip){\vector(0,1){\dimexpr
5mm+1.25\baselineskip\relax}}
\iffree{\color{red}}{}%
\put(0,-2.5\baselineskip){\line(-1,0){\dimexpr .45\textwidth-4em\relax}}%
\put(-\dimexpr
.45\textwidth-4em\relax,-2.5\baselineskip){\vector(0,1){\dimexpr
5mm+2.5\baselineskip\relax}}
}%
\put(\dimexpr.5\textwidth+2em,.5\baselineskip){%
\iffree{\color{blue}}{}%
\put(0,0){\line(1,0){1.5em}}%
\put(1.5em,0){\vector(0,1){5mm}}%
\iffree{\color{green}}{}%
\put(0,-1.25\baselineskip){\line(1,0){\dimexpr .25\textwidth-2em\relax}}
\put(\dimexpr
.25\textwidth-2em\relax,-1.25\baselineskip){\vector(0,1){\dimexpr
5mm+1.25\baselineskip\relax}}
\iffree{\color{red}}{}%
\put(0,-2.5\baselineskip){\line(1,0){\dimexpr .45\textwidth-4em\relax}}
\put(\dimexpr
.45\textwidth-4em\relax,-2.5\baselineskip){\vector(0,1){\dimexpr
5mm+2.5\baselineskip\relax}}
}%
\end{picture}
\caption[Commands to define the page head]%
{The meaning of the commands to define the contents of the page head
of the page styles sketched on a schematic double page}
\label{fig:scrlayer-scrpage.head}
\end{figure}
%
\begin{Example}
Assume you're writing a short article and you want the title of that
article to be shown left aligned and the author's name to be
shown right aligned at the page head. You may for example use:
\begin{lstcode}
\documentclass{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead{John Doe}
\rohead{Page style with \KOMAScript}
\pagestyle{scrheadings}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\end{document}
\end{lstcode}
But what happens: On the first page there's only a page number at the page
foot, but the header is empty!
The explanation is very easy. Document class \Class{scrartcl} switches to
page style \Pagestyle{plain} for the page with the title head. After command
\Macro{pagestyle}\PParameter{scrheadings} in the preamble of the short
document this will actually result in page style
\Pagestyle{plain.scrheadings}. Using a \KOMAScript{} class the default of
this page style is an empty page header and a page number in the footer. In
the example code the optional arguments of \Macro{lohead} and \Macro{rohead}
are omitted. So page style \Pagestyle{plain.scrheadings} remains
unchanged as default and the result for the first page is indeed correct.
Please add some text below \Macro{maketitle} until a second page will be
printed. Alternatively you may just add
\Macro{usepackage}\PParameter{lipsum}\IndexPackage{lipsum} into the document
preamble and \Macro{lipsum}\IndexCmd{lipsum} below \Macro{maketitle}. You
will see that the head of the second page will show the author and the
document title as we wanted.
To see the difference you should also add an optional argument to
\Macro{lohead} and \Macro{rohead} containing some content. To do so, change
the example above:
\begin{lstcode}
\documentclass{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead[John Doe]
{John Doe}
\rohead[Page style with \KOMAScript]
{Page style with \KOMAScript}
\pagestyle{scrheadings}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\end{document}
\end{lstcode}
Now, you also get a page header above the title head of the first
page. That is because you have reconfigured page style
\Pagestyle{plain.scrheadings} with the two optional arguments. Most of you
will also recognise that it would be better to leave this page style
unchanged, because the running head above the document title is certainly
annoying.
\end{Example}
Allow me an important note:\textnote{Attention!} You should never put a
section heading or section number directly into the page head using a new
declaration by one of these commands. This could result in a wrong number or
heading text in the running head, because of the asynchronous page generation
and output of \TeX. Instead you should use the mark mechanism and ideally you
should use it together with the automatism described in the following
section.%
\EndIndex{Cmd}{rohead}%
\EndIndex{Cmd}{cohead}%
\EndIndex{Cmd}{lohead}%
\EndIndex{Cmd}{rehead}%
\EndIndex{Cmd}{cehead}%
\EndIndex{Cmd}{lehead}%
\begin{Declaration}
\Macro{lehead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cehead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rehead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{lohead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cohead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rohead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{lehead*}%
\BeginIndex{Cmd}{cehead*}%
\BeginIndex{Cmd}{rehead*}%
\BeginIndex{Cmd}{lohead*}%
\BeginIndex{Cmd}{cohead*}%
\BeginIndex{Cmd}{rohead*}%
The previously described commands have also a version with
star\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} that differs only if you
omit the optional argument \PName{plain.scrheadings's content}. In this case
the version without star does not change the content of
\Pagestyle{plain.scrheadings}. The version with star on the other hand uses
the obligatory argument \PName{scrheading's content} also as default for
\Pagestyle{plain.scrheadings}. So, if both arguments should be the same, you
can simply use the star version with the obligatory argument only.%
\begin{Example}
You can shorten the previous example using the star version of
\Macro{lohead} and \Macro{rohead}:
\begin{lstcode}
\documentclass{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead*{John Doe}
\rohead*{Page style with \KOMAScript}
\pagestyle{scrheadings}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\end{document}
\end{lstcode}
\end{Example}
The obsolete package \Package{scrpage2}\important{\Package{scrpage2}} does not
provide this feature.%
%
\EndIndex{Cmd}{rohead*}%
\EndIndex{Cmd}{cohead*}%
\EndIndex{Cmd}{lohead*}%
\EndIndex{Cmd}{rehead*}%
\EndIndex{Cmd}{cehead*}%
\EndIndex{Cmd}{lehead*}%
\begin{Declaration}
\Macro{lefoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cefoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{refoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{lofoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cofoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rofoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{lefoot}%
\BeginIndex{Cmd}{cefoot}%
\BeginIndex{Cmd}{refoot}%
\BeginIndex{Cmd}{lofoot}%
\BeginIndex{Cmd}{cofoot}%
\BeginIndex{Cmd}{rofoot}%
The contents of the footer of page style \Pagestyle{plain.scrheadings} and
\Pagestyle{scrheadings} can be defined using these commands. Thereby the
optional argument defines the content of an element of page style
\Pagestyle{plain.scrheadings}, while the mandatory argument sets the content
of the corresponding element of page style \Pagestyle{scrheadings}.
Contents of left\,---\,so called even\,---\,pages can be set with
\Macro{lefoot}, \Macro{cefoot}, and \Macro{rohead}. Remark: The ``\texttt{e}''
at the second position of the commands' names means ``\emph{even}''.
Contents of odd pages can be set with \Macro{lofoot}, \Macro{cofoot}, and
\Macro{rofoot}. Remark: The ``\texttt{o}'' at the second position of the
commands' names means ``\emph{odd}''.
Please note\textnote{Attention!} that there are only odd pages within single
side layouts independent of whether or not they have an odd page number.
Each footer consists of a left aligned element that will be defined by
\Macro{lefoot} respectively \Macro{lofoot}. Remark: The ``\texttt{l}'' at the
first position of the commands' names means ``\emph{left aligned}''.
Similarly each footer has a centred element that will be defined by
\Macro{cefoot} respectively \Macro{cofoot}. Remark: The ``\texttt{c}'' at the
first position of the command' names means ``\emph{centred}''.
Similarly each footer has a right aligned element that will be defined by
\Macro{refoot} respectively \Macro{rofoot}. Remark: The ``\texttt{r}'' at the
first position of the commands' names means ``\emph{right aligned}''.
\BeginIndex{FontElement}{pagefoot}%
\BeginIndex{FontElement}{pageheadfoot}%
However, these elements do not have their own font attributes that may be
changed using commands \Macro{setkomafont} and \Macro{addtokomafont} (see
\autoref{sec:maincls.textmarkup}, \autopageref{desc:maincls.cmd.setkomafont}),
but are grouped in an element named \FontElement{pagefoot}. And before the
font of that element additionally the font of element
\FontElement{pageheadfoot} will be used. See
\autoref{tab:scrlayer-scrpage.fontelements} for the defaults of the fonts of
these elements.%
\EndIndex{FontElement}{pageheadfoot}%
\EndIndex{FontElement}{pagefoot}%
The semantics of the described commands within two-sided layouts are also
sketched in \autoref{fig:scrlayer-scrpage.foot}.%
%
\begin{figure}[bp]
\centering
\begin{picture}(\textwidth,30mm)
\thinlines
\small\ttfamily
% left page
\put(0,0){\line(1,0){.49\textwidth}}%
\put(0,0){\line(0,1){20mm}}%
\multiput(0,20mm)(0,1mm){10}{\line(0,1){.5mm}}%
\put(.49\textwidth,0){\line(0,1){15mm}}%
\put(.05\textwidth,5mm){%
\iffree{\color{red}}{}%
\put(-.5em,0){\line(1,0){4em}}%
\multiput(3.5em,0)(.25em,0){5}{\line(1,0){.125em}}%
\put(-.5em,0){\line(0,1){\baselineskip}}%
\put(-.5em,\baselineskip){\line(1,0){4em}}%
\multiput(3.5em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\makebox(4em,5mm)[l]{\Macro{lefoot}}%
}%
\put(.465\textwidth,5mm){%
\iffree{\color{blue}}{}%
\put(-4em,0){\line(1,0){4em}}%
\multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(-4em,\baselineskip){\line(1,0){4em}}%
\multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{refoot}}}%
}%
\put(.2525\textwidth,5mm){%
\iffree{\color{green}}{}%
\put(-2em,0){\line(1,0){4em}}%
\multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,\baselineskip){\line(1,0){4em}}%
\multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cefoot}}}%
}%
% right page
\put(.51\textwidth,0){\line(1,0){.49\textwidth}}%
\put(.51\textwidth,0){\line(0,1){15mm}}%
\put(\textwidth,0){\line(0,1){20mm}}%
\multiput(\textwidth,20mm)(0,1mm){10}{\line(0,1){.5mm}}%
\put(.5325\textwidth,5mm){%
\iffree{\color{blue}}{}%
\put(0,0){\line(1,0){4em}}%
\multiput(4em,0)(.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(0em,\baselineskip){\line(1,0){4em}}%
\multiput(4em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\put(.5em,0){\makebox(4em,5mm)[l]{\Macro{lofoot}}}%
}%
\put(.965\textwidth,5mm){%
\iffree{\color{red}}{}%
\put(-4em,0){\line(1,0){4em}}%
\multiput(-4em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(0,0){\line(0,1){\baselineskip}}%
\put(-4em,\baselineskip){\line(1,0){4em}}%
\multiput(-4em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-4.5em,0){\makebox(4em,5mm)[r]{\Macro{rofoot}}}%
}%
\put(.75\textwidth,5mm){%
\iffree{\color{green}}{}%
\put(-2em,0){\line(1,0){4em}}%
\multiput(2em,0)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,0)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,\baselineskip){\line(1,0){4em}}%
\multiput(2em,\baselineskip)(.25em,0){5}{\line(1,0){.125em}}%
\multiput(-2em,\baselineskip)(-.25em,0){5}{\line(1,0){.125em}}%
\put(-2em,0){\makebox(4em,5mm)[c]{\Macro{cofoot}}}%
}%
% both pages
\iffree{\color{blue}}{}%
\put(.5\textwidth,15mm){\makebox(0,\baselineskip)[c]{\Macro{ifoot}}}%
\iffree{\color{green}}{}%
\put(.5\textwidth,20mm){\makebox(0,\baselineskip)[c]{\Macro{cfoot}}}
\iffree{\color{red}}{}%
\put(.5\textwidth,25mm){\makebox(0,\baselineskip)[c]{\Macro{ofoot}}}
\put(\dimexpr.5\textwidth-2em,.5\baselineskip){%
\iffree{\color{blue}}{}%
\put(0,15mm){\line(-1,0){1.5em}}%
\put(-1.5em,15mm){\vector(0,-1){5mm}}%
\iffree{\color{green}}{}%
\put(0,20mm){\line(-1,0){\dimexpr .25\textwidth-2em\relax}}%
\put(-\dimexpr .25\textwidth-2em\relax,20mm){\vector(0,-1){10mm}}%
\iffree{\color{red}}{}%
\put(0,25mm){\line(-1,0){\dimexpr .45\textwidth-4em\relax}}%
\put(-\dimexpr .45\textwidth-4em\relax,25mm){\vector(0,-1){15mm}}%
}%
\put(\dimexpr.5\textwidth+2em,.5\baselineskip){%
\iffree{\color{blue}}{}%
\put(0,15mm){\line(1,0){1.5em}}%
\put(1.5em,15mm){\vector(0,-1){5mm}}%
\iffree{\color{green}}{}%
\put(0,20mm){\line(1,0){\dimexpr .25\textwidth-2em\relax}}%
\put(\dimexpr .25\textwidth-2em\relax,20mm){\vector(0,-1){10mm}}%
\iffree{\color{red}}{}%
\put(0,25mm){\line(1,0){\dimexpr .45\textwidth-4em\relax}}%
\put(\dimexpr .45\textwidth-4em\relax,25mm){\vector(0,-1){15mm}}%
}%
\end{picture}
\caption[Commands to define the page footer]%
{The meaning of the commands to define the contents of the page
footer of the page styles sketched on a schematic double page}%
\label{fig:scrlayer-scrpage.foot}
\end{figure}
%
\begin{Example}
Let's return to the example of the short article. Assuming you want to print
the publisher at the left side of the page footer, you would change the
example above into:
\begin{lstcode}
\documentclass{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead{John Doe}
\rohead{Page style with \KOMAScript}
\lofoot{Smart Alec Publishing}
\pagestyle{scrheadings}
\usepackage{lipsum}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\lipsum
\end{document}
\end{lstcode}
Once again the publisher is not printed on the first page with the title
head. For the reason see the explanation about \Macro{lohead} in the example
above. And again the solution to print the publisher on the first page would
be similar:
\begin{lstcode}
\lofoot[Smart Alec Publishing]
{Smart Alec Publishing}
\end{lstcode}
But now you also want to replace the slanted font used in page head and
footer by a upright smaller font. This may be done using:
\begin{lstcode}
\setkomafont{pageheadfoot}{\small}
\end{lstcode}
Furthermore, the head but not the footer should be bold:
\begin{lstcode}
\setkomafont{pagehead}{\bfseries}
\end{lstcode}
For the last command it is important to have it just after
\Package{scrpage-scrlayer} has been loaded, because
the \KOMAScript{} class already defines \FontElement{pagehead} and
\FontElement{pageheadfoot} but with the same meaning. Only loading
\Package{scrpage-scrlayer} changes the meaning of \FontElement{pagehead} and
makes it an element independent of \FontElement{pageheadfoot}.
Now, please add one more \Macro{lipsum} and add option \Option{twoside} to
the loading of \Class{scrartcl}. First of all, you will see the page number
moving from the middle of the page footer to the outer margin, due to the
changed defaults of \Pagestyle{scrheadings} and
\Pagestyle{plain.scrheadings} using double-sided layout and a \KOMAScript{}
class.
Simultaneously the author, document title and publisher will vanish from
page~2. It only appears on page~3. This is a consequence of using only
commands for odd pages. You can recognise this by the ``\texttt{o}'' on the
second position of the commands' names.
Now, we could simply copy those commands and replace the ``\texttt{o}'' by
an ``\texttt{e}'' to define the contents of \emph{even} pages. But with
double sided layout it makes more sense to use mirror-inverted elements. So
the left element of an odd page should become the right element of the even
page and visa versa. To achieve this, we also replace the first letter
``\texttt{l}'' by ``\texttt{r}'':
\begin{lstcode}
\documentclass[twoside]{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead{John Doe}
\rohead{Page style with \KOMAScript}
\lofoot[Smart Alec Publishing]
{Smart Alec Publishing}
\rehead{John Doe}
\lohead{Page style with \KOMAScript}
\refoot[Smart Alec Publishing]
{Smart Alec Publishing}
\pagestyle{scrheadings}
\usepackage{lipsum}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\lipsum\lipsum
\end{document}
\end{lstcode}
\end{Example}
%
After reading the example it may appear to you that it is somehow
uncomfortable to duplicate commands to have the same contents on mirror
positions of the page header or footer of a double page. Therefore you will
learn to know an easier solution for this standard case next.
Before allow me an important note:\textnote{Attention!} You should never put a
section heading or section number directly into the page's footer using a new
declaration by one of these commands. This could result in a wrong number or
heading text in the running footer, because of the asynchronous page
generation and output of \TeX. Instead you should use the mark mechanism
ideally together with the automatism described in the following section.%
\EndIndex{Cmd}{rofoot}%
\EndIndex{Cmd}{cofoot}%
\EndIndex{Cmd}{lofoot}%
\EndIndex{Cmd}{refoot}%
\EndIndex{Cmd}{cefoot}%
\EndIndex{Cmd}{lefoot}%
\begin{Declaration}
\Macro{lefoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cefoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{refoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{lofoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cofoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{rofoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{lefoot*}%
\BeginIndex{Cmd}{cefoot*}%
\BeginIndex{Cmd}{refoot*}%
\BeginIndex{Cmd}{lofoot*}%
\BeginIndex{Cmd}{cofoot*}%
\BeginIndex{Cmd}{rofoot*}%
The previously described commands have also a version with
star\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} that differs only if you
omit the optional argument \PName{plain.scrheadings's content}. In this case
the version without star does not change the content of
\Pagestyle{plain.scrheadings}. The version with star on the other hand uses
the obligatory argument \PName{scrheading's content} also as default for
\Pagestyle{plain.scrheadings}. So, if both arguments should be the same, you
can simply use the star version with the obligatory argument only.
\begin{Example}
You can shorten the previous example using the star version of
\Macro{lofoot} and \Macro{refoot}:
\begin{lstcode}
\documentclass[twoside]{scrartcl}
\usepackage{scrlayer-scrpage}
\lohead{John Doe}
\rohead{Page style with \KOMAScript}
\lofoot*{Smart Alec Publishing}
\rehead{John Doe}
\lohead{Page style with \KOMAScript}
\refoot*{Smart Alec Publishing}
\pagestyle{scrheadings}
\usepackage{lipsum}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\lipsum\lipsum
\end{document}
\end{lstcode}
\end{Example}
The obsolete package \Package{scrpage2}\important{\Package{scrpage2}} does not
provide this feature.%
%
\EndIndex{Cmd}{rofoot*}%
\EndIndex{Cmd}{cofoot*}%
\EndIndex{Cmd}{lofoot*}%
\EndIndex{Cmd}{refoot*}%
\EndIndex{Cmd}{cefoot*}%
\EndIndex{Cmd}{lefoot*}%
\begin{Declaration}
\Macro{ohead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{chead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ihead}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ofoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cfoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ifoot}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{ohead}%
\BeginIndex{Cmd}{chead}%
\BeginIndex{Cmd}{ihead}%
\BeginIndex{Cmd}{ofoot}%
\BeginIndex{Cmd}{cfoot}%
\BeginIndex{Cmd}{ifoot}%
To define the contents of page headers and footers of odd and the even pages
of a double-sided layout using the commands described before, you would have to
define the contents of the even page different from the contents of the odd
page. But in general the pages should be symmetric. An element, that should be
printed left aligned on an even page, should be right aligned on an odd page
and vise versa. Elements, that are centred on odd pages, should be centred on
even pages too.
To simplify the definition of such symmetric page styles,
\Package{scrlayer-scrpage} provides a kind of abbreviation. Command
\Macro{ohead} is same like usage of both \Macro{lehead} and
\Macro{rohead}. Command \Macro{chead} is same like \Macro{cehead} and
\Macro{cohead}. And command \Macro{ihead} is same like \Macro{rehead} and
\Macro{lohead}. The corresponding commands for the page footer are defined
accordingly. A sketch of these commands can be found also in
\autoref{fig:scrlayer-scrpage.head} on \autopageref{fig:scrlayer-scrpage.head}
and \autoref{fig:scrlayer-scrpage.foot} on
\autopageref{fig:scrlayer-scrpage.foot} together with the relationships of all
the page header and footer commands.
%
\begin{Example}
You can simplify the example before using the new commands:
\begin{lstcode}
\documentclass[twoside]{scrartcl}
\usepackage{scrlayer-scrpage}
\ihead{John Doe}
\ohead{Page style with \KOMAScript}
\ifoot[Smart Alec Publishing]
{Smart Alec Publishing}
\pagestyle{scrheadings}
\usepackage{lipsum}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\lipsum\lipsum
\end{document}
\end{lstcode}
As you can see, you can spare half of the commands but get the same result.
\end{Example}
%
In single-sided layouts all pages are odd pages. So in LaTeX's single-sided
mode these commands are synonymous for the odd page commands. Therefore in
most cases you will only need these six commands instead of the twelve
described before.
Once again, allow me an important note:\textnote{Attention!} You should never
put a section heading or section number directly into the page head or
page foot using a new declaration by one of these commands. This could result in
a wrong number or heading text in the running header or footer, because of the
asynchronous page generation and output of \TeX. Instead you should use the
mark mechanism ideally together with the automatism described in the following
section.%
\EndIndex{Cmd}{ihead}%
\EndIndex{Cmd}{chead}%
\EndIndex{Cmd}{ohead}%
\EndIndex{Cmd}{ifoot}%
\EndIndex{Cmd}{cfoot}%
\EndIndex{Cmd}{ofoot}%
\begin{Declaration}
\Macro{ohead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{chead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ihead*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ofoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{cfoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}\\
\Macro{ifoot*}\OParameter{plain.scrheadings's content}%
\Parameter{scrheadings's content}
\end{Declaration}
\BeginIndex{Cmd}{ohead*}%
\BeginIndex{Cmd}{chead*}%
\BeginIndex{Cmd}{ihead*}%
\BeginIndex{Cmd}{ofoot*}%
\BeginIndex{Cmd}{cfoot*}%
\BeginIndex{Cmd}{ifoot*}%
The previously described commands have also a version with
star\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} that differs only if you
omit the optional argument \PName{plain.scrheadings's content}. In this case
the version without star does not change the content of
\Pagestyle{plain.scrheadings}. The version with star on the other hand uses
the obligatory argument \PName{scrheading's content} also as default for
\Pagestyle{plain.scrheadings}. So, if both arguments should be the same, you
can simply use the star version with the obligatory argument only.%
\begin{Example}
You can shorten the previous example using the star version of
\Macro{ifoot}:
\begin{lstcode}
\documentclass[twoside]{scrartcl}
\usepackage{scrlayer-scrpage}
\ihead{John Doe}
\ohead{Page style with \KOMAScript}
\ifoot*{Smart Alec Publishing}
\pagestyle{scrheadings}
\usepackage{lipsum}
\begin{document}
\title{Page styles with \KOMAScript}
\author{John Doe}
\maketitle
\lipsum\lipsum
\end{document}
\end{lstcode}
\end{Example}
The obsolete package \Package{scrpage2}\important{\Package{scrpage2}} does not
provide this feature.%
%
\EndIndex{Cmd}{ihead*}%
\EndIndex{Cmd}{chead*}%
\EndIndex{Cmd}{ohead*}%
\EndIndex{Cmd}{ifoot*}%
\EndIndex{Cmd}{cfoot*}%
\EndIndex{Cmd}{ofoot*}%
\begin{Declaration}
\KOption{pagestyleset}\PName{setting}
\end{Declaration}
\BeginIndex{Option}{pagestyleset~=KOMA-Script}%
\BeginIndex{Option}{pagestyleset~=standard}%
In the examples above you can already find some information about the defaults
of \Pagestyle{scrheadings}\IndexPagestyle{scrheadings} and
\Pagestyle{plain.scrheadings}\IndexPagestyle{plain.scrheadings}. Indeed
\Package{scrlayer-scrpage} provides two different defaults yet. You may select
one of those defaults manually using option \Option{pagestyleset}.
If \PName{setting} is \PValue{KOMA-Script} the defaults will be used that
would also be activated automatically if a \KOMAScript{} class has been
detected. In this case and within double-sided layout \Pagestyle{scrheadings}
uses running heads outer aligned in the page head. The page number will be
printed outer aligned in the page footer. Within single-sided layout the
running head will be printed in the middle of the page head and the page
number in the middle of the page footer. Upper and lower case will be used for
the automatic running head as given by the words you have typed. This would be
same like using Option
\OptionValue{markcase}{used}\IndexOption{markcase~=used}. Pagestyle
\Pagestyle{plain.scrheadings} has not got running heads, but the page numbers
will be printed in the same manner.
If \PName{setting} is \PValue{standard} the defaults will be used that are
similar to page style \Pagestyle{headings} and \Pagestyle{plain} of the
standard classes. This \PName{setting} will also be activated automatically
if the option has not been used and \KOMAScript{} class cannot be
detected. Within double-sided layout thereby \Pagestyle{scrheadings} uses
running heads aligned inner in the page head and the page numbers will be
printed\,---\,also in the page head\,---\,aligned outer. Within single-sided
layout \Pagestyle{scrheadings} is the same. But because of single side layout
knows only odd pages, the running head will be aligned left always and the
page number will be aligned right. In spite of typographic objection, the
automatic running head will be converted into upper cases like they would
using \OptionValue{markcase}{upper}\IndexOption{markcase~=upper}. Within
single side layout page style \Pagestyle{plain.scrheadings} differs a lot from
\Pagestyle{scrheading}, because the page number will be printed in the middle
of the page footer. Using double side layout page style
\Pagestyle{plain.scrheadings} differs from standard classes'
\Pagestyle{plain}. The standard classes would print the page number in the
middle of the page footer. But this would not harmonise with the
\Pagestyle{scrheadings}, so \Pagestyle{plain.scrheadings} does not print a page
number. But like \Pagestyle{plain} it does not print a running head.
Please note\textnote{Attention!} that together with this option page style
\Pagestyle{scrheadings} will be activated. This will be also the case, if you
use the option inside the document.
\BeginIndex{Option}{komastyle}%
\BeginIndex{Option}{standardstyle}%
Options \Option{komastyle} and \Option{standardstyle}, provided by
\Package{scrpage}, are defined only for compatibility reasons in
\Package{scrlayer-scrpage}. But they are implemented using option
\Option{pagestyleset}. They are deprecated and you should not use them.%
%
\EndIndex{Option}{standardstyle}%
\EndIndex{Option}{komastyle}%
\EndIndex{Option}{pagestyleset~=standard}%
\EndIndex{Option}{pagestyleset~=KOMA-Script}%
\LoadCommon[scrlayerscrpage]{21} % \section{Manipulation of Defined Page Styles}
\begin{Declaration}
\KOption{headwidth}\PName{width\textup{:}offset\textup{:}offset}\\
\KOption{footwidth}\PName{width\textup{:}offset\textup{:}offset}
\end{Declaration}
\BeginIndex{Option}{headwidth~=\PName{width\textup{:}offset\textup{:}offset}}%
\BeginIndex{Option}{footwidth~=\PName{width\textup{:}offset\textup{:}offset}}%
By default the page head\Index{head>width} and foot\Index{foot>width} are as
wide as the type area. This can be changed using these \KOMAScript{}
options. The value \PName{width} is the wanted width of the head respective
foot. The \PName{offset} defines how much the head or foot should be moved
towards the outer\,---\,in single side layout to the right\,---\,margin. All
three\ChangedAt{v3.14}{\Package{scrlayer-scrpage}} values are optional and can
be omitted. If you omit a value, you can also omit the corresponding colon
left beside. If there is only one \PName{offset} it is used for both, odd and
even pages. Otherwise, the first \PName{offset} is used for odd and the second
\PName{offset} for even pages in two-side mode. If you only use one value
without colon, this will be the \PName{width}.
For the \PName{width} as well as the \PName{offset} you can use any valid
length value, \LaTeX{} length, \TeX{} dimension or \TeX{} skip. In addition
you may use an \eTeX{} dimension expression with basic arithmetic operations
\texttt{+}, \texttt{-}, \texttt{*}, \texttt{/}, and parenthesis. See
\cite[section~3.5]{manual:eTeX} for more information on such expressions. See
\autoref{sec:scrlayer-scrpage.options} for more information on using,
e.\,g., a \LaTeX{} length as an option value. The \PName{width} can
alternatively be one of the symbolic values shown in
\autoref{tab:scrlayer-scrpage.symbolic.values}.
By default the head and the foot are as wide as the text area. The default
\PName{offset} depends on the used \PName{width}. In single side layout
generally the half of the difference of \PName{width} and the width of the
text area will be used. This results in horizontal centring the page head
above or the page footer below the text area. In difference to this, in double
side layout generally a third of the difference of \PName{offset} and the
width of the text area will be used. But if \PName{width} is the width of the
whole text area plus the marginal note column, default \PName{offset} will be
zero. If you think, this is complicated, you should simply use an explicit
\PName{offset}.
%
\begin{table}
\centering
\caption[Symbolic values for options \Option{headwidth} and
\Option{footwidth}]{Possible symbolic values for the \PName{width} value of
options \Option{headwidth} and \Option{footwidth}}
\label{tab:scrlayer-scrpage.symbolic.values}
\begin{desctabular}
\ventry{foot}{%
the current width of the page foot%
}%
\ventry{footbotline}{%
the current length of the horizontal line below the page foot%
}%
\ventry{footsepline}{%
the current length of the horizontal line above the page foot%
} \ventry{head}{%
the current width of the page head%
}%
\ventry{headsepline}{%
the current length of the horizontal line below the page head%
}%
\ventry{headtopline}{%
the current lenght of the horizontal line above the page head%
}%
\ventry{marginpar}{%
the current width of the marginal note column including the distance
between the text area and the marginal note column%
}%
\ventry{page}{%
the current width of the page considering a binding correction of
package \Package{typearea} (see option \Option{BCOR} in
\autoref{sec:typearea.typearea},
\autopageref{desc:typearea.option.BCOR})%
}%
\ventry{paper}{%
the current width of the paper without considering a binding correction%
}%
\ventry{text}{%
the current width of the text area%
}%
\ventry{textwithmarginpar}{%
the current width of the text area plus the marginal note column
including the distance between them (note: in this case and only in this
case the default of \PName{offset} would be zero)%
}%
\end{desctabular}
\end{table}
%
\EndIndex{Option}{footwidth~=\PName{width\textup{:}offset\textup{:}offset}}%
\EndIndex{Option}{headwidth~=\PName{width\textup{:}offset\textup{:}offset}}%
\begin{Declaration}
\KOption{headtopline}\PName{thickness\textup{:}length}\\
\KOption{headsepline}\PName{thickness\textup{:}length}\\
\KOption{footsepline}\PName{thickness\textup{:}length}\\
\KOption{footbotline}\PName{thickness\textup{:}length}
\end{Declaration}
\BeginIndex{Option}{headtopline~=\PName{thickness\textup{:}length}}%
\BeginIndex{Option}{headsepline~=\PName{thickness\textup{:}length}}%
\BeginIndex{Option}{footsepline~=\PName{thickness\textup{:}length}}%
\BeginIndex{Option}{footbotline~=\PName{thickness\textup{:}length}}%
The \KOMAScript{} classes provide only a separation line below the page head
and above the page head, and you may only switch each of these lines on or
off. But package \Package{scrlayer-scrpage} provides four such horizontal
lines: one above the head, one below the head, one above the foot, and one
below the foot. And you can not only switch them on an off, but also configure
the \PName{length} and \PName{thickness} of each of these lines.
Both values are optional. If you omit the \PName{thickness}, a default value
of 0.4\Unit{pt} will be used, a so called \emph{hairline}. If you omit the
\PName{length}, the width of the head respective the foot will be used. If you
omit both, you can also omit the colon. If you use only one value without
colon, this will be the \PName{thickness}.
For sure, the \PName{length} can be not only shorter than the current width of
the page head respectively the page foot, but also longer. See additionally
options \Option{ilines}\IndexOption{ilines},
\Option{clines}\IndexOption{clines}, and \Option{olines}\IndexOption{olines}
later in this section.
\BeginIndex{FontElement}{headtopline}%
\BeginIndex{FontElement}{headsepline}%
\BeginIndex{FontElement}{footsepline}%
\BeginIndex{FontElement}{footbotline}%
Beside the length and thickness also the colour of the lines can be
changed. First of all the colour depends on the colour of the head or
foot. But independent from those or additional to them the settings of the
corresponding elements \FontElement{headtopline}, \FontElement{headsepline},
\FontElement{footsepline}, and \FontElement{footbotline} will be used. You may
change these using command \Macro{setkomafont} or \Macro{addtokomafont} (see
\autoref{sec:maincls.textmarkup} from
\autopageref{desc:maincls.cmd.setkomafont}). By default those settings are
empty, which means no change of the current font or colour. Change of font in
opposite to colour would not make sense and is not recommended for these
elements.%
\EndIndex{FontElement}{footbotline}%
\EndIndex{FontElement}{footsepline}%
\EndIndex{FontElement}{headsepline}%
\EndIndex{FontElement}{headtopline}%
\BeginIndex{Cmd}{setheadtopline}%
\BeginIndex{Cmd}{setheadsepline}%
\BeginIndex{Cmd}{setfootsepline}%
\BeginIndex{Cmd}{setfootbotline}%
Package \Package{scrpage2} has additionally to the options that do not take
any values, also four commands
\Macro{setheadtopline}\IndexCmd[indexmain]{setheadtopline},
\Macro{setheadsepline}\IndexCmd[indexmain]{setheadsepline},
\Macro{setfootsepline}\IndexCmd[indexmain]{setfootsepline}, and
\Macro{setfootbotline}\IndexCmd[indexmain]{setfootbotline}. These have a first
optional argument for the \PName{length}, a second mandatory argument for the
\PName{thickness}, and a third optional argument for the setting of font or
colour. Package \Package{scrlayer-scrpage} does also provide those
commands. Nevertheless, these commands are deprecated and should not be used
any longer. To get it clear: These commands have never been made to
switch the lines on or off. They have been made to configure already switched
on lines. Users often ignored this!%
\EndIndex{Cmd}{setfootbotline}%
\EndIndex{Cmd}{setfootsepline}%
\EndIndex{Cmd}{setheadsepline}%
\EndIndex{Cmd}{setheadtopline}%
%
\EndIndex{Option}{footbotline~=\PName{thickness\textup{:}length}}%
\EndIndex{Option}{footsepline~=\PName{thickness\textup{:}length}}%
\EndIndex{Option}{headsepline~=\PName{thickness\textup{:}length}}%
\EndIndex{Option}{headtopline~=\PName{thickness\textup{:}length}}%
\begin{Declaration}
\KOption{plainheadtopline}\PName{simple switch}\\
\KOption{plainheadsepline}\PName{simple switch}\\
\KOption{plainfootsepline}\PName{simple switch}\\
\KOption{plainfootbotline}\PName{simple switch}
\end{Declaration}
\BeginIndex{Option}{plainheadtopline~=\PName{simple switch}}%
\BeginIndex{Option}{plainheadsepline~=\PName{simple switch}}%
\BeginIndex{Option}{plainfootsepline~=\PName{simple switch}}%
\BeginIndex{Option}{plainfootbotline~=\PName{simple switch}}%
These options can be used to inherit the settings of the lines also for the
\Pagestyle{plain} page style. Possible values for \PName{simple switch} can be
found in \autoref{tab:truefalseswitch} on
\autopageref{tab:truefalseswitch}. If a option is activated, the
\Pagestyle{plain} page style will use the line settings given by the options
and commands described above. If the option is deactivated, the
\Pagestyle{plain} will not show the corresponding line.%
\EndIndex{Option}{plainfootbotline~=\PName{simple switch}}%
\EndIndex{Option}{plainfootsepline~=\PName{simple switch}}%
\EndIndex{Option}{plainheadsepline~=\PName{simple switch}}%
\EndIndex{Option}{plainheadtopline~=\PName{simple switch}}%
\begin{Declaration}
\Option{ilines}\\
\Option{clines}\\
\Option{olines}
\end{Declaration}
\BeginIndex{Option}{ilines}%
\BeginIndex{Option}{clines}%
\BeginIndex{Option}{olines}%
You have already been told that the horizontal lines above or below the page
head or foot can be shorter or longer than the page head or page foot
itself. Only the answer to the question about the alignment of those lines is
still missing. By default all lines are left aligned at single side layout and
aligned to the inner margin of the head or foot at double side layout. This
is same like using option \Option{ilines}. Alternatively, you can use option
\Option{clines} to centre the lines in the head or foot, or option
\Option{olines} to align them right respectively to the outer margin.%
\EndIndex{Option}{olines}%
\EndIndex{Option}{clines}%
\EndIndex{Option}{ilines}%
%
\EndIndex{Package}{scrlayer-scrpage}%
%%% Local Variables:
%%% mode: latex
%%% mode: flyspell
%%% coding: us-ascii
%%% ispell-local-dictionary: "en_GB"
%%% TeX-master: "../guide"
%%% End:
|