Debian Codegraph @

texmf-dist/source/latex/alphalph/alphalph.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: alphalph.dtx
4 % Version: 2019/12/09 v2.6
5 % Info: Convert numbers to letters
6 %
7 % Copyright (C)
8 % 1999, 2006-2008, 2010, 2011 Heiko Oberdiek
9 % 2016-2019 Oberdiek Package Support Group
10 % https://github.com/ho-tex/alphalph/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/alphalph/issues
27 %
28 % The Base Interpreter refers to any `TeX-Format',
29 % because some files are installed in TDS:tex/generic//.
30 %
31 % This work consists of the main source file alphalph.dtx
32 % and the derived files
33 % alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv,
34 % alphalph-test1.tex, alphalph-test2.tex, alphalph-test3.tex.
35 %
36 % Distribution:
37 % CTAN:macros/latex/contrib/alphalph/alphalph.dtx
38 % CTAN:macros/latex/contrib/alphalph/alphalph.pdf
39 %
40 % Unpacking:
41 % (a) If alphalph.ins is present:
42 % tex alphalph.ins
43 % (b) Without alphalph.ins:
44 % tex alphalph.dtx
45 % (c) If you insist on using LaTeX
46 % latex \let\install=y\input{alphalph.dtx}
47 % (quote the arguments according to the demands of your shell)
48 %
49 % Documentation:
50 % (a) If alphalph.drv is present:
51 % latex alphalph.drv
52 % (b) Without alphalph.drv:
53 % latex alphalph.dtx; ...
54 % The class ltxdoc loads the configuration file ltxdoc.cfg
55 % if available. Here you can specify further options, e.g.
56 % use A4 as paper format:
57 % \PassOptionsToClass{a4paper}{article}
58 %
59 % Programm calls to get the documentation (example):
60 % pdflatex alphalph.dtx
61 % makeindex -s gind.ist alphalph.idx
62 % pdflatex alphalph.dtx
63 % makeindex -s gind.ist alphalph.idx
64 % pdflatex alphalph.dtx
65 %
66 % Installation:
67 % TDS:tex/generic/alphalph/alphalph.sty
68 % TDS:doc/latex/alphalph/alphalph.pdf
69 % TDS:source/latex/alphalph/alphalph.dtx
70 %
71 %<*ignore>
72 \begingroup
73 \catcode123=1 %
74 \catcode125=2 %
75 \def\x{LaTeX2e}%
76 \expandafter\endgroup
77 \ifcase 0\ifx\install y1\fi\expandafter
78 \ifx\csname processbatchFile\endcsname\relax\else1\fi
79 \ifx\fmtname\x\else 1\fi\relax
80 \else\csname fi\endcsname
81 %</ignore>
82 %<*install>
83 \input docstrip.tex
84 \Msg{************************************************************************}
85 \Msg{* Installation}
86 \Msg{* Package: alphalph 2019/12/09 v2.6 Convert numbers to letters (HO)}
87 \Msg{************************************************************************}
88
89 \keepsilent
90 \askforoverwritefalse
91
92 \let\MetaPrefix\relax
93 \preamble
94
95 This is a generated file.
96
97 Project: alphalph
98 Version: 2019/12/09 v2.6
99
100 Copyright (C)
101 1999, 2006-2008, 2010, 2011 Heiko Oberdiek
102 2016-2019 Oberdiek Package Support Group
103
104 This work may be distributed and/or modified under the
105 conditions of the LaTeX Project Public License, either
106 version 1.3c of this license or (at your option) any later
107 version. This version of this license is in
108 https://www.latex-project.org/lppl/lppl-1-3c.txt
109 and the latest version of this license is in
110 https://www.latex-project.org/lppl.txt
111 and version 1.3 or later is part of all distributions of
112 LaTeX version 2005/12/01 or later.
113
114 This work has the LPPL maintenance status "maintained".
115
116 The Current Maintainers of this work are
117 Heiko Oberdiek and the Oberdiek Package Support Group
118 https://github.com/ho-tex/alphalph/issues
119
120
121 The Base Interpreter refers to any `TeX-Format',
122 because some files are installed in TDS:tex/generic//.
123
124 This work consists of the main source file alphalph.dtx
125 and the derived files
126 alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv,
127 alphalph-test1.tex, alphalph-test2.tex, alphalph-test3.tex.
128
129 \endpreamble
130 \let\MetaPrefix\DoubleperCent
131
132 \generate{%
133 \file{alphalph.ins}{\from{alphalph.dtx}{install}}%
134 \file{alphalph.drv}{\from{alphalph.dtx}{driver}}%
135 \usedir{tex/generic/alphalph}%
136 \file{alphalph.sty}{\from{alphalph.dtx}{package}}%
137 }
138
139 \catcode32=13\relax% active space
140 \let =\space%
141 \Msg{************************************************************************}
142 \Msg{*}
143 \Msg{* To finish the installation you have to move the following}
144 \Msg{* file into a directory searched by TeX:}
145 \Msg{*}
146 \Msg{* alphalph.sty}
147 \Msg{*}
148 \Msg{* To produce the documentation run the file `alphalph.drv'}
149 \Msg{* through LaTeX.}
150 \Msg{*}
151 \Msg{* Happy TeXing!}
152 \Msg{*}
153 \Msg{************************************************************************}
154
155 \endbatchfile
156 %</install>
157 %<*ignore>
158 \fi
159 %</ignore>
160 %<*driver>
161 \NeedsTeXFormat{LaTeX2e}
162 \ProvidesFile{alphalph.drv}%
163 [2019/12/09 v2.6 Convert numbers to letters (HO)]%
164 \documentclass{ltxdoc}
165 \usepackage{alphalph}[2019/12/09]
166 \makeatletter
167 \newalphalph{\fnsymbolwrap}[wrap]{\@fnsymbol}{}
168 \newcommand*{\fnsymbolsingle}[1]{%
169 \ensuremath{%
170 \ifcase#1%
171 \or *%
172 \or \dagger
173 \or \ddagger
174 \or \mathsection
175 \or \mathparagraph
176 \else
177 \@ctrerr
178 \fi
179 }%
180 }
181 \makeatother
182 \newalphalph{\fnsymbolmult}[mult]{\fnsymbolsingle}{}
183 \usepackage{amsmath}
184 \DeclareMathOperator{\opDiv}{div}
185 \DeclareMathOperator{\opMod}{mod}
186 \newcommand*{\Def}{%
187 \ensuremath{%
188 \mathrel{\mathop{:}}=%
189 }%
190 }
191 \usepackage{holtxdoc}[2011/11/22]
192 \begin{document}
193 \DocInput{alphalph.dtx}%
194 \end{document}
195 %</driver>
196 % \fi
197 %
198 %
199 %
200 % \GetFileInfo{alphalph.drv}
201 %
202 % \title{The \xpackage{alphalph} package}
203 % \date{2019/12/09 v2.6}
204 % \author{Heiko Oberdiek\thanks
205 % {Please report any issues at \url{https://github.com/ho-tex/alphalph/issues}}}
206 %
207 % \maketitle
208 %
209 % \begin{abstract}
210 % The package provides methods to represent numbers with a limited
211 % set of symbols. Both \hologo{LaTeX} and \hologo{plainTeX} are supported.
212 % \end{abstract}
213 %
214 % \tableofcontents
215 %
216 % \section{Documentation}
217 %
218 % \subsection{Introduction}
219 % \hologo{LaTeX} counters can be represented in different ways
220 % by using presentation commands:
221 % \begin{quote}
222 % \cs{arabic}, \cs{roman}, \cs{Roman},\\
223 % \cs{alph}, \cs{Alph}, \cs{fnsymbol}
224 % \end{quote}
225 % The ranges of supported counter values are more or less
226 % restricted. Only \cs{arabic} can be used with any counter
227 % value \hologo{TeX} supports.
228 % \begin{quote}
229 % \catcode`\|=12 %
230 % \begin{tabular}{@{}l|l|l|l@{}}
231 % Presentation & Supported & Ignored & Error message\\
232 % command & domain & values & ``Counter too large''\\
233 % \hline
234 % \cs{arabic}
235 % & \ttfamily -MAX..MAX & &\\
236 % \cs{roman}, \cs{Roman}
237 % & \ttfamily 1..MAX & \ttfamily -MAX..0 &\\
238 % \cs{alph}, \cs{Alph}
239 % & \ttfamily 1..26 & 0 & \ttfamily -MAX..-1, 27..MAX\\
240 % \cs{fnsymbol}
241 % & \ttfamily 1..9 & 0 & \ttfamily -MAX..-1, 10..MAX\\
242 % \hline
243 % \end{tabular}\\[1ex]
244 % \texttt{MAX} = \texttt{2147483647}
245 % \end{quote}
246 % Ordinal numbers are often used in documents: numbering
247 % of chapters, sections, figures, footnotes and so on.
248 % The layouter chooses \cs{Alph} for chapter numbers
249 % and \cs{fnsymbol} for footnotes. But what can be done
250 % if there are more than 26 chapters or more than 10 footnotes?
251 % This package \xpackage{alphalph} allows to define new
252 % presentation commands. They rely on a existing command
253 % and define presentations for values greater the limits.
254 % Three different methods are provided by the package.
255 % In the following use cases they are presentated.
256 %
257 % \subsection{Use cases}
258 %
259 % \subsubsection{Number system based on symbols}
260 %
261 % Asume you are writing a book and your lecturer demands
262 % that chapter numbers must be letters. But you have already
263 % 30 chapters and you have only 26 letters?
264 %
265 % In the decimal system the situation would be clear.
266 % If you run out of digits, you are using more digits
267 % to represent a number. This method can be also be used
268 % for letters. After chapter 26 with |Z| we us |AA|, |AB|, |AC|, and |AD|
269 % for the remaining chapters.
270 %
271 % Happily this package already defines this presentation command:
272 %\begin{quote}
273 %\begin{verbatim}
274 %\usepackage{alphalph}
275 %\renewcommand*{\thechapter}{%
276 % \AlphAlph{\value{chapter}}%
277 %}
278 %\end{verbatim}
279 %\end{quote}
280 % \cs{AlphAlph} generates:
281 % \AlphAlph{1}, \AlphAlph{2}, \AlphAlph{3}, \dots,
282 % \AlphAlph{26}, \AlphAlph{27}, \AlphAlph{28}, \dots
283 %
284 % The other presentation command is \cs{alphalph} for lowercase letters.
285 %
286 % \subsubsection{Wrap symbols around}
287 %
288 % Nine footnote symbols are quite a few.
289 % Too soon the symbols are consumed
290 % and \hologo{LaTeX} complains with the error ``Counter too large''.
291 % However, it could be acceptable to start again with the symbols
292 % from the beginning, especially if there are less than nine symbols
293 % on a page.
294 % This could be achieved by a counter reset.
295 % But finding the right place can be difficult or needs manual
296 % actions. Also a
297 % unique counter value can be desirable (e.g. for generating
298 % unique anchor/link names).
299 % Package \xpackage{alphalph} allows you to define
300 % a macro that implements a ``wrap around'', but letting
301 % the value of the counter untouched:
302 %\begin{quote}
303 %\begin{verbatim}
304 %\usepackage{alphalph}
305 %\makeatletter
306 %\newalphalph{\fnsymbolwrap}[wrap]{\@fnsymbol}{}
307 %\makeatother
308 %\renewcommand*{\thefootnote}{%
309 % \fnsymbolwrap{\value{footnote}}%
310 %}
311 %\end{verbatim}
312 %\end{quote}
313 % \cs{fnsymbolwrap} generates:
314 % \fnsymbolwrap{1}~(1), \fnsymbolwrap{2}~(2), \fnsymbolwrap{3}~(3), \dots,
315 % \fnsymbolwrap{9}~(9), \fnsymbolwrap{10}~(10), \fnsymbolwrap{11}~11, \dots
316 %
317 % \subsubsection{Multiple symbols}
318 %
319 % \Hologo{LaTeX}'s standard set of footnote symbols contains doubled
320 % symbols at the higher positions. Could this principle
321 % be generalized?
322 % Yes, but first we need a clean footnote symbol list without
323 % doubled entries, example:
324 %\begin{quote}
325 %\begin{verbatim}
326 %\usepackage{alphalph}
327 %\makeatletter
328 %\newcommand*{\fnsymbolsingle}[1]{%
329 % \ensuremath{%
330 % \ifcase#1%
331 % \or *%
332 % \or \dagger
333 % \or \ddagger
334 % \or \mathsection
335 % \or \mathparagraph
336 % \else
337 % \@ctrerr
338 % \fi
339 % }%
340 %}
341 %\makeatother
342 %\newalphalph{\fnsymbolmult}[mult]{\fnsymbolsingle}{}
343 %\renewcommand*{\thefootnote}{%
344 % \fnsymbolmult{\value{footnote}}%
345 %}
346 %\end{verbatim}
347 %\end{quote}
348 % The own definition of \cs{fnsymbolsingle} has the
349 % advantage that this list can easily modified.
350 % Otherwise you can use \cs{@fnsymbol} directly,
351 % because it uses the same first five symbols.
352 %\begin{quote}
353 %\begin{verbatim}
354 %\usepackage{alphalph}
355 %\makeatletter
356 %\newalphalph{\fnsymbolmult}[mult]{\@fnsymbol}{5}
357 %\makeatother
358 %\renewcommand*{\thefootnote}{%
359 % \fnsymbolmult{\value{footnote}}%
360 %}
361 %\end{verbatim}
362 %\end{quote}
363 % \cs{fnsymbolmult} generates:
364 % \fnsymbolmult{1}~(1), \fnsymbolmult{2}~(2), \fnsymbolmult{3}~(3),
365 % \fnsymbolmult{4}~(4), \fnsymbolmult{5}~(5), \fnsymbolmult{6}~(6),
366 % \dots, \fnsymbolmult{16}~16, \fnsymbolmult{17}~17, \dots
367 %
368 % \bigskip
369 % The same method can also be used for the chapter problem
370 % in the first discussed use case:
371 %\begin{quote}
372 %\begin{verbatim}
373 %\usepackage{alphalph}
374 %\makeatletter
375 %\newalphalph{\AlphMult}[mult]{\@Alph}{26}
376 %\makeatother
377 %\renewcommand*{\chapter}{%
378 % \AlphMult{\value{chapter}}%
379 %}
380 %\end{verbatim}
381 %\end{quote}
382 % \cs{AlphMult} then generates AA, BB, CC, and DD for chapters 27--30.
383 %
384 % \subsection{Glossary}
385 %
386 % \begin{description}
387 % \item[Counter presentation command] is a macro that
388 % expects a \hologo{LaTeX} counter name as argument.
389 % Numbers cannot be used. Examples:
390 % \cs{arabic}, \cs{alph}, \cs{fnsymbol}.
391 % \item[Number presentation command] is a macro that
392 % expects a number as argument. A number is anything
393 % that \hologo{TeX} accepts as number including \cs{value}.
394 % Examples: \cs{alphalph}, \cs{AlphAlph}, \cs{alphalph@alph}
395 %
396 % However, \cs{alph} or \cs{fnsymbol} are not number
397 % presentation commands because they expect a counter
398 % name as argument. Happily \hologo{LaTeX} counter presentation
399 % commands internally uses number presentation commands
400 % with the same name, but prefixed by `@'. Thus
401 % \cs{@alph}, \cs{@fnsymbol} are number presentation commands.
402 % \item[Symbols provider] is a command that can be used
403 % to get a list of symbols. For example, \cs{@Alph}
404 % provides the 26 uppercase letters from `A' to `Z'.
405 % Basically a symbol provider is a number presentation
406 % command, usually with a limited range.
407 % \item[Number of symbols] is the number of the
408 % last symbol slot of a symbol provider. Thus \cs{@Alph}
409 % generates 26 symbols, \cs{@fnsymbol} provides 9 symbols.
410 % \end{description}
411 %
412 % \subsection{Package usage}
413 %
414 % The package \Package{alphalph} can be used with both \hologo{plainTeX}
415 % and \hologo{LaTeX}:
416 % \begin{description}
417 % \item[\hologo{plainTeX}:] |\input alphalph.sty|
418 % \item[\hologo{LaTeX2e}:] |\usepackage{alphalph}|\\
419 % There aren't any options.
420 % \end{description}
421 %
422 % \subsection{User commands}
423 %
424 % \begin{declcs}{AlphAlph} \M{number}\\
425 % \cs{alphalph} \M{number}
426 % \end{declcs}
427 % Both macros are number presentation commands that
428 % expects a number as argument. \hologo{LaTeX} counters
429 % are used with \cs{value}.
430 %
431 % The macros represents a number by letters.
432 % First single letters |A..Z| are used, then
433 % two letters |AA..ZZ|, three letters |AAA...ZZZ|, \dots
434 % follow.
435 %
436 % Macro \cs{AlphAlph} uses uppercase letters,
437 % \cs{alphalph} generates the lowercase variant.
438 % \begin{quote}
439 % \catcode`\|=12
440 % \def\entry#1{
441 % \texttt{#1}
442 % & \texttt{\AlphAlph{#1}}
443 % & \texttt{\alphalph{#1}}
444 % }
445 % \begin{tabular}{@{}l|l|l@{}}
446 % \meta{number} & \verb|\AlphAlph{|\meta{number}\verb|}|
447 % & \verb|\alphalph{|\meta{number}\verb|}|\\
448 % \hline
449 % \entry{1}\\
450 % \entry{2}\\
451 % \entry{26}\\
452 % \entry{27}\\
453 % \entry{30}\\
454 % \entry{2000}\\
455 % \entry{3752127}\\
456 % \entry{10786572}\\
457 % \entry{2147483647}\\
458 % \end{tabular}
459 % \end{quote}
460 %
461 % \begin{declcs}{newalphalph}
462 % \M{cmd}
463 % |[|\meta{method}|]|
464 % \M{symbols provider}
465 % \M{number of symbols}
466 % \end{declcs}
467 % Macro \cs{newalphalph} defines \meta{cmd} as new
468 % number presentation command. Like \cs{newcommand} an error
469 % is thrown, if macro \meta{cmd} already exists.
470 %
471 % The \meta{method} is one of |alph|, |wrap|, or |mult|.
472 % The default is |alph|.
473 %
474 % As symbol provider a number presentation command
475 % can be used, e.g. \cs{@fnsymbol}, \cs{@Alph}, or
476 % \cs{alphalph@alph}.
477 %
478 % The last argument is the number of symbols.
479 % If the argument is empty, then \cs{newalphalph} tries
480 % to find this number itself. \hologo{LaTeX}'s number presentation
481 % commands throw an error message, if the number is too large.
482 % This error message is put in a macro \cs{@ctrerr}.
483 % Thus \cs{newalphalph} calls the symbol provider and tests
484 % a number by typesetting it in a temporary box. The error
485 % macro \cs{@ctrerr} is catched, it proofs that the number
486 % is not supported. Also if the width of the result is zero
487 % the number is considered as unavailable.
488 %
489 % The empty argument is useful for potentially variable lists.
490 % However if the end cannot be detected, then the number of
491 % symbols must be given. This is also a lot faster. Therefore don't
492 % let the argument empty without reason.
493 %
494 % \subsection{Programmer commands}
495 %
496 % \begin{declcs}{alphalph@Alph} \M{number}\\
497 % \cs{alphalph@alph} \M{number}
498 % \end{declcs}
499 % They are basically the same as \cs{@Alph} and \cs{@alph}.
500 % Some languages of package \xpackage{babel} redefine
501 % \hologo{LaTeX}'s macros to include some font setup that
502 % breaks expandibility. Therefore \cs{AlphAlph} and \cs{alphalph}
503 % are based on \cs{alphalph@Alph} and \cs{alphalph@alph} to get
504 % the letters. The behaviour of these symbol providers for numbers
505 % outside the range |1..26| is undefined.
506 %
507 % \subsection{Design principles}
508 %
509 % \subsubsection{Number presentation commands}
510 %
511 % All number presentation commands that this package defines
512 % (including \cs{alphalph} and \cs{AlphAlph}) have the following
513 % properties:
514 % \begin{itemize}
515 % \item They are fully expandable. This means that they can safely
516 % \begin{itemize}
517 % \item be written to a file,
518 % \item used in moving arguments (\hologo{LaTeX}: they are \emph{robust}),
519 % \item used in a \cmd{\csname}-\cmd{\endcsname} pair.
520 % \end{itemize}
521 % \item If the argument is zero or negative, the commands expand
522 % to nothing like \cmd{\romannumeral}.
523 % \item The argument is a \hologo{TeX} number. Anything that would be
524 % accepted by \cmd{\number} is a valid argument:
525 % \begin{itemize}
526 % \item explicite constants,
527 % \item macros that expand to a number,
528 % \item count registers, \hologo{LaTeX} counter can used
529 % via \cmd{\value}, e.\,g.:\\
530 % |\alphalph{\value{page}}|
531 % \item \dots
532 % \end{itemize}
533 % \item \hologo{eTeX}'s numeric expressions are supported, if \hologo{eTeX} is
534 % available. Then \cs{numexpr} is applied to the argument.
535 % Package \cs{calc}'s expressions are not supported.
536 % That would violate the expandibility.
537 % \end{itemize}
538 %
539 % \subsubsection{General usability}
540 %
541 % \begin{description}
542 % \item[\hologo{TeX} format:]
543 % The package does not depend on \hologo{LaTeX}, it can also be used
544 % by \hologo{plainTeX}, for example.
545 % \item[\hologo{eTeX}:] \eTeX is supported, the macros are shorter and
546 % faster. But \eTeX's extensions are not requirements.
547 % Without \hologo{eTeX}, just the implementation changes. The properties
548 % remain unchanged.
549 % \end{description}
550 %
551 % \StopEventually{
552 % }
553 %
554 % \section{Implementation}
555 % \subsection{Begin\texorpdfstring{ of package}{}}
556 % \begin{macrocode}
557 %<*package>
558 % \end{macrocode}
559 % Reload check, especially if the package is not used with \LaTeX.
560 % \begin{macrocode}
561 \begingroup\catcode61\catcode48\catcode32=10\relax%
562 \catcode13=5 % ^^M
563 \endlinechar=13 %
564 \catcode35=6 % #
565 \catcode39=12 % '
566 \catcode44=12 % ,
567 \catcode45=12 % -
568 \catcode46=12 % .
569 \catcode58=12 % :
570 \catcode64=11 % @
571 \catcode123=1 % {
572 \catcode125=2 % }
573 \expandafter\let\expandafter\x\csname [email protected]\endcsname
574 \ifx\x\relax % plain-TeX, first loading
575 \else
576 \def\empty{}%
577 \ifx\x\empty % LaTeX, first loading,
578 % variable is initialized, but \ProvidesPackage not yet seen
579 \else
580 \expandafter\ifx\csname PackageInfo\endcsname\relax
581 \def\x#1#2{%
582 \immediate\write-1{Package #1 Info: #2.}%
583 }%
584 \else
585 \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
586 \fi
587 \x{alphalph}{The package is already loaded}%
588 \aftergroup\endinput
589 \fi
590 \fi
591 \endgroup%
592 % \end{macrocode}
593 % Package identification:
594 % \begin{macrocode}
595 \begingroup\catcode61\catcode48\catcode32=10\relax%
596 \catcode13=5 % ^^M
597 \endlinechar=13 %
598 \catcode35=6 % #
599 \catcode39=12 % '
600 \catcode40=12 % (
601 \catcode41=12 % )
602 \catcode44=12 % ,
603 \catcode45=12 % -
604 \catcode46=12 % .
605 \catcode47=12 % /
606 \catcode58=12 % :
607 \catcode64=11 % @
608 \catcode91=12 % [
609 \catcode93=12 % ]
610 \catcode123=1 % {
611 \catcode125=2 % }
612 \expandafter\ifx\csname ProvidesPackage\endcsname\relax
613 \def\x#1#2#3[#4]{\endgroup
614 \immediate\write-1{Package: #3 #4}%
615 \xdef#1{#4}%
616 }%
617 \else
618 \def\x#1#2[#3]{\endgroup
619 #2[{#3}]%
620 \ifx#1\@undefined
621 \xdef#1{#3}%
622 \fi
623 \ifx#1\relax
624 \xdef#1{#3}%
625 \fi
626 }%
627 \fi
628 \expandafter\x\csname [email protected]\endcsname
629 \ProvidesPackage{alphalph}%
630 [2019/12/09 v2.6 Convert numbers to letters (HO)]%
631 % \end{macrocode}
632 %
633 % \subsection{Catcodes}
634 %
635 % \begin{macrocode}
636 \begingroup\catcode61\catcode48\catcode32=10\relax%
637 \catcode13=5 % ^^M
638 \endlinechar=13 %
639 \catcode123=1 % {
640 \catcode125=2 % }
641 \catcode64=11 % @
642 \def\x{\endgroup
643 \expandafter\edef\csname AlPh@AtEnd\endcsname{%
644 \endlinechar=\the\endlinechar\relax
645 \catcode13=\the\catcode13\relax
646 \catcode32=\the\catcode32\relax
647 \catcode35=\the\catcode35\relax
648 \catcode61=\the\catcode61\relax
649 \catcode64=\the\catcode64\relax
650 \catcode123=\the\catcode123\relax
651 \catcode125=\the\catcode125\relax
652 }%
653 }%
654 \x\catcode61\catcode48\catcode32=10\relax%
655 \catcode13=5 % ^^M
656 \endlinechar=13 %
657 \catcode35=6 % #
658 \catcode64=11 % @
659 \catcode123=1 % {
660 \catcode125=2 % }
661 \def\TMP@EnsureCode#1#2{%
662 \edef\AlPh@AtEnd{%
663 \AlPh@AtEnd
664 \catcode#1=\the\catcode#1\relax
665 }%
666 \catcode#1=#2\relax
667 }
668 \TMP@EnsureCode{33}{12}% !
669 \TMP@EnsureCode{39}{12}% '
670 \TMP@EnsureCode{40}{12}% (
671 \TMP@EnsureCode{41}{12}% )
672 \TMP@EnsureCode{43}{12}% +
673 \TMP@EnsureCode{44}{12}% ,
674 \TMP@EnsureCode{46}{12}% .
675 \TMP@EnsureCode{47}{12}% /
676 \TMP@EnsureCode{59}{12}% ;
677 \TMP@EnsureCode{60}{12}% <
678 \TMP@EnsureCode{62}{12}% >
679 \TMP@EnsureCode{91}{12}% [
680 \TMP@EnsureCode{93}{12}% ]
681 \TMP@EnsureCode{96}{12}% `
682 \TMP@EnsureCode{124}{12}% |
683 \edef\AlPh@AtEnd{\AlPh@AtEnd\noexpand\endinput}
684 % \end{macrocode}
685 %
686 % \subsection{Package loading}
687 %
688 % \begin{macrocode}
689 \begingroup\expandafter\expandafter\expandafter\endgroup
690 \expandafter\ifx\csname RequirePackage\endcsname\relax
691 \input infwarerr.sty\relax
692 \input intcalc.sty\relax
693 \else
694 \RequirePackage{infwarerr}[2007/09/09]%
695 \RequirePackage{intcalc}[2007/09/09]%
696 \fi
697 % \end{macrocode}
698 %
699 % \subsection{\hologo{eTeX} detection}
700 %
701 % \begin{macrocode}
702 \begingroup\expandafter\expandafter\expandafter\endgroup
703 \expandafter\ifx\csname numexpr\endcsname\relax
704 \catcode124=9 % '!': ignore
705 \catcode43=14 % '+': comment
706 \else
707 \catcode124=14 % '!': comment
708 \catcode43=9 % '+': ignore
709 \fi
710 % \end{macrocode}
711 %
712 % \subsection{Help macros}
713 %
714 % \begin{macro}{\AlPh@Error}
715 % \begin{macrocode}
716 \def\AlPh@Error#1{%
717 \begingroup
718 \escapechar=92 % backslash
719 \@PackageError{alphalph}{#1}\@ehc
720 \endgroup
721 }
722 % \end{macrocode}
723 % \end{macro}
724 %
725 % \begin{macro}{\AlPh@IfDefinable}
726 % \begin{macrocode}
727 \begingroup\expandafter\expandafter\expandafter\endgroup
728 \expandafter\ifx\csname @ifdefinable\endcsname\relax
729 \def\AlPh@IfDefinable#1#2{%
730 \ifcase\ifx#1\@undefined\else\ifx#1\relax\else1\fi\fi0 %
731 #2%
732 \else
733 \AlPh@Error{%
734 Command \string#1 already defined%
735 }%
736 \fi
737 }%
738 % \end{macrocode}
739 % \end{macro}
740 % \begin{macrocode}
741 \else
742 % \end{macrocode}
743 % \begin{macro}{\AlPh@IfDefinable}
744 % \begin{macrocode}
745 \let\AlPh@IfDefinable\@ifdefinable
746 % \end{macrocode}
747 % \end{macro}
748 % \begin{macrocode}
749 \fi
750 % \end{macrocode}
751 %
752 % \begin{macro}{\@ReturnAfterElseFi}
753 % \begin{macro}{\@ReturnAfterFi}
754 % The following commands moves the `then' and `else' part respectively
755 % behind the |\if|-construct. This prevents a too deep |\if|-nesting
756 % and so a \hologo{TeX} capacity error because of a limited input stack size.
757 % I use this trick in several packages, so I don't prefix these internal
758 % commands in order not to have the same macros with different names.
759 % (It saves memory.)
760 % \begin{macrocode}
761 \long\def\@ReturnAfterElseFi#1\else#2\fi{\fi#1}
762 \long\def\@ReturnAfterFi#1\fi{\fi#1}
763 % \end{macrocode}
764 % \end{macro}
765 % \end{macro}
766 %
767 % \begin{macro}{\@gobblefour}
768 % \Hologo{LaTeX} defines commands for eating arguments.
769 % Define \cs{@gobblefour} if it is not defined (\hologo{plainTeX}).
770 % \begin{macrocode}
771 \expandafter\ifx\csname @gobblefour\endcsname\relax
772 \long\def\@gobblefour#1#2#3#4{}%
773 \fi
774 % \end{macrocode}
775 % \end{macro}
776 %
777 % \begin{macro}{AlPh@IfOptArg}
778 % \begin{macrocode}
779 \begingroup\expandafter\expandafter\expandafter\endgroup
780 \expandafter\ifx\csname kernel@ifnextchar\endcsname\relax
781 \begingroup\expandafter\expandafter\expandafter\endgroup
782 \expandafter\ifx\csname @ifnextchar\endcsname\relax
783 \def\AlPh@IfOptArg#1#2{%
784 \def\AlPh@TempA{#1}%
785 \def\AlPh@TempB{#2}%
786 \futurelet\AlPh@Token\AlPh@IfOptArgNext
787 }%
788 \let\AlPh@BracketLeft=[%]
789 \def\AlPh@IfOptArgNext{%
790 \ifx\AlPh@Token\AlPh@BracketLeft
791 \expandafter\AlPh@TempA
792 \else
793 \expandafter\AlPh@TempB
794 \fi
795 }%
796 \else
797 \def\AlPh@IfOptArg{\@ifnextchar[}%]
798 \fi
799 \else
800 \def\AlPh@IfOptArg{\kernel@ifnextchar[}%]
801 \fi
802 % \end{macrocode}
803 % \end{macro}
804 %
805 % \subsection{Symbol provider}
806 %
807 % \subsubsection{Alphabet}
808 %
809 % The output of \cs{alphalph} and \cs{AlphAlph} should be
810 % usable as part of command names (see \cs{@namedef}, \cs{csname}, \dots).
811 % Unhappily some languages of package \xpackage{babel}
812 % redefine \hologo{LaTeX}'s \cs{@alph} and \cs{@Alph} in a manner that
813 % they cannot be used in expandable context any more.
814 % Therefore package \xpackage{alphalph} provides its own
815 % commands.
816 %
817 % \begin{macro}{\alphalph@Alph}
818 % \begin{macro}{\alphalph@alph}
819 % The two commands \cmd{\AlPh@Alph} and \cmd{\AlPh@alph} convert a
820 % number into a letter (uppercase and lowercase respectivly).
821 % The character |@| is used as an error symbol,
822 % if the number isn't in the range of 1 until 26.
823 % Here we need no space after the number |#1|, because the error
824 % symbol |@| for the zero case stops scanning the number.
825 % This error symbol should not appear anywhere (except for bugs).
826 % \begin{macrocode}
827 \def\alphalph@Alph#1{%
828 \ifcase#1%
829 @%
830 \or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
831 \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z%
832 \else
833 \AlPh@ctrerr
834 @%
835 \fi
836 }
837 \def\alphalph@alph#1{%
838 \ifcase#1%
839 @%
840 \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
841 \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
842 \else
843 \AlPh@ctrerr
844 @%
845 \fi
846 }
847 % \end{macrocode}
848 % \end{macro}
849 % \end{macro}
850 % \begin{macro}{\AlPh@ctrerr}
851 % Macro \cs{AlPh@ctrerr} is used as hook for the algorithm
852 % to get the available number of symbols.
853 % \begin{macrocode}
854 \def\AlPh@ctrerr{}
855 % \end{macrocode}
856 % \end{macro}
857 %
858 % \subsection{Finding number of symbols}
859 %
860 % \begin{macro}{\AlPh@GetNumberOfSymbols}
861 % \noindent
862 % |#1|: symbols provider
863 % \begin{macrocode}
864 \def\AlPh@GetNumberOfSymbols#1{%
865 \AlPh@TestNumber1!{#1}%
866 \ifAlPh@Unavailable
867 \def\AlPh@Number{0}%
868 \AlPh@Error{No symbols found}%
869 \else
870 \def\AlPh@Number{1}%
871 \AlPh@ExpSearch2!{#1}%
872 \fi
873 }
874 % \end{macrocode}
875 % \end{macro}
876 % \begin{macro}{\ifAlPh@Unavailable}
877 % \begin{macrocode}
878 \let\ifAlPh@Unavailable\iffalse
879 \def\AlPh@Unavailabletrue{%
880 \global\let\ifAlPh@Unavailable\iftrue
881 }
882 \def\AlPh@Unavailablefalse{%
883 \global\let\ifAlPh@Unavailable\iffalse
884 }
885 % \end{macrocode}
886 % \end{macro}
887 % \begin{macro}{\AlPh@TestNumber}
888 % |#1|: number to be tested\\
889 % |#2|: symbols provider
890 % \begin{macrocode}
891 \def\AlPh@TestNumber#1!#2{%
892 \AlPh@Unavailablefalse
893 \begingroup
894 \setbox0=\hbox{%
895 \begingroup % color
896 \let\@ctrerr\AlPh@Unavailabletrue
897 \let\AlPh@ctrerr\AlPh@Unavailabletrue
898 #2{#1}%
899 \endgroup
900 }%
901 \ifdim\wd0=0pt %
902 \AlPh@Unavailabletrue
903 \fi
904 \endgroup
905 }
906 % \end{macrocode}
907 % \end{macro}
908 % \begin{macro}{\AlPh@ExpSearch}
909 % |#1|: number to be tested\\
910 % |#2|: symbols provider
911 % \begin{macrocode}
912 \def\AlPh@ExpSearch#1!#2{%
913 \let\AlPh@Next\relax
914 \AlPh@TestNumber#1!{#2}%
915 \ifAlPh@Unavailable
916 \expandafter\AlPh@BinSearch\AlPh@Number!#1!{#2}%
917 \else
918 \def\AlPh@Number{#1}%
919 \ifnum#1>1073741823 %
920 \AlPh@TestNumber2147483647!{#2}%
921 \ifAlPh@Unavailable
922 \AlPh@BinSearch#1!2147483647!{#2}%
923 \else
924 \def\AlPh@Number{0}%
925 \AlPh@Error{%
926 Maximal symbol number not found%
927 }%
928 \fi
929 \else
930 \def\AlPh@Next{%
931 \expandafter\AlPh@ExpSearch\number\intcalcShl{#1}!{#2}%
932 }%
933 \fi
934 \fi
935 \AlPh@Next
936 }
937 % \end{macrocode}
938 % \end{macro}
939 % \begin{macro}{\AlPh@BinSearch}
940 % |#1|: available number\\
941 % |#2|: unavailable number, |#2| $>$ |#1|\\
942 % |#3|: symbols provider
943 % \begin{macrocode}
944 \def\AlPh@BinSearch#1!#2!#3{%
945 \expandafter\AlPh@ProcessBinSearch
946 \number\intcalcShr{\intcalcAdd{#1}{#2}}!%
947 #1!#2!{#3}%
948 }
949 % \end{macrocode}
950 % \end{macro}
951 % \begin{macro}{\AlPh@ProcessBinSearch}
952 % |#1|: number to be tested, |#2| $\leq$ |#1| $\leq$ |#3|\\
953 % |#2|: available number\\
954 % |#3|: unavailable number\\
955 % |#4|: symbols provider
956 % \begin{macrocode}
957 \def\AlPh@ProcessBinSearch#1!#2!#3!#4{%
958 \let\AlPh@Next\relax
959 \ifnum#1>#2 %
960 \ifnum#1<#3 %
961 \AlPh@TestNumber#1!{#4}%
962 \ifAlPh@Unavailable
963 \def\AlPh@Next{%
964 \AlPh@BinSearch#2!#1!{#4}%
965 }%
966 \else
967 \def\AlPh@Next{%
968 \AlPh@BinSearch#1!#3!{#4}%
969 }%
970 \fi
971 \else
972 \def\AlPh@Number{#2}%
973 \fi
974 \else
975 \def\AlPh@Number{#2}%
976 \fi
977 \AlPh@Next
978 }
979 % \end{macrocode}
980 % \end{macro}
981 %
982 % \subsection{Methods}
983 %
984 % The names of method macros start with \cs{AlPh@Method}.
985 % These macros do the main job in converting a number to
986 % its representation.
987 % A method command is called with three arguments.
988 % The first argument is the number of symbols. The
989 % second argument is the basic macro for converting
990 % a number with limited number range. The last parameter
991 % is the number that needs converting.
992 %
993 % \subsubsection{Common methods}
994 %
995 % \begin{macro}{\AlPh@CheckPositive}
996 % \noindent
997 % |#1|: number to be checked
998 % |#2|: continuation macro\\
999 % |#3|: number of symbols (hidden here)\\
1000 % |#4|: symbol provider (hidden here)
1001 % \begin{macrocode}
1002 \def\AlPh@CheckPositive#1!#2{%
1003 \ifnum#1<1 %
1004 \expandafter\@gobblefour
1005 \fi
1006 #2{#1}%
1007 }
1008 % \end{macrocode}
1009 % \end{macro}
1010 %
1011 % \subsubsection{Method `alph'}
1012 %
1013 % \begin{macro}{\AlPh@Method@alph}
1014 % \noindent
1015 % |#1|: number of symbols\\
1016 % |#2|: symbols provider\\
1017 % |#3|: number to be converted
1018 % \begin{macrocode}
1019 \def\AlPh@Method@alph#1#2#3{%
1020 \expandafter\AlPh@CheckPositive
1021 | \number#3!%
1022 + \the\numexpr#3!%
1023 \AlPh@ProcessAlph
1024 {#1}{#2}%
1025 }
1026 % \end{macrocode}
1027 % \end{macro}
1028 % \begin{macro}{\AlPh@ProcessAlph}
1029 % |#1|: current number\\
1030 % |#2|: number of symbols\\
1031 % |#3|: symbols provider
1032 % \begin{macrocode}
1033 \def\AlPh@ProcessAlph#1#2#3{%
1034 \ifnum#1>#2 %
1035 \@ReturnAfterElseFi{%
1036 \expandafter\AlPh@StepAlph\number
1037 \intcalcInc{%
1038 \intcalcMod{\intcalcDec{#1}}{#2}%
1039 }%
1040 \expandafter!\number
1041 \intcalcDiv{\intcalcDec{#1}}{#2}%
1042 !{#2}{#3}%
1043 }%
1044 \else
1045 \@ReturnAfterFi{%
1046 #3{#1}%
1047 }%
1048 \fi
1049 }
1050 % \end{macrocode}
1051 % \end{macro}
1052 % \begin{macro}{\AlPh@StepAlph}
1053 % |#1|: current last digit\\
1054 % |#2|: new current number\\
1055 % |#3|: number of symbols\\
1056 % |#4|: symbols provider
1057 % \begin{macrocode}
1058 \def\AlPh@StepAlph#1!#2!#3#4{%
1059 \AlPh@ProcessAlph{#2}{#3}{#4}%
1060 #4{#1}%
1061 }
1062 % \end{macrocode}
1063 % \end{macro}
1064 %
1065 % \subsubsection{Method `wrap'}
1066 %
1067 % \begin{macro}{\AlPh@Method@wrap}
1068 % \noindent
1069 % |#1|: number of symbols\\
1070 % |#2|: symbols provider\\
1071 % |#3|: number to be converted
1072 % \begin{macrocode}
1073 \def\AlPh@Method@wrap#1#2#3{%
1074 \expandafter\AlPh@CheckPositive
1075 | \number#3!%
1076 + \the\numexpr#3!%
1077 \AlPh@ProcessWrap
1078 {#1}{#2}%
1079 }
1080 % \end{macrocode}
1081 % \end{macro}
1082 %
1083 % \begin{macro}{\AlPh@ProcessWrap}
1084 % |#1|: number to be converted\\
1085 % |#2|: number of symbols\\
1086 % |#3|: symbols provider
1087 % \begin{macrocode}
1088 \def\AlPh@ProcessWrap#1#2#3{%
1089 \ifnum#1>#2 %
1090 \@ReturnAfterElseFi{%
1091 \expandafter\AlPh@StepWrap\number
1092 \intcalcInc{\intcalcMod{\intcalcDec{#1}}{#2}}%
1093 !{#3}%
1094 }%
1095 \else
1096 \@ReturnAfterFi{%
1097 #3{#1}%
1098 }%
1099 \fi
1100 }
1101 % \end{macrocode}
1102 % \end{macro}
1103 % \begin{macro}{\AlPh@StepWrap}
1104 % |#1|: final number\\
1105 % |#2|: symbols provider
1106 % \begin{macrocode}
1107 \def\AlPh@StepWrap#1!#2{%
1108 #2{#1}%
1109 }
1110 % \end{macrocode}
1111 % \end{macro}
1112 %
1113 % \subsubsection{Method `mult'}
1114 %
1115 % After the number of symbols is exhausted,
1116 % repetitions of the symbol are used.
1117 % \begin{gather*}
1118 % x \Def \text{number to be converted}\\
1119 % n \Def \text{number of symbols}\\
1120 % r \Def \text{repetition length}\\
1121 % s \Def \text{symbol slot}\\
1122 % r = ((x - 1) \div n) + 1\\
1123 % s = ((x - 1) \mod n) + 1
1124 % \end{gather*}
1125 % \begin{macro}{\AlPh@Method@mult}
1126 % \noindent
1127 % |#1|: number of symbols\\
1128 % |#2|: symbols provider\\
1129 % |#3|: number to be converted
1130 % \begin{macrocode}
1131 \def\AlPh@Method@mult#1#2#3{%
1132 \expandafter\AlPh@CheckPositive
1133 | \number#3!%
1134 + \the\numexpr#3!%
1135 \AlPh@ProcessMult
1136 {#1}{#2}%
1137 }
1138 % \end{macrocode}
1139 % \end{macro}
1140 %
1141 % \begin{macro}{\AlPh@ProcessMult}
1142 % |#1|: number to be converted\\
1143 % |#2|: number of symbols\\
1144 % |#3|: symbols provider
1145 % \begin{macrocode}
1146 \def\AlPh@ProcessMult#1#2#3{%
1147 \ifnum#1>#2 %
1148 \@ReturnAfterElseFi{%
1149 \expandafter\AlPh@StepMult\romannumeral
1150 \intcalcInc{\intcalcDiv{\intcalcDec{#1}}{#2}}%
1151 000%
1152 \expandafter!\number
1153 \intcalcInc{\intcalcMod{\intcalcDec{#1}}{#2}}%
1154 !{#3}%
1155 }%
1156 \else
1157 \@ReturnAfterFi{%
1158 #3{#1}%
1159 }%
1160 \fi
1161 }
1162 % \end{macrocode}
1163 % \end{macro}
1164 % \begin{macro}{\AlPh@StepMult}
1165 % |#1#2|: repetitions coded as list of character `m'\\
1166 % |#3|: symbol slot\\
1167 % |#4|: symbols provider
1168 % \begin{macrocode}
1169 \def\AlPh@StepMult#1#2!#3!#4{%
1170 \ifx\\#2\\%
1171 \else
1172 \@ReturnAfterFi{%
1173 \AlPh@StepMult#2!#3!{#4}%
1174 }%
1175 \fi
1176 #4{#3}%
1177 }
1178 % \end{macrocode}
1179 % \end{macro}
1180 %
1181 % \subsection{User interface}
1182 %
1183 % \begin{macro}{\newalphalph}
1184 % Macro \cs{newalphalph} had three arguments in versions below 2.0.
1185 % For the new method argument we use an optional argument an first
1186 % position.\\
1187 % |#1|: cmd\\
1188 % |[#2]|: method name: |alph| (default), |wrap|, |mult|\\ % hash-ok
1189 % |#3|: symbols provider\\
1190 % |#4|: number of symbols
1191 % \begin{macrocode}
1192 \AlPh@IfDefinable\newalphalph{%
1193 \def\newalphalph#1{%
1194 \AlPh@IfOptArg{%
1195 \AlPh@newalphalph{#1}%
1196 }{%
1197 \AlPh@newalphalph{#1}[alph]%
1198 }%
1199 }%
1200 }
1201 % \end{macrocode}
1202 % \end{macro}
1203 % \begin{macro}{\AlPh@newalphalph}
1204 % |#1|: cmd
1205 % |#2|: method name\\
1206 % |#3|: symbols provider\\
1207 % |#4|: number of symbols
1208 % \begin{macrocode}
1209 \def\AlPh@newalphalph#1[#2]#3#4{%
1210 \begingroup\expandafter\expandafter\expandafter\endgroup
1211 \expandafter\ifx\csname AlPh@Method@#2\endcsname\relax
1212 \AlPh@Error{%
1213 Unknown method %
1214 | `#2'%
1215 + `\detokenize{#2}'%
1216 }%
1217 \else
1218 \ifx\\#4\\%
1219 \AlPh@GetNumberOfSymbols{#3}%
1220 \ifcase\AlPh@Number
1221 \else
1222 \begingroup
1223 \escapechar=92 % backslash
1224 \@PackageInfo{alphalph}{%
1225 Number of symbols for \string#1 is \AlPh@Number
1226 }%
1227 \endgroup
1228 \expandafter\AlPh@NewAlphAlph
1229 \csname AlPh@Method@#2\expandafter\endcsname
1230 \AlPh@Number!{#1}{#3}%
1231 \fi
1232 \else
1233 \expandafter\AlPh@NewAlphAlph
1234 \csname AlPh@Method@#2\expandafter\endcsname
1235 | \number#4!%
1236 + \the\numexpr#4!%
1237 {#1}{#3}%
1238 \fi
1239 \fi
1240 }%
1241 % \end{macrocode}
1242 % \end{macro}
1243 % \begin{macro}{\AlPh@NewAlphAlph}
1244 % |#1|: method macro\\
1245 % |#2|: number of symbols\\
1246 % |#3|: cmd\\
1247 % |#4|: symbols provider
1248 % \begin{macrocode}
1249 \def\AlPh@NewAlphAlph#1#2!#3#4{%
1250 \AlPh@IfDefinable#3{%
1251 \ifnum#2>0 %
1252 \def#3{#1{#2}{#4}}%
1253 \else
1254 \AlPh@Error{%
1255 Definition of \string#3 failed,\MessageBreak
1256 because number of symbols (#2) is not positive%
1257 }%
1258 \fi
1259 }%
1260 }
1261 % \end{macrocode}
1262 % \end{macro}
1263 %
1264 % \begin{macro}{\AlphAlph}
1265 % \begin{macrocode}
1266 \newalphalph\AlphAlph\alphalph@Alph{26}
1267 % \end{macrocode}
1268 % \end{macro}
1269 % \begin{macro}{\alphalph}
1270 % \begin{macrocode}
1271 \newalphalph\alphalph\alphalph@alph{26}
1272 % \end{macrocode}
1273 % \end{macro}
1274 %
1275 % \begin{macrocode}
1276 \AlPh@AtEnd%
1277 %</package>
1278 % \end{macrocode}
1279 %
1280 % \section{Installation}
1281 %
1282 % \subsection{Download}
1283 %
1284 % \paragraph{Package.} This package is available on
1285 % CTAN\footnote{\CTANpkg{alphalph}}:
1286 % \begin{description}
1287 % \item[\CTAN{macros/latex/contrib/alphalph/alphalph.dtx}] The source file.
1288 % \item[\CTAN{macros/latex/contrib/alphalph/alphalph.pdf}] Documentation.
1289 % \end{description}
1290 %
1291 %
1292 % \paragraph{Bundle.} All the packages of the bundle `alphalph'
1293 % are also available in a TDS compliant ZIP archive. There
1294 % the packages are already unpacked and the documentation files
1295 % are generated. The files and directories obey the TDS standard.
1296 % \begin{description}
1297 % \item[\CTANinstall{install/macros/latex/contrib/alphalph.tds.zip}]
1298 % \end{description}
1299 % \emph{TDS} refers to the standard ``A Directory Structure
1300 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
1301 % with \xfile{texmf} in their name are usually organized this way.
1302 %
1303 % \subsection{Bundle installation}
1304 %
1305 % \paragraph{Unpacking.} Unpack the \xfile{alphalph.tds.zip} in the
1306 % TDS tree (also known as \xfile{texmf} tree) of your choice.
1307 % Example (linux):
1308 % \begin{quote}
1309 % |unzip alphalph.tds.zip -d ~/texmf|
1310 % \end{quote}
1311 %
1312 % \subsection{Package installation}
1313 %
1314 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
1315 % \docstrip\ archive. The files are extracted by running the
1316 % \xfile{.dtx} through \plainTeX:
1317 % \begin{quote}
1318 % \verb|tex alphalph.dtx|
1319 % \end{quote}
1320 %
1321 % \paragraph{TDS.} Now the different files must be moved into
1322 % the different directories in your installation TDS tree
1323 % (also known as \xfile{texmf} tree):
1324 % \begin{quote}
1325 % \def\t{^^A
1326 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
1327 % alphalph.sty & tex/generic/alphalph/alphalph.sty\\
1328 % alphalph.pdf & doc/latex/alphalph/alphalph.pdf\\
1329 % alphalph.dtx & source/latex/alphalph/alphalph.dtx\\
1330 % \end{tabular}^^A
1331 % }^^A
1332 % \sbox0{\t}^^A
1333 % \ifdim\wd0>\linewidth
1334 % \begingroup
1335 % \advance\linewidth by\leftmargin
1336 % \advance\linewidth by\rightmargin
1337 % \edef\x{\endgroup
1338 % \def\noexpand\lw{\the\linewidth}^^A
1339 % }\x
1340 % \def\lwbox{^^A
1341 % \leavevmode
1342 % \hbox to \linewidth{^^A
1343 % \kern-\leftmargin\relax
1344 % \hss
1345 % \usebox0
1346 % \hss
1347 % \kern-\rightmargin\relax
1348 % }^^A
1349 % }^^A
1350 % \ifdim\wd0>\lw
1351 % \sbox0{\small\t}^^A
1352 % \ifdim\wd0>\linewidth
1353 % \ifdim\wd0>\lw
1354 % \sbox0{\footnotesize\t}^^A
1355 % \ifdim\wd0>\linewidth
1356 % \ifdim\wd0>\lw
1357 % \sbox0{\scriptsize\t}^^A
1358 % \ifdim\wd0>\linewidth
1359 % \ifdim\wd0>\lw
1360 % \sbox0{\tiny\t}^^A
1361 % \ifdim\wd0>\linewidth
1362 % \lwbox
1363 % \else
1364 % \usebox0
1365 % \fi
1366 % \else
1367 % \lwbox
1368 % \fi
1369 % \else
1370 % \usebox0
1371 % \fi
1372 % \else
1373 % \lwbox
1374 % \fi
1375 % \else
1376 % \usebox0
1377 % \fi
1378 % \else
1379 % \lwbox
1380 % \fi
1381 % \else
1382 % \usebox0
1383 % \fi
1384 % \else
1385 % \lwbox
1386 % \fi
1387 % \else
1388 % \usebox0
1389 % \fi
1390 % \end{quote}
1391 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
1392 % TDS installing feature, then some files can already be in the right
1393 % place, see the documentation of \docstrip.
1394 %
1395 % \subsection{Refresh file name databases}
1396 %
1397 % If your \TeX~distribution
1398 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
1399 % these. For example, \TeX\,Live\ users run \verb|texhash| or
1400 % \verb|mktexlsr|.
1401 %
1402 % \subsection{Some details for the interested}
1403 %
1404 % \paragraph{Unpacking with \LaTeX.}
1405 % The \xfile{.dtx} chooses its action depending on the format:
1406 % \begin{description}
1407 % \item[\plainTeX:] Run \docstrip\ and extract the files.
1408 % \item[\LaTeX:] Generate the documentation.
1409 % \end{description}
1410 % If you insist on using \LaTeX\ for \docstrip\ (really,
1411 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
1412 % about your intention:
1413 % \begin{quote}
1414 % \verb|latex \let\install=y\input{alphalph.dtx}|
1415 % \end{quote}
1416 % Do not forget to quote the argument according to the demands
1417 % of your shell.
1418 %
1419 % \paragraph{Generating the documentation.}
1420 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
1421 % the documentation. The process can be configured by the
1422 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
1423 % line into this file, if you want to have A4 as paper format:
1424 % \begin{quote}
1425 % \verb|\PassOptionsToClass{a4paper}{article}|
1426 % \end{quote}
1427 % An example follows how to generate the
1428 % documentation with pdf\LaTeX:
1429 % \begin{quote}
1430 %\begin{verbatim}
1431 %pdflatex alphalph.dtx
1432 %makeindex -s gind.ist alphalph.idx
1433 %pdflatex alphalph.dtx
1434 %makeindex -s gind.ist alphalph.idx
1435 %pdflatex alphalph.dtx
1436 %\end{verbatim}
1437 % \end{quote}
1438 %
1439 % \begin{History}
1440 % \begin{Version}{1999/03/19 v0.1}
1441 % \item
1442 % The first version was built as a response to a
1443 % \URL{\link{question}}^^A
1444 % {https://groups.google.com/group/comp.text.tex/msg/17a74cd721641038}^^A
1445 % of \NameEmail{Will Douglas}{[email protected]}
1446 % and the
1447 % \URL{\link{request}}^^A
1448 % {https://groups.google.com/group/comp.text.tex/msg/8f9768825640315f}^^A
1449 % of \NameEmail{Donald Arsenau}{[email protected]},
1450 % published in the newsgroup
1451 % \href{news:comp.text.tex}{comp.text.tex}:
1452 % \URL{``\link{Re: alph counters \textgreater\ 26}''}^^A
1453 % {https://groups.google.com/group/comp.text.tex/msg/cec563eef8bf65d0}
1454 % \item
1455 % Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt})
1456 % \end{Version}
1457 % \begin{Version}{1999/04/12 v1.0}
1458 % \item
1459 % Documentation added in dtx format.
1460 % \item
1461 % \hologo{eTeX} support added.
1462 % \end{Version}
1463 % \begin{Version}{1999/04/13 v1.1}
1464 % \item
1465 % Minor documentation change.
1466 % \item
1467 % First CTAN release.
1468 % \end{Version}
1469 % \begin{Version}{1999/06/26 v1.2}
1470 % \item
1471 % First generic code about \cmd{\ProvidesPackage} improved.
1472 % \item
1473 % Documentation: Installation part revised.
1474 % \end{Version}
1475 % \begin{Version}{2006/02/20 v1.3}
1476 % \item
1477 % Reload check (for \hologo{plainTeX})
1478 % \item
1479 % New DTX framework.
1480 % \item
1481 % LPPL 1.3
1482 % \end{Version}
1483 % \begin{Version}{2006/05/30 v1.4}
1484 % \item
1485 % \cs{newalphalph} added.
1486 % \end{Version}
1487 % \begin{Version}{2007/04/11 v1.5}
1488 % \item
1489 % Line ends sanitized.
1490 % \end{Version}
1491 % \begin{Version}{2007/09/09 v2.0}
1492 % \item
1493 % New implementation that uses package \cs{intcalc}.
1494 % This removes the dependency on \hologo{eTeX}.
1495 % \item
1496 % \cs{newalphalph} is extended to support new methods `wrap' and 'multi'.
1497 % \item
1498 % Documentation rewritten.
1499 % \end{Version}
1500 % \begin{Version}{2008/08/11 v2.1}
1501 % \item
1502 % Code is not changed.
1503 % \item
1504 % URLs updated from \texttt{www.dejanews.com}
1505 % to \texttt{groups.google.com}.
1506 % \end{Version}
1507 % \begin{Version}{2010/03/01 v2.2}
1508 % \item
1509 % Compatibility with \hologo{iniTeX}.
1510 % \end{Version}
1511 % \begin{Version}{2010/04/18 v2.3}
1512 % \item
1513 % Documentation fixes (Martin M\"unch).
1514 % \end{Version}
1515 % \begin{Version}{2011/05/13 v2.4}
1516 % \item
1517 % Documentation fixes (Jim Diamond) and using package
1518 % \xpackage{hologo} for the documentation.
1519 % \item
1520 % Catalogue file added.
1521 % \end{Version}
1522 % \begin{Version}{2016/05/16 v2.5}
1523 % \item
1524 % Documentation updates.
1525 % \end{Version}
1526 % \begin{Version}{2019/12/09 v2.6}
1527 % \item
1528 % Documentation updates.
1529 % \end{Version}
1530 % \end{History}
1531 %
1532 % \PrintIndex
1533 %
1534 % \Finale
1535 \endinput