Debian Codegraph @

texmf-dist/source/latex/oberdiek/classlist.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: classlist.dtx
4 % Version: 2016/05/16 v1.5
5 % Info: Record classes used in a document
6 %
7 % Copyright (C)
8 % 2005, 2006, 2008, 2011 Heiko Oberdiek
9 % 2016-2019 Oberdiek Package Support Group
10 % https://github.com/ho-tex/oberdiek/issues
11 %
12 % This work may be distributed and/or modified under the
13 % conditions of the LaTeX Project Public License, either
14 % version 1.3c of this license or (at your option) any later
15 % version. This version of this license is in
16 % https://www.latex-project.org/lppl/lppl-1-3c.txt
17 % and the latest version of this license is in
18 % https://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of
20 % LaTeX version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status "maintained".
23 %
24 % The Current Maintainers of this work are
25 % Heiko Oberdiek and the Oberdiek Package Support Group
26 % https://github.com/ho-tex/oberdiek/issues
27 %
28 % This work consists of the main source file classlist.dtx
29 % and the derived files
30 % classlist.sty, classlist.pdf, classlist.ins, classlist.drv.
31 %
32 % Distribution:
33 % CTAN:macros/latex/contrib/oberdiek/classlist.dtx
34 % CTAN:macros/latex/contrib/oberdiek/classlist.pdf
35 %
36 % Unpacking:
37 % (a) If classlist.ins is present:
38 % tex classlist.ins
39 % (b) Without classlist.ins:
40 % tex classlist.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{classlist.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If classlist.drv is present:
47 % latex classlist.drv
48 % (b) Without classlist.drv:
49 % latex classlist.dtx; ...
50 % The class ltxdoc loads the configuration file ltxdoc.cfg
51 % if available. Here you can specify further options, e.g.
52 % use A4 as paper format:
53 % \PassOptionsToClass{a4paper}{article}
54 %
55 % Program calls to get the documentation (example):
56 % pdflatex classlist.dtx
57 % makeindex -s gind.ist classlist.idx
58 % pdflatex classlist.dtx
59 % makeindex -s gind.ist classlist.idx
60 % pdflatex classlist.dtx
61 %
62 % Installation:
63 % TDS:tex/latex/oberdiek/classlist.sty
64 % TDS:doc/latex/oberdiek/classlist.pdf
65 % TDS:source/latex/oberdiek/classlist.dtx
66 %
67 %<*ignore>
68 \begingroup
69 \catcode123=1 %
70 \catcode125=2 %
71 \def\x{LaTeX2e}%
72 \expandafter\endgroup
73 \ifcase 0\ifx\install y1\fi\expandafter
74 \ifx\csname processbatchFile\endcsname\relax\else1\fi
75 \ifx\fmtname\x\else 1\fi\relax
76 \else\csname fi\endcsname
77 %</ignore>
78 %<*install>
79 \input docstrip.tex
80 \Msg{************************************************************************}
81 \Msg{* Installation}
82 \Msg{* Package: classlist 2016/05/16 v1.5 Record classes used in a document (HO)}
83 \Msg{************************************************************************}
84
85 \keepsilent
86 \askforoverwritefalse
87
88 \let\MetaPrefix\relax
89 \preamble
90
91 This is a generated file.
92
93 Project: classlist
94 Version: 2016/05/16 v1.5
95
96 Copyright (C)
97 2005, 2006, 2008, 2011 Heiko Oberdiek
98 2016-2019 Oberdiek Package Support Group
99
100 This work may be distributed and/or modified under the
101 conditions of the LaTeX Project Public License, either
102 version 1.3c of this license or (at your option) any later
103 version. This version of this license is in
104 https://www.latex-project.org/lppl/lppl-1-3c.txt
105 and the latest version of this license is in
106 https://www.latex-project.org/lppl.txt
107 and version 1.3 or later is part of all distributions of
108 LaTeX version 2005/12/01 or later.
109
110 This work has the LPPL maintenance status "maintained".
111
112 The Current Maintainers of this work are
113 Heiko Oberdiek and the Oberdiek Package Support Group
114 https://github.com/ho-tex/oberdiek/issues
115
116
117 This work consists of the main source file classlist.dtx
118 and the derived files
119 classlist.sty, classlist.pdf, classlist.ins, classlist.drv.
120
121 \endpreamble
122 \let\MetaPrefix\DoubleperCent
123
124 \generate{%
125 \file{classlist.ins}{\from{classlist.dtx}{install}}%
126 \file{classlist.drv}{\from{classlist.dtx}{driver}}%
127 \usedir{tex/latex/oberdiek}%
128 \file{classlist.sty}{\from{classlist.dtx}{package}}%
129 }
130
131 \catcode32=13\relax% active space
132 \let =\space%
133 \Msg{************************************************************************}
134 \Msg{*}
135 \Msg{* To finish the installation you have to move the following}
136 \Msg{* file into a directory searched by TeX:}
137 \Msg{*}
138 \Msg{* classlist.sty}
139 \Msg{*}
140 \Msg{* To produce the documentation run the file `classlist.drv'}
141 \Msg{* through LaTeX.}
142 \Msg{*}
143 \Msg{* Happy TeXing!}
144 \Msg{*}
145 \Msg{************************************************************************}
146
147 \endbatchfile
148 %</install>
149 %<*ignore>
150 \fi
151 %</ignore>
152 %<*driver>
153 \NeedsTeXFormat{LaTeX2e}
154 \ProvidesFile{classlist.drv}%
155 [2016/05/16 v1.5 Record classes used in a document (HO)]%
156 \documentclass{ltxdoc}
157 \usepackage{holtxdoc}[2011/11/22]
158 \begin{document}
159 \DocInput{classlist.dtx}%
160 \end{document}
161 %</driver>
162 % \fi
163 %
164 %
165 %
166 % \GetFileInfo{classlist.drv}
167 %
168 % \title{The \xpackage{classlist} package}
169 % \date{2016/05/16 v1.5}
170 % \author{Heiko Oberdiek\thanks
171 % {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
172 %
173 % \maketitle
174 %
175 % \begin{abstract}
176 % This package records the loaded classes and stores
177 % them in a list.
178 % \end{abstract}
179 %
180 % \tableofcontents
181 %
182 % \section{Documentation}
183 %
184 % \subsection{Background}
185 %
186 % This packages is an answer of a newsgroup question:
187 % \begin{quote}
188 % \begin{tabular}{@{}ll@{}}
189 % Newsgroup: & comp.text.tex\\
190 % Subject: & Finding the Document Class\\
191 % From: & Herber Schulz\\
192 % Date: & 18 Jun 2005 13:16:49 -0500\\
193 % Message-ID: &
194 % \textless
195 % \texttt{[email protected]}^^A
196 % \textgreater
197 % \end{tabular}
198 % \end{quote}
199 %
200 % \subsection{Usage}
201 %
202 % Load this package before \cs{documentclass}:
203 % \begin{quote}
204 % |\RequirePackage{classlist}|\\
205 % |\documentclass[some,options]{whatever}|
206 % \end{quote}
207 % It then records the classes with options.
208 %
209 % If used after \cs{documentclass}, \cs{@filelist} is
210 % parsed for classes. The additional data
211 % specified options and requested version is no
212 % longer available here.
213 %
214 % \begin{description}
215 % \item[\cs{MainClassName}] contains the first loaded class.
216 % \item[\cs{ClassList}] stores the class entries, eg.
217 % \begin{quote}
218 % \begin{tabular}{@{}l@{ }l@{}}
219 % \cs{ClassList} $\rightarrow$&
220 % |\ClassListEntry{myarticle}{a4paper}{}|\\
221 % &|\ClassListEntry{article}{}{}|
222 % \end{tabular}
223 % \end{quote}
224 % \item[\cs{ClassListEntry}] has three arguments:
225 % \begin{quote}
226 % \begin{tabular}{@{}ll@{}}
227 % |#1|: & class name\\
228 % |#2|: & options given in \cs{documentclass}/\cs{LoadClass}\\
229 % |#3|: & requested version, not the version of class
230 % \end{tabular}
231 % \end{quote}
232 % \item[\cs{PrintClassList}] prints the list on screen it can be
233 % configured by
234 % \item[\cs{PrintClassListTitle}] for the title and
235 % \item[\cs{PrintClassListEntry}] for formatting the entries.
236 % See the implementation for how to use these.
237 % \end{description}
238 %
239 % \StopEventually{
240 % }
241 %
242 % \section{Implementation}
243 %
244 % \begin{macrocode}
245 %<*package>
246 % \end{macrocode}
247 % Package identification.
248 % \begin{macrocode}
249 \NeedsTeXFormat{LaTeX2e}
250 \ProvidesPackage{classlist}%
251 [2016/05/16 v1.5 Record classes used in a document (HO)]
252 % \end{macrocode}
253 %
254 % \begin{macrocode}
255 \let\ClassList\@empty
256 \let\MainClassName\relax
257 % \end{macrocode}
258 %
259 % Test, whether we are called before \cs{documentclass}.
260 % \begin{macrocode}
261 \ifx\@classoptionslist\relax
262 \let\CL@org@fileswith@pti@ns\@fileswith@pti@ns
263 \def\@fileswith@pti@ns#1[#2]#3[#4]{%
264 % \end{macrocode}
265 % \begin{tabular}{@{}ll@{}}
266 % |#1|: & \cs{@clsextension}\\
267 % |#2|: & options of \cs{documentclass}/\cs{LoadClass}\\
268 % |#3|: & class name\\
269 % |#4|: & requested version
270 % \end{tabular}
271 % \begin{macrocode}
272 \ifx#1\@clsextension
273 \@ifl@aded#1{#3}{%
274 \PackageInfo{classlist}{%
275 Skipping class `#3', because\MessageBreak
276 this class is already loaded%
277 }%
278 }{%
279 \@ifundefined{MainClassName}{%
280 \def\MainClassName{#3}%
281 }{}%
282 \@temptokena\expandafter{%
283 \ClassList
284 \ClassListEntry{#3}{#2}{#4}%
285 }%
286 \edef\ClassList{\the\@temptokena}%
287 }%
288 \fi
289 \CL@org@fileswith@pti@ns{#1}[{#2}]{#3}[{#4}]%
290 }%
291 \let\@@fileswith@pti@ns\@fileswith@pti@ns
292 \else
293 % \end{macrocode}
294 % Called after \cs{documentclass}.
295 % \begin{macrocode}
296 \PackageInfo{classlist}{Use \string\@filelist\space method}%
297
298 \let\ClassListEntry\relax
299 \expandafter\def\expandafter\CL@test
300 \expandafter#\expandafter1\@clsextension#2\@nil{%
301 \ifx\\#2\\%
302 % \end{macrocode}
303 % Name does not contain \cs{@clsextension}
304 % \begin{macrocode}
305 \else
306 \expandafter\CL@test@i\CL@entry\@nil
307 \fi
308 }%
309 \expandafter\def\expandafter\CL@test@i
310 \expandafter#\expandafter1\@clsextension#2\@nil{%
311 \ifx\\#2\\%
312 \@ifundefined{opt@\CL@entry}{%
313 }{%
314 \@ifundefined{MainClassName}{%
315 \let\MainClassName\CL@entry
316 }{%
317 }%
318 \edef\ClassList{%
319 \ClassList
320 \ClassListEntry{\CL@entry}{}{}%
321 }%
322 }%
323 \else
324 % \end{macrocode}
325 % Names with more than one \cs{@clsextension} are not supported.
326 % \begin{macrocode}
327 \fi
328 }%
329 \@for\CL@entry:=\@filelist\do{%
330 \expandafter\expandafter\expandafter\CL@test\expandafter
331 \CL@entry\@clsextension\@nil
332 }%
333 \fi
334 % \end{macrocode}
335 %
336 % \begin{macro}{\PrintClassListEntry}
337 % \begin{macrocode}
338 \providecommand*{\PrintClassListEntry}[3]{%
339 \toks@{* #1}%
340 \typeout{\the\toks@}%
341 }
342 % \end{macrocode}
343 % \end{macro}
344 % \begin{macro}{\PrintClassListTitle}
345 % \begin{macrocode}
346 \providecommand*{\PrintClassListTitle}{%
347 \typeout{Class list:}%
348 }
349 % \end{macrocode}
350 % \end{macro}
351 % \begin{macro}{\PrintClassList}
352 % \begin{macrocode}
353 \providecommand*{\PrintClassList}{%
354 \begingroup
355 \let\ClassListEntry\PrintClassListEntry
356 \PrintClassListTitle
357 \ClassList
358 \endgroup
359 }
360 % \end{macrocode}
361 % \end{macro}
362 % \begin{macro}{\CL@InfoEntry}
363 % \begin{macrocode}
364 \def\CL@InfoEntry#1#2#3{%
365 \advance\count@ by \@ne
366 \def\x{#2}%
367 \@onelevel@sanitize\x
368 \edef\CL@Info{%
369 \CL@Info
370 \noexpand\MessageBreak
371 (\the\count@) %
372 #1 [\x]%
373 \ifx\\#3\\%
374 \else
375 \space[#3]% hash-ok
376 \fi
377 }%
378 }
379 % \end{macrocode}
380 % \end{macro}
381 % \begin{macrocode}
382 \AtBeginDocument{%
383 \begingroup
384 \count@=\z@
385 \def\CL@Info{Class List:}%
386 \let\ClassListEntry\CL@InfoEntry
387 \ClassList
388 \let\on@line\@empty
389 \PackageInfo{classlist}{\CL@Info}%
390 \endgroup
391 }
392 % \end{macrocode}
393 %
394 % \begin{macrocode}
395 %</package>
396 % \end{macrocode}
397 %
398 % \section{Installation}
399 %
400 % \subsection{Download}
401 %
402 % \paragraph{Package.} This package is available on
403 % CTAN\footnote{\CTANpkg{classlist}}:
404 % \begin{description}
405 % \item[\CTAN{macros/latex/contrib/oberdiek/classlist.dtx}] The source file.
406 % \item[\CTAN{macros/latex/contrib/oberdiek/classlist.pdf}] Documentation.
407 % \end{description}
408 %
409 %
410 % \paragraph{Bundle.} All the packages of the bundle `oberdiek'
411 % are also available in a TDS compliant ZIP archive. There
412 % the packages are already unpacked and the documentation files
413 % are generated. The files and directories obey the TDS standard.
414 % \begin{description}
415 % \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
416 % \end{description}
417 % \emph{TDS} refers to the standard ``A Directory Structure
418 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
419 % with \xfile{texmf} in their name are usually organized this way.
420 %
421 % \subsection{Bundle installation}
422 %
423 % \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
424 % TDS tree (also known as \xfile{texmf} tree) of your choice.
425 % Example (linux):
426 % \begin{quote}
427 % |unzip oberdiek.tds.zip -d ~/texmf|
428 % \end{quote}
429 %
430 % \subsection{Package installation}
431 %
432 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
433 % \docstrip\ archive. The files are extracted by running the
434 % \xfile{.dtx} through \plainTeX:
435 % \begin{quote}
436 % \verb|tex classlist.dtx|
437 % \end{quote}
438 %
439 % \paragraph{TDS.} Now the different files must be moved into
440 % the different directories in your installation TDS tree
441 % (also known as \xfile{texmf} tree):
442 % \begin{quote}
443 % \def\t{^^A
444 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
445 % classlist.sty & tex/latex/oberdiek/classlist.sty\\
446 % classlist.pdf & doc/latex/oberdiek/classlist.pdf\\
447 % classlist.dtx & source/latex/oberdiek/classlist.dtx\\
448 % \end{tabular}^^A
449 % }^^A
450 % \sbox0{\t}^^A
451 % \ifdim\wd0>\linewidth
452 % \begingroup
453 % \advance\linewidth by\leftmargin
454 % \advance\linewidth by\rightmargin
455 % \edef\x{\endgroup
456 % \def\noexpand\lw{\the\linewidth}^^A
457 % }\x
458 % \def\lwbox{^^A
459 % \leavevmode
460 % \hbox to \linewidth{^^A
461 % \kern-\leftmargin\relax
462 % \hss
463 % \usebox0
464 % \hss
465 % \kern-\rightmargin\relax
466 % }^^A
467 % }^^A
468 % \ifdim\wd0>\lw
469 % \sbox0{\small\t}^^A
470 % \ifdim\wd0>\linewidth
471 % \ifdim\wd0>\lw
472 % \sbox0{\footnotesize\t}^^A
473 % \ifdim\wd0>\linewidth
474 % \ifdim\wd0>\lw
475 % \sbox0{\scriptsize\t}^^A
476 % \ifdim\wd0>\linewidth
477 % \ifdim\wd0>\lw
478 % \sbox0{\tiny\t}^^A
479 % \ifdim\wd0>\linewidth
480 % \lwbox
481 % \else
482 % \usebox0
483 % \fi
484 % \else
485 % \lwbox
486 % \fi
487 % \else
488 % \usebox0
489 % \fi
490 % \else
491 % \lwbox
492 % \fi
493 % \else
494 % \usebox0
495 % \fi
496 % \else
497 % \lwbox
498 % \fi
499 % \else
500 % \usebox0
501 % \fi
502 % \else
503 % \lwbox
504 % \fi
505 % \else
506 % \usebox0
507 % \fi
508 % \end{quote}
509 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
510 % TDS installing feature, then some files can already be in the right
511 % place, see the documentation of \docstrip.
512 %
513 % \subsection{Refresh file name databases}
514 %
515 % If your \TeX~distribution
516 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
517 % these. For example, \TeX\,Live\ users run \verb|texhash| or
518 % \verb|mktexlsr|.
519 %
520 % \subsection{Some details for the interested}
521 %
522 % \paragraph{Unpacking with \LaTeX.}
523 % The \xfile{.dtx} chooses its action depending on the format:
524 % \begin{description}
525 % \item[\plainTeX:] Run \docstrip\ and extract the files.
526 % \item[\LaTeX:] Generate the documentation.
527 % \end{description}
528 % If you insist on using \LaTeX\ for \docstrip\ (really,
529 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
530 % about your intention:
531 % \begin{quote}
532 % \verb|latex \let\install=y\input{classlist.dtx}|
533 % \end{quote}
534 % Do not forget to quote the argument according to the demands
535 % of your shell.
536 %
537 % \paragraph{Generating the documentation.}
538 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
539 % the documentation. The process can be configured by the
540 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
541 % line into this file, if you want to have A4 as paper format:
542 % \begin{quote}
543 % \verb|\PassOptionsToClass{a4paper}{article}|
544 % \end{quote}
545 % An example follows how to generate the
546 % documentation with pdf\LaTeX:
547 % \begin{quote}
548 %\begin{verbatim}
549 %pdflatex classlist.dtx
550 %makeindex -s gind.ist classlist.idx
551 %pdflatex classlist.dtx
552 %makeindex -s gind.ist classlist.idx
553 %pdflatex classlist.dtx
554 %\end{verbatim}
555 % \end{quote}
556 %
557 % \begin{History}
558 % \begin{Version}{2005/06/19 v1.0}
559 % \item
560 % First published version: CTAN and newsgroup \xnewsgroup{comp.text.tex}:
561 % \URL{``\link{Re: Finding the Document Class}''}^^A
562 % {https://groups.google.com/group/comp.text.tex/msg/8ee9523c2dc13666}
563 % \end{Version}
564 % \begin{Version}{2005/06/19 v1.1}
565 % \item
566 % After \cs{documentclass} the package looks
567 % at \cs{@filelist} instead of aborting with error.
568 % \end{Version}
569 % \begin{Version}{2006/02/20 v1.2}
570 % \item
571 % DTX framework.
572 % \item
573 % Fix for \cs{@@fileswith@pti@ns}.
574 % \end{Version}
575 % \begin{Version}{2008/08/11 v1.3}
576 % \item
577 % Code is not changed.
578 % \item
579 % URLs updated.
580 % \end{Version}
581 % \begin{Version}{2011/10/17 v1.4}
582 % \item
583 % Documentation fix: \cs{MainClass} $\rightarrow$ \cs{MainClassName}.
584 % \end{Version}
585 % \begin{Version}{2016/05/16 v1.5}
586 % \item
587 % Documentation updates.
588 % \end{Version}
589 % \end{History}
590 %
591 % \PrintIndex
592 %
593 % \Finale
594 \endinput