diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/isodate/isodate.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/isodate/isodate.sty | 95 |
1 files changed, 83 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/isodate/isodate.sty b/Master/texmf-dist/tex/latex/isodate/isodate.sty index 8d631358199..b37457a8da7 100644 --- a/Master/texmf-dist/tex/latex/isodate/isodate.sty +++ b/Master/texmf-dist/tex/latex/isodate/isodate.sty @@ -8,7 +8,7 @@ %% %% isodate package %% -%% Copyright 2000--2005 Harald Harders +%% Copyright 2000--2010 Harald Harders %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN @@ -19,7 +19,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{isodate} - [2005/04/15 v2.28 Print dates with different formats (HH)] + [2010/01/03 v2.30 Print dates with different formats (HH)] \RequirePackage{ifthen} \IfFileExists{substr.sty}{\RequirePackage{substr}% }{\PackageError{isodate.sty}{Package file substr.sty not found} @@ -40,6 +40,8 @@ \DeclareOption{shortroman}{\AtEndOfPackage{\shortromandate}} \DeclareOption{cleanlook}{\AtEndOfPackage{\cleanlookdateon}} \DeclareOption{nocleanlook}{\AtEndOfPackage{\cleanlookdateoff}} +\DeclareOption{printdayoff}{\AtEndOfPackage{\printdayoff}} +\DeclareOption{printdayon}{\AtEndOfPackage{\printdayon}} \DeclareOption{inputenglish}{\AtEndOfPackage{\dateinputformat{english}}} \DeclareOption{inputbritish}{\AtEndOfPackage{\dateinputformat{english}}} \DeclareOption{inputUKenglish}{\AtEndOfPackage{\dateinputformat{english}}} @@ -73,7 +75,7 @@ Isodate definition file \CurrentOption.idf not found}{% Maybe you misspelled the language option?}}% } -\ExecuteOptions{orig,nocleanlook} +\ExecuteOptions{orig,nocleanlook,printdayon} \ProcessOptions* \ifx\iso@languageloaded\@undefined \PackageError{isodate}{% @@ -119,20 +121,20 @@ \def\iso@dateformat{numeric} \DeclareRobustCommand*\dateinputformat[1]{% \ifthenelse{% - \equal{#1}{english}\or - \equal{#1}{british}\or + \equal{#1}{english}\OR + \equal{#1}{british}\OR \equal{#1}{UKenglish}}{% \def\iso@inputformat{english}% }{% \ifthenelse{% - \equal{#1}{american}\or + \equal{#1}{american}\OR \equal{#1}{USenglish}}{% \def\iso@inputformat{american}% }{% \ifthenelse{% - \equal{#1}{tex}\or - \equal{#1}{TeX}\or - \equal{#1}{latex}\or + \equal{#1}{tex}\OR + \equal{#1}{TeX}\OR + \equal{#1}{latex}\OR \equal{#1}{LaTeX}}{% \def\iso@inputformat{tex}% }{% @@ -200,10 +202,20 @@ \DeclareRobustCommand*\printyearon{\iso@printyeartrue} \DeclareRobustCommand*\printyearoff{\iso@printyearfalse} \printyearon +\newif\ifiso@doprintday +\DeclareRobustCommand*\printdayon{\iso@doprintdaytrue} +\DeclareRobustCommand*\printdayoff{\iso@doprintdayfalse} +\printdayon \newif\ifiso@cleanlook \DeclareRobustCommand*\cleanlookdateon{\iso@cleanlooktrue} \DeclareRobustCommand*\cleanlookdateoff{\iso@cleanlookfalse} \cleanlookdateoff +\newcommand*\iso@daysep{~} +\newcommand*\iso@monthsep{~} +\newcommand*\iso@yearsep{~} +\DeclareRobustCommand*\isospacebeforeday[1]{\def\iso@daysep{#1}} +\DeclareRobustCommand*\isospacebeforemonth[1]{\def\iso@monthsep{#1}} +\DeclareRobustCommand*\isospacebeforeyear[1]{\def\iso@yearsep{#1}} \newcommand*\iso@printdate[3]{% \begingroup% \@ifundefined{iso@printdate@\iso@languagename}{% @@ -266,6 +278,65 @@ \protect~ inside the argument.}% }} \def\iso@input@TeX#1/#2/#3\@empty{\iso@printdate{#1}{#2}{#3}} +\def\iso@printmonthday@int#1#2{% + \ifthenelse{\equal{\iso@dateformat}{iso}}{% + \iso@printmonth{#1}% + \ifiso@doprintday + \iso@isodash\iso@printday{#2}% + \fi + }{% + \ifthenelse{\equal{\iso@dateformat}{TeX}}{% + \iso@printmonth{#1}% + \ifiso@doprintday + /\iso@printday{#2}% + \fi + }{% + \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname: + Invalid date format `\iso@dateformat'}{Internal error. Please + report to the package author.} + }% + }% +} +\def\iso@printdate@int#1#2#3{% + \ifiso@printyear + \ifthenelse{\equal{\iso@dateformat}{iso}}{% + \iso@yearfour{\number#1}\iso@isodash% + }{% + \ifthenelse{\equal{\iso@dateformat}{TeX}}{% + \iso@yearfour{\number#1}/% + }{% + \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname: + Invalid date format `\iso@dateformat'}{Internal error. Please + report to the package author.} + }% + }% + \fi + \csname iso@printmonthday@int\endcsname{\number#2}{\number#3}% +} +\def\iso@daterange@int#1#2#3#4#5#6{% + \ifthenelse{\equal{\iso@dateformat}{iso}\OR + \equal{\iso@dateformat}{TeX}}{% + \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}% + \iso@rangesign% + \ifthenelse{\equal{\number#1}{\number#4}}{% + \ifthenelse{\equal{\number#2}{\number#5}}{% + \ifiso@doprintday + \iso@printday{#6}% + \else + \iso@printmonthday@int{#5}{#6}% + \fi + }{% + \iso@printmonthday@int{#5}{#6}% + }% + }{% + \iso@printdate@int{#4}{#5}{#6}% + }% + }{% + \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname: + Invalid date format `\iso@dateformat'}{Internal error. Please + report to the package author.} + }% +} \DeclareRobustCommand*\daterange[2]{% \edef\iso@date{#1}% \edef\iso@@date{#2}% @@ -276,11 +347,11 @@ \SubStringsToCounter{iso@@slash}{/}{\iso@@date}% \SubStringsToCounter{iso@@minus}{-}{\iso@@date}% \SubStringsToCounter{iso@@dot}{.}{\iso@@date}% - \ifthenelse{\equal{\theiso@dot}{2}\and\equal{\theiso@@dot}{2}}{% + \ifthenelse{\equal{\theiso@dot}{2}\AND\equal{\theiso@@dot}{2}}{% \expandafter\iso@range@input@german\iso@@@date\@empty}{% - \ifthenelse{\equal{\theiso@minus}{2}\and\equal{\theiso@@minus}{2}}{% + \ifthenelse{\equal{\theiso@minus}{2}\AND\equal{\theiso@@minus}{2}}{% \expandafter\iso@range@input@iso\iso@@@date\@empty}{% - \ifthenelse{\equal{\theiso@slash}{2}\and% + \ifthenelse{\equal{\theiso@slash}{2}\AND \equal{\theiso@@slash}{2}}{% \expandafter\iso@range@input@english\iso@@@date\@empty}{% ????\iso@isodash ??\iso@isodash ??% |