diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/xistercian/xistercian.dtx | 107 |
1 files changed, 53 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/xistercian/xistercian.dtx b/Master/texmf-dist/source/latex/xistercian/xistercian.dtx index 934b4fe0448..2398ac4dbeb 100644 --- a/Master/texmf-dist/source/latex/xistercian/xistercian.dtx +++ b/Master/texmf-dist/source/latex/xistercian/xistercian.dtx @@ -55,7 +55,7 @@ and the derived files xistercian.pdf \fi % \IfFileExists{xistercian.sty}{\RequirePackage[debug]{xistercian}}{} -\ProvidesFile{xistercian.dtx}[2021-07-17 v1.0.0 Cistercian numerals in LaTeX] +\ProvidesFile{xistercian.dtx}[2021-11-23 v1.1 Cistercian numerals in LaTeX] \PassOptionsToPackage{full}{textcomp} \documentclass{l3doc} \RequirePackage[fulloldstyle,nott]{kpfonts} @@ -131,14 +131,14 @@ and the derived files xistercian.pdf \noalign{\vskip1ex} } \AddToHook{bfseries} - {\cisterciansetup{sv=.27ex,sdd=.27ex,sh=.12ex,sdu=.12ex,wd=.5em}} + {\cisterciansetup{sv=.27ex,sdd=.27ex,sh=.12ex,sdu=.12ex,wd=.625em}} \AddToHook{mdseries}{\myrestoredefaults} \cisterciansetup{redraw+=series} \ExplSyntaxOff \begin{document} \title{The \pkg{xistercian} package} \author{Jonathan P. Spratte\thanks{\protect\randomize{jspratte@yahoo.de}}} - \date{2021-07-17 v1.0} + \date{2021-11-23 v1.1} \DocInput{xistercian.dtx} \end{document} %</driver>^^A=<< @@ -245,9 +245,8 @@ and the derived files xistercian.pdf % \end{syntax} % Prints the \meta{integer} as a Cistercian numeral. The \meta{integer} has to % be provided as a string containing only digits and optionally a single -% leading~|-| (spaces are ignored). This can handle integers of almost -% arbitrary size (well, an integer with more than $2147483647$ places will be -% an issue). +% leading~|-| (spaces are ignored). This can handle integers of arbitrary +% size. % \end{function} % % \begin{function}{\cisterciannumE} @@ -290,7 +289,7 @@ and the derived files xistercian.pdf % \end{function} % For example, the key |horizontal| is equivalently defined to % \begin{verbatim} -% \cistercianstyle{horizontal}{o=h,wd=0.62em,ht=1ex} +% \cistercianstyle{horizontal}{o=h,wd=0.775em,ht=1.13ex} % \end{verbatim} % % @@ -483,14 +482,15 @@ and the derived files xistercian.pdf % \begin{syntax} % horizontal % \end{syntax} -% Same as setting |orientation = horizontal, width = 0.62em, height = 1ex|. +% Same as setting +% |orientation = horizontal, width = 0.775em, height = 1.13ex|. % \end{function} % % \begin{function}{vertical} % \begin{syntax} % vertical % \end{syntax} -% Same as setting |orientation = vertical, width = 0.4em, height = 1.55ex|. +% Same as setting |orientation = vertical, width = 0.5em, height = 1.55ex|. % \end{function} % % \begin{function}{alternate-5,5} @@ -612,12 +612,12 @@ and the derived files xistercian.pdf % \begin{verbatim} % \AddToHook{bfseries} % {% -% \cisterciansetup{sv=.27ex,sdd=.27ex,sh=.15ex,sdu=.15ex,wd=.5em}% +% \cisterciansetup{sv=.27ex,sdd=.27ex,sh=.15ex,sdu=.15ex,wd=.625em}% % \cistercianredrawlazy % } % \AddToHook{mdseries} % {% -% \cisterciansetup{sv=.18ex,sdd=.18ex,sh=.1ex,sdu=.1ex,wd=.4em}% +% \cisterciansetup{sv=.18ex,sdd=.18ex,sh=.1ex,sdu=.1ex,wd=.5em}% % \cistercianredrawlazy % } % This results in \cisterciannum{2} different \enquote{series}.\par @@ -636,9 +636,9 @@ and the derived files xistercian.pdf % determine when to redraw: % \begin{verbatim} % \AddToHook{bfseries} -% {\cisterciansetup{sv=.27ex,sdd=.27ex,sh=.15ex,sdu=.15ex,wd=.5em}} +% {\cisterciansetup{sv=.27ex,sdd=.27ex,sh=.15ex,sdu=.15ex,wd=.625em}} % \AddToHook{mdseries} -% {\cisterciansetup{sv=.18ex,sdd=.18ex,sh=.1ex,sdu=.1ex,wd=.4em}} +% {\cisterciansetup{sv=.18ex,sdd=.18ex,sh=.1ex,sdu=.1ex,wd=.5em}} % \cisterciansetup{redraw+=series} % \end{verbatim} % @@ -663,7 +663,7 @@ and the derived files xistercian.pdf \newcommand*\xister@tv{.18ex} \newcommand*\xister@tdu{.1ex} \newcommand*\xister@tdd{.18ex} -\newcommand*\xister@x{.4em} +\newcommand*\xister@x{.5em} \newcommand*\xister@y{1.55ex} \newcommand*\xister@bx{1.2} \newcommand*\xister@by{} @@ -746,7 +746,7 @@ and the derived files xistercian.pdf % \xister@build@h,\xister@build@horizontal, % \xister@build@v,\xister@build@vertical % } -% First we set the length registers to the correct size, than we draw the +% First we set the length registers to the correct size, then we draw the % glyphs batch wise. We have to flip the $x$-direction for the tenths and % thousands, and the $y$-direction for the hundreds and thousands. The macro % |\xister@sgn| is used to set the baseline in the correct direction. We @@ -866,7 +866,7 @@ and the derived files xistercian.pdf }% }% } -\expandafter\xister@tmp\csname\string\color@.\endcsname{color} +\expandafter\xister@tmp\csname\@backslashchar color@.\endcsname{color} \xister@tmp\f@encoding{encoding} \xister@tmp\f@family {family} \xister@tmp\f@series {series} @@ -961,13 +961,13 @@ and the derived files xistercian.pdf \protected\ekvdefNoVal{xister}{horizontal} {% \let\xister@build\xister@build@horizontal - \def\xister@x{.62em}% - \def\xister@y{1ex}% + \def\xister@x{.775em}% + \def\xister@y{1.13ex}% } \protected\ekvdefNoVal{xister}{vertical} {% \let\xister@build\xister@build@vertical - \def\xister@x{.4em}% + \def\xister@x{.5em}% \def\xister@y{1.55ex}% } % \end{macrocode} @@ -1108,32 +1108,23 @@ and the derived files xistercian.pdf \def\xister@gobbletoat#1@{} \def\xister@gobbletozero#10{} \def\xister@gobblecopy0\rlap#1{} -\def\xister@done#1\xister@symbols@{} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[internal]{\xister@count,\xister@count@done} -% A simple loop to count tokens. The loop delimiter is a single |@|. Should be -% used after |\numexpr|. -% \begin{macrocode} -\def\xister@count#1{\xister@gobbletoat#1\xister@count@done @+1\xister@count} -\def\xister@count@done @+1\xister@count{\relax @} +\def\xister@done#1\xister@symbols{} % \end{macrocode} % \end{macro} % % \begin{macro}[internal]{\xister@texorpdf} % \begin{macrocode} \let\xister@texorpdf\@firstoftwo -\AddToHook{package/after/hyperref} +\AddToHook{package/hyperref/after} {% \ifdefined\texorpdfstring - \let\xister@texorpdf\texorpdfstring + \def\xister@texorpdf{\texorpdfstring}% \fi } \AddToHook{begindocument/before} {% \ifdefined\texorpdfstring - \let\xister@texorpdf\texorpdfstring + \def\xister@texorpdf{\texorpdfstring}% \fi } % \end{macrocode} @@ -1142,7 +1133,7 @@ and the derived files xistercian.pdf % % \subsubsection{Input Parsing} % -% \begin{macro}[internal]{\xister@a,\xister@b,\xister@c} +% \begin{macro}[internal]{\xister@a,\xister@b,\xister@c,\xister@d} % First we have to make sure that we're in horizontal mode, else the |\rlap|s % used to insert the glyphs will create havoc. We also need to ensure that the % boxes contain the correct glyphs according to the current size and colour. @@ -1157,29 +1148,44 @@ and the derived files xistercian.pdf \else\expandafter\xister@b\expandafter#1\fi } % \end{macrocode} -% Next we count the number of decimal digits in the number we want to print, -% take that modulo $4$ (that's what's |4*((#1-2)/4)| is doing, thanks to Heiko -% Oberdiek and the code in \pkg{expl3}), and use the correct symbol creating -% macro. The |@@@@| serves as the end marker since each step (except the -% first) will grab four digits. +% Next we check whether the remaining number is empty. If that is the case we +% use |\the\numexpr\relax| to throw a missing number error and produce just a +% zero stem. Else we do a dry run over the input number to see how many +% leading zeros we must pad to get blocks of four. The two blocks of |@@@@| +% serve as end markers since each step of both \cs{xister@c} and +% \cs{xister@symbols} will grab four digits. % \begin{macrocode} \def\xister@b#1@% - {\expandafter\xister@c\the\numexpr\xister@count#1@#1@@@@} -\def\xister@c#1@% - {\csname xister@symbols@\romannumeral\numexpr#1-4*((#1-2)/4)\relax\endcsname} + {% + \if\relax\detokenize{#1}\relax + \expandafter\xister@gobbletozero\the\numexpr\relax + \xister@symbols0000@@@@% + \expandafter\@gobbletwo + \fi + \@firstofone{\xister@c#1@@@@\relax#1@@@@}% + } +\def\xister@c#1#2#3#4% + {% + \xister@gobbletoat + #1\xister@d{}% + #2\xister@d{000}% + #3\xister@d{00}% + #4\xister@d0% + @\xister@c + } +\def\xister@d#1#2@\xister@c#3\relax{\xister@symbols#1} % \end{macrocode} % \end{macro} % -% \begin{macro}[internal] -% {\xister@symbols@,\xister@symbols@i,\xister@symbols@ii,\xister@symbols@iii} +% \begin{macro}[internal]{\xister@symbols} % When this loop is done all arguments will be |@|, but we only check the % first here. We generate the symbols by overlaying up to five boxes, one for % each decade plus the zero stem. Each digit might be skipped if it is $0$. % Next grab the next four digits. % \begin{macrocode} -\def\xister@symbols@#1% +\def\xister@symbols#1% {% - \protected\def\xister@symbols@##1##2##3##4% + \protected\def\xister@symbols##1##2##3##4% {% \xister@gobbletoat##1\xister@done @% \xister@gobbletozero##1\xister@gobblecopy0% @@ -1191,17 +1197,10 @@ and the derived files xistercian.pdf \xister@gobbletozero##4\xister@gobblecopy0% \rlap{\copy\csname xister@digitbox@##4\endcsname}% \copy#1% - \xister@symbols@ + \xister@symbols }% } -\expandafter\xister@symbols@\csname xister@digitbox@0\endcsname -% \end{macrocode} -% If there are less than four decimal digits inside the first Cistercian -% numeral we provide enough zeros to fill up the remainder. -% \begin{macrocode} -\def\xister@symbols@i{\xister@symbols@000} -\def\xister@symbols@ii{\xister@symbols@00} -\def\xister@symbols@iii{\xister@symbols@0} +\expandafter\xister@symbols\csname xister@digitbox@0\endcsname % \end{macrocode} % \end{macro} % |