diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/texdate/texdate.dtx')
-rw-r--r-- | Master/texmf-dist/source/generic/texdate/texdate.dtx | 78 |
1 files changed, 72 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/generic/texdate/texdate.dtx b/Master/texmf-dist/source/generic/texdate/texdate.dtx index 4ceee291453..329788416bb 100644 --- a/Master/texmf-dist/source/generic/texdate/texdate.dtx +++ b/Master/texmf-dist/source/generic/texdate/texdate.dtx @@ -26,7 +26,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%<package>\ProvidesPackage{texdate}[2018/05/30 v1.0 Print and manipulate dates in plain TeX] +%<package>\ProvidesPackage{texdate}[2018/12/08 v2.0 Print and manipulate dates in plain TeX] %<*driver> \documentclass{ltxdoc} @@ -48,7 +48,7 @@ \end{document} %</driver> \fi % -% \title{The |texdate| Package, v1.0} +% \title{The |texdate| Package, v2.0} % \author{Donald P.\ Goodman III} % \date{\today} % @@ -110,6 +110,14 @@ % package to do this. For more information, see % \url{http://www.dozenal.org}. % +% \section{Dependencies} +% \label{sect:deps} +% +% |texdate| requires the |padcount|, |modulus|, and |iflang| +% packages internally, so be sure that they are installed. +% They are all available on CTAN and in the \TeX{}Live +% distribution. +% % \section{Printing and Setting the Date} % \label{sect:basic} % @@ -674,6 +682,64 @@ % \emph{after} you've loaded |texdate|, will localize all % the strings involved. % +% \section{Plain \TeX\ Usage} +% +% I was asked recently, quite unexpectedly, whether +% |texdate| could be used with plain \TeX. My initial +% thought was an obvious ``yes,'' since it's implemented +% entirely with \TeX\ primitives; however, the matter wasn't +% quite that simple. The package file does use some +% \LaTeX-specific macros, all related to the packaging +% itself; and it uses a |padcount| macro which doesn't work +% with plain \TeX. Also, according to \LaTeX\ convention, +% it uses |@| as a letter in control sequences willy-nilly, +% and \TeX\ balks at such craziness. Finally, a small +% change in the code (due to deep \TeX\ magic involving +% |\outer| that is best left unspoken) needed to be made. +% This done, however, the package \emph{can} (mostly) be +% used in plain \TeX. Here's how. +% +% The following must be included in your document in order +% to prevent \TeX\ from choking on our \LaTeX\ packaging +% macros: +% +% \begin{quote} +% |\def\NeedsTeXFormat#1[#2]{}|\\ +% |\def\ProvidesPackage#1[#2]{}|\\ +% |\def\RequirePackage#1{}|\\ +% |\def\AtBeginDocument#1{}|\\ +% \end{quote} +% +% This simply defines these macros to do nothing, which is +% how \TeX\ prefers packaging macros to work. Then, you +% need to tell \TeX\ that |@| can, in fact, be part of the +% name of a control sequence: +% +% \begin{quote} +% |\catcode`@=11| +% \end{quote} +% +% This, again, is some deep \TeX\ magic best left +% undiscussed for the benefit of those not interested. +% There's plenty of information around if you really want +% it. Finally, we need to input the packages that |texdate| +% needs, and tell \TeX\ not to use the +% |padcount| macro that it doesn't like, by redefining it to +% simply spit out its own parameter: +% +% \begin{quote} +% |\input modulus.sty|\\ +% |\input padcount.sty|\\ +% |\input texdate.sty|\\ +% |\def\padnum#1{#1}|\\ +% \end{quote} +% +% These things done, |texdate| will work almost entirely +% with plain \TeX, except that (obviously) the padding +% options won't have any effect. So, if plain \TeX\ is your +% preference, go for it. +% +% % \section{Implementation} % % \begin{macrocode} @@ -689,11 +755,11 @@ \newcount\texd@rmon% %% taken from dayofweek.tex, by Martin Minow of DEC; %% included in TeXLive +\newcount\texd@dow% Gets day of the week +\newcount\texd@leap% Leap year fingaler +\newcount\texd@x% Temp register +\newcount\texd@y% Another temp register \def\texd@nextdow#1#2#3{% - \newcount\texd@dow% Gets day of the week - \newcount\texd@leap% Leap year fingaler - \newcount\texd@x% Temp register - \newcount\texd@y% Another temp register \global\texd@leap=#2% \global\advance\texd@leap by-14% \global\divide\texd@leap by12% |