diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/datetime/datetime.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/datetime/datetime.sty | 136 |
1 files changed, 75 insertions, 61 deletions
diff --git a/Master/texmf-dist/tex/latex/datetime/datetime.sty b/Master/texmf-dist/tex/latex/datetime/datetime.sty index c26f32b35b1..5acf82beff7 100644 --- a/Master/texmf-dist/tex/latex/datetime/datetime.sty +++ b/Master/texmf-dist/tex/latex/datetime/datetime.sty @@ -5,12 +5,24 @@ %% The original source files were: %% %% datetime.dtx (with options: `datetime.sty,package') -%% Copyright (C) 2007 Nicola Talbot, all rights reserved. -%% If you modify this file, you must change its name first. -%% You are NOT ALLOWED to distribute this file alone. You are NOT -%% ALLOWED to take money for the distribution or use of either this -%% file or a changed version, except for a nominal charge for copying -%% etc. +%% +%% datetime.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (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'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files datetime.dtx and datetime.ins and the derived files datetime.sty, dt-austrian.def, dt-bahasa.def, dt-basque.def, dt-breton.def, dt-british.def, dt-bulgarian.def, dt-catalan.def, dt-croatian.def, dt-czech.def, dt-danish.def, dt-dutch.def, dt-esperanto.def, dt-estonian.def, dt-finnish.def, dt-french.def, dt-galician.def, dt-german.def, dt-greek.def, dt-hebrew.def, dt-icelandic.def, dt-irish.def, dt-italian.def, dt-latin.def, dt-lsorbian.def, dt-magyar.def, dt-naustrian.def, dt-ngerman.def, dt-norsk.def, dt-polish.def, dt-portuges.def, dt-romanian.def, dt-russian.def, dt-samin.def, dt-scottish.def, dt-serbian.def, dt-slovak.def, dt-slovene.def, dt-spanish.def, dt-swedish.def, dt-turkish.def, dt-UKenglish.def, dt-ukraineb.def, dt-USenglish.def, dt-usorbian.def, dt-welsh.def. +%% %% \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 @@ -27,32 +39,32 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime}[2007/04/21 v2.52 Date Time Package] +\ProvidesPackage{datetime}[2007/08/20 v2.55 Date Time Package] \RequirePackage{fmtcount} \newif\if@dt@nodate \@dt@nodatefalse \newcommand{\dateseparator}{/} \newif\if@dt@multilingual \@ifpackageloaded{babel}{% -\@dt@multilingualtrue}{\@dt@multilingualfalse} +\@dt@multilingualtrue}{% \@ifpackageloaded{ngerman}{% -\@dt@multilingualtrue}{\@dt@multilingualfalse} -\newcommand{\ordinaldateenglish}[1]{\ordinalnum{#1}} -\newcommand{\ordinaldatewelsh}[1]{% +\@dt@multilingualtrue}{\@dt@multilingualfalse}} +\newcommand*{\ordinaldateenglish}[1]{\ordinalnum{#1}} +\newcommand*{\ordinaldatewelsh}[1]{% #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -\newcommand{\ordinaldatebreton}[1]{% +\newcommand*{\ordinaldatebreton}[1]{% #1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -\newcommand{\ordinaldatefrench}[1]{% +\newcommand*{\ordinaldatefrench}[1]{% #1\ifnum#1=1\ier\fi} -\newcommand{\ordinaldate}[1]{% +\newcommand*{\ordinaldate}[1]{% \if@dt@multilingual \@ifundefined{ordinaldate\languagename}{#1}{% \csname ordinaldate\languagename\endcsname{#1}}% \else \ordinalnum{#1}% \fi} -\providecommand{\ier}{\textsuperscript{er}} -\newif\ifshowdow % show the day of week if true +\providecommand*{\ier}{\textsuperscript{er}} +\newif\ifshowdow \providecommand*{\formatdate}[3]{} \newcount\@day \newcount\@month @@ -119,17 +131,17 @@ \@dtctr=\@year% \@modulo{\@dtctr}{100}% \the\@month\dateseparator \the\@day\dateseparator \twodigit\@dtctr}} -\newcommand{\newdate}[4]{% +\newcommand*{\newdate}[4]{% \@ifundefined{date@#1@y}{% \@namedef{date@#1@d}{#2}% \@namedef{date@#1@m}{#3}% \@namedef{date@#1@y}{#4}}{% \PackageError{datetime}{Date `#1' already defined}{}}} -\newcommand{\getdateyear}[1]{% +\newcommand*{\getdateyear}[1]{% \@ifundefined{date@#1@y}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@y\endcsname}} -\newcommand{\getdatemonth}[1]{% +\newcommand*{\getdatemonth}[1]{% \@ifundefined{date@#1@m}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@m\endcsname}} @@ -137,15 +149,15 @@ \@ifundefined{date@#1@d}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \csname date@#1@d\endcsname}} -\newcommand{\displaydate}[1]{% +\newcommand*{\displaydate}[1]{% \@ifundefined{date@#1@y}{% \PackageError{datetime}{Date `#1' not defined}{}}{% \formatdate{\csname date@#1@d\endcsname}{% \csname date@#1@m\endcsname}{% \csname date@#1@y\endcsname}}} \DeclareRobustCommand*{\currenttime}{\xxivtime} -\newcommand{\timeseparator}{:} -\providecommand{\settimeformat}[1]{% +\newcommand*{\timeseparator}{:} +\providecommand*{\settimeformat}[1]{% \DeclareRobustCommand*\currenttime{\csname#1\endcsname}} \longdate \showdowtrue @@ -222,7 +234,7 @@ settings}} \PackageInfo{datetime}{option "nodate" used, so not defining \string\monthname} \else -\providecommand{\monthnameenglish}[1][\month]{% +\providecommand*{\monthnameenglish}[1][\month]{% \@orgargctr=#1\relax \ifcase\@orgargctr \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month @@ -242,7 +254,7 @@ numbers should go from 1 (January) to 12 (December)}% \else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% Month numbers should go from 1 (January) to 12 (December)}% \fi} -\newcommand{\monthname}[1][\month]{% +\newcommand*{\monthname}[1][\month]{% \if@dt@multilingual \@ifundefined{monthname\languagename}{% \PackageWarning{datetime}{No month names provided for language @@ -256,7 +268,7 @@ Month numbers should go from 1 (January) to 12 (December)}% \PackageInfo{datetime}{option "nodate" used, so not defining \protect\shortmonthname} \else -\providecommand{\shortmonthnameenglish}[1][\month]{% +\providecommand*{\shortmonthnameenglish}[1][\month]{% \@orgargctr=#1\relax \ifcase\@orgargctr \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month @@ -277,7 +289,7 @@ numbers should go from 1 (jan) to 12 (dec)}% \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (jan) to 12 (dec)}% \fi} -\newcommand{\shortmonthname}[1][\month]{% +\newcommand*{\shortmonthname}[1][\month]{% \if@dt@multilingual \@ifundefined{shortmonthname\languagename}{% \PackageWarning{datetime}{No abbreviated month name defined for @@ -294,7 +306,7 @@ language '\languagename', using full version instead}% \PackageInfo{datetime}{option "nodate" used, so not defining \string\dayofweek \space or \string\shortdayofweek} \else -\providecommand{\testifleapyear}[1]{% +\providecommand*{\testifleapyear}[1]{% \leapyearfalse \@year=#1\relax \@dtctr=\@year @@ -316,8 +328,7 @@ language '\languagename', using full version instead}% \fi } \newcount\dayofyear - -\providecommand{\computedayofyear}[3]{% +\providecommand*{\computedayofyear}[3]{% \testifleapyear{#3}% \dayofyear=0\relax \@day=#1\relax \@month=#2\relax \@year=#3\relax @@ -336,7 +347,7 @@ language '\languagename', using full version instead}% \or \advance\dayofyear by 334\relax \else \PackageError{datetime}{Invalid month number}{The second argument to -\string\computedayofyear \space should lie in the range 1-12} +\string\computedayofyear \space should lie in the range 1-12}% \fi \ifnum\@month>2\relax \ifleapyear\advance\dayofyear by 1\relax\fi @@ -344,8 +355,7 @@ language '\languagename', using full version instead}% \advance\dayofyear by \@day\relax } \newcount\dayofweek - -\providecommand{\computedayofweek}[3]{% +\providecommand*{\computedayofweek}[3]{% \computedayofyear{#1}{#2}{#3}% \@dtctr=#3\relax \advance\@dtctr by -1901\relax @@ -359,7 +369,7 @@ language '\languagename', using full version instead}% \advance\dayofweek by -1\relax \@modulo{\dayofweek}{7}% \advance\dayofweek by 1\relax} -\providecommand{\dayofweeknameidenglish}[1]{% +\providecommand*{\dayofweeknameidenglish}[1]{% \ifcase#1\relax \or Sunday% \or Monday% @@ -369,7 +379,7 @@ language '\languagename', using full version instead}% \or Friday% \or Saturday% \fi} -\providecommand{\dayofweeknameid}[1]{% +\providecommand*{\dayofweeknameid}[1]{% \if@dt@multilingual \@ifundefined{dayofweeknameid\languagename}{% \ifthenelse{\equal{\languagename}{nohyphenation}}{}{% @@ -381,13 +391,13 @@ language '\languagename', using full version instead}% \dayofweeknameidenglish{#1}% \fi } -\providecommand{\dayofweekname}[3]{% +\providecommand*{\dayofweekname}[3]{% \computedayofweek{#1}{#2}{#3}% \dayofweeknameid{\dayofweek}% } -\providecommand{\thisdayofweekname}{% +\providecommand*{\thisdayofweekname}{% \dayofweekname{\day}{\month}{\year}} -\providecommand{\shortdayofweeknameidenglish}[1]{% +\providecommand*{\shortdayofweeknameidenglish}[1]{% \ifcase#1\relax \or Sun% \or Mon% @@ -397,7 +407,7 @@ language '\languagename', using full version instead}% \or Fri% \or Sat% \fi} -\providecommand{\shortdayofweekname}[3]{% +\providecommand*{\shortdayofweekname}[3]{% \computedayofweek{#1}{#2}{#3}% \if@dt@multilingual \@ifundefined{shortdayofweeknameid\languagename}{% @@ -410,7 +420,7 @@ language '\languagename', defaulting to long version}}% \shortdayofweeknameidenglish{\dayofweek}% \fi } -\providecommand{\thisshortdayofweekname}{% +\providecommand*{\thisshortdayofweekname}{% \dayofweekname{\day}{\month}{\year}} \fi \if@dt@nodate @@ -420,6 +430,9 @@ language '\languagename', defaulting to long version}}% \if@dt@nodate \else \@ifundefined{dateenglish}{}{\let\dateenglish\longdate} +\@ifundefined{dateUKenglish}{}{\input{dt-UKenglish.def}} +\@ifundefined{dateUSenglish}{}{\input{dt-USenglish.def}} +\@ifundefined{datebritish}{}{\input{dt-british.def}} \@ifundefined{dateaustrian}{}{\input{dt-austrian.def}} \@ifundefined{datebahasa}{}{\input{dt-bahasa.def}} \@ifundefined{datebasque}{}{\input{dt-basque.def}} @@ -467,13 +480,13 @@ language '\languagename', defaulting to long version}}% \PackageInfo{datetime}{option "nodate" used, so not defining \string\newdateformat} \else -\providecommand\THEDAY{\the\@day} -\providecommand\THEMONTH{\the\@month} -\providecommand\THEYEAR{\the\@year} +\providecommand*\THEDAY{\the\@day} +\providecommand*\THEMONTH{\the\@month} +\providecommand*\THEYEAR{\the\@year} \let\c@DAY=\@day \let\c@MONTH=\@month \let\c@YEAR=\@year -\providecommand{\dateformat}[4]{% +\providecommand*{\dateformat}[4]{% \@day=#2\relax\@month=#3\relax\@year=#4\relax#1} \providecommand{\newdateformat}[2]{% \@ifundefined{#1}{% @@ -493,7 +506,7 @@ give your new date format a different name}}} \def\THEMINUTE{\the\c@MINUTE} \def\THETOHOUR{\the\c@TOHOUR} \def\THETOMINUTE{\the\c@TOMINUTE} -\providecommand{\newtimeformat}[2]{% +\providecommand*{\newtimeformat}[2]{% \@ifundefined{#1}{% \expandafter\def\csname#1\endcsname{% \c@HOUR=\time% @@ -518,7 +531,8 @@ You can't create a new time format called "#1" as the command \newtimeformat{xxivtime}{% \twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} \newtimeformat{ampmtime}{% -\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator\twodigit\THEMINUTE +\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator +\twodigit\THEMINUTE \ifthenelse{\value{HOUR}<12}{\amname}{% \ifthenelse{\time=720}{ \noon}{\pmname}}} \newcommand*{\hourstring}[1]{% @@ -541,32 +555,32 @@ past \hourstring{HOURXII}}{% \ifthenelse{\value{HOUR}<12}{% \ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% \ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} -\providecommand{\amname}{am} -\providecommand{\pmname}{pm} -\providecommand{\amorpmname}{% +\providecommand*{\amname}{am} +\providecommand*{\pmname}{pm} +\providecommand*{\amorpmname}{% \ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} -\providecommand{\amstring}{in the morning} -\providecommand{\pmstring}{in the afternoon} -\providecommand{\amorpmstring}{% +\providecommand*{\amstring}{in the morning} +\providecommand*{\pmstring}{in the afternoon} +\providecommand*{\amorpmstring}{% \ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} -\providecommand{\halfpast}{Half past} -\providecommand{\quarterpast}{Quarter past} -\providecommand{\quarterto}{Quarter to} -\providecommand{\noon}{Noon} -\providecommand{\midnight}{Midnight} -\providecommand{\oclockstring}{O'Clock} -\toksdef\dt@a=0 \toksdef\dt@b=2 +\providecommand*{\halfpast}{Half past} +\providecommand*{\quarterpast}{Quarter past} +\providecommand*{\quarterto}{Quarter to} +\providecommand*{\noon}{Noon} +\providecommand*{\midnight}{Midnight} +\providecommand*{\oclockstring}{O'Clock} +\newtoks\dt@a \newtoks\dt@b \edef\pdfdate{\the\year} \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\month} -\ifnum\month<10 +\ifnum\month<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} \fi \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\day} -\ifnum\day<10 +\ifnum\day<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} @@ -584,7 +598,7 @@ past \hourstring{HOURXII}}{% \@modulo{\@dtctr}{60}% \dt@b=\expandafter{\pdfdate} \dt@a=\expandafter{\the\@dtctr} -\ifnum\@dtctr<10 +\ifnum\@dtctr<10\relax \edef\pdfdate{\the\dt@b0\the\dt@a} \else \edef\pdfdate{\the\dt@b\the\dt@a} |