summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source/scrkernel-version.dtx
blob: bb6e1ca9dd9deefee8610c614b8f4099d1b66a92 (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
% \iffalse meta-comment
% ======================================================================
% scrkernel-version.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.txt.
% ======================================================================
%%% From File: $Id: scrkernel-version.dtx 3774 2022-04-28 07:46:52Z kohm $
%
% ATTENTION: In this file parts of the code and documentation are before the
% driver. This must be, because this part of the code is needed by the driver
% in this file and most of the other KOMA-Script dtx-files.
%
% \fi^^A meta-comment
%
% \changes{v2.0e}{1994/07/07}{first release of \cls*{scrartcl},
%   \cls*{scrreprt}, and \cls*{scrbook}}
% \changes{v2.95}{2002/06/25}{first version of this file by splitting of
%   \file{scrclass.dtx}}
% \changes{v3.36}{2022/02/11}{switch over from \cls*{scrdoc} to
%   \cls*{koma-script-source-doc}}
% \changes{v3.36}{2022/02/11}{whole implementation documentation in English}
%
% \GetFileInfo{scrkernel-version.dtx}
% \title{The Version of the \href{https://komascript.de}{\KOMAScript} Kernel
%   and therefore the Classes and most of the Packages}
% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
% \date{Version \fileversion{} of \filedate}
% \maketitle
% \begin{abstract}
%   \filename{} is not only used for the code of all \KOMAScript{} classes and
%   most of the \KOMAScript{} packages. It is also used by most of the
%   installation drivers (\file{ins}-files) for the definition of
%   \KOMAScript{} version.
% \end{abstract}
% \tableofcontents
%
%
% \section{User Manual}
%
% You can find the user documentation of the commands implemented here in the
% \KOMAScript{} manual, either the German \file{scrguide} or the English
% \file{scrguien}.
%
% \MaybeStop{\PrintIndex}
%
% \section{Implementation of the \KOMAScript{} Kernel Version Information}
%
% \begin{command}{\KOMAScriptVersion}
% \changes{v2.95}{2002/06/25}{added}
% This is the \KOMAScript{} version the file is related to. It is also added
% to the classes and most of the packages by the installation drivers. This is
% done using \file{scrdocstrip.tex} and additionally loading this file.
% \begin{macro}{\@CheckKOMAScriptVersion}
% \changes{v2.95}{2002/06/25}{added}
% Depending on \cs{KOMAScriptVersion} already defined or not, the existing
% definition is compared with the version here or \cs{KOMAScriptVersion} is
% newly and globally defined. This has to work not only in class or package
% files, but also in document files. So \cs{makeatletter} inside a group is
% needed for the internal macros. Additionally a guard \texttt{ignorethis} is
% used, to avoid adding code, that is needed only for the installation driver,
% also to classes or packages.
%    \begin{macrocode}
\begingroup
  \catcode`\@11\relax
%<*ignorethis>
  \ifx\newcommand\undefined
    \gdef\@CheckKOMAScriptVersion#1{%
      \global\KOMAdefVariable{KOMAScriptVersion}{\space\space#1}%
      \aftergroup\endinput
    }%
  \else
%</ignorethis>
  \ifx\KOMAScriptVersion\undefined
    \newcommand*{\@CheckKOMAScriptVersion}[1]{%
      \gdef\KOMAScriptVersion{#1}%
    }%
  \else
    \newcommand*{\@CheckKOMAScriptVersion}[1]{%
      \def\@tempa{#1}%
      \ifx\KOMAScriptVersion\@tempa\else
        \@latex@warning@no@line{%
          \noexpand\KOMAScriptVersion\space is 
          `\KOMAScriptVersion',\MessageBreak
          but `#1' was expected!\MessageBreak
          You should not use classes, packages or files
          from\MessageBreak
          different KOMA-Script versions%
        }%
      \fi
    }
%<*ignorethis>
  \fi
%</ignorethis>
  \fi
%    \end{macrocode}
% Note: Following line will be patched by \file{makebetaorrelase.sh} and
% therefore the syntax or general structure of the line must not be changed!
%    \begin{macrocode}
  \@CheckKOMAScriptVersion{2022/05/01 v3.36 KOMA-Script}%
\endgroup
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \iffalse
%<*dtx>
\ProvidesFile{scrkernel-version.dtx}[\KOMAScriptVersion (versions)]
\documentclass[USenglish]{koma-script-source-doc}
\usepackage{babel}
\begin{document}
  \DocInput{scrkernel-version.dtx}
\end{document}
%</dtx>
% \fi
%
% \subsection{Implementation of class and package names and file names}
%
% \begin{description}
% \item[ToDo] Maybe, this should be split in one file for each class. The file
%   extension code should be moved to \file{scrkernel-miscellaneous.dtx}.
% \end{description}
%
% \begin{macro}{\scr@pkgextension}
% \changes{v3.17}{2015/03/17}{added}
% \begin{macro}{\scr@clsextension}
% \changes{v3.17}{2015/03/17}{added}
% \changes{v3.18}{2015/06/17}{fixed}
% Last but not least same like \cs{@pkgextension} and \cs{@clsextension} but
% still valid after the preamble.
%    \begin{macrocode}
%<*class|package>
%<package>\providecommand*{\scr@pkgextension}{\@pkgextension}
%<class>\providecommand*{\scr@clsextension}{\@clsextension}
\AtBeginDocument{%
%<package>  \let\scr@pkgextension\@pkgextension
%<class>  \let\scr@clsextension\@clsextension
}
%</class|package>
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{command}{\KOMAClassFileName}
% \changes{v3.17}{2014/03/12}{added}
% \begin{command}{\KOMAClassName}
% \changes{v2.95}{2004/11/04}{added}
% \begin{command}{\KOMALongClassFileName,\KOMALongClassName}
% \changes{v3.27}{2019/02/16}{added}
% \begin{command}{\ClassName}
% \changes{v2.95}{2004/11/04}{added}
% We define the name of each \KOMAScript{} class and the name of the
% \emph{class} of the class (usually name of the corresponding standard class)
% once. This allows to use code, that outputs the name of the class, for
% several classes without using always class specific code.
%    \begin{macrocode}
%<*class>
\newcommand*{\KOMAClassName}{%
%<article|(letter&long)>  scrartcl%
%<report>  scrreprt%
%<book>  scrbook%
%<letter&!long>  scrlttr2%
}
%<*!long>
\newcommand*{\KOMAClassFileName}{\KOMAClassName.\@clsextension}
\edef\KOMAClassFileName{\KOMAClassFileName}
%</!long>
\newcommand*{\ClassName}{%
%<article|(letter&long)>  article%
%<report>  report%
%<book>  book%
%<letter&!long>  letter%
}
%<*long>
\newcommand*{\KOMALongClassName}{}
%<!letter>\edef\KOMALongClassName{scr\ClassName}
%<letter>\def\KOMALongClassName{scrletter}
\newcommand*{\KOMALongClassFileName}{\KOMALongClassName.\@clsextension}
\edef\KOMALongClassFileName{\KOMALongClassFileName}
%</long>
%    \end{macrocode}
% \end{command}
% \end{command}
% \end{command}
% \end{command}
%    \begin{macrocode}
%<!long>\ProvidesClass{\KOMAClassName}[%
%<long>\ProvidesClass{\KOMALongClassName}[%
%!KOMAScriptVersion
  document class (\ClassName)%
]
%<*long>
\let\ClassName\relax
%<letter>\providecommand*{\@ptsize}{12}
\expandafter\let\expandafter\KOMAClassName\expandafter\relax
\expandafter\LoadClassWithOptions\expandafter{\KOMAClassName}
%<letter>\RequirePackage{scrletter}
%</long>
%</class>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*package&letter>
\ProvidesPackage{scrletter}[%
%!KOMAScriptVersion
  letter package extending any KOMA-Script class%
]
%</package&letter>
%    \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: