summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/scrkernel-title.dtx
blob: 95f6af22e00113d5e1a7f5b15ed0af303206dfac (plain)
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
% \iffalse meta-comment
% ======================================================================
% scrkernel-title.dtx
% Copyright (c) Markus Kohm, 2002-2022
%
% 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.md.
% ======================================================================
%%% From File: $Id: scrkernel-title.dtx 3874 2022-06-05 10:38:02Z kohm $
%<option>%%%            (run: option)
%<body>%%%            (run: body)
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
  \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
  \filedate$Date: 2022-06-05 12:38:02 +0200 (So, 05. Jun 2022) $
  \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
  \filerevision$Revision: 3874 $
  \edef\reserved@a{%
    \noexpand\endgroup
    \noexpand\ProvidesFile{scrkernel-title.dtx}%
                          [\filedate\space\filerevision\space
                           KOMA-Script source (title pages)]
  }%
\reserved@a
\documentclass[USenglish]{koma-script-source-doc}
\usepackage{babel}
\setcounter{StandardModuleDepth}{3}
\begin{document}
\DocInput{scrkernel-title.dtx}
\end{document}
%</dtx>
% \fi
%
% \changes{v2.95}{2002/06/26}{first version after splitting \file{scrclass.dtx}}
% \changes{v3.36}{2022/03/08}{switch over from \cls*{scrdoc} to
%   \cls*{koma-script-source-doc}}
% \changes{v3.36}{2022/03/08}{whole implementation documentation in English}
%
% \GetFileInfo{scrkernel-title.dtx}
% \title{The Code to Implement the Extended Titles of
%   \href{https://komascript.de}{\KOMAScript} Classes}
% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
% \date{Revision \fileversion{} of \filedate}
% \maketitle
% \begin{abstract}
%   \file{scrkernel-title.dtx} implements on-page titles and title pages, that
%   are extended a lot comparing with the titles of the standard classes.
% \end{abstract}
% \tableofcontents
%
% \section{User Manual}
%
% You can find the user documentation the commands implemented here in the
% \KOMAScript{} manual, either the German \file{scrguide} or the English
% \file{scrguien}.
%
% \MaybeStop{\PrintIndex}
%
%
% \section{Implementation of Titles}
%
% This kind of titles are not needed for letters.
%
%    \begin{macrocode}
%<*!letter>
%    \end{macrocode}
% 
% \begin{option}{titlepage}
% \changes{v2.95c}{2006/08/21}{using \pkg*{scrkbase}}
% \changes{v3.12}{2013/11/21}{value \opt{\quotechar=firstiscover} added}
% \changes{v3.17}{2015/03/10}{using internal value storage}
% \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
% \begin{macro}{\@titlepagetrue,\@titlepagefalse,\if@titlepage}
% \begin{macro}{\@titlepageiscoverpagetrue,\@titlepageisvoerpagefalse,
%               \if@titlepageiscoverpage}
% \changes{v3.12}{2013/11/21}{added}
% There is support for two kinds of titles: in-page titles also known as title
% heads and title pages. Usually title pages are the title pages of the inner
% book. But some users prefer to interpret them as cover instead. With
% \KOMAScript{} this does in fact makes some sense, but only, if the user uses
% the mock title and wants to interpret it not as mock title but as cover. So
% we provide the following values:
% \begin{description}
% \item[\opt{=false}:] use a in-page title (\cs{@titlepagefalse},
%   \cs{@titlepageiscoverpagefalse}),
% \item[\opt{=true}:] use several title pages (\cs{@titlepagetrue},
%   \cs{@titlepageiscoverpagefalse}),
% \item[\opt{=firstiscover}:] use several title pages and the first one is the
%   cover (\cs{@titlepagetrue}, \cs{@titlepageiscoverpagetrue}). We do not
%   test, if this is was originally a mock title of a main title.
% \end{description}
% With package \pkg*{scrextend} this feature is defined as activatable. And
% the initial values differ from class to class.
%    \begin{macrocode}
%<*option>
%<*class>
\newif\if@titlepage
%<article>\@titlepagefalse
%<report|book>\@titlepagetrue
%</class>
%<*package&extend>
\scr@ext@activateable{title}{%
  \scr@ifundefinedorrelax{if@titlepage}{%
    \expandafter\newif\csname if@titlepage\endcsname
    \@titlepagefalse
  }{}%
  \scr@ifundefinedorrelax{if@titlepageiscoverpage}{%
    \expandafter\newif\csname if@titlepageiscoverpage\endcsname
    \@titlepageiscoverpagefalse
  }{}%
%</package&extend>
%<*class|package>
%<class>\newif\if@titlepageiscoverpage
\KOMA@key{titlepage}[true]{%
%<!(package&extend)>  \Ifstr{#1}{firstiscover}{%
%<package&extend>  \Ifstr{##1}{firstiscover}{%
    \@titlepagetrue
    \@titlepageiscoverpagetrue
    \FamilyKeyStateProcessed
    \KOMA@kav@replacevalue{.%
%<class>      \KOMAClassFileName
%<package&extend>      scrextend.\scr@pkgextension
    }{titlepage}{firstiscover}%
  }{%
    \def\FamilyElseValue{, `firstiscover'}%
%<!(package&extend)>     \KOMA@set@ifkey{titlepage}{@titlepage}{#1}%
%<package&extend>     \KOMA@set@ifkey{titlepage}{@titlepage}{##1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \KOMA@kav@remove{.%
%<class>      \KOMAClassFileName
%<package&extend>      scrextend.\scr@pkgextension
      }{titlepage}{firstiscover}%
      \KOMA@kav@replacebool{.%
%<class>      \KOMAClassFileName
%<package&extend>      scrextend.\scr@pkgextension
      }{titlepage}{@titlepage}%
      \@titlepageiscoverpagefalse
    \fi
  }%
}
\KOMA@kav@xadd{.%
%<class>  \KOMAClassFileName
%<package&extend>  scrextend.\scr@pkgextension
}{titlepage}{\if@titlepage true\else false\fi}
%<*extend>
%    \end{macrocode}
% For \pkg*{scrextend} we allow to activate the feature at load time.
%    \begin{macrocode}
  \def\scr@ext@immediate@title{%
    \scr@ext@activate{title}%
    \let\scr@ext@immediate@title\relax
  }%
}
%</extend>
%</class|package>
%    \end{macrocode}
% \begin{option}{notitlepage}
% \changes{v2.95c}{2006/08/21}{obsolete}
% \changes{v3.01a}{2008/11/21}{standard not obsolete}
%    \begin{macrocode}
\KOMA@DeclareStandardOption%
%<package>  [scrextend]%
  {notitlepage}{titlepage=false}
%</option>
%    \end{macrocode}
% \end{option}^^A notitlepage
% \end{macro}^^A \if@titlepageiscoverpage
% \end{macro}^^A \if@titlepage
% \end{option}^^A titlepage
%
% \begin{command}{\extratitle}
% \begin{macro}{\@extratitle}
% \begin{command}{\frontispiece}
% \changes{v3.25}{2017/11/21}{added}
% \begin{macro}{\@frontispiece}
% \changes{v3.25}{2017/11/21}{added}
% \begin{command}{\titlehead}
% \begin{macro}{\@titlehead}
% \begin{command}{\subject}
% \begin{macro}{\@subject}
% \begin{command}{\subtitle}
% \changes{v2.97c}{2007/06/20}{neue Möglichkeit}
% \begin{macro}{\@subtitle}
% \changes{v2.97c}{2007/06/20}{added}
% \begin{command}{\publishers}
% \begin{macro}{\@publishers}
% \begin{command}{\uppertitleback}
% \begin{macro}{\@uppertitleback}
% \begin{command}{\lowertitleback}
% \begin{macro}{\@lowertitleback}
% \begin{command}{\dedication}
% \begin{macro}{\@dedication}
% The \LaTeX{} kernel already provides user commands \cs{title}, \cs{author},
% \cs{date}, which store their arguments globally into macros \cs{@title},
% \cs{@author} and \cs{@date}. But for \KOMAScript{} these are not enough for
% several pages of title and even not for the main title. So several more
% similar commands and macros are defined. All additional user commands but
% \cs{subject} are long.
% \begin{description}
% \item[ToDo:] Make them all robust as \LaTeX{} from 2018/10/01 does. However
%   this could be incompatible with \pkg{uni-titlepage}, so when doing the
%   change, don't forget to also change \pkg{uni-titlepage} if needed.
% \end{description}
% For package \pkg*{scrextend} all the code is added to the activatable
% \texttt{title}.
%    \begin{macrocode}
%<*body>
%<package&extend>\scr@ext@addto@activateable{title}{%
\newcommand*{\@extratitle}{}%
\newcommand{\extratitle}[1]{\gdef\@extratitle{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@frontispiece}{}%
\newcommand{\frontispiece}[1]{\gdef\@frontispiece{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@titlehead}{}%
\newcommand{\titlehead}[1]{\gdef\@titlehead{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@subject}{}%
\newcommand*{\subject}[1]{\gdef\@subject{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\subtitle}[1]{\gdef\@subtitle{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@subtitle}{}%
\newcommand*{\@publishers}{}%
\newcommand{\publishers}[1]{\gdef\@publishers{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@uppertitleback}{}%
\newcommand{\uppertitleback}[1]{\gdef\@uppertitleback{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@lowertitleback}{}%
\newcommand{\lowertitleback}[1]{\gdef\@lowertitleback{%
%<extend>    ##1%
%<!extend>    #1%
}}%
\newcommand*{\@dedication}{}%
\newcommand{\dedication}[1]{\gdef\@dedication{%
%<extend>    ##1%
%<!extend>    #1%
}}%
%    \end{macrocode}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
% \end{macro}
% \end{command}
%
% \begin{macro}{\next@tpage}
% \changes{v2.3b}{1995/07/24}{\cs{null} removed}
% \changes{v2.3g}{1996/01/14}{\cs{newpage} replaced by \cs{clearpage}}
% \changes{v3.11c}{2013/02/14}{output \cs{@thanks}}
% \changes{v3.11c}{2013/02/14}{initialize \cs{@thanks}}
% \changes{v3.20}{2015/10/14}{\cs{setparsizes} resp. similar code added}
% \begin{macro}{\next@tdpage}
% \changes{v3.11c}{2013/02/14}{added}
% \changes{v3.12}{2013/11/21}{\cs{titlepage@restore} added}
% Because we have more than one title page but all title pages inside one
% \env{titlepage} environment, we need a special kind of
% \cs{newpage}/\cs{clearpage}.
% \begin{description}
% \item[ToDo:] Replace the original \cs{clearpage} and \cs{cleardoublepage}
%   inside \env{titlepage} by these two macros. With this, users could also
%   have more than one page inside a \env{titlepage} environment.
% \end{description}
%    \begin{macrocode}
\newcommand*{\next@tpage}{%
  \@thanks\global\let\@thanks\@empty
  \clearpage
  \csname titlepage@restore\endcsname
%<!extend>      \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
%<extend>      \parskip\z@ \parindent\z@ \parfillskip\z@\@plus 1fil
  \thispagestyle{empty}%
  \let\footnote\thanks
  \setcounter{footnote}{0}%
}
\newcommand*{\next@tdpage}{%
  \next@tpage\if@twoside \ifodd\value{page}\else\null\next@tpage\fi\fi
}
%    \end{macrocode}
% \end{macro}^^A \next@tdpage
% \end{macro}^^A \next@tpage
%
% \begin{command}{\maketitle}
% \changes{v2.3a}{1995/07/08}{\texttt{plus} replaced by \cs{@plus}}
% \changes{v2.3a}{1995/07/08}{\texttt{fill} replaced by \cs{fill}}
% \changes{v2.3a}{1995/07/08}{\cs{vfil} replaced by \cs{vfill}}
% \changes{v2.3a}{1995/07/08}{using \cs{@makefnmark} in \cs{@makefntext}}
% \changes{v2.3a}{1995/07/08}{\cs{@makefnmark} and \cs{@makefntext}
%   independent from math mode}
% \changes{v2.3b}{1995/07/24}{page break inside \cs{@extratitle} in
%   double-sided mode fixed}
% \changes{v2.3d}{1995/08/19}{\cs{fill} replaced by \texttt{fill}}
% \changes{v2.3e}{1995/08/30}{support but ignore optional argument in
%   single-sided mode}
% \changes{v2.3g}{1996/01/14}{several \cs{null} to \cs{next@tpage} added}
% \changes{v2.3g}{1996/01/14}{\cs{footnote} in titles fixed}
% \changes{v2.3g}{1996/01/14}{deleting \cs{@date}, \cs{title} etc. to save memory}
% \changes{v2.3g}{1996/01/14}{\cs{gdef} replaced by \cs{global}\cs{let}}
% \changes{v2.4}{1996/02/25}{\cs{footnote} in titles fixed again}
% \changes{v2.4h}{1996/11/09}{always use \cs{sectfont} followed by the side
%   for the \cs{@title}}
% \changes{v2.4l}{1997/02/06}{using footnote symbols with width 0}
% \changes{v2.4l}{1997/02/06}{redefining \cs{\@makefnmark} instead of
%   \cs{@makefntext} only}
% \changes{v2.8d}{2001/07/05}{using \cs{titlepagestyle} for in-page title}
% \changes{v2.8p}{2001/09/22}{\cs{sectfont} replaced by \cs{titlefont}}
% \changes{v2.95c}{2006/08/21}{setting paragraph base values}
% \changes{v2.97c}{2007/08/31}{interleaf pages with page style
%   \pstyle{emmpty}}
% \changes{v3.04a}{2009/07/14}{distinguishing in-page titles and title pages
%   inside \cs{maketitle} instead of loading time}
% \changes{v3.11c}{2013/02/14}{mock title moved to new macro}
% \changes{v3.11c}{2013/02/14}{using \cs{next@tdpage}}
% \changes{v3.12}{2013/05/29}{using font elements \fnt{titlehead},
%   \fnt{author}, \fnt{date}, \fnt{publishers}, \fnt{dedication}}
% \changes{v3.12}{2013/11/21}{support for
%   \opt{titlepage\quotechar=firstiscover}}
% \changes{v3.12}{2013/11/21}{retro page only if needed}
% \changes{v3.12}{2013/11/21}{kill the title macros only in compatibility mode}
% \changes{v3.12a}{2014/03/03}{orphan spaced fixed}
% \changes{v3.12a}{2014/03/03}{output extra/mock title in one-side mode only
%   if not empty}
% \changes{v3.12a}{2014/03/03}{\cs{next@tdpage} removed from \cs{@maketitle}
%   and \cs{@makeextrattitle}}
% \changes{v3.13}{2013/10/31}{\cs{next@tdpage} replaced by
%   \cs{cleardoubleemptypage} after dedication (last title page)}
% \changes{v3.19}{2015/08/25}{don't use empty \cs{titlepagestyle}}
% \changes{v3.25}{2017/11/21}{support for \cs{@frontispiece}}
% \changes{v3.27}{2019/01/01}{warning for not empty retro page in single-sided
%   mode}
% \changes{v3.27}{2019/03/18}{empty \cs{@thanks} after usage}
% \changes{v3.27}{2019/03/18}{deleting \cs{@thanks} always globally}
% The user command that prints either the in-page title or the title pages
% with all the title macros filled before.
%    \begin{macrocode}
%<package&extend>\let\maketitle\relax\let\@maketitle\relax
\newcommand*\maketitle[1][1]{%
%    \end{macrocode}
% To support several \cs{maketitle} in the same document, we have to take care
% to use the correct \cs{and} every time. So we define it here (instead of
% outside).
%    \begin{macrocode}
  \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax
  \else
    \def\and{%
      \end{tabular}%
      \hskip 1em \@plus.17fil%
      \begin{tabular}[t]{c}%
    }%
  \fi
%    \end{macrocode}
% Depending on in-page titles or title pages, we have to use different
% code. First the title pages.
%    \begin{macrocode}
  \if@titlepage
    \begin{titlepage}
      \setcounter{page}{%
%<extend>        ##1%
%<!extend>        #1%
      }%
%    \end{macrocode}
% From \KOMAScript~3.12 we need special treatment for the case this is the
% first title page and the first one should be the cover. The changes here has
% to be restored later. So we locally define \cs{titlepage@restore} to restore
% the original parameters.
%    \begin{macrocode}
      \if@titlepageiscoverpage
        \edef\titlepage@restore{%
          \noexpand\endgroup
          \noexpand\global\noexpand\@colht\the\@colht
          \noexpand\global\noexpand\@colroom\the\@colroom
          \noexpand\global\vsize\the\vsize
          \noexpand\global\noexpand\@titlepageiscoverpagefalse
          \noexpand\let\noexpand\titlepage@restore\noexpand\relax
        }%
        \begingroup
        \topmargin=\dimexpr \coverpagetopmargin-1in\relax
        \oddsidemargin=\dimexpr \coverpageleftmargin-1in\relax
        \evensidemargin=\dimexpr \coverpageleftmargin-1in\relax
        \textwidth=\dimexpr
        \paperwidth-\coverpageleftmargin-\coverpagerightmargin\relax
        \textheight=\dimexpr
        \paperheight-\coverpagetopmargin-\coverpagebottommargin\relax
        \headheight=0pt
        \headsep=0pt
        \footskip=\baselineskip
        \@colht=\textheight
        \@colroom=\textheight
        \vsize=\textheight
        \columnwidth=\textwidth
        \hsize=\columnwidth
        \linewidth=\hsize
      \else
        \let\titlepage@restore\relax
      \fi
      \let\footnotesize\small
      \let\footnoterule\relax
      \let\footnote\thanks
      \renewcommand*\thefootnote{\@fnsymbol\c@footnote}%
      \let\@oldmakefnmark\@makefnmark
      \renewcommand*{\@makefnmark}{\rlap\@oldmakefnmark}%
      \ifx\@extratitle\@empty
        \ifx\@frontispiece\@empty
        \else
          \if@twoside\mbox{}\next@tpage\fi
          \noindent\@frontispiece\next@tdpage
        \fi
      \else
        \noindent\@extratitle
        \ifx\@frontispiece\@empty
        \else
          \next@tpage
          \noindent\@frontispiece
        \fi
        \next@tdpage  
      \fi
%<!extend>      \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
%<extend>      \parskip\z@ \parindent\z@ \parfillskip\z@\@plus 1fil
      \ifx\@titlehead\@empty \else
        \begin{minipage}[t]{\textwidth}%
          \usekomafont{titlehead}{\@titlehead\par}%
        \end{minipage}\par
      \fi
      \null\vfill
      \begin{center}
        \ifx\@subject\@empty \else
          {\usekomafont{subject}{\@subject\par}}%
          \vskip 3em
        \fi
        {\usekomafont{title}{\huge \@title\par}}%
        \vskip 1em
        {\ifx\@subtitle\@empty\else\usekomafont{subtitle}{\@subtitle\par}\fi}%
        \vskip 2em
        {%
          \usekomafont{author}{%
            \lineskip 0.75em
            \begin{tabular}[t]{c}
              \@author
            \end{tabular}\par
          }%
        }%
        \vskip 1.5em
        {\usekomafont{date}{\@date \par}}%
        \vskip \z@ \@plus3fill
        {\usekomafont{publishers}{\@publishers \par}}%
        \vskip 3em
      \end{center}\par
      \@thanks\global\let\@thanks\@empty
      \vfill\null
      \if@twoside
%    \end{macrocode}
% From \KOMAScript~3.12 we show the retro page only if needed. It is needed in
% double-sided mode, if the upper and lower elements are not empty.
%    \begin{macrocode}
        \@tempswatrue
        \expandafter\ifnum \@nameuse{scr@v@3.12}>\scr@compatibility\relax
        \else
          \ifx\@uppertitleback\@empty\ifx\@lowertitleback\@empty
            \@tempswafalse
          \fi\fi
        \fi
        \if@tempswa
          \next@tpage
          \begin{minipage}[t]{\textwidth}
            \@uppertitleback
          \end{minipage}\par
          \vfill
          \begin{minipage}[b]{\textwidth}
            \@lowertitleback
          \end{minipage}\par
          \@thanks\global\let\@thanks\@empty
        \fi
%    \end{macrocode}
% In single-sided mode, we warn for used but never printed upper and lower
% retro page variables.
%    \begin{macrocode}
      \else
        \ifx\@uppertitleback\@empty\else
%<package>          \PackageWarning{scrextend}{%
%<class>          \ClassWarning{\KOMAClassName}{%
            non empty \string\uppertitleback\space ignored
            by \string\maketitle\MessageBreak
            in `twoside=false' mode%
          }%
        \fi
        \ifx\@lowertitleback\@empty\else
%<package>          \PackageWarning{scrextend}{%
%<class>          \ClassWarning{\KOMAClassName}{%
            non empty \string\lowertitleback\space ignored
            by \string\maketitle\MessageBreak
            in `twoside=false' mode%
          }%
        \fi          
      \fi
      \ifx\@dedication\@empty 
      \else
        \next@tdpage\null\vfill
        {\centering\usekomafont{dedication}{\@dedication \par}}%
        \vskip \z@ \@plus3fill
%    \end{macrocode}
% \begin{description}
% \item[ToDo:] Why can't we use \cs{next@tdpage} here? Would this be a
%   problem, if we redefine \cs{cleardoublepage} to \cs{next@tdpage}?
% \end{description}
%    \begin{macrocode}
        \@thanks\global\let\@thanks\@empty
        \cleardoubleemptypage
      \fi
%    \end{macrocode}
% If we are still at a cover page, we have to restore the title page.
%    \begin{macrocode}
      \ifx\titlepage@restore\relax\else\clearpage\titlepage@restore\fi
    \end{titlepage}
  \else
%    \end{macrocode}
% Now, the in-page title.
%    \begin{macrocode}
    \par
    \@tempcnta=%
%<extend>    ##1%
%<!extend>    #1%
    \relax\ifnum\@tempcnta=1\else
%<class>      \ClassWarning{\KOMAClassName}{%
%<package>      \PackageWarning{scrextend}{%
        Optional argument of \string\maketitle\space ignored\MessageBreak
        in `titlepage=false' mode%
      }%
    \fi
    \ifx\@uppertitleback\@empty\else
%<package>     \PackageWarning{scrextend}{%
%<class>      \ClassWarning{\KOMAClassName}{%
        non empty \string\uppertitleback\space ignored
        by \string\maketitle\MessageBreak
        in `titlepage=false' mode%
      }%
    \fi
    \ifx\@lowertitleback\@empty\else
%<package>      \PackageWarning{scrextend}{%
%<class>      \ClassWarning{\KOMAClassName}{%
        non empty \string\lowertitleback\space ignored
        by \string\maketitle\MessageBreak
        in `titlepage=false' mode%
      }%
    \fi          
    \begingroup
      \let\titlepage@restore\relax
      \renewcommand*\thefootnote{\@fnsymbol\c@footnote}%
      \let\@oldmakefnmark\@makefnmark
      \renewcommand*{\@makefnmark}{\rlap\@oldmakefnmark}%
      \next@tdpage
      \if@twocolumn
        \ifnum \col@number=\@ne
          \ifx\@extratitle\@empty
            \ifx\@frontispiece\@empty\else\if@twoside\mbox{}\fi\fi
          \else
            \@makeextratitle
          \fi
          \ifx\@frontispiece\@empty
            \ifx\@extratitle\@empty\else\next@tdpage\fi
          \else
            \next@tpage
            \@makefrontispiece
            \next@tdpage
          \fi
          \@maketitle
        \else
          \ifx\@extratitle\@empty
            \ifx\@frontispiece\@empty\else\if@twoside\mbox{}\fi\fi
          \else
            \twocolumn[\@makeextratitle]%
          \fi
          \ifx\@frontispiece\@empty
            \ifx\@extratitle\@empty\else\next@tdpage\fi
          \else
            \next@tpage
            \twocolumn[\@makefrontispiece]%
            \next@tdpage
          \fi
          \twocolumn[\@maketitle]%
        \fi
      \else
        \ifx\@extratitle\@empty
          \ifx\@frontispiece\@empty\else \mbox{}\fi
        \else
          \@makeextratitle
        \fi
        \ifx\@frontispiece\@empty
          \ifx\@extratitle\@empty\else\next@tdpage\fi
        \else
          \next@tpage
          \@makefrontispiece
          \next@tdpage
        \fi
        \@maketitle
      \fi
      \ifx\titlepagestyle\@empty\else\thispagestyle{\titlepagestyle}\fi
      \@thanks\global\let\@thanks\@empty
    \endgroup
  \fi
  \setcounter{footnote}{0}%
  \expandafter\ifnum \csname scr@v@3.12\endcsname>\scr@compatibility\relax
    \let\thanks\relax
    \let\maketitle\relax
    \let\@maketitle\relax
    \global\let\@thanks\@empty
    \global\let\@author\@empty
    \global\let\@date\@empty
    \global\let\@title\@empty
    \global\let\@subtitle\@empty
    \global\let\@extratitle\@empty
    \global\let\@frontispiece\@empty    
    \global\let\@titlehead\@empty
    \global\let\@subject\@empty
    \global\let\@publishers\@empty
    \global\let\@uppertitleback\@empty
    \global\let\@lowertitleback\@empty
    \global\let\@dedication\@empty
    \global\let\author\relax
    \global\let\title\relax
    \global\let\extratitle\relax
    \global\let\titlehead\relax
    \global\let\subject\relax
    \global\let\publishers\relax
    \global\let\uppertitleback\relax
    \global\let\lowertitleback\relax
    \global\let\dedication\relax
    \global\let\date\relax
  \fi
  \global\let\and\relax
}%
%    \end{macrocode}
% \begin{macro}{\@maketitle}
% \changes{v2.95c}{2006/08/21}{default paragraph settings}
% \changes{v3.11c}{2012/02/14}{extra/mock title moved to \cs{@makeextratitle}}
% \changes{v3.12a}{2014/03/03}{\cs{next@tdpage} removed}
% \begin{macro}{\@makeextratitle}
% \changes{v3.11c}{2013/02/14}{added}
% \changes{v3.12a}{2014/03/03}{\cs{next@tdpage} removed}
% \begin{macro}{\@makefrontispiece}
% \changes{v3.25}{2017/11/21}{added}
% These do the printing of the main title, the extra or mock title and the
% frontispiece (retro page of the mock title).
%    \begin{macrocode}
\newcommand*{\@makeextratitle}{%
  \ifx\@extratitle\@empty \else
    \noindent\@extratitle\par
  \fi
}
\newcommand*{\@makefrontispiece}{%
  \ifx\@frontispiece\@empty \else
    \noindent\@frontispiece\par
  \fi
}
\newcommand*{\@maketitle}{%
  \global\@topnum=\z@
%<!extend>  \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
%<extend>  \parskip\z@ \parindent\z@ \parfillskip\z@\@plus 1fil
  \ifx\@titlehead\@empty \else
    \begin{minipage}[t]{\textwidth}
      \usekomafont{titlehead}{\@titlehead\par}%
    \end{minipage}\par
  \fi
  \null
  \vskip 2em%
  \begin{center}%
    \ifx\@subject\@empty \else
      {\usekomafont{subject}{\@subject \par}}%
      \vskip 1.5em
    \fi
    {\usekomafont{title}{\huge \@title \par}}%
    \vskip .5em
    {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
    \vskip 1em
    {%
      \usekomafont{author}{%
        \lineskip .5em%
        \begin{tabular}[t]{c}
          \@author
        \end{tabular}\par
      }%
    }%
    \vskip 1em%
    {\usekomafont{date}{\@date \par}}%
    \vskip \z@ \@plus 1em
    {\usekomafont{publishers}{\@publishers \par}}%
    \ifx\@dedication\@empty \else
      \vskip 2em
      {\usekomafont{dedication}{\@dedication \par}}%
    \fi
  \end{center}%
  \par
  \vskip 2em
}%
%    \end{macrocode}
% \end{macro}^^A \@makefrontispiece
% \end{macro}^^A \@makeextratitle
% \end{macro}^^A \@maketitle
% \end{command}^^A \maketitle
%
% \begin{command}{\coverpagetopmargin}
% \changes{v3.12}{2013/11/21}{added}
% Top margin of a cover page (\opt{titlepage=firstiscover}).
%    \begin{macrocode}
\newcommand*{\coverpagetopmargin}{%
  \dimexpr \topmargin+1in\relax
}
%    \end{macrocode}
% \end{command}
%
% \begin{command}{\coverpagebottommargin}
% \changes{v3.12}{2013/11/21}{added}
% Bottom margin of a cover page (\opt{titlepage=firstiscover}).
%    \begin{macrocode}
\newcommand*{\coverpagebottommargin}{%
  2\dimexpr\coverpagetopmargin\relax
}
%    \end{macrocode}
% \end{command}
%
% \begin{command}{\coverpageleftmargin}
% \changes{v3.12}{2013/11/21}{added}
% Left margin of a cover page (\opt{titlepage=firstiscover}).
%    \begin{macrocode}
\newcommand*{\coverpageleftmargin}{%
  \dimexpr \evensidemargin+1in\relax
}
%    \end{macrocode}
% \end{command}
%
% \begin{command}{\coverpagerightmargin}
% \changes{v3.12}{2013/11/21}{added}
% Right margin of a cover page (\opt{titlepage=firstiscover}).
%    \begin{macrocode}
\newcommand*{\coverpagerightmargin}{\coverpageleftmargin}
%    \end{macrocode}
% \end{command}
%
% \begin{environment}{titlepage}
% The environment to be used for title pages. Title pages are always
% one-columned and use page style \pstyle{empty}. We have to take care to
% reset this at the end of the title page.
% \begin{description}
% \item[ToDo:] Wouldn't it be better to use \cs{pagestyle} instead of
%   \cs{thispagestyle}, because \cs{pagestyle} would also be valid, if a user
%   uses more than one page inside a \env{titlepage} environment?
% \item[ToDo:] See the note about \cs{next@tpage} above.
% \end{description}
%    \begin{macrocode}
%<package&extend>\scr@ifundefinedorrelax{titlepage}{%
\newenvironment{titlepage}{%
%<report|book>  \cleardoublepage
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse\newpage
  \fi
  \thispagestyle{empty}%
  \if@compatibility
    \setcounter{page}{0}%
  \fi
}{%
  \if@restonecol\twocolumn \else \newpage \fi
}%
%<package&extend>}{}%
%    \end{macrocode}
% \end{environment}
%
% In case of package \pkg*{scrextend} the code of activatable \texttt{title}
% is complete and should be used if activated.
%    \begin{macrocode}
%<package&extend>}\csname scr@ext@immediate@title\endcsname
%    \end{macrocode}
%
% \begin{fontelement}{subtitle}
% \changes{v2.97c}{2007/06/20}{added}
%    \begin{macrocode}
\newkomafont{subtitle}{\usekomafont{title}\large}%
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{titlehead}
% \changes{v3.12}{2013/05/29}{added}
%    \begin{macrocode}
\newkomafont{titlehead}{}%
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{author}
% \changes{v3.12}{2013/05/29}{added}
%    \begin{macrocode}
\newkomafont{author}{\Large}
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{date}
% \changes{v3.12}{2013/05/29}{added}
%    \begin{macrocode}
\newkomafont{date}{\Large}
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{publishers}
% \changes{v3.12}{2013/05/29}{added}
%    \begin{macrocode}
\newkomafont{publishers}{\Large}
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{dedication}
% \changes{v3.12}{2013/05/29}{added}
%    \begin{macrocode}
\newkomafont{dedication}{\Large}
%    \end{macrocode}
% \end{fontelement}
%
% \begin{fontelement}{title}
% \changes{v2.8o}{2001/09/14}{added}
% \begin{macro}{\titlefont}
% \changes{v2.8p}{2001/09/22}{added}
% Font to be used for the title. The font element has to be defined manually,
% because of compatibility with \KOMAScript{} up to version 2.8n and old
% \LaTeX~2.09 style \textsc{Script 2.0}. \cs{titlefont} is a user command for
% compatibility only. So we index it a internal macro.
%    \begin{macrocode}
\newcommand*\titlefont{\sectfont}%
\newcommand*{\scr@fnt@title}{\titlefont}%
%    \end{macrocode}           
% \end{macro}
% \end{fontelement}
%
% \begin{fontelement}{subject}
% \changes{v2.8q}{2002/01/14}{added}
% \changes{v2.95}{2002/06/26}{also with \cls*{scrbook}, \cls*{scrreprt},
%   \cls*{scrartcl}}
% \begin{macro}{\subject@font}
% \changes{v2.8q}{2002/01/14}{added}
% \changes{v2.95}{2002/06/26}{also defined with \cls*{scrbook},
%   \cls*{scrreprt}, \cls*{scrartcl}}
% This has to be defined manually, because of compatibility with \KOMAScript{}
% up to version 2.8n and old \LaTeX~2.09 style \textsc{Script 2.0}.
%    \begin{macrocode}
\newcommand*{\subject@font}{\normalfont\normalcolor\bfseries\Large}%
\newcommand*{\scr@fnt@subject}{\subject@font}%
%</body>
%    \end{macrocode}
% \end{macro}
% \end{fontelement}
%
%    \begin{macrocode}
%</!letter>
%    \end{macrocode}
%
% \section{Implementation of the Abstract}
%
% The abstract is not part of the title but related to it. But maybe it is
% also a kind of section.
% \begin{description}
% \item[ToDo:] Should this be moved to \file{scrkernel-sections.dtx} or a new
%   file \file{scrkernel-abstract.dtx}?
% \end{description}
% It is only defined for the classes \cls*{scrartcl} and \cls*{scrreprt} but
% not for \cls*{scrbook}, \cls*{scrlttr2} or package \pkg*{scrextend}.
%    \begin{macrocode}
%<*class&(article|report)>           
%    \end{macrocode}
%
% \begin{option}{abstract}
% \changes{v2.95c}{2006/08/21}{added}
% \begin{macro}{\@abstrttrue,\@abstrtfalse,\if@abstrt}
% \changes{v3.17}{2015/03/10}{using \pkg*{scrkbase}}
% \KOMAScript{} provides abstracts with and without titles and only for the
% classes \cls*{scrartcl} and \cls*{scrreprt}. Books usually use a chapter for
% the abstract. We just need a simple boolean option, that sets a boolean
% switch.
%    \begin{macrocode}
%<*option>
\KOMA@ifkey{abstract}{@abstrt}
%    \end{macrocode}
% \begin{option}{abstracton,abstractoff}
% \changes{v2.95c}{2006/08/21}{obsolete}
% \changes{v3.01a}{2008/11/21}{standard not obsolete}
% \changes{v3.27}{2019/03/13}{deprecated}
%    \begin{macrocode}
\KOMA@DeclareDeprecatedOption{abstracton}{abstract=true}
\KOMA@DeclareDeprecatedOption{abstractoff}{abstract=false}
%</option>
%    \end{macrocode}
% \end{option}^^A abstracton,abstractoff
% \end{macro}^^A \if@abstrt
% \end{option}^^A abstract
%
% \begin{environment}{abstract}
% \changes{v2.3a}{1995/07/08}{\cs{@endparpenalty} added}
% \changes{v2.3g}{1996/01/14}{\cs{@beginparpenalty} added}
% \changes{v2.7a}{2001/01/04}{\cs{section*} replaced by \cs{addsec*}}
% \changes{v3.04a}{2009/07/14}{\cs{if@titlepage} moved inside environment}
% The abstract is different for documents with title page. We provide an
% abstract with or without title.
%    \begin{macrocode}
%<*body>
\newenvironment{abstract}{%
  \if@titlepage
    \titlepage
    \null\vfil
    \@beginparpenalty\@lowpenalty
    \if@abstrt
      \begin{center}
        \normalfont\sectfont\nobreak\abstractname
        \@endparpenalty\@M
      \end{center}
    \fi
  \else
    \if@twocolumn\if@abstrt
        \addsec*{\abstractname}
      \fi
    \else
      \if@abstrt
        \small
        \begin{center}
          {\normalfont\sectfont\nobreak\abstractname
            \vspace{-.5em}\vspace{\z@}}%
        \end{center}
      \fi
      \quotation
    \fi
  \fi
}{%
  \if@titlepage
    \par\vfil\null\endtitlepage
  \else
    \if@twocolumn\else\endquotation\fi
  \fi
}
%    \end{macrocode}
% \end{environment}^^A abstract
%
% \begin{command}{\abstractname}
% \changes{v3.36}{2022/03/08}{explicit definition for English languages}
% The name of the abstract (if a title is used).
%    \begin{macrocode}
\newcommand*\abstractname{Abstract}
\providecaptionname{american,australian,british,canadian,english,newzealand,%
  UKenglish,ukenglish,USenglish,usenglish}\abstractname{Abstract}
%</body> 
%    \end{macrocode}
% \end{command}^^A \abstractname
%
%    \begin{macrocode}
%</class&(article|report)>           
%    \end{macrocode}
%
%
% \Finale
% \PrintChanges
% 
\endinput
% Local Variables:
% mode: doctex
% ispell-local-dictionary: "en_US"
% eval: (flyspell-mode 1)
% TeX-master: t
% TeX-engine: luatex-dev
% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
% End: