The isodate package^{∗}

Harald Harders

                   h.harders@tu-bs.de

File Date 2001-05-04, Printed 2001-05-17

Abstract This package provides commands to switch between different date formats (standard, ISO, numeric, L^{A}TEX package). They are used by the \today command, by the \printdate and \printdateTeX commands that print any date, and by the \daterange command that prints a date range. At the moment this package supports German (old and new rules, Austrian), British English, US English, French, Danish, and Norwegian.

The idea for this package was taken from the akletter class.

Contents

1 Commands 2 1.1 Switching the date format . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Printing today’s date . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Printing any date . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Printing date ranges . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Changing the ISO format . . . . . . . . . . . . . . . . . . . . . . . 3 1.6 Changing the German format . . . . . . . . . . . . . . . . . . . . . 4

2 Calling the package 4 3 Add new languages to the package 5 4 Solvable problems 6

4.1 Redefinition of language dependent names . . . . . . . . . . . . . . 6 A Licence 6 B Known errors 6 C Planned features and changes 7 D Literature 7 E The implementation 7

∗This file has version 2.04 last revised 2001-05-04, documentation dated 2001-05-17.

E.1 Package file isodate.sty . . . . . . . . . . . . . . . . . . . . . . . . . 7 E.2 Language definition file danish.idf . . . . . . . . . . . . . . . . . . . 13 E.3 Language definition file english.idf . . . . . . . . . . . . . . . . . . 15 E.4 Language definition file french.idf . . . . . . . . . . . . . . . . . . . 20 E.5 Language definition file german.idf . . . . . . . . . . . . . . . . . . 21 E.6 Language definition file norsk.idf . . . . . . . . . . . . . . . . . . . 24

Acknowledgements

First of all I have to thank Axel Kielhorn who wrote the package akletter which inspired me to write isodate. The help of Heiko Oberdiek was necessary to handle characters in substrings which resulted in the package substr. David Sanderson found the bug which disabled isodate to work without babel. He also helped me to improve the documentation and sent me a link to the ISO 8601 norm [1]. Svend Tollak Munkejord has added the norwegian language.

1 Commands

1.1 Switching the date format

This package provides five commands to switch the output format of all commands that print dates (described later):

\isodate  date format described in ISO 8601 and DIN 5008 [1]

(yyyy-mm-dd)

\numdate  numeric date format with four digits of the year
\shortdate short numeric date format with two digits of the year
\TeXdate  date format used for version description of packages

(yyyy/mm/dd)

\origdate original L^{A}TEX format

\isodate
\numdate
\shortdate
\TeXdate
\origdate

The numeric and short numeric format change their behaviour depending on the actual language:

German, nGerman dd.\,mm.~yyyy resp. dd.\,mm.\,yy
US English  mm/dd/yyyy  resp. mm/dd/yy

other languages  dd/mm/yyyy  resp. dd/mm/yy

This package supports German (old and new rules, Austrian), US English, French, Danish, and Norwegian. Switching the language by using \selectlanguage does not switch back to the original date format. So the current date format stays active when changing the language.

The change of the date format works locally. So it is possible to change it locally inside a group. E.g.

 \today, {\origdate\today}, \today

leads to “2001-05-17, 17th May 2001, 2001-05-17”.

1.2 Printing today’s date

\today As usual the command \today prints the date of today. Its appearance is influenced by the current date format

1.3 Printing any date

\printdate The command \printdate{#1} prints any date in the current format. The argument may be a date in German, British English, or ISO format, e.g.

 \printdate{24.12.2000}
 \printdate{24/12/2000}
 \printdate{2000-12-24}

\printdateTeX The command \printdateTeX{#1} prints any date in the actual format. The argument must be in the L^{A}TEX format yyyy/mm/dd, e.g.

 \printdateTeX{2000/12/24}

This command is useful for printing version information stored in a macro. For example the version of this documentation is stored in the macro \docdate (“2001/05/17”). To print it with the actual date format you can use the command \printdateTeX{\docdate} which leads to e.g. “2001-05-17” or “17th May 2001”.

1.4 Printing date ranges

\daterange The command \daterange{#1}{#2} prints a date range in the current format. The arguments may be a date in German, British English, or ISO format (see above). But there is a limitation: Both arguments must have the same input format.

Depending on the language and date format this commands lets out some of the data. The simplest way to understand it is to watch some examples:

{\isodate
\daterange{1999-05-03}{1999-05-31} ⟶ 1999-05-03 to 31
\daterange{1999-05-03}{1999-11-03} ⟶ 1999-05-03 to 11-03
\daterange{1999-05-03}{2000-04-07} ⟶ 1999-05-03 to 2000-04-07
}
{\origdate
\daterange{1999-05-03}{1999-05-31} ⟶ 3rd to 31st May 1999
\daterange{1999-05-03}{1999-11-03} ⟶ 3rd May to 3rd November 1999
\daterange{1999-05-03}{2000-04-07} ⟶ 3rd May 1999 to 7th April 2000
}

1.5 Changing the ISO format

\isodash The ISO norm says that the date format is “yyyy-mm-dd” or “yyyymmdd” [1].

By default I use the hyphen “-” as separator. You can change this using the \isodash^{1} command, e.g.

 \printdate{24/12/2000},
 \isodash{--}%
 \printdate{24/12/2000},
 \isodash{}%
 \printdate{24/12/2000}

leads to “2000-12-24, 2000–12–24, 20001224”. Or for example

 \isodash{$\cdot$}
 \printdate{24/12/2000}

leads to “2000·12·24”.

1.6 Changing the German format

The spacings for the numerical formats in the German language (24. 12. 2000 resp.

24. 12. 00) was taken from the Duden [2] and is the default spacing when using one of the German derivatives. Some people want to use different spacings. Thus

\daymonthsepgerman from version 2.03 on it will be possible to change it. You can change the spacing \monthyearsepgerman between the day and the month using the command \daymonthsepgerman. Using

the command \monthyearsepgerman you can change the spacing between the month and the year for the long and the short format, e.g.

 \daymonthsepgerman{\quad}%
 \monthyearsepgerman{\qquad}{\quad}%
 {\numdate\printdate{24.12.2000}}, {\shortdate\printdate{24.12.2000}}

leads to “24. 12. 2000, 24. 12. 00”.

2 Calling the package

The package is called using the \usepackage command:

\usepackage[option]{isodate}.

The possible package options can be seen in table 1.

Be aware that at least one language option must be set when calling isodate. The last language in the option list is the default language.

The package isodate works well together with babel.sty, german.sty, or ngerman.sty. Maybe it also works together with other language packages like e.g. french.sty, but this has not been tested. It does not matter if isodate is loaded before or after the used language package.

1The name “isodash” is a little bit confusing and was chosen due to my limited knowledge in English. It should be named “isoseparator” or “isosep”. But for compatiblity reasons I will not change it.

Table 1: Package options

option  function
iso  start with ISO date format
num  start with numeric date format with 4 digits of the year
short  start with numeric date format with 2 digits of the year
TeX  start with L^{A}TEX numeric date format (yyyy/mm/dd)
orig  start with normal L^{A}TEX date format (default)
american support American English date format
austrian support Austrian date format
danish  support Danish date format
english  support British English date format
french  support French date format
german  support German date format
naustrian support new Austrian date format
ngerman  support new German date format
norsk  support Norwegian date format
norwegian support Norwegian date format

It is also possible to use isodate without one of the language packages. Then it is not possible to switch between languages using the \selectlanguage command.^{2} Then the default language is the last one in the option list. If an error occurs when using isodate without one of the packages babel.sty, german.sty, and ngerman.sty please run tstlang.tex through latex and send the file tstlang.log

to the address h.harders@tu-bs.de.

If using isodate together with babel it can be useful to put the language options as global options into the optional parameters of the \documentclass command. Then automatically the available languages are the same for the text and the dates, and the default language is also the same. For example:

\documentclass[english,german]{article}
\usepackage{babel}
\usepackage[num]{isodate}

3 Add new languages to the package

The easiest way to add new languages to the package is to copy one of the simple language files danish.idf or french.idf to the new language name, e.g. plattdeutsch.idf, and change it as necessary.

This new file can be used without changing isodate.sty if you use its name explicitly in the optional parameter of the \usepackage command. If you have added support for a new language please mail me.

2Yes, there is a way to change the date language, but it is a little bit tricky:

\makeatletter \def\iso@languagename{german}% \dategerman% \makeatother

4 Solvable problems

4.1 Redefinition of language dependent names

If someone wants to change one of the language dependent names (e.g. \contentsname, \figurename, …) many people just write (e.g. in the language ngerman)

 \renewcommand{\contentsname}{Inhalt}

in the preamble of the document. If they are using german.sty, ngerman.sty, or no language package (and not isodate.sty) this approach works. But when using babel.sty and/or isodate.sty the default (“Inhaltsverzeichnis”) results. This is due to the fact that these packages call the command \selectlanguage

at the \begin{document}.

Depending on the used package different solutions have to be used.

Using babel.sty the redefinition of the name has to be added to the language extras:

 \addto{\extrasngerman}{\renewcommand{\contentsname}{Inhalt}}

Using german.sty or ngerman.sty this approach does not work. Instead, the \selectlanguage command has to be redefined. First, the original command has to be copied via the \let command. Then the \selectcommand is redefined using the original command:

 \let\origselectlanguage=\selectlanguage
 \def\selectlanguage#1{\origselectlanguage{#1}%
   \iflanguage{ngerman}{\renewcommand{\contentsname}{Inhalt}}{%
   \iflanguage{german}{\renewcommand{\contentsname}{Inhalt}}{}}}
  \selectlanguage{ngerman}

These commands should be placed shortly before the \begin{document} command.

A Licence

Copyright 2000 Harald Harders

This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory macros/latex/base/lppl.txt; either version 1 of the License, or any later version.

B Known errors

• The \printdate and \printdateTeX commands are not very good in checking the argument for correct syntax.

• I don’t know the French word that should be used in a date range. So I have taken ~--~ (“ – ”).

• The language definition files french.idf and german.idf are not yet commented.

C Planned features and changes

• Of course eliminate the errors.

• Add other languages than German, new German, English, US English, French, Danish, and Norwegian. Please help me with this topic. I don’t know the date formats in other languages.

D Literature

References

[1] International Standard: ISO 8601. http://www.iso.ch/markete/8601.pdf, 1988-06-15.

[2] DUDEN Band 1. Die deutsche Rechtschreibung. 21. Auflage, Dudenverlag, Mannheim, Germany, 1996.

E The implementation

E.1 Package file isodate.sty

Heading of the package:

 1 \NeedsTeXFormat{LaTeX2e}
 2 \ProvidesPackage{isodate}[\filedate\space v\fileversion
 3 Change the output format of dates (HH)]
 4 \RequirePackage{ifthen}
 5 \RequirePackage{calc}
 6 \IfFileExists{substr.sty}{\RequirePackage{substr}%
 7 }{\PackageError{isodate.sty}{Package file substr.sty not found}
 8 {This version of isodate.sty needs the package substr.sty.^^J%
 9  You can download it from
10  CTAN:/macros/latex/contrib/supported/substr/^^J%
11  E.g. one CTAN node is ftp.dante.de.
12  Install substr.sty into your TeX tree.}}

Declare the options for the default date format.

13 \DeclareOption{iso}{\AtBeginDocument{\isodate}}
14 \DeclareOption{num}{\AtBeginDocument{\numdate}}
15 \DeclareOption{short}{\AtBeginDocument{\shortdate}}
16 \DeclareOption{TeX}{\AtBeginDocument{\TeXdate}}
17 \DeclareOption{orig}{\AtBeginDocument{\origdate}}

Declare the options for language support.

18 \DeclareOption{austrian}{\input{german.idf}}
19 \DeclareOption{english}{\input{english.idf}}
20 \DeclareOption{german}{\input{german.idf}}
21 \DeclareOption{american}{\input{english.idf}}
22 \DeclareOption{naustrian}{\input{german.idf}}
23 \DeclareOption{ngerman}{\input{german.idf}}
24 \DeclareOption{UKenglish}{\input{english.idf}}
25 \DeclareOption{USenglish}{\input{english.idf}}

26 \DeclareOption{danish}{\input{danish.idf}}
27 \DeclareOption{norsk}{\input{norsk.idf}}
28 \DeclareOption{norwegian}{\input{norsk.idf}}
29 \DeclareOption{french}{\input{french.idf}}

Make it possible to load language definition files that are not known by this package.

30 \DeclareOption*{%
31 \InputIfFileExists{\CurrentOption.idf}{}{%
32  \PackageError{isodate}{%
33  Isodate definition file \CurrentOption.idf not found}{%
34  Maybe you misspelled the language option?}}%

35 }

Set default option to orig.

36 \ExecuteOptions{orig}

Process the options.

37 \ProcessOptions*

Handle the case that no language was given. Throw an error message. Each language definition file *.idf must contain a line

 \let\iso@languageloaded\active

that defines the command \iso@languageloaded.

38 \ifx\iso@languageloaded\@undefined
39 \PackageError{isodate}{%
40  You haven't specified a language option}{%
41  You need to specify a language, either as a global
42  option\MessageBreak
43  or as an optional argument to the \string\usepackage\space
44  command.\MessageBreak
45  If you have used the old isodate package (version <=1.06) you can
46  change the\MessageBreak
47  usepackage command to \protect\usepackage{isodate}.\MessageBreak
48  You shouldn't try to proceed from here, type x to quit.}
49 \fi

\printnumber Prints a number. If the optional parameter is used the number has two digits and

it is filled by “0”.

   Examples: \printnumber{4} ⟶ 4, \printnumber[g]{4} ⟶ 04.
50 \newcommand{\printnumber}[2][\@empty]{%
51 \ifthenelse{\equal{#1}{\@empty}}{}{%
52  \ifthenelse{\number#2<10}{0}{}}\number#2}%

\iso@yeartwo Prints the argument of the command with two digits.

   Example: \iso@yeartwo{1873} ⟶ 73.
53 \newcounter{iso@yeartwo}%
54 \newcommand{\iso@yeartwo}[1]{%
55 \setcounter{iso@yeartwo}{\number#1}%
56 \whiledo{\theiso@yeartwo>99}{%
57  \setcounter{iso@yeartwo}{\theiso@yeartwo-100}}{}%
58 \ifthenelse{\number\theiso@yeartwo<10}{0}{}\theiso@yeartwo}%

\iso@dateformat In this command the current active date format ist stored. Possible values are:

numeric, short, iso, orig, TeX.
59 \def\iso@dateformat{numeric}

\numdate Switches to long numerical date format.

60 \DeclareRobustCommand*{\numdate}{\def\iso@dateformat{numeric}}%

\shortdate Switches to short numerical date format.

61 \DeclareRobustCommand*{\shortdate}{\def\iso@dateformat{short}}%

\isodate Switches to ISO date format.

62 \DeclareRobustCommand*{\isodate}{\def\iso@dateformat{iso}}%

\origdate Switches to the original date format.

63 \DeclareRobustCommand*{\origdate}{\def\iso@dateformat{orig}}%

\TeXdate Switches to L^{A}TEX date format.

64 \DeclareRobustCommand*{\TeXdate}{\def\iso@dateformat{TeX}}%

\isodash Changes the dash in the ISO date format. The default is “-”.

65 \def\iso@isodash{-}%
66 \DeclareRobustCommand*{\isodash}[1]{\def\iso@isodash{#1}}%

\isorangesign Defines the sign or word that is printed between the two dates in a date range. E.g. in English the default is “ to ”.

67 \def\iso@rangesign{\csname iso@rangesign@\iso@languagename\endcsname}%
68 \DeclareRobustCommand*{\isorangesign}[1]{\def\iso@rangesign{#1}}%

\iso@printdate Defines the command iso@printdate which takes three arguments (year, month, day) and prints the date by using the \today command.

69 \newcommand{\iso@printdate}[3]{%
70 \begingroup%
71 \def\year{#1}%
72 \def\month{#2}%
73 \def\day{#3}%
74 \today%
75 \endgroup%

76 }

\printdate Prints a date that is given as one argument in one of these formats: yyyy-mm-dd,

dd/mm/yyyy, dd.mm.yyyy.
77 \DeclareRobustCommand*{\printdate}[1]{%

Define \iso@date command to expand the argument #1.

78 \edef\iso@date{#1}%

Count appearances of “/”, “-”, and “.” in the argument.

79 \SubStringsToCounter{iso@slash}{/}{\iso@date}%
80 \SubStringsToCounter{iso@minus}{-}{\iso@date}%
81 \SubStringsToCounter{iso@dot}{.}{\iso@date}%

If number of “.” in the argument is equal to 2 then the German format dd.mm.yyyy is used.

82 \ifthenelse{\equal{\theiso@dot}{2}}{%
83  \expandafter\iso@input@german\iso@date\@empty}{%

If number of “-” in the argument is equal to 2 then the ISO format yyyy-mm-dd is used.

84  \ifthenelse{\equal{\theiso@minus}{2}}{%
85  \expandafter\iso@input@iso\iso@date\@empty}{%

If number of “/” in the argument is equal to 2 then the British English format

dd/mm/yyyy is used.
86  \ifthenelse{\equal{\theiso@slash}{2}}{%
87  \expandafter\iso@input@english\iso@date\@empty}{%

Else no of the formats above is used an thus an error message is thrown.

88  ????\iso@isodash ??\iso@isodash ??%
89  \PackageError{isodate}{unrecognized date format}{Use one of
90  the following formats as macro argument:^^J%
91  \space\space dd.mm.yyyy^^J%
92  \space\space dd/mm/yyyy^^J%
93  \space\space yyyy-mm-dd^^J%
94  Don't use any spaces or commands like \protect\, or
95  \protect~ inside the argument.}%
96  }}}%

97 }

\iso@input@iso Converts a string with the format yyyy-mm-dd to three arguments {#1}{#2}{#3}

and calls \iso@printdate.
98 \def\iso@input@iso#1-#2-#3\@empty{\iso@printdate{#1}{#2}{#3}}

\iso@input@german Converts a string with the format dd.mm.yyyy to three arguments {#3}{#2}{#1}

and calls \iso@printdate.
99 \def\iso@input@german#1.#2.#3\@empty{\iso@printdate{#3}{#2}{#1}}

\iso@input@english Converts a string with the format dd/mm/yyyy to three arguments {#3}{#2}{#1}

and calls \iso@printdate.
100 \def\iso@input@english#1/#2/#3\@empty{\iso@printdate{#3}{#2}{#1}}

\printdateTeX Prints a date that is given as one argument in the format yyyy/mm/dd.

101 \DeclareRobustCommand*{\printdateTeX}[1]{%

Define \iso@date command to expand the argument #1.

102 \edef\iso@date{#1}%

Count appearances of “/” in the argument.

103 \SubStringsToCounter{iso@slash}{/}{\iso@date}%

If number of “/” in the argument is equal to 2 then the L^{A}TEX format yyyy/mm/dd is used.

104 \ifthenelse{\equal{\theiso@slash}{2}}{%
105  \expandafter\iso@input@TeX\iso@date\@empty}{%

Else no of the formats above is used an thus an error message is thrown.

106  ????\iso@isodash ??\iso@isodash ??%
107  \PackageError{isodate}{unrecognized date format}{Use one of
108  the following formats as macro argument:^^J%
109  \space\space dd.mm.yyyy^^J%
110  \space\space dd/mm/yyyy^^J%
111  \space\space yyyy-mm-dd^^J%

112  Don't use any spaces or commands like \protect\, or
113  \protect~ inside the argument.}%

114 }}

\iso@input@TeX Converts a string with the format yyyy/mm/dd to three arguments {#1}{#2}{#3}

 and calls \iso@printdate.
115 \def\iso@input@TeX#1/#2/#3\@empty{\iso@printdate{#1}{#2}{#3}}

\daterange Prints a date range.

116 \DeclareRobustCommand*{\daterange}[2]{%

Define \iso@date and \iso@@date commands to expand the argument #1 and #2. Define \iso@@@date which contains both arguments devided by a komma.

117 \edef\iso@date{#1}%
118 \edef\iso@@date{#2}%
119 \edef\iso@@@date{\iso@date,\iso@@date}%

Count appearances of “/”, “-”, and “.” in the arguments.

120 \SubStringsToCounter{iso@slash}{/}{\iso@date}%
121 \SubStringsToCounter{iso@minus}{-}{\iso@date}%
122 \SubStringsToCounter{iso@dot}{.}{\iso@date}%
123 \SubStringsToCounter{iso@@slash}{/}{\iso@@date}%
124 \SubStringsToCounter{iso@@minus}{-}{\iso@@date}%
125 \SubStringsToCounter{iso@@dot}{.}{\iso@@date}%

If number of “.” in both arguments is equal to 2 then the German format

 dd.mm.yyyy is used.
126 \ifthenelse{\equal{\theiso@dot}{2}\and\equal{\theiso@@dot}{2}}{%
127  \expandafter\iso@range@input@german\iso@@@date\@empty}{%

If number of “-” in both arguments is equal to 2 then the ISO format yyyy-mm-dd is used.

128  \ifthenelse{\equal{\theiso@minus}{2}\and\equal{\theiso@@minus}{2}}{%
129  \expandafter\iso@range@input@iso\iso@@@date\@empty}{%

If number of “/” in both arguments is equal to 2 then the British English format

 dd/mm/yyyy is used.
130  \ifthenelse{\equal{\theiso@slash}{2}\and%
131  \equal{\theiso@@slash}{2}}{%
132  \expandafter\iso@range@input@english\iso@@@date\@empty}{%

Else no of the formats above is used an thus an error message is thrown.

133  ????\iso@isodash ??\iso@isodash ??%
134  \PackageError{isodate}{unrecognized date format}{Use one of
135  the following formats as macro argument:^^J%
136  \space\space dd.mm.yyyy^^J%
137  \space\space dd/mm/yyyy^^J%
138  \space\space yyyy-mm-dd^^J%
139  Don't use any spaces or commands like \protect\, or
140  \protect~ inside the argument.^^J
141  Use the same format for both arguments.}%
142  }}}%

143 }

\iso@range@input@iso Converts a string with the format yyyy-mm-dd,yyyy-mm-dd to six arguments

{#1}{#2}{#3}{#4}{#5}{#6} and calls \iso@daterange@language.
144 \def\iso@range@input@iso#1-#2-#3,#4-#5-#6\@empty{%
145 \csname iso@daterange@\iso@languagename\endcsname{%
146  #1}{#2}{#3}{#4}{#5}{#6}}
\iso@range@input@german Converts a string with the format dd.mm.yyyy,dd.mm.yyyy to six arguments
{#3}{#2}{#1}{#6}{#5}{#4} and calls \iso@daterange@language.
147 \def\iso@range@input@german#1.#2.#3,#4.#5.#6\@empty{%
148 \csname iso@daterange@\iso@languagename\endcsname{%
149  #3}{#2}{#1}{#6}{#5}{#4}}
\iso@range@input@english Converts a string with the format dd/mm/yyyy,dd/mm/yyyy to six arguments
{#3}{#2}{#1}{#6}{#5}{#4} and calls \iso@daterange@language.
150 \def\iso@range@input@english#1/#2/#3,#4/#5/#6\@empty{%
151 \csname iso@daterange@\iso@languagename\endcsname{%
152  #3}{#2}{#1}{#6}{#5}{#4}}

Define the counters for conting the appearances of “.”, “-”, and ”/” in the arguments.

153 \newcounter{iso@slash}
154 \newcounter{iso@minus}
155 \newcounter{iso@dot}
156 \newcounter{iso@@slash}
157 \newcounter{iso@@minus}
158 \newcounter{iso@@dot}

The command \iso@languagename is defined to be able to use this package without loading one of the language packages babel.sty, german.sty, or ngerman.sty.

If neither babel.sty nor german.sty nor ngerman.sty is loaded my computer returns “nohyphenation” when using \languagename. So this is the indication that none of the above packages is loaded.

159 \AtBeginDocument{%
160 \ifthenelse{\not\equal{\languagename}{nohyphenation}}{%

The language is not equal “nohyphenation”. So one of the language packages is loaded. Replace the internal language name \iso@languagename by the global

language name \languagename.
161  \gdef\iso@languagename{\languagename}%

Reload language to surely switch to new date format. The languagename gets first expanded because of errors that would occur otherwise.

162  \edef\iso@tmplang{\languagename}%
163  \expandafter\selectlanguage\expandafter{\iso@tmplang}%
164 }{%

None of the language packages are loaded. So no language switching is possible. Set the date language manually to the last language that was loaded for isodate.

165  \csname date\iso@languagename\endcsname%

166 } 167 }

The end of the package.

E.2 Language definition file danish.idf

Heading of the file:

168 \ProvidesFile{danish.idf}[\filedate\space v\fileversion\space
169 Danish support from the isodate package]
\iso@languageloaded Define the command \iso@languageloaded in order to enable isodate.sty to

determine if at least one language is loaded.

170 \let\iso@languageloaded\active

\month@danish Prints the name of today’s month in the long form for the original date format.

171 \def\month@danish{\ifcase\month\or
172  januar\or februar\or marts\or april\or maj\or juni\or
173  juli\or august\or september\or oktober\or november\or december\fi}

\iso@printmonthday@danish Prints the month and the day given as two arguments ({mm}{dd}) in the current date format.

174 \def\iso@printmonthday@danish#1#2{%

Numeric and short date format: dd/mm/

175  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
176  \equal{\iso@dateformat}{short}}{%
177  \printnumber[10]{#2}/\printnumber[10]{#1}/}{%

ISO date format: -mm-dd

178  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
179  \iso@isodash\printnumber[10]{#1}%
180  \iso@isodash\printnumber[10]{#2}}{%

L^{A}TEX date format: /mm/dd

181  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
182  /\printnumber[10]{#1}/\printnumber[10]{#2}}{%

Original date format: d. mmm

183  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
184  \printnumber{#2}.~\begingroup
185  \edef\lmonth{#1}\def\month{\lmonth}%
186  \month@danish%
187  \endgroup
188  }{}}}}%

189 }

\iso@printdate@danish Prints the date given as three arguments ({yyyy}{mm}{dd}) in the actual date format

190 \def\iso@printdate@danish#1#2#3{%
 ISO or L^{A}TEXdate format: yyyy\iso@printmonthday@danish
191  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
192  \equal{\iso@dateformat}{TeX}}{\number#1}{}%
193  \iso@printmonthday@danish{\number#2}{\number#3}%
 numeric date format: \iso@printmonthday@danish yyyy
194  \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
 original date format: \iso@printmonthday@danish~yyyy
195  \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%

 short date format: \iso@printmonthday@danish yy
196  \ifthenelse{\equal{\iso@dateformat}{short}}{%
197  \iso@yeartwo{\number#1}}{%
198  }}}%

199 }

\iso@datedanish This command redefines the \today command to print in the actual date format.

200 \def\iso@datedanish{%
201  \def\today{\iso@printdate@danish{\year}{\month}{\day}}}%
\iso@daterange@danish This command takes six arguments ({yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2})

and prints the corrosponding date range in the actual date format.

202 \def\iso@daterange@danish#1#2#3#4#5#6{%

ISO or L^{A}TEX date format.

203 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
204  \equal{\iso@dateformat}{TeX}}{%

Print the start date.

205  \csname iso@printdate@\iso@languagename\endcsname{%
206  #1}{#2}{#3}\iso@rangesign%

If year and month are equal, only print the day of the end date. If only the year is equal, only print month and day of the end date. Otherwise print the whole end date.

207  \ifthenelse{\equal{\number#1}{\number#4}}{%
208  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
209  }{\iso@printmonthday@danish{#5}{#6}}}{%
210  \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%

Numeric, short, or original date format.

If year and month are equal, only print the day of the start date. If only the year is equal, only print month and day of the start date. Otherwise print the whole start date.

211  \ifthenelse{\equal{\number#1}{\number#4}}{%
212  \ifthenelse{\equal{\number#2}{\number#5}}{%
213  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
214  \printnumber{#3}.}{\printnumber[10]{#3}}%
215  }{\iso@printmonthday@danish{#2}{#3}}}{%
216  \csname iso@printdate@\iso@languagename\endcsname{%
217  #1}{#2}{#3}}%

Print the end date.

218  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
219  #4}{#5}{#6}%
220 }{%

221 }% 222 }

\iso@rangesign@danish Sets the word between start and end date in a date range to “ til ”.

223 \def\iso@rangesign@danish{~til~}

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

224 \def\iso@languagename{danish}%

Redefine the command \datedanish that is used by babel to switch to the original Danish date format to enable the use of different date formats.

225 \AtBeginDocument{%
226 \ifx\undefined\iso@datedanish\else
227  \def\datedanish{\iso@datedanish}%
228 \fi

229 }

The end of the file.

E.3 Language definition file english.idf

Heading of the file:

230 \ProvidesFile{english.idf}[\filedate\space v\fileversion\space
231 English support from the isodate package]
\iso@languageloaded Define the command \iso@languageloaded in order to enable isodate.sty to

determine if at least one language is loaded.

232 \let\iso@languageloaded\active

\month@english Prints the name of today’s month in the long form for the original date format.

233 \def\month@english{\ifcase\month\or
234  January\or February\or March\or April\or May\or June\or
235  July\or August\or September\or October\or November\or December\fi}

British and American English dates are very different. So handle them seperately. It might have been easier to put them in different files but I wanted to organize my files analogous to babel.

First handle British English.

236 \ifthenelse{\equal{\CurrentOption}{english}\or%
237  \equal{\CurrentOption}{UKenglish}}{%

\day@english Prints today’s day for the original date format.

238 \def\day@english{\ifcase\day\or
239  1st\or 2nd\or 3rd\or 4th\or 5th\or
240  6th\or 7th\or 8th\or 9th\or 10th\or
241  11th\or 12th\or 13th\or 14th\or 15th\or
242  16th\or 17th\or 18th\or 19th\or 20th\or
243  21st\or 22nd\or 23rd\or 24th\or 25th\or
244  26th\or 27th\or 28th\or 29th\or 30th\or
245  31st\fi}

\iso@printmonthday@english Prints the month and the day given as two arguments ({mm}{dd}) in the current date format.

246 \def\iso@printmonthday@english#1#2{%

Numeric and short date format: dd/mm/

247  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
248  \equal{\iso@dateformat}{short}}{%
249  \printnumber[10]{#2}/\printnumber[10]{#1}/}{%

ISO date format: mm-dd

250  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
251  \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%

L^{A}TEX date format: mm/dd

252  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
253  \printnumber[10]{#1}/\printnumber[10]{#2}}{%

Original date format: ddd mmm

254  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
255  \begingroup
256  \edef\lday{#2}\def\day{\lday}%
257  \edef\lmonth{#1}\def\month{\lmonth}%
258  \day@english~\month@english%
259  \endgroup
260  }{}}}}%

261 }

\iso@printdate@english Prints the date given as three arguments ({yyyy}{mm}{dd}) in the actual date format.

262 \def\iso@printdate@english#1#2#3{%
 ISO date format: yyyy-\iso@printmonthday@english
263  \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
 L^{A}TEX date format: yyyy/\iso@printmonthday@english
264  \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
265  \iso@printmonthday@english{\number#2}{\number#3}%
 Numeric date format: \iso@printmonthday@english yyyy
266  \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
 Original date format: \iso@printmonthday@english~yyyy
267  \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
 Short date format: \iso@printmonthday@english yy
268  \ifthenelse{\equal{\iso@dateformat}{short}}{%
269  \iso@yeartwo{\number#1}}{%
270  }}}%

271 }

\iso@printdate@UKenglish Just a second name for \iso@printdate@UKenglish.
272 \def\iso@printdate@UKenglish{\iso@printdate@english}

\iso@dateenglish This command redefines the \today command to print in the actual date format.

273 \def\iso@dateenglish{%
274  \def\today{\iso@printdate@english{\year}{\month}{\day}}}%
\iso@daterange@english This command takes six arguments ({yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2})

and prints the corrosponding date range in the actual date format.

275 \def\iso@daterange@english#1#2#3#4#5#6{%

ISO or L^{A}TEX date format.

276 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
277  \equal{\iso@dateformat}{TeX}}{%

Print the start date.

278  \csname iso@printdate@\iso@languagename\endcsname{%
279  #1}{#2}{#3}\iso@rangesign%

If year and month are equal, only print the day of the end date. If only the year is equal, only print month and day of the end date. Otherwise print the whole end date.

280  \ifthenelse{\equal{\number#1}{\number#4}}{%
281  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
282  }{\iso@printmonthday@english{#5}{#6}}}{%
283  \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%

Numeric, short, or original date format.

If year and month are equal, only print the day of the start date. If only the year is equal, only print month and day of the start date. Otherwise print the whole start date.

284  \ifthenelse{\equal{\number#1}{\number#4}}{%
285  \ifthenelse{\equal{\number#2}{\number#5}}{%
286  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
287  \begingroup
288  \edef\lday{#3}\def\day{\lday}%
289  \day@english\endgroup}{\printnumber[10]{#3}}%
290  }{\iso@printmonthday@english{#2}{#3}}}{%
291  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%

Print the end date.

292  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
293  #4}{#5}{#6}%
294 }{%

295 }% 296 }

\iso@daterange@english Sets the word between start and end date in a date range to “ to”.

297 \def\iso@rangesign@english{~to~}

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

298 \def\iso@languagename{english}%

The end of the British section.

Second handle American English.

299 }{%

\iso@printmonthday@american Prints the month and the day given as two arguments ({mm}{dd}) in the current date format.

300 \def\iso@printmonthday@american#1#2{%

Numeric and short date format: mm/dd/

301  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
302  \equal{\iso@dateformat}{short}}{%
303  \printnumber[10]{#1}/\printnumber[10]{#2}/}{%

ISO date format: mm-dd

304  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
305  \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%

L^{A}TEX date format: mm/dd

306  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
307  \printnumber[10]{#1}/\printnumber[10]{#2}}{%

Original date format: mmm d

308  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
309  \begingroup%
310  \edef\lmonth{#1}%
311  \def\month{\lmonth}\month@english%
312  \endgroup
313  ~\printnumber{#2}%
314  }{}}}}%

315 }

\iso@printdate@american Prints the date given as three arguments ({yyyy}{mm}{dd}) in the actual date format.

316 \def\iso@printdate@american#1#2#3{%
 ISO date format: yyyy-\iso@printmonthday@american
317  \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
 L^{A}TEX date format: yyyy/\iso@printmonthday@american
318  \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
319  \iso@printmonthday@american{\number#2}{\number#3}%
 Numeric date format: \iso@printmonthday@american yyyy
320  \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
 Original date format: \iso@printmonthday@american,~yyyy
321  \ifthenelse{\equal{\iso@dateformat}{orig}}{,~\number#1}{%
 Short date format: \iso@printmonthday@american yy
322  \ifthenelse{\equal{\iso@dateformat}{short}}{%
323  \iso@yeartwo{\number#1}}{}}}%

324 }

\iso@printdate@USenglish Just a second name for \iso@printdate@UKamerican.
325 \def\iso@printdate@USenglish{\iso@printdate@american}

\iso@dateamerican This command redefines the \today command to print in the actual date format.

326 \def\iso@dateamerican{%
327  \def\today{\iso@printdate@american{\year}{\month}{\day}}}%
\iso@daterange@american This command takes six arguments ({yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2})

and prints the corrosponding date range in the actual date format.

328 \def\iso@daterange@american#1#2#3#4#5#6{%

ISO or L^{A}TEX date format.

329 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
330  \equal{\iso@dateformat}{TeX}}{%

Print the start date.

331  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
332  \iso@rangesign%

If year and month are equal, only print the day of the end date. If only the year is equal, only print month and day of the end date. Otherwise print the whole end date.

333  \ifthenelse{\equal{\number#1}{\number#4}}{%
334  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
335  }{\iso@printmonthday@american{#5}{#6}}}{%
336  \csname iso@printdate@\iso@languagename\endcsname{%
337  #4}{#5}{#6}}}{%

Original date format.

If year and month are equal, print mmm d1 to d2, yyyy. If only the year is equal, print mmm1 d1 to mmm2 d2, yyyy. Otherwise print the whole start and end date.

338  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
339  \ifthenelse{\equal{\number#1}{\number#4}}{%
340  \ifthenelse{\equal{\number#2}{\number#5}}{%
341  \iso@printmonthday@american{#2}{#3}\iso@rangesign%
342  \printnumber{#6},~\number#4}{%
343  \iso@printmonthday@american{#2}{#3}\iso@rangesign%
344  \csname iso@printdate@\iso@languagename\endcsname{%
345  #4}{#5}{#6}}}{%
346  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
347  \iso@rangesign%
348  \csname iso@printdate@\iso@languagename\endcsname{%
349  #4}{#5}{#6}}}{%

Numeric or short date format.

If year and month are equal, only print the day of the end date. Otherwise print the whole end date.

350  \ifthenelse{\equal{\number#1}{\number#4}}{%
351  \iso@printmonthday@american{#2}{#3}}{%
352  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%

Print the end date.

353  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
354  #4}{#5}{#6}}%

355 }% 356 }

\iso@rangesign@american Set the word between start and end date in a date range to “ to ”.

357 \def\iso@rangesign@american{~to~}

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

358 \def\iso@languagename{american}%

The end of the American section.

359 }

Redefine the command datelanguage that is used by babel.sty, german.sty, and ngerman.sty to switch to the original English/American date format to enable the use of different date formats.

Do this only if \iso@datelanguage is defined.

360 \AtBeginDocument{%
361 \ifx\undefined\iso@dateenglish\else
362  \def\dateenglish{\iso@dateenglish}%
363  \def\dateUKenglish{\iso@dateenglish}%
364 \fi
365 \ifx\undefined\iso@dateamerican\else
366  \def\dateamerican{\iso@dateamerican}%
367  \def\dateUSenglish{\iso@dateamerican}%
368 \fi

369 }

The end of the file.

E.4 Language definition file french.idf

Heading of the file:

370 \ProvidesFile{french.idf}[\filedate\space v\fileversion\space
371 French support from the isodate package]
\iso@languageloaded Define the command \iso@languageloaded in order to enable isodate.sty to

determine if at least one language is loaded.

372 \let\iso@languageloaded\active
373 \def\month@french{\ifcase\month\or
374 janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
375 juillet\or ao\^ut\or septembre\or octobre\or novembre\or
376 d\'ecembre\fi}
377 \def\iso@printmonthday@french#1#2{%
378  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
379  \equal{\iso@dateformat}{short}}{%
380  \printnumber[10]{#2}/\printnumber[10]{#1}/}{%
381  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
382  \iso@isodash\printnumber[10]{#1}\iso@isodash%
383  \printnumber[10]{#2}}{%
384  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
385  /\printnumber[10]{#1}/\printnumber[10]{#2}}{%
386  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
387  \begingroup
388  \edef\lday{#2}\edef\day{\lday}%
389  \edef\lmonth{#1}\def\month{\lmonth}%
390  \number\day\ifnum1=\day \noexpand\ier\fi~\month@french%
391  \endgroup
392  }{}}}}%

393 }

394 \def\iso@printdate@french#1#2#3{%
395  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
396  \equal{\iso@dateformat}{TeX}}{\number#1}{}%
397  \iso@printmonthday@french{\number#2}{\number#3}%
398  \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%

399  \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
400  \ifthenelse{\equal{\iso@dateformat}{short}}{%
401  \iso@yeartwo{\number#1}}{}}}%

402 }

403 \def\iso@datefrench{%
404  \def\today{\iso@printdate@french{\year}{\month}{\day}}}%
405 \def\iso@daterange@french#1#2#3#4#5#6{%
406 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
407  \equal{\iso@dateformat}{TeX}}{%
408  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
409  \iso@rangesign%
410  \ifthenelse{\equal{\number#1}{\number#4}}{%
411  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
412  }{\iso@printmonthday@french{#5}{#6}}}{%
413  \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
414  \ifthenelse{\equal{\number#1}{\number#4}}{%
415  \ifthenelse{\equal{\number#2}{\number#5}}{%
416  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
417  \begingroup
418  \edef\lday{#3}\edef\day{\lday}%
419  \number\day\ifnum1=\day \noexpand\ier\fi
420  \endgroup}{\printnumber[10]{#3}}%
421  }{\iso@printmonthday@french{#2}{#3}}}{%
422  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
423  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
424  #4}{#5}{#6}%
425 }{%

426 }% 427 }

428 \def\iso@rangesign@french{~--~}

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

429 \def\iso@languagename{french}%

\datefrenchb has to be defined additionally because babel starts with language frenchb instead of french.

430 \AtBeginDocument{%
431 \ifx\undefined\iso@datefrench\else
432  \def\datefrench{\iso@datefrench}%
433  \def\datefrenchb{\iso@datefrench}%
434 \fi

435 }

The end of the file.

E.5 Language definition file german.idf

Heading of the file:

436 \ProvidesFile{german.idf}[\filedate\space v\fileversion\space
437 German support from the isodate package]

\iso@languageloaded Define the command \iso@languageloaded in order to enable isodate.sty to

determine if at least one language is loaded.

438 \let\iso@languageloaded\active

Define spaces between day and month resp. month and year. dm stands for daymonth and my for month-year. The defaults are taken from the Duden [2].

439 \def\iso@dmsepgerman{\,}%
440 \def\iso@mylongsepgerman{~}%
441 \def\iso@myshortsepgerman{\,}%

\daymonthsepgerman Change space between day and month in numeric date formats for the German language. The only parameter is the new spacing.

442 \DeclareRobustCommand*{\daymonthsepgerman}[1]{\def\iso@dmsepgerman{#1}}
443 %    \begin{macrocode}
444 % \end{macro}
445 % \begin{macro}{\monthyearsepgerman}
446 % Change space between month and year in numeric date formats for the
447 % German language. The first parameter is the new spacing for the long
448 % format and the second for the short format.
449 %    \begin{macrocode}
450 \DeclareRobustCommand*{\monthyearsepgerman}[2]{%
451 \def\iso@mylongsepgerman{#1}%
452 \def\iso@myshortsepgerman{#2}}
453 \def\month@german{\ifcase\month\or
454 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
455 Juli\or August\or September\or Oktober\or November\or Dezember\fi}
456 \def\month@ngerman{\month@german}
457 \def\month@austrian{\ifnum1=\month
458 J\"anner\else \month@german\fi}
459 \def\month@naustrian{\month@austrian}
460 \@namedef{iso@printmonthday@\CurrentOption}#1#2{%
461 \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
462  \equal{\iso@dateformat}{short}}{%
463  \printnumber[10]{#2}.\iso@dmsepgerman\printnumber[10]{#1}.}{%
464  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
465  \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%
466  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
467  \printnumber[10]{#1}/\printnumber[10]{#2}}{%
468  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
469  \printnumber{#2}.~\begingroup
470  \edef\lmonth{#1}%
471  \def\month{\lmonth}\csname month@\iso@languagename\endcsname%
472  \endgroup
473  }{}}}}%

474 }

475 \@namedef{iso@printdate@\CurrentOption}#1#2#3{%
476 \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
477  \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
478 \csname iso@printmonthday@\iso@languagename\endcsname{%
479  \number#2}{\number#3}%
480 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%

481  \iso@mylongsepgerman\number#1}{%
482  \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
483  \ifthenelse{\equal{\iso@dateformat}{short}}{%
484  \iso@myshortsepgerman\iso@yeartwo{\number#1}}{}}}%

485 }

486 \@namedef{iso@daterange@\CurrentOption}#1#2#3#4#5#6{%
487 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
488  \equal{\iso@dateformat}{TeX}}{%
489  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
490  \iso@rangesign%
491  \ifthenelse{\equal{\number#1}{\number#4}}{%
492  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
493  }{\csname iso@printmonthday@\iso@languagename\endcsname{#5}{#6}}}{%
494  \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
495  \ifthenelse{\equal{\number#1}{\number#4}}{%
496  \ifthenelse{\equal{\number#2}{\number#5}}{%
497  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
498  \printnumber{#3}}{\printnumber[10]{#3}}.%
499  }{\csname iso@printmonthday@\iso@languagename\endcsname{%
500  #2}{#3}}}{%
501  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
502  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
503  #4}{#5}{#6}%

504 }% 505 }

506 \@namedef{iso@rangesign@\CurrentOption}{~bis~}
507 \ifthenelse{\equal{\CurrentOption}{german}}{%
508 \def\iso@dategerman{%
509  \def\today{\iso@printdate@german{\year}{\month}{\day}}}%

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

510 \def\iso@languagename{german}%
511 }{%
512 \ifthenelse{\equal{\CurrentOption}{ngerman}}{%
513 \def\iso@datengerman{%
514  \def\today{\iso@printdate@ngerman{\year}{\month}{\day}}}%

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

515 \def\iso@languagename{ngerman}%
516 }{%
517 \ifthenelse{\equal{\CurrentOption}{austrian}}{%
518 \def\iso@dateaustrian{%
519  \def\today{\iso@printdate@austrian{\year}{\month}{\day}}}%

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

520 \def\iso@languagename{austrian}%
521 }{%
522 \ifthenelse{\equal{\CurrentOption}{naustrian}}{%
523 \def\iso@datenaustrian{%
524  \def\today{\iso@printdate@naustrian{\year}{\month}{\day}}}%

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

525 \def\iso@languagename{naustrian}%
526 }{%
527 }}}}
528 \AtBeginDocument{%
529 \ifx\undefined\iso@dategerman\else
530  \def\dategerman{\iso@dategerman}%
531 \fi
532 \ifx\undefined\iso@datengerman\else
533  \def\datengerman{\iso@datengerman}%
534 \fi
535 \ifx\undefined\iso@dateaustrian\else
536  \def\dateaustrian{\iso@dateaustrian}%
537 \fi
538 \ifx\undefined\iso@datenaustrian\else
539  \def\datenaustrian{\iso@datenaustrian}%
540 \fi

541 }

The end of the file.

E.6 Language definition file norsk.idf

This file was provided by Svend Tollak Munkejord (svend.t.munkejord@energy.sintef.no).

Heading of the file:

542 %% Endret til norsk, 2001-04-30, STM
543 \ProvidesFile{norsk.idf}[\filedate\space v\fileversion\space
544 Norwegian support from the isodate package]
\iso@languageloaded Define the command \iso@languageloaded in order to enable isodate.sty to

determine if at least one language is loaded.

545 \let\iso@languageloaded\active

\month@norsk Prints the name of today’s month in the long form for the original date format.

546 \def\month@norsk{\ifcase\month\or
547  januar\or februar\or mars\or april\or mai\or juni\or
548  juli\or august\or september\or oktober\or november\or desember\fi}

\iso@printmonthday@norsk Prints the month and the day given as two arguments ({mm}{dd}) in the current date format.

549 \def\iso@printmonthday@norsk#1#2{%

Numeric and short date format: dd/mm/

550  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
551  \equal{\iso@dateformat}{short}}{%
552  \printnumber[10]{#2}/\printnumber[10]{#1}/}{%

ISO date format: -mm-dd

553  \ifthenelse{\equal{\iso@dateformat}{iso}}{%
554  \iso@isodash\printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%

L^{A}TEX date format: /mm/dd

555  \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
556  /\printnumber[10]{#1}/\printnumber[10]{#2}}{%

Original date format: d. mmm

557  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
558  \printnumber{#2}.~\begingroup
559  \edef\lmonth{#1}\def\month{\lmonth}%
560  \month@norsk%
561  \endgroup
562  }{}}}}%

563 }

\iso@printdate@norsk Prints the date given as three arguments ({yyyy}{mm}{dd}) in the actual date format

564 \def\iso@printdate@norsk#1#2#3{%
 ISO or L^{A}TEXdate format: yyyy\iso@printmonthday@norsk
565  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
566  \equal{\iso@dateformat}{TeX}}{\number#1}{}%
567  \iso@printmonthday@norsk{\number#2}{\number#3}%
 numeric date format: \iso@printmonthday@norsk yyyy
568  \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
 original date format: \iso@printmonthday@norsk~yyyy
569  \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
 short date format: \iso@printmonthday@norsk yy
570  \ifthenelse{\equal{\iso@dateformat}{short}}{%
571  \iso@yeartwo{\number#1}}{%
572  }}}%

573 }

\iso@datenorsk This command redefines the \today command to print in the actual date format.

574 \def\iso@datenorsk{%
575  \def\today{\iso@printdate@norsk{\year}{\month}{\day}}}%
\iso@daterange@norsk This command takes six arguments ({yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2})

and prints the corrosponding date range in the actual date format.

576 \def\iso@daterange@norsk#1#2#3#4#5#6{%

ISO or L^{A}TEX date format.

577 \ifthenelse{\equal{\iso@dateformat}{iso}\or%
578  \equal{\iso@dateformat}{TeX}}{%

Print the start date.

579  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
580  \iso@rangesign%

If year and month are equal, only print the day of the end date. If only the year is equal, only print month and day of the end date. Otherwise print the whole end date.

581  \ifthenelse{\equal{\number#1}{\number#4}}{%
582  \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
583  }{\iso@printmonthday@norsk{#5}{#6}}}{%
584  \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%

Numeric, short, or original date format.

If year and month are equal, only print the day of the start date. If only the year is equal, only print month and day of the start date. Otherwise print the whole start date.

585  \ifthenelse{\equal{\number#1}{\number#4}}{%
586  \ifthenelse{\equal{\number#2}{\number#5}}{%
587  \ifthenelse{\equal{\iso@dateformat}{orig}}{%
588  \printnumber{#3}.}{\printnumber[10]{#3}}%
589  }{\iso@printmonthday@norsk{#2}{#3}}}{%
590  \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%

Print the end date.

591  \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
592  #4}{#5}{#6}%
593 }{%

594 }% 595 }

\iso@rangesign@norsk Sets the word between start and end date in a date range to “ til ”.

596 \def\iso@rangesign@norsk{~til~}

Define the language name that will the active language for isodate if none of the packages babel.sty, german.sty, and ngerman.sty is loaded and if this is the last language that is used for isodate. If one of the above packages is used this definition will be overridden by the command \languagename that will always return the current used language.

597 \def\iso@languagename{norsk}%

Redefine the command \datenorsk that is used by babel to switch to the original Norsk date format to enable the use of different date formats.

598 \AtBeginDocument{%
599 \ifx\undefined\iso@datenorsk\else
600  \def\datenorsk{\iso@datenorsk}%
601 \fi

602 }

The end of the file.

Change History

2.00

General: Total reimplementation of the package. The old package has renamed to isodateo. . . . . . 1

2.01

General: For the case that none of the packages babel, german, and ngerman is loaded there is a

new macro \iso@languagename

that contains the name of the last loaded language. If one of the packages is loaded it contains the current language. … 1 Handle case of not loaded language package babel, german and ngerman . . . . . . . . . . . . 12 2.02

General: Added Norwegian language by Svend Tollak Munkejord . . . . . . . . . . . . . . . . . . . 24 Changed the umlauts to normal TEX commands to be able to use German dates without german.sty or babel.sty. . . . . . . . 22

2.03

General: Allow change of spaces for German language . . . . . . . 4, 22 Fixed a bug in the French language that caused not to switch to it correctly on startup. … 21

2.04

General: Added section for solvable problems. . . . . . . . . . . . . . . . . 6

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\" . . . . . . . . . . 454, 458 \' . . . . . . . . . . 374, 376

\@namedef . . . . . . . .

. 460, 475, 486, 506

\@undefined . . . . . . . 38

\^. . . . . . . . . . . . . . 375

A

\active . . . . . . 170,

232, 372, 438, 545 \and . . . . . . 126, 128, 130

\AtBeginDocument . .

13–17, 159, 225, 360, 430, 528, 598

B

\begin …. 443, 445, 449

\begingroup . 70, 184,

255, 287, 309, 387, 417, 469, 558

C

\csname …. 67, 145, 148, 151, 165, 205, 210, 216, 218, 278, 283, 291, 292, 331, 336, 344, 346, 348, 352, 353, 408, 413, 422, 423, 471, 478, 489, 493, 494, 499, 501, 502, 579, 584, 590, 591

                   \CurrentOption 31, 33,

236, 237, 460, 475, 486, 506, 507, 512, 517, 522

D

                   \dateamerican . . . . . 366
                   \dateaustrian . . . . . 536
                   \datedanish . . . . . . . 227
                   \dateenglish . . . . . . 362
                   \datefrench . . . . . . . 432
                   \datefrenchb . . . . . . 433
                   \dategerman . . . . . . . 530
                   \datenaustrian . . . . 539
                   \datengerman . . . . . . 533
                   \datenorsk . . . . . . . 600
                   \daterange . . . . . 3, \underline{116}

                                             \dateUKenglish . . . . 363
                                             \dateUSenglish . . . . 367

\day 73, 201, 238, 256, 274, 288, 327, 388, 390, 404, 418, 419, 509, 514, 519, 524, 575

                                             \day@english . . . . . .

…. \underline{238}, 258, 289

                                             \daymonthsepgerman .

. . . . . . . . . 4, \underline{442}

                                             \DeclareOption . . 13–30
                                             \DeclareRobustCommand

. . . . . . . . 60– 64, 66, 68, 77, 101, 116, 442, 450

E \else . 226, 361, 365,

431, 458, 529, 532, 535, 538, 599

\end . . . . . . . . . . . . . 444

                                             \endcsname . 67, 145,

148, 151, 165, 205, 210, 216, 218, 278, 283, 291, 292, 331, 336, 344, 346, 348, 352, 353, 408, 413, 422, 423, 471, 478, 489, 493, 494, 499, 501, 502, 579, 584, 590, 591

\endgroup . . 75, 187,

259, 289, 312, 391, 420, 472, 561

\equal . . . . . . . . 51, 82, 84, 86, 104, 126, 128, 130, 131, 160, 175, 176, 178, 181, 183, 191, 192, 194–196, 203, 204, 207, 208, 211–213, 236, 237, 247, 248, 250, 252, 254, 263, 264, 266– 268, 276, 277, 280, 281, 284– 286, 301, 302, 304, 306, 308, 317, 318, 320– 322, 329, 330, 333, 334, 338– 340, 350, 378, 379, 381, 384, 386, 395, 396, 398–400, 406, 407, 410, 411, 414–416, 461, 462, 464, 466, 468, 476, 477, 480, 482, 483, 487, 488, 491, 492, 495–497, 507, 512, 517, 522, 550, 551, 553, 555, 557, 565, 566, 568– 570, 577, 578, 581, 582, 585–587

\ExecuteOptions . . . 36
\expandafter . . . . . .

83, 85, 87, 105, 127, 129, 132, 163

F

\fi … 49, 173, 228, 235, 245, 364, 368, 376, 390, 419, 434, 455, 458, 531, 534, 537, 540, 548, 601

                   \filedate . . . 2, 168,

230, 370, 436, 543

                   \fileversion . 2, 168,

230, 370, 436, 543

I \ier . . . . . . . . . 390, 419 \ifcase … 171, 233,

238, 373, 453, 546

                   \IfFileExists . . . . . . 6

\ifnum …. 390, 419, 457 \ifx … 38, 226, 361,

365, 431, 529, 532, 535, 538, 599

\input . . . . . . . . . 18–29

                   \InputIfFileExists . 31
                   \iso@@@date . . . . . . .

. 119, 127, 129, 132

                   \iso@@date . . . . . . .

. 118, 119, 123–125

                   \iso@date 78–81, 83,

85, 87, 102, 103, 105, 117, 119–122

                   \iso@dateamerican .

…. \underline{326}, 365–367

                   \iso@dateaustrian .

…. 518, 535, 536

                   \iso@datedanish . . .

…. \underline{200}, 226, 227

                   \iso@dateenglish . .

…. \underline{273}, 361–363

                   \iso@dateformat . . .

…. \underline{59}, 60–64, 175, 176, 178, 181, 183, 191, 192, 194–196, 203, 204, 213, 247, 248, 250, 252, 254, 263, 264, 266–268, 276, 277, 286, 301, 302, 304, 306, 308, 317, 318, 320–322, 329, 330, 338, 378, 379, 381, 384, 386, 395, 396, 398–400, 406, 407, 416, 461, 462, 464, 466, 468, 476, 477, 480, 482, 483, 487, 488, 497, 550, 551, 553, 555, 557, 565, 566, 568– 570, 577, 578, 587

                                             \iso@datefrench . . .

…. 403, 431–433

                                             \iso@dategerman . . .

…. 508, 529, 530

                                             \iso@datenaustrian .

…. 523, 538, 539

                                             \iso@datengerman . .

…. 513, 532, 533

                                             \iso@datenorsk . . . .

…. \underline{574}, 599, 600

                                             \iso@daterange@american

. . . . . . . . . . . \underline{328}

                                             \iso@daterange@danish

. . . . . . . . . . . \underline{202}

                                             \iso@daterange@english

. . . . . . . . \underline{275}, \underline{297}

                                             \iso@daterange@french

. . . . . . . . . . . 405

                                             \iso@daterange@norsk

. . . . . . . . . . . \underline{576}

                                             \iso@dmsepgerman . .

…. 439, 442, 463

                                             \iso@input@english .

. . . . . . . . 87, \underline{100}

                                             \iso@input@german 83, \underline{99}
                                             \iso@input@iso . . 85, \underline{98}
                                             \iso@input@TeX 105, \underline{115}
                                             \iso@isodash . . . 65,

66, 88, 106, 133, 179, 180, 251, 263, 305, 317, 382, 465, 476, 554

                                             \iso@languageloaded

. . . . . 38, \underline{170}, \underline{232}, \underline{372}, \underline{438}, \underline{545}

                                             \iso@languagename .

. . 67, 145, 148, 151, 161, 165, 205, 210, 216, 218, 224, 278, 283, 291, 292, 298, 331, 336, 344, 346, 348, 352, 353, 358, 408, 413, 422, 423, 429, 471, 478, 489, 493, 494, 499, 501, 502, 510, 515, 520, 525, 579, 584, 590, 591, 597

\iso@mylongsepgerman

…. 440, 451, 481

\iso@myshortsepgerman

…. 441, 452, 484

\iso@printdate . . . .

. . \underline{69}, 98–100, 115

\iso@printdate@american

…. \underline{316}, 325, 327

\iso@printdate@austrian

. . . . . . . . . . . 519

\iso@printdate@danish

. . . . . . . . \underline{190}, 201

\iso@printdate@english

…. \underline{262}, 272, 274

\iso@printdate@french

. . . . . . . . 394, 404

\iso@printdate@german

. . . . . . . . . . . 509

\iso@printdate@naustrian

. . . . . . . . . . . 524

\iso@printdate@ngerman

. . . . . . . . . . . 514

\iso@printdate@norsk

. . . . . . . . \underline{564}, 575

\iso@printdate@UKenglish

. . . . . . . . . . . \underline{272}

\iso@printdate@USenglish

. . . . . . . . . . . \underline{325}

\iso@printmonthday@american

…. \underline{300}, 319, 335, 341, 343, 351

\iso@printmonthday@danish

. \underline{174}, 193, 209, 215

\iso@printmonthday@english

. \underline{246}, 265, 282, 290

\iso@printmonthday@french

. 377, 397, 412, 421

\iso@printmonthday@norsk

. \underline{549}, 567, 583, 589

\iso@range@input@english

. . . . . . . . 132, \underline{150}

\iso@range@input@german

. . . . . . . . 127, \underline{147}

\iso@range@input@iso

. . . . . . . . 129, \underline{144}

\iso@rangesign . . . .

67, 68, 206, 218, 279, 292, 332, 341, 343, 347, 353, 409, 423, 490, 502, 580, 591

\iso@rangesign@american

. . . . . . . . . . . \underline{357}

\iso@rangesign@danish

. . . . . . . . . . . \underline{223}

\iso@rangesign@english

. . . . . . . . . . . 297

\iso@rangesign@french

. . . . . . . . . . . 428

\iso@rangesign@norsk

. . . . . . . . . . . \underline{596}

\iso@tmplang . . 162, 163
\iso@yeartwo . . . . . .

. . \underline{53}, 197, 269, 323, 401, 484, 571

\isodash . . . . . . . . 3, \underline{65} \isodate . . . . . 2, 13, \underline{62}

\isorangesign . . . . . \underline{67}

L

\languagename . 160–162

\lday . 256, 288, 388, 418 \lmonth . . . . . . 185,

257, 310, 311, 389, 470, 471, 559

M

\MessageBreak . . . . .

…. 42, 44, 46, 47 \month . 72, 171, 185,

201, 233, 257, 274, 311, 327, 373, 389, 404, 453, 457, 471, 509, 514, 519, 524, 546, 559, 575

\month@austrian 457, 459
\month@danish . \underline{171}, 186
\month@english . . . .

…. \underline{233}, 258, 311

\month@french . 373, 390
\month@german . . . . .

…. 453, 456, 458

\month@naustrian . . 459
\month@ngerman . . . . 456
\month@norsk . . \underline{546}, 560
\monthyearsepgerman

. . . . . . 4, 445, 450

N

\NeedsTeXFormat . . . . 1

\noexpand …. 390, 419 \not . . . . . . . . . . . . . 160 \numdate . . . . . 2, 14, \underline{60}

O \or . . . . . . 171–173,

175, 191, 203, 233–236, 238– 244, 247, 276, 301, 329, 373– 375, 378, 395, 406, 453–455, 461, 487, 546– 548, 550, 565, 577

\origdate …. 2, 17, \underline{63}

P

                          \PackageError . . . 7,

32, 39, 89, 107, 134

                          \printdate . . . . . . 3, \underline{77}
                          \printdateTeX . . . 3, \underline{101}
                          \printnumber . . . . . .

. . \underline{50}, 177, 179, 180, 182, 184, 208, 214, 249, 251, 253, 281, 289, 303, 305, 307, 313, 334, 342, 380, 382, 383, 385, 411, 420, 463, 465, 467, 469, 492, 498, 552, 554, 556, 558, 582, 588

                          \ProcessOptions . . . 37

\protect . 47, 94, 95,

112, 113, 139, 140

                          \ProvidesFile . 168,

230, 370, 436, 543

                          \ProvidesPackage . . . 2

R

                          \RequirePackage . . . 4–6

S

                          \selectlanguage . . . 163
                          \shortdate . . . 2, 15, \underline{61}

\string . . . . . . . . . . 43

                          \SubStringsToCounter

. . . . . . . . 79– 81, 103, 120–125

T \TeXdate . . . . . 2, 16, \underline{64}

                          \theiso@@dot . . . . . . 126
                          \theiso@@minus . . . . 128
                          \theiso@@slash . . . . 131
                          \theiso@dot . . . . 82, 126

\theiso@minus . . 84, 128
\theiso@slash . . . . .

. . . . . 86, 104, 130

\theiso@yeartwo . 56–58

\today 3, 74, 201, 274, 327, 404, 509, 514, 519, 524, 575

U

                          \undefined 226, 361,

365, 431, 529, 532, 535, 538, 599

                                                   \usepackage . . . . . 43, 47

Y \year . . 71, 201, 274,

327, 404, 509, 514, 519, 524, 575