%%
%% This is file `dozenal.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% dozenal.dtx  (with options: `package')
%% This is a generated file.
%% 
%% This document is copyright 2015 by Donald P. Goodman, and is
%% released publicly under the LaTeX Project Public License.  The
%% distribution and modification of this work is constrained by the
%% conditions of that license.  See
%% http://www.latex-project.org/lppl.txt
%% for the text of the license.  This document is released
%% under version 1.3 of that license, and this work may be distributed
%% or modified under the terms of that license or, at your option, any
%% later version.
%% 
%% This work has the LPPL maintenance status 'maintained'.
%% 
%% The Current Maintainer of this work is Donald P. Goodman
%% (dgoodmaniii@gmail.com).
%% 
%% This work consists of the files listed in dozenalfilelist.txt.

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{dozenal}[2015/01/29 v7.0 support for dozenal fonts]
\RequirePackage{fixltx2e}
\RequirePackage{xstring}
\RequirePackage{ifpdf}
\RequirePackage{mfirstuc}
\DeclareOption{nocounters}{%
\def\nocounters{}%
}%
\newif\iftypeone\typeonefalse
\DeclareOption{typeone}{\typeonetrue}
\ProcessOptions\relax
\iftypeone%
\ifpdf
\pdfmapfile{=dozenal.map}
\fi
\DeclareFontFamily{T1}{dozch}{}
\DeclareFontShape{T1}{dozch}{m}{n}{<-6> dozchars6
<7> dozchars7 <8> dozchars8 <9> dozchars9 <10-11>
dozchars10 <12-16> dozchars12 <17-> dozchars17  }{}
\DeclareFontShape{T1}{dozch}{b}{n}{<-> dozchb10 }{}
\DeclareFontShape{T1}{dozch}{bx}{n}{<-6> dozchbx6
<7> dozchbx7 <8> dozchbx8 <9> dozchbx9 <10-11>
dozchbx10 <12-> dozchbx12 }{}
\DeclareFontShape{T1}{dozch}{m}{sl}{<-8> dozchsl8
<9> dozchsl9 <10-11> dozchsl10 <12-> dozchsl12 }{}
\DeclareFontShape{T1}{dozch}{bx}{sl}{<-> dozchbxsl10 }{}
\DeclareFontShape{T1}{dozch}{m}{it}{<-7> dozchit7
<8> dozchit8 <9> dozchit9 <10-11> dozchit10
<12-> dozchit12 }{}
\DeclareFontShape{T1}{dozch}{bx}{it}{<-> dozchbxi10 }{}
\def\doz#1{{\fontfamily{dozch}\fontencoding{T1}\selectfont #1}}%
\DeclareSymbolFont{dozens}{T1}{dozch}{m}{n}
\else%
\DeclareFontFamily{OT1}{dozch}{}
\DeclareFontShape{OT1}{dozch}{m}{n}{<-6> dozchars6
<7> dozchars7 <8> dozchars8 <9> dozchars9 <10-11>
dozchars10 <12-16> dozchars12 <17-> dozchars17  }{}
\DeclareFontShape{OT1}{dozch}{b}{n}{<-> dozchb10 }{}
\DeclareFontShape{OT1}{dozch}{bx}{n}{<-6> dozchbx6
<7> dozchbx7 <8> dozchbx8 <9> dozchbx9 <10-11>
dozchbx10 <12-> dozchbx12 }{}
\DeclareFontShape{OT1}{dozch}{m}{sl}{<-8> dozchsl8
<9> dozchsl9 <10-11> dozchsl10 <12-> dozchsl12 }{}
\DeclareFontShape{OT1}{dozch}{bx}{sl}{<-> dozchbxsl10 }{}
\DeclareFontShape{OT1}{dozch}{m}{it}{<-7> dozchit7
<8> dozchit8 <9> dozchit9 <10-11> dozchit10
<12-> dozchit12 }{}
\DeclareFontShape{OT1}{dozch}{bx}{it}{<-> dozchbxi10 }{}
\def\doz#1{{\fontfamily{dozch}\fontencoding{OT1}\selectfont #1}}%
\DeclareSymbolFont{dozens}{OT1}{dozch}{m}{n}
\fi%
\newcommand\x{\TextOrMath{\protect\doz{{X}}}{\doz@X}}%
\newcommand\e{\TextOrMath{\protect\doz{{E}}}{\doz@E}}%
\DeclareMathSymbol{\doz@X}{\mathord}{dozens}{88}%
\DeclareMathSymbol{\doz@E}{\mathord}{dozens}{69}%
\newcommand\tally[1]{%
\doz{#1}%
}%
\def\basexii#1#2#3{\ifcase\numexpr(#1)\relax
0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or#2\or#3\else
\expandafter\basexii\expandafter{\number\numexpr((#1)-6)/12}{#2}{#3}\expandafter\basexii\expandafter{\number\numexpr(#1)-((#1)-6)/12*12}{#2}{#3}\fi}
\newcommand\dozens[1]{\basexii{#1}{\x}{\e}}
\newcount\doz@countchar
\def\doz@charcount#1{%
\StrLen{#1}[\doz@filler]%
\doz@countchar=\doz@filler%
}%
\newcount\doz@lfiller\doz@lfiller=-1%
\newcount\doz@total\doz@total=0%
\newcount\doz@loopi\doz@loopi=0%
\newcount\doz@multiplier\doz@multiplier=1%
\def\ninthofmany#1#2#3#4#5#6#7#8#9{#9\gobbletorelax}
\def\gobbletorelax#1\relax{}
\def\doz@CharAt#1#2{%
\expandafter\ninthofmany\romannumeral\numexpr(9000-\number#1000)#2\relax}
\def\doz@ten{X}%
\def\doz@elv{E}%
\def\doz@basex#1{%
\doz@total=0%
\doz@loopi=\doz@countchar%
\doz@multiplier=1%
\def\doz@wholenum{#1}%
\loop\ifnum\doz@loopi>0%
\def\doz@currchar{\doz@CharAt{\number\doz@loopi}{\doz@wholenum}}%
\if\doz@currchar\doz@ten%
\doz@lfiller=10%
\else\if\doz@currchar\doz@elv%
\doz@lfiller=11%
\else%
\doz@lfiller=\doz@currchar%
\fi\fi%
\multiply\doz@lfiller by\doz@multiplier%
\multiply\doz@multiplier by12%
\advance\doz@total by\doz@lfiller%
\advance\doz@loopi by-1%
\repeat%
\the\doz@total%
}%
\def\basex#1{%
\doz@charcount{#1}%
\doz@loopi=0%
\doz@basex{#1}%
\doz@multiplier=1%
\doz@total=0%
}%
\newcount\doz@modulus%
\def\doz@modulo#1#2{%
\doz@modulus=#1%
\divide\doz@modulus by#2%
\multiply\doz@modulus by#2%
\multiply\doz@modulus by-1%
\advance\doz@modulus by#1\relax%
}%
\newcount\doz@quotient%
\def\doz@quot#1#2{%
\doz@quotient=#1%
\divide\doz@quotient by#2%
}%
\newcount\doz@romct%
\newif\ifdoz@domancaps%
\def\doz@doman#1{%
\doz@romct=#1%
\doz@quot{\doz@romct}{1728}%
\loop\ifnum\doz@quotient>0%
\ifdoz@domancaps M\else m\fi%
\advance\doz@quotient by-1%
\advance\doz@romct by-1728%
\repeat
\ifnum\doz@romct>1440
\ifnum\doz@romct<1584
\ifdoz@domancaps CCM\else ccm\fi%
\advance\doz@romct by-1440
\else%\ifnum\doz@romct>1583
\ifdoz@domancaps CM\else cm\fi%
\advance\doz@romct by-1584
\fi
\fi
\ifnum\doz@romct>575%
\ifnum\doz@romct<719
\ifdoz@domancaps CCD\else ccd\fi%
\advance\doz@romct by-576
\else
\ifnum\doz@romct<864%
\ifdoz@domancaps CD\else cd\fi%
\advance\doz@romct by-720%
\fi
\fi
\else
\ifnum\doz@romct>719
\ifdoz@domancaps D\else d\fi%
\advance\doz@romct by-719%
\fi
\fi
\doz@quot{\doz@romct}{144}%
\loop\ifnum\doz@quotient>0%
\ifdoz@domancaps C\else c\fi%
\advance\doz@quotient by-1%
\advance\doz@romct by-144%
\repeat
\ifnum\doz@romct>119
\ifnum\doz@romct<132
\ifdoz@domancaps XXC\else xxc\fi%
\advance\doz@romct by-120
\else
\ifdoz@domancaps XC\else xc\fi%
\advance\doz@romct by-132
\fi
\fi
\ifnum\doz@romct>71
\ifdoz@domancaps L\else l\fi%
\advance\doz@romct by-72
\fi
\ifnum\doz@romct>47%
\ifnum\doz@romct>59%
\ifdoz@domancaps XL\else xl\fi%
\advance\doz@romct by-60%
\else
\ifdoz@domancaps XXL\else xxl\fi%
\advance\doz@romct by-48%
\fi
\fi
\doz@quot{\doz@romct}{12}%
\loop\ifnum\doz@quotient>0%
\ifdoz@domancaps X\else x\fi%
\advance\doz@quotient by-1%
\advance\doz@romct by-12%
\repeat
\doz@modulo{\doz@romct}{12}%
\ifnum\doz@modulus=10
\ifdoz@domancaps IIX\else iix\fi%
\advance\doz@romct by-10
\fi
\ifnum\doz@modulus=11
\ifdoz@domancaps IX\else ix\fi%
\advance\doz@romct by-11
\fi
\ifnum\doz@romct>5
\ifdoz@domancaps V\else v\fi%
\advance\doz@romct by-6
\fi
\ifnum\doz@romct>3%
\ifnum\doz@romct=4%
\ifdoz@domancaps IIV\else iiv\fi%
\advance\doz@romct by-4%
\else
\ifnum\doz@romct=5%
\ifdoz@domancaps IV\else iv\fi%
\advance\doz@romct by-5%
\fi
\ifnum\doz@romct=6%
\ifdoz@domancaps V\else v\fi%
\advance\doz@romct by-6
\fi
\fi
\fi
\doz@quot{\doz@romct}{1}%
\loop\ifnum\doz@quotient>0%
\ifdoz@domancaps I\else i\fi%
\advance\doz@quotient by-1%
\advance\doz@romct by-1%
\repeat
}
\protected\def\doman#1{%
\doz@domancapsfalse%
\doz@doman{#1}%
}%
\protected\def\Doman#1{%
\doz@domancapstrue%
\doz@doman{#1}%
}%
\@ifundefined{nocounters}{%
\@ifundefined{c@page}{}{%
\renewcommand\thepage{\basexii{\value{page}}{\x}{\e}}}
\@ifundefined{c@footnote}{}{%
\renewcommand\thefootnote{%
\basexii{\value{footnote}}{\x}{\e}}}
\@ifundefined{c@part}{}{%
\renewcommand\thepart{%
\basexii{\value{part}}{\x}{\e}}}
\@ifundefined{c@subparagraph}{}{%
\renewcommand\thesubparagraph{%
\basexii{\value{subparagraph}}{\x}{\e}}}
\@ifundefined{c@paragraph}{}{%
\renewcommand\theparagraph{%
\basexii{\value{paragraph}}{\x}{\e}}}
\@ifundefined{c@equation}{}{%
\renewcommand\theequation{%
\basexii{\value{equation}}{\x}{\e}}}
\@ifundefined{c@figure}{}{%
\renewcommand\thefigure{%
\basexii{\value{figure}}{\x}{\e}}}
\@ifundefined{c@table}{}{%
\renewcommand\thetable{%
\basexii{\value{table}}{\x}{\e}}}
\@ifundefined{c@table}{}{%
\renewcommand\thempfootnote{%
\basexii{\value{mpfootnote}}{\x}{\e}}}
\@ifundefined{c@enumi}{}{%
\renewcommand\theenumi{%
\basexii{\value{enumi}}{\x}{\e}}}
\@ifundefined{c@enumii}{}{%
\renewcommand\theenumii{%
\basexii{\value{enumii}}{\x}{\e}}}
\@ifundefined{c@enumiii}{}{%
\renewcommand\theenumiii{%
\basexii{\value{enumiii}}{\x}{\e}}}
\@ifundefined{c@enumiv}{}{%
\renewcommand\theenumiv{%
\basexii{\value{enumiv}}{\x}{\e}}}
\@ifundefined{c@chapter}{%
\renewcommand\thesection{%
\basexii{\value{section}}{\x}{\e}}
\renewcommand\thesubsection{%
\thesection.\basexii{\value{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{%
\thesubsection.\basexii{\value{subsubsection}}{\x}{\e}}
}{
\renewcommand\thechapter{%
\basexii{\value{chapter}}{\x}{\e}}
\renewcommand\thesection{%
\thechapter.\basexii{\value{section}}{\x}{\e}}
\renewcommand\thesubsection{%
\thesection.\basexii{\value{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{%
\thesubsection.\basexii{\value{subsubsection}}{\x}{\e}}
}
\@ifundefined{mainmatter}{}{%
\g@addto@macro\mainmatter{%
\@ifundefined{c@page}{}{%
\renewcommand\thepage{\basexii{\value{page}}{\x}{\e}}}
\@ifundefined{c@footnote}{}{%
\renewcommand\thefootnote{\basexii{\value{footnote}}{\x}{\e}}}
\@ifundefined{c@part}{}{%
\renewcommand\thepart{\basexii{\value{part}}{\x}{\e}}}
\@ifundefined{c@subparagraph}{}{%
\renewcommand\thesubparagraph{%
\basexii{\value{subparagraph}}{\x}{\e}}}
\@ifundefined{c@paragraph}{}{%
\renewcommand\theparagraph{%
\basexii{\value{paragraph}}{\x}{\e}}}
\@ifundefined{c@equation}{}{%
\renewcommand\theequation{%
\basexii{\value{equation}}{\x}{\e}}}
\@ifundefined{c@figure}{}{%
\renewcommand\thefigure{%
\basexii{\value{figure}}{\x}{\e}}}
\@ifundefined{c@table}{}{%
\renewcommand\thetable{%
\basexii{\value{table}}{\x}{\e}}}
\@ifundefined{c@table}{}{%
\renewcommand\thempfootnote{%
\basexii{\value{mpfootnote}}{\x}{\e}}}
\@ifundefined{c@enumi}{}{%
\renewcommand\theenumi{%
\basexii{\value{enumi}}{\x}{\e}}}
\@ifundefined{c@enumii}{}{%
\renewcommand\theenumii{%
\basexii{\value{enumii}}{\x}{\e}}}
\@ifundefined{c@enumiii}{}{%
\renewcommand\theenumiii{%
\basexii{\value{enumiii}}{\x}{\e}}}
\@ifundefined{c@enumiv}{}{%
\renewcommand\theenumiv{%
\basexii{\value{enumiv}}{\x}{\e}}}
\@ifundefined{c@chapter}{
\renewcommand\thesection{%
\basexii{\value{section}}{\x}{\e}}
\renewcommand\thesubsection{%
\thesection.\basexii{\value{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{%
\thesubsection.\basexii{\value{subsubsection}}{\x}{\e}}
}{
\renewcommand\thechapter{%
\basexii{\value{chapter}}{\x}{\e}}
\renewcommand\thesection{%
\thechapter.\basexii{\value{section}}{\x}{\e}}
\renewcommand\thesubsection{%
\thesection.\basexii{\value{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{%
\thesubsection.\basexii{\value{subsubsection}}{\x}{\e}}
} % end if it's defined
}
}
}{} % end redefinition of counters block
\def\dozrankoneword{unqua}
\def\dozranktwoword{biqua}
\def\dozrankthreeword{triqua}
\def\dozrankfourword{quadqua}
\def\dozrankfiveword{pentqua}
\def\dozranksixword{hexqua}
\def\dozranksevenword{septqua}
\def\dozrankeightword{octqua}
\def\dozranknineword{ennqua}
\def\dozranktenword{decqua}
\def\dozrankelvword{elvqua}
\newif\ifDOZcaps\DOZcapsfalse
\newif\ifDozcaps\Dozcapsfalse
\def\doz@expandloop#1{\doz@xloop#1\relax}
\def\doz@xloop#1{%
\ifx\relax#1\else%
\doz@numword#1%
\expandafter\doz@xloop\fi%
}
\def\printdozrankword{}
\def\doz@rankword{%
\ifnum\doz@countchar=12
\def\printdozrankword{\dozrankelvword}%
\fi
\ifnum\doz@countchar=11
\def\printdozrankword{\dozranktenword}%
\fi
\ifnum\doz@countchar=10
\def\printdozrankword{\dozranknineword}%
\fi
\ifnum\doz@countchar=9
\def\printdozrankword{\dozrankeightword}%
\fi
\ifnum\doz@countchar=8
\def\printdozrankword{\dozranksevenword}%
\fi
\ifnum\doz@countchar=7
\def\printdozrankword{\dozranksixword}%
\fi
\ifnum\doz@countchar=6
\def\printdozrankword{\dozrankfiveword}%
\fi
\ifnum\doz@countchar=5
\def\printdozrankword{\dozrankfourword}%
\fi
\ifnum\doz@countchar=4
\def\printdozrankword{\dozrankthreeword}%
\fi
\ifnum\doz@countchar=3
\def\printdozrankword{\dozranktwoword}%
\fi
\ifnum\doz@countchar=2
\def\printdozrankword{\dozrankoneword}%
\fi
\ifnum\doz@countchar=1
\def\printdozrankword{\relax}%
\fi
\advance\doz@countchar by-1
\ifDOZcaps
\edef\printdozrankword{\uppercase{\printdozrankword}}%
\fi
\ifDozcaps
\edef\printdozrankword{\capitalisewords{\printdozrankword}}%
\fi
\ifnum\doz@countchar>0
\ \printdozrankword\ %
\else
\printdozrankword%
\fi
}%
\def\doz@numword#1{%
\IfStrEq{#1}{0}{\def\doz@numberword{zero}}{}%
\IfStrEq{#1}{1}{\def\doz@numberword{one}}{}%
\IfStrEq{#1}{2}{\def\doz@numberword{two}}{}%
\IfStrEq{#1}{3}{\def\doz@numberword{three}}{}%
\IfStrEq{#1}{4}{\def\doz@numberword{four}}{}%
\IfStrEq{#1}{5}{\def\doz@numberword{five}}{}%
\IfStrEq{#1}{6}{\def\doz@numberword{six}}{}%
\IfStrEq{#1}{7}{\def\doz@numberword{seven}}{}%
\IfStrEq{#1}{8}{\def\doz@numberword{eight}}{}%
\IfStrEq{#1}{9}{\def\doz@numberword{nine}}{}%
\IfStrEq{#1}{X}{\def\doz@numberword{ten}}{}%
\IfStrEq{#1}{E}{\def\doz@numberword{eleven}}{}%
\ifDOZcaps
\edef\doz@numberword{\uppercase{\doz@numberword}}%
\fi
\ifDozcaps
\edef\doz@numberword{\makefirstuc{\doz@numberword}}%
\fi
\doz@numberword%
\doz@rankword%
}%
\def\doznumtoword#1{%
\edef\thenumber{\basexii{\value{#1}}{X}{E}}%
\expandafter\doz@charcount\expandafter{\thenumber}%
\expandafter\doz@expandloop\expandafter{\thenumber}%
\doz@countchar=0%
}%
\def\DOZnumtoword#1{%
\DOZcapstrue%
\doznumtoword{#1}%
\DOZcapsfalse%
}%
\def\Doznumtoword#1{%
\Dozcapstrue%
\doznumtoword{#1}%
\Dozcapsfalse%
}%
\AtBeginDocument{%
    \mathchardef\humphrey\mathcode`\;%
    \mathcode`\;="8000 %
}
{\catcode`;=\active
    \gdef;{\futurelet\@let@token\sm@rtsemi}
}
\def\sm@rtsemi{%
    \ifx\@let@token\@sptoken \else
    \ifx\@let@token\space \else
    \mathord\fi\fi \humphrey}
\endinput
%%
%% End of file `dozenal.sty'.
