summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dozenal
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/dozenal')
-rw-r--r--Master/texmf-dist/tex/latex/dozenal/dozenal.sty76
1 files changed, 62 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/dozenal/dozenal.sty b/Master/texmf-dist/tex/latex/dozenal/dozenal.sty
index 0f8a2caedbd..1bdb6e114f6 100644
--- a/Master/texmf-dist/tex/latex/dozenal/dozenal.sty
+++ b/Master/texmf-dist/tex/latex/dozenal/dozenal.sty
@@ -93,16 +93,16 @@
% \cs{basexii}\marg{number}\marg{ten symbol}\marg{eleven symbol}
% \end{quote}
% What the above means is that the command is |\basexii| and
-% it takes three mandatory arguments: first, the symbol
-% that should be used for ten; second, the symbol that
-% should be used for eleven; and third, the number that
-% should be converted into dozenal using those two symbols.
-% This number should be positive and whole; that is, it
-% should be zero or higher, and it should not contain a
-% fractional part. \TeX\ is a typesetting program, after
-% all; if you want a robust decimal to dozenal converter,
-% there are many options that any dozenalists caring enough
-% to use this package will already know about.
+% it takes three mandatory arguments: first, the number to
+% be converted into dozenal; second, the symbol that should
+% be used for ten; and third, the symbol that should be used
+% for eleven. This number should be positive and whole;
+% that is, it should be zero or higher, and it should not
+% contain a fractional part. \TeX\ is a typesetting
+% program, after all; if you want a robust decimal to
+% dozenal converter, there are many options that any
+% dozenalists caring enough to use this package will already
+% know about.
%
% This |\basexii| algorithm was produced by David Kastrup,
% well known and admired in the \TeX\ world for his many
@@ -166,7 +166,8 @@
% \begin{macrocode}
\ProvidesPackage{dozenal}
% \end{macrocode}
-% Now we need to make sure that we have fixltx2e loaded.
+% Now we need to make sure that we have fixltx2e loaded, so
+% that the |\TextorMath| magic will work.
% \begin{macrocode}
\RequirePackage{fixltx2e}
% \end{macrocode}
@@ -176,6 +177,8 @@
% decent use for it except in packages and preambles; it is
% then used to define |\x| and |\e|, which provide the ten
% and eleven symbols for all the counter redefinitions.
+% This includes definitions for both T1 and OT1 encodings,
+% so it will work with either.
% \begin{macrocode}
\DeclareFontFamily{OT1}{dozch}{}
\DeclareFontShape{OT1}{dozch}{m}{n}{<-7> dozchars6 <7> dozchars7 <8> dozchars8 <9> dozchars9 <10-11> dozchars10 <12-16> dozchars12 <17-> dozchars17 }{}
@@ -185,6 +188,14 @@
\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 }{}
+\DeclareFontFamily{T1}{dozch}{}
+\DeclareFontShape{T1}{dozch}{m}{n}{<-7> 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 }{}
\newcommand\doz[1]{{\fontfamily{dozch}\selectfont #1}}
\newcommand\x{\TextOrMath{\protect\doz{{X}}}{\X}}%
\newcommand\e{\TextOrMath{\protect\doz{{E}}}{\E}}%
@@ -210,9 +221,45 @@
% covers only those counters included in the basic \LaTeX\
% document classes, however, so if you've written your own,
% you'll need to redefine them yourself.
+%
+% This first bit ensures that the counters are redefined
+% even if the command |\mainmatter| is not defined. We have
+% to do this outside of the |\g@addto@macro| below;
+% otherwise, in documents where |\mainmatter| is defined but
+% not used, the counters will not be redefined. This way,
+% they're redefined in all cases.
+% \begin{macrocode}
+\@ifundefined{c@page}{}{\renewcommand\thepage{\basexii{\arabic{page}}{\x}{\e}}}
+\@ifundefined{c@footnote}{}{\renewcommand\thefootnote{\basexii{\arabic{footnote}}{\x}{\e}}}
+\@ifundefined{c@part}{}{\renewcommand\thepart{\basexii{\arabic{part}}{\x}{\e}}}
+\@ifundefined{c@subparagraph}{}{\renewcommand\thesubparagraph{\basexii{\arabic{subparagraph}}{\x}{\e}}}
+\@ifundefined{c@paragraph}{}{\renewcommand\theparagraph{\basexii{\arabic{paragraph}}{\x}{\e}}}
+\@ifundefined{c@equation}{}{\renewcommand\theequation{\basexii{\arabic{equation}}{\x}{\e}}}
+\@ifundefined{c@figure}{}{\renewcommand\thefigure{\basexii{\arabic{figure}}{\x}{\e}}}
+\@ifundefined{c@table}{}{\renewcommand\thetable{\basexii{\arabic{table}}{\x}{\e}}}
+\@ifundefined{c@table}{}{\renewcommand\thempfootnote{\basexii{\arabic{mpfootnote}}{\x}{\e}}}
+\@ifundefined{c@enumi}{}{\renewcommand\theenumi{\basexii{\arabic{enumi}}{\x}{\e}}}
+\@ifundefined{c@enumii}{}{\renewcommand\theenumii{\basexii{\arabic{enumii}}{\x}{\e}}}
+\@ifundefined{c@enumiii}{}{\renewcommand\theenumiii{\basexii{\arabic{enumiii}}{\x}{\e}}}
+\@ifundefined{c@enumiv}{}{\renewcommand\theenumiv{\basexii{\arabic{enumiv}}{\x}{\e}}}
+\@ifundefined{c@chapter}{% if it's undefined
+\renewcommand\thesection{\basexii{\arabic{section}}{\x}{\e}}
+\renewcommand\thesubsection{\thesection.\basexii{\arabic{subsection}}{\x}{\e}}
+\renewcommand\thesubsubsection{\thesubsection.\basexii{\arabic{subsubsection}}{\x}{\e}}
+} % end undefined
+{%if it's defined
+\renewcommand\thechapter{\basexii{\arabic{chapter}}{\x}{\e}}
+\renewcommand\thesection{\thechapter.\basexii{\arabic{section}}{\x}{\e}}
+\renewcommand\thesubsection{\thesection.\basexii{\arabic{subsection}}{\x}{\e}}
+\renewcommand\thesubsubsection{\thesubsection.\basexii{\arabic{subsubsection}}{\x}{\e}}
+}%end if chapter's defined
+% \end{macrocode}
+% Finally, if the ``mainmatter'' command is used, we need to
+% make sure that it doesn't mess up our numbering scheme.
% \begin{macrocode}
+\@ifundefined{mainmatter}{}{%
+\g@addto@macro\mainmatter{%
\@ifundefined{c@page}{}{\renewcommand\thepage{\basexii{\arabic{page}}{\x}{\e}}}
-\@ifundefined{c@chapter}{}{\renewcommand\thechapter{\basexii{\arabic{chapter}}{\x}{\e}}}
\@ifundefined{c@footnote}{}{\renewcommand\thefootnote{\basexii{\arabic{footnote}}{\x}{\e}}}
\@ifundefined{c@part}{}{\renewcommand\thepart{\basexii{\arabic{part}}{\x}{\e}}}
\@ifundefined{c@subparagraph}{}{\renewcommand\thesubparagraph{\basexii{\arabic{subparagraph}}{\x}{\e}}}
@@ -225,17 +272,18 @@
\@ifundefined{c@enumii}{}{\renewcommand\theenumii{\basexii{\arabic{enumii}}{\x}{\e}}}
\@ifundefined{c@enumiii}{}{\renewcommand\theenumiii{\basexii{\arabic{enumiii}}{\x}{\e}}}
\@ifundefined{c@enumiv}{}{\renewcommand\theenumiv{\basexii{\arabic{enumiv}}{\x}{\e}}}
-
-\@ifundefined{chapter}{% if it's undefined
+\@ifundefined{c@chapter}{% if it's undefined
\renewcommand\thesection{\basexii{\arabic{section}}{\x}{\e}}
\renewcommand\thesubsection{\thesection.\basexii{\arabic{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{\thesubsection.\basexii{\arabic{subsubsection}}{\x}{\e}}
} % end undefined
{%if it's defined
+\renewcommand\thechapter{\basexii{\arabic{chapter}}{\x}{\e}}
\renewcommand\thesection{\thechapter.\basexii{\arabic{section}}{\x}{\e}}
\renewcommand\thesubsection{\thesection.\basexii{\arabic{subsection}}{\x}{\e}}
\renewcommand\thesubsubsection{\thesubsection.\basexii{\arabic{subsubsection}}{\x}{\e}}
} % end if it's defined
+}}
% \end{macrocode}
% And that's the end. Thanks for reading,
% folks; please email me with any suggestions or improvements.