diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
commit | 2607d53137ede06e9780342b225218743e100bb4 (patch) | |
tree | c6c88c805dd21a5bbb6ad6f26d3d53c517f4b866 /Master/texmf-dist/source/latex/oberdiek/alphalph.dtx | |
parent | fb0d58de45c0fc32bab09a839c186de46f75628e (diff) |
oberdiek update from tds zip (28aug06)
git-svn-id: svn://tug.org/texlive/trunk@2054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/alphalph.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/alphalph.dtx | 805 |
1 files changed, 571 insertions, 234 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/alphalph.dtx b/Master/texmf-dist/source/latex/oberdiek/alphalph.dtx index 8e6b906b92b..5d8b86d3719 100644 --- a/Master/texmf-dist/source/latex/oberdiek/alphalph.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/alphalph.dtx @@ -1,100 +1,187 @@ % \iffalse meta-comment % -% alphalph.dtx -% -% This file is part of the package `alphalph' for use with LaTeX2e. -% -% Function: Selecting shipout output pages. -% -% Copyright (C) 1999 Heiko Oberdiek. -% -% This program can be redistributed and/or modified -% under the terms of the LaTeX Project Public License -% distributed from CTAN archives in directory -% macros/latex/base/lppl.txt; either version 1 of -% the License, or (at your option) any later version. -% -% Please send error reports and suggestions for improvements to -% Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>. -% -% This is the desperate try to use only one identification string -% with the verion info: -%<*dtx> - \ProvidesFile{alphalph.dtx} -%</dtx> -%<package>\ifx\ProvidesPackage\UnDeFiNeD -%<package>\begingroup\def\x#1#2#3[#4]#5{\endgroup\csname fi\endcsname -%<package>\immediate\write-1{Package: #3 #4 }}\x -%<package>\else -%<package>\ProvidesPackage{alphalph}% -%<driver>\ProvidesFile{alphalph.drv} -% \fi -% \ProvidesFile{alphalph.dtx} - [1999/04/13 v1.1 Converting numbers to letters (HO)] -% -% \iffalse -%<package>\fi -% \fi -% \GetFileInfo{alphalph.dtx} -% -% \CheckSum{268} -% -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -% \iffalse +% Copyright (C) 1999, 2006 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or (at your option) any later +% version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This Current Maintainer of this work is Heiko Oberdiek. +% +% This work consists of the main source file alphalph.dtx +% and the derived files +% alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv. +% +% Distribution: +% CTAN:macros/latex/contrib/oberdiek/alphalph.dtx +% CTAN:macros/latex/contrib/oberdiek/alphalph.pdf +% +% Unpacking: +% (a) If alphalph.ins is present: +% tex alphalph.ins +% (b) Without alphalph.ins: +% tex alphalph.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{alphalph.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If alphalph.drv is present: +% latex alphalph.drv +% (b) Without alphalph.drv: +% latex alphalph.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex alphalph.dtx +% makeindex -s gind.ist alphalph.idx +% pdflatex alphalph.dtx +% makeindex -s gind.ist alphalph.idx +% pdflatex alphalph.dtx +% +% Installation: +% TDS:tex/generic/oberdiek/alphalph.sty +% TDS:doc/latex/oberdiek/alphalph.pdf +% TDS:source/latex/oberdiek/alphalph.dtx +% +%<*ignore> +\begingroup + \def\x{LaTeX2e} +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +%</ignore> +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: alphalph 2006/05/30 v1.4 Converting numbers to letters (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\preamble + +This is a generated file. + +Copyright (C) 1999, 2006 by Heiko Oberdiek <oberdiek@uni-freiburg.de> + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +This Current Maintainer of this work is Heiko Oberdiek. + +This work consists of the main source file alphalph.dtx +and the derived files + alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv. + +\endpreamble + +\generate{% + \file{alphalph.ins}{\from{alphalph.dtx}{install}}% + \file{alphalph.drv}{\from{alphalph.dtx}{driver}}% + \usedir{tex/generic/oberdiek}% + \file{alphalph.sty}{\from{alphalph.dtx}{package}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* alphalph.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `alphalph.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +%</install> +%<*ignore> +\fi +%</ignore> %<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{alphalph.drv}% + [2006/05/30 v1.4 Converting numbers to letters (HO)] \documentclass{ltxdoc} -\usepackage{holtxdoc,alphalph} +\usepackage{holtxdoc} +\usepackage{alphalph} \begin{document} - \DocInput{alphalph.dtx} + \DocInput{alphalph.dtx} \end{document} %</driver> % \fi % -% ^^A\DoNotIndex{\ifnum,\ifx,\ifcase} -% \DoNotIndex{\or,\else,\fi,\csname,\endcsname} -% \DoNotIndex{\def,\edef,\long,\begingroup,\endgroup} -% \DoNotIndex{\@,\\} -% \DoNotIndex{\the,\relax,\expandafter} -% -% \newenvironment{param}{^^A -% \newcommand{\entry}[1]{\meta{\###1}:&}^^A -% \begin{tabular}[t]{@{}l@{ }l@{}}^^A -% }{^^A -% \end{tabular}^^A -% } +% \CheckSum{393} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \GetFileInfo{alphalph.drv} +% +% \title{The \xpackage{alphalph} package} +% \date{2006/05/30 v1.4} +% \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % -% \SetupTitle{number,count,alph,TeX} % \maketitle % % \begin{abstract} -% The package provides the new expandable commands \cmd{\alphalph} -% and \cmd{\AlphAlph}. -% They are like \cmd{\number}, but the expansion consists of -% lowercase and uppercase letters respectively. +% The package provides the new expandable commands \cs{alphalph} +% and \cs{AlphAlph}. They are like \cs{number}, but the expansion +% consists of lowercase and uppercase letters respectively. % \end{abstract} % % \tableofcontents % +% \newenvironment{param}{^^A +% \newcommand{\entry}[1]{\meta{\###1}:&}^^A +% \begin{tabular}[t]{@{}l@{ }l@{}}^^A +% }{^^A +% \end{tabular}^^A +% } +% % \section{Usage} -% The package \Package{alphalph} can used with both plain\TeX\ +% The package \Package{alphalph} can be used with both \plainTeX\ % and \LaTeX: % \begin{description} -% \item[plain\TeX:] |\input alphalph.sty| +% \item[\plainTeX:] |\input alphalph.sty| % \item[\LaTeXe:] |\usepackage{alphalph}|\\ % There aren't any options. % \end{description} @@ -141,27 +228,84 @@ % \end{tabular} % \end{center} % -% \section{Installation} -% \InstallPackage -% Or for use with TeX: -% \begin{quote} -% \Verb{texmf/tex/generic/misc/alphalph.sty} -% \end{quote} -% \newcommand*{\ExtraDocumentation}{% -% For generating the documentation the \eTeX-extension is recommended, -% because it works faster with \Package{alphalph}. +% \subsubsection{New commands like \cs{alphalph}} +% \begin{description} +% \item[\cmd{\newalphalph}:]\DescribeMacro{\newalphalph} +% This macro defines a new command that acts like \cs{alphalph}. +% The use of \eTeX is required. +% The macro has three arguments: +% \begin{itemize} +% \item[\texttt{\#1}:] The command to be defined. +% \item[\texttt{\#2}:] A macro that converts a positive number +% to a symbol. +% \item[\texttt{\#3}:] The number of available symbols. +% \end{itemize} +% \end{description} +% +% Example: +%\begin{quote} +%\begin{verbatim} +%\newcommand*{\myvocals}[1]{% +% \ifcase#1\or A\or E\or I\or O\or U\fi +%} +%\newalphalph{\vocalsvocals}{\myvocals}{5} +%\end{verbatim} +%\end{quote} +% +% \StopEventually{ % } -% \InstallDocumentation -% -% \StopEventually{} % % \section{Implementation} % \subsection{Begin\texorpdfstring{ of package}{}} % \begin{macrocode} %<*package> % \end{macrocode} -% The package identification is done at the top of the |.dtx| file -% in order to use only one identification string. +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\begingroup + \expandafter\let\expandafter\x\csname ver@alphalph.sty\endcsname + \ifcase 0% + \ifx\x\relax % plain + \else + \ifx\x\empty % LaTeX + \else + 1% + \fi + \fi + \else + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{alphalph}{The package is already loaded}% + \endgroup + \expandafter\endinput + \fi +\endgroup +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\begingroup + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@alphalph.sty\endcsname +\ProvidesPackage{alphalph}% + [2006/05/30 v1.4 Converting numbers to letters (HO)] +% \end{macrocode} % % For unique command names this package uses |aa@| as prefix % for internal command names. Because we need |@| as a letter @@ -248,7 +392,7 @@ % methods: a fast and simple one that uses the \eTeX\ extension % and a method that is restricted to the standard \TeX\ means. % -% Now we distinguish between \TeX\ and \eTeX by checking +% Now we distinguish between \TeX\ and \eTeX\ by checking % whether \cmd{\numexpr} is defined or isn't. % Because the \TeX\ primitive \cmd{\csname} defines an % undefined command to be \cmd{\relax}, \cmd{\csname} @@ -263,14 +407,14 @@ % \cmd{\aa@make} catches the cases, if the number is zero or negative. % Then it expands to nothing like \cmd{\romannumeral}. % \begin{macrocode} -\def\aa@make#1#2{% - \ifnum#1<1 - \else - \@ReturnAfterFi{% - \aa@process1;#1;1..#2% - }% - \fi -} + \def\aa@make#1#2{% + \ifnum#1<1 + \else + \@ReturnAfterFi{% + \aa@process1;#1;1..#2% + }% + \fi + } % \end{macrocode} % \end{macro} % @@ -312,15 +456,15 @@ % Now \cmd{\aa@alphinc} makes its job and returns with its % argument |;#2;|. At last the first character |;| finishes \cmd{\number}. % \begin{macrocode} -\def\aa@process#1;#2;{% - \ifnum#1=#2 - \expandafter\aa@getresult - \else - \@ReturnAfterFi{% - \expandafter\aa@process\number\aa@inc{#1}\aa@alphinc{;#2;}% - }% - \fi -} + \def\aa@process#1;#2;{% + \ifnum#1=#2 + \expandafter\aa@getresult + \else + \@ReturnAfterFi{% + \expandafter\aa@process\number\aa@inc{#1}\aa@alphinc{;#2;}% + }% + \fi + } % \end{macrocode} % \end{macro} % @@ -342,9 +486,9 @@ % command |#2|. Then it % calls \cmd{\aa@@getresult} with its arguments. % \begin{macrocode} -\def\aa@getresult#1..#2{% - \aa@@getresult!#2#1..% -} + \def\aa@getresult#1..#2{% + \aa@@getresult!#2#1..% + } % \end{macrocode} % \end{macro} % @@ -357,19 +501,19 @@ % If the digit |#3| is empty, the end of the digit form is reached % and the process stops and the ready letter number is output. % \begin{macrocode} -\def\aa@@getresult#1!#2#3.{% - \ifx\\#3\\% - \@ReturnAfterElseFi{#1}% ready - \else - \@ReturnAfterFi{% - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \aa@@getresult - \expandafter\expandafter\expandafter\expandafter - #2{#3}#1!#2% - }% - \fi -} + \def\aa@@getresult#1!#2#3.{% + \ifx\\#3\\% + \@ReturnAfterElseFi{#1}% ready + \else + \@ReturnAfterFi{% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \aa@@getresult + \expandafter\expandafter\expandafter\expandafter + #2{#3}#1!#2% + }% + \fi + } % \end{macrocode} % \end{macro} % @@ -383,20 +527,20 @@ % after |9| is neccessary.) % \begin{macrocode} % \aa@inc adds one to its argument #1. -\def\aa@inc#1{% - \ifnum#1<9 - \aa@nextdigit{#1}% - \else - \aa@reverse#1!!% - \fi -} + \def\aa@inc#1{% + \ifnum#1<9 + \aa@nextdigit{#1}% + \else + \aa@reverse#1!!% + \fi + } % \end{macrocode} % \end{macro} % \begin{macro}{\aa@nextdigit} % \cmd{\aa@nextdigit} increments the digit |#1|. The result % is a digit again. \cmd{\aa@addone} works off the case ``9+1''. % \begin{macrocode} -\def\aa@nextdigit#1{\ifcase#1 1\or2\or3\or4\or5\or6\or7\or8\or9\fi} + \def\aa@nextdigit#1{\ifcase#1 1\or2\or3\or4\or5\or6\or7\or8\or9\fi} % \end{macrocode} % \end{macro} % \begin{macro}{\aa@reverse} @@ -406,15 +550,15 @@ % reverses the order of the digits and calls \cmd{\aa@addone}, % if it is ready. % \begin{macrocode} -\def\aa@reverse#1#2!#3!{% - \ifx\\#2\\% - \aa@addone#1#3!!% - \else - \@ReturnAfterFi{% - \aa@reverse#2!#1#3!% - }% - \fi -} + \def\aa@reverse#1#2!#3!{% + \ifx\\#2\\% + \aa@addone#1#3!!% + \else + \@ReturnAfterFi{% + \aa@reverse#2!#1#3!% + }% + \fi + } % \end{macrocode} % \end{macro} % \begin{macro}{\aa@addone} @@ -424,21 +568,21 @@ % Already incremented digits are stored in |#3| in reversed order % to take some work of \cmd{\aa@lastreverse}. % \begin{macrocode} -\def\aa@addone#1#2!#3!{% - \ifnum#1<9 - \expandafter\aa@lastreverse\number\aa@nextdigit#1 #2!#3!% - \else - \@ReturnAfterFi{% - \ifx\\#2\\% - 10#3% - \else - \@ReturnAfterFi{% - \aa@addone#2!0#3!% - }% - \fi - }% - \fi -} + \def\aa@addone#1#2!#3!{% + \ifnum#1<9 + \expandafter\aa@lastreverse\number\aa@nextdigit#1 #2!#3!% + \else + \@ReturnAfterFi{% + \ifx\\#2\\% + 10#3% + \else + \@ReturnAfterFi{% + \aa@addone#2!0#3!% + }% + \fi + }% + \fi + } % \end{macrocode} % \end{macro} % \begin{macro}{\aa@lastreverse} @@ -446,15 +590,15 @@ % perform the addition in \cmd{\aa@addone}. Now we have to return % to the original order that is done by \cmd{\aa@lastreverse}. % \begin{macrocode} -\def\aa@lastreverse#1#2!#3!{% - \ifx\\#2\\% - #1#3% - \else - \@ReturnAfterFi{% - \aa@lastreverse#2!#1#3!% - }% - \fi -} + \def\aa@lastreverse#1#2!#3!{% + \ifx\\#2\\% + #1#3% + \else + \@ReturnAfterFi{% + \aa@lastreverse#2!#1#3!% + }% + \fi + } % \end{macrocode} % \end{macro} % @@ -468,26 +612,26 @@ % |#2| contains the next digit in the range of 1 until 26. % An empty |#2| marks the end of the number. % \begin{macrocode} -\def\aa@alphinc#1#2.{% - \ifx\\#2\\% - \@ReturnAfterElseFi{% - #11..% ready - }% - \else - \@ReturnAfterFi{% - \ifnum#2<26 - \@ReturnAfterElseFi{% - \expandafter\aa@alphinclast\expandafter - {\number\aa@inc{#2}}{#1}% - }% - \else - \@ReturnAfterFi{% - \aa@alphinc{#11.}% - }% - \fi - }% - \fi -} + \def\aa@alphinc#1#2.{% + \ifx\\#2\\% + \@ReturnAfterElseFi{% + #11..% ready + }% + \else + \@ReturnAfterFi{% + \ifnum#2<26 + \@ReturnAfterElseFi{% + \expandafter\aa@alphinclast\expandafter + {\number\aa@inc{#2}}{#1}% + }% + \else + \@ReturnAfterFi{% + \aa@alphinc{#11.}% + }% + \fi + }% + \fi + } % \end{macrocode} % \end{macro} % \begin{macro}{\aa@alphinclast} @@ -495,7 +639,16 @@ % several tokens (e.g. |;100;|), we cannot jump over it via % \cmd{\expandafter} in \cmd{\aa@alphinc}. % \begin{macrocode} -\def\aa@alphinclast#1#2{#2#1.} + \def\aa@alphinclast#1#2{#2#1.} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newalphalph} +% \begin{macrocode} + \newcommand*{\newalphalph}[3]{% + \PackageError{alphalph}{% + \string\newalphalph\space requires e-TeX% + }\@ehc % \end{macrocode} % \end{macro} % @@ -509,14 +662,14 @@ % \cmd{\aa@make} catches the cases, if the number is zero or negative. % Then it expands to nothing like \cmd{\romannumeral}. % \begin{macrocode} -\def\aa@make#1#2{% - \ifnum#1<1 - \else - \@ReturnAfterFi{% - \aa@eprocess#1;#2% - }% - \fi -} + \def\aa@make#1#2{% + \ifnum#1<1 % + \else + \@ReturnAfterFi{% + \aa@eprocess#1;#2% + }% + \fi + }% % \end{macrocode} % \end{macro} % @@ -531,20 +684,92 @@ % The only feature of \eTeX\ we use the new primitive \cmd{\numexpr}. % It provides expandible mathematical calculations. % \begin{macrocode} -\def\aa@eprocess#1;#2{% - \ifnum#1<27 - \@ReturnAfterElseFi{% - #2{#1}% - }% - \else - \@ReturnAfterFi{% - \expandafter\aa@eprocess\number\numexpr(#1-14)/26% + \def\aa@eprocess#1;#2{% + \ifnum#1<27 + \@ReturnAfterElseFi{% + #2{#1}% + }% + \else + \@ReturnAfterFi{% + \expandafter\aa@eprocess\number\numexpr(#1-14)/26% + \expandafter\expandafter\expandafter;% + \expandafter\expandafter\expandafter#2% + #2{\numexpr#1-((#1-14)/26)*26}% + }% + \fi + }% +% \end{macrocode} +% \end{macro} +% +% \subsection{Generic version} +% +% \begin{macro}{\aa@gen@callmake} +% See macro \cs{aa@callmake}. Argument |#3| holds the +% number of available symbols. +% \begin{macrocode} + \def\aa@gen@callmake#1#2#3{% + \expandafter\aa@gen@make\expandafter{\number#3}#1{#2}% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\aa@gen@make} +% See macro \cs{aa@make}. Argument |#3| holds the number of +% available symbols. +% \begin{macrocode} + \def\aa@gen@make#1#2#3{% + \ifnum#1<1 % + \else + \@ReturnAfterFi{% + \aa@gen@eprocess{#3}#1;#2% + }% + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\aa@gen@eprocess} +% See macro \cs{aa@eprocess}. Argument |#1| holds the number of +% available symbols. +% \begin{macrocode} + \def\aa@gen@eprocess#1#2;#3{% + \ifnum#2>#1 % + \@ReturnAfterElseFi{% + \expandafter\aa@gen@eprocess\expandafter{% + \number#1\expandafter + }% + \number\numexpr(#2-(\aa@half{#1}+1))/#1% \expandafter\expandafter\expandafter;% - \expandafter\expandafter\expandafter#2% - #2{\numexpr#1-((#1-14)/26)*26}% + \expandafter\expandafter\expandafter#3% + #3{\numexpr#2-((#2-(\aa@half{#1}+1))/#1)*#1\relax}% + }% + \else + \@ReturnAfterFi{% + #3{#2}% + }% + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\aa@half} +% Macro \cs{aa@half} implements integer division by two +% without rounding. +% \begin{macrocode} + \def\aa@half#1{% + \number\dimexpr.5\dimexpr #1sp\relax\relax + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\newalphalph} +% New macros are defined by \cs{newalphalph} that act like +% \cs{alphalph}. The macro to be defined is |#1|. Argument |#2| +% contains the macro that converts a number to a symbol and +% argument |#3| holds the number of available symbols. +% \begin{macrocode} + \newcommand*{\newalphalph}[3]{% + \newcommand*{#1}{}% + \edef#1{% + \noexpand\aa@gen@callmake\noexpand#2{\number\numexpr#3}% }% - \fi -} + }% % \end{macrocode} % \end{macro} % @@ -561,34 +786,146 @@ % \begin{macrocode} %</package> % \end{macrocode} +% \section{Installation} % -% \StartHistory -% \HistVersion{1999/03/19 v0.1} -% \begin{itemize} -% \item The first version was built as a response to a -% \URL{question}^^A -% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=455791936}^^A -% of \Email[Will Douglas]{william.douglas@wolfson.ox.ac.uk} -% and the -% \URL{request}^^A -% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=456358639}^^A -% of \Email[Donald Arsenau]{asnd@reg.triumf.ca}, -% published in the newsgroup -% \href{news:comp.text.tex}{comp.text.tex}: -% \URL{``Re: alph counters \textgreater\ 26''}^^A -% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=456485421} -% \item Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt}) -% \end{itemize} -% \HistVersion{1999/04/12 v1.0} -% \begin{itemize} -% \item Documentation added in dtx format. -% \item \eTeX\ support added. -% \end{itemize} -% \HistVersion{1999/04/13 v1.1} -% \begin{itemize} -% \item Minor documentation change. -% \item First CTAN release. -% \end{itemize} +% \paragraph{CTAN.} This package is available on +% CTAN\footnote{\url{ftp://ftp.ctan.org/tex-archive/}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/oberdiek/alphalph.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/oberdiek/alphalph.pdf}] Documentation. +% \end{description} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex alphalph.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \sbox0{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{$\quad\rightarrow\quad$}>{\ttfamily}l@{}} +% alphalph.sty & tex/generic/oberdiek/alphalph.sty\\ +% alphalph.pdf & doc/latex/oberdiek/alphalph.pdf\\ +% alphalph.dtx & source/latex/oberdiek/alphalph.dtx\\ +% \end{tabular}^^A +% }% +% \ifdim\wd0>\linewidth +% \mbox{}\nobreak\hskip0pt minus\leftmargin +% \usebox0 +% \nobreak\hskip0pt minus\rightmargin +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \paragraph{Refresh file databases.} If your \TeX~distribution +% (\teTeX, \mikTeX, \dots) rely on file databases, you must refresh +% these. For example, \teTeX\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Attached source.} +% +% The PDF documentation on CTAN also includes the +% \xfile{.dtx} source file. It can be extracted by +% AcrobatReader 6 or higher. Another option is \textsf{pdftk}, +% e.g. unpack the file into the current directory: +% \begin{quote} +% \verb|pdftk alphalph.pdf unpack_files output .| +% \end{quote} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intension: +% \begin{quote} +% \verb|latex \install=y\input{alphalph.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex alphalph.dtx +%makeindex -s gind.ist alphalph.idx +%pdflatex alphalph.dtx +%makeindex -s gind.ist alphalph.idx +%pdflatex alphalph.dtx +%\end{verbatim} +% \end{quote} +% +% \begin{History} +% \begin{Version}{1999/03/19 v0.1} +% \item +% The first version was built as a response to a +% \URL{question}^^A +% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=455791936}^^A +% of \NameEmail{Will Douglas}{william.douglas@wolfson.ox.ac.uk} +% and the +% \URL{request}^^A +% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=456358639}^^A +% of \NameEmail{Donald Arsenau}{asnd@reg.triumf.ca}, +% published in the newsgroup +% \href{news:comp.text.tex}{comp.text.tex}: +% \URL{``Re: alph counters \textgreater\ 26''}^^A +% {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=456485421} +% \item +% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt}) +% \end{Version} +% \begin{Version}{1999/04/12 v1.0} +% \item +% Documentation added in dtx format. +% \item +% \eTeX\ support added. +% \end{Version} +% \begin{Version}{1999/04/13 v1.1} +% \item +% Minor documentation change. +% \item +% First CTAN release. +% \end{Version} +% \begin{Version}{1999/06/26 v1.2} +% \item +% First generic code about \cmd{\ProvidesPackage} improved. +% \item +% Documentation: Installation part revised. +% \end{Version} +% \begin{Version}{2006/02/20 v1.3} +% \item +% Reload check (for \plainTeX) +% \item +% New DTX framework. +% \item +% LPPL 1.3 +% \end{Version} +% \begin{Version}{2006/05/30 v1.4} +% \item +% \cs{newalphalph} added. +% \end{Version} +% \end{History} % % \PrintIndex % |