Debian Codegraph @

texmf-dist/source/latex/isodate/isodate.dtx

raw
1 % \iffalse meta comment
2 % File: isodate.dtx Copyright (C) 2000--2010 Harald Harders
3 % \fi
4 %
5 % \iffalse
6 %
7 %<*driver>
8 \documentclass[UKenglish]{ltxdoc}
9 \usepackage{babel}
10 \IfFileExists{isodate.sty}{\usepackage[english,iso]{isodate}
11 \let\isodateSTYfound\active}{\GenericWarning{isodate.dtx}{Package
12 file isodate.sty not found (Documentation will be messed up!^^J^^A
13 Generate isodate.sty by (La)TeXing isodate.ins, process
14 isodate.dtx again)^^J}\stop}
15 \usepackage{array}
16 \usepackage{url}
17 \usepackage{longtable}
18 \usepackage{morefloats}
19 \GetFileInfo{isodate.sty}
20 \title{The \texttt{isodate} package\thanks{This file has version
21 \fileversion\ last revised \printdateTeX{\filedate}.}}
22 \author{Harald Harders\\\texttt{[email protected]}}
23 \date{File Date \printdateTeX{\filedate}, Printed \today}
24 \newlength{\tempdima}%
25 \makeatletter
26 \renewenvironment{table}[1][]{%
27 \@float{table}[#1]%
28 \centering%
29 \setlength{\tempdima}{\abovecaptionskip}%
30 \setlength{\abovecaptionskip}{\belowcaptionskip}%
31 \setlength{\belowcaptionskip}{\tempdima}%
32 }{%
33 \end@float
34 }
35 \makeatother
36 \EnableCrossrefs
37 \CodelineIndex
38 \DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter,%
39 \gdef,\@ifundefined,\@empty,\@firstoftwo,\@secondoftwo,\@nil,%
40 \,,\number,\renewcommand,\setboolean,\whiledo,\ifthenelse}
41 \DoNotIndex{\setcounter,\space,\MessageBreak,\DeclareRobustCommand,\equal}
42 \DoNotIndex{\csname,\endcsname,\ifx,\else,\fi,\if,\fi,\@tempswafalse}
43 \DoNotIndex{\@tempswatrue,\undefined,\if,\or,\and,\fi}
44 \DoNotIndex{\begingroup,\endgroup,\begin,\end,\CurrentOption}
45 \CodelineNumbered
46 \RecordChanges
47 \CheckSum{2493}
48 \begin{document}
49 \DocInput{isodate.dtx}
50 \end{document}
51 %</driver>
52 % \fi
53 %
54 % \changes{2.30}{2010/01/03}{Add a month-year format}%
55 % \changes{2.30}{2010/01/03}{Move defintion of language-independent
56 % formats into the main style file}%
57 % \changes{2.26}{2005/03/10}{Support different input formats
58 % containing slashes}%
59 % \changes{2.23}{2004/11/19}{Avoid to use the \texttt{calc} package
60 % since it causes problems with many other packages}%
61 % \changes{2.22}{2004/02/12}{Path changed according to new CTAN
62 % structure}%
63 % \changes{2.22}{2004/02/12}{Makefile adapted for \TeX Live}%
64 % \changes{2.21}{2003/12/06}{Fix some bugs in date ranges when both
65 % month and year are equal (several language)}%
66 % \changes{2.21}{2003/12/06}{Support to print date without year (in
67 % all language-dependent commands \cs{iso@printmonthday@...} and
68 % \cs{iso@printdate@...})}%
69 % \changes{2.20}{2003/12/06}{Avoid usage of \cs{filedate} and
70 % \cs{fileversion}}
71 % \changes{2.01}{2000/08/24}{For the case that none of the packages
72 % babel, german, and ngerman is loaded there is a new macro
73 % \texttt{\textbackslash iso@languagename} that contains the name of
74 % the last loaded language. If one of the packages is loaded it
75 % contains the current language.}
76 % \changes{2.00}{2000/08/21}{Total reimplementation of the
77 % package. The old package has renamed to isodateo.}
78 %
79 % \maketitle
80 %
81 % \begin{abstract}
82 % \noindent This package provides commands to switch between different
83 % date formats (standard, ISO, numeric, \LaTeX\ package).
84 % They are used by the \cs{today} command, by the \cs{printdate} and
85 % \cs{printdateTeX} commands that print any date, and by the
86 % \cs{daterange} command that prints a date range.
87 % At the moment, this package supports German (old and new
88 % orthography, Austrian), British, US, Australian as well as New
89 % Zealand English,\footnote{In order to use Australian or New Zealand,
90 % you need a version of babel that supports the used language. It
91 % should be available, soon.}
92 % French, Italian, Danish, Swedish, and Norwegian.
93 %
94 % The idea for this package was taken from the akletter class.
95 % \end{abstract}
96 %
97 % \tableofcontents
98 %
99 % \section*{Acknowledgements}
100 %
101 % First of all I have to thank Axel Kielhorn who wrote the package
102 % \verb|akletter| which inspired me to write \verb|isodate|. The help
103 % of Heiko Oberdiek was necessary to handle characters in substrings
104 % which resulted in the package \verb|substr|. David Sanderson found
105 % the bug which disabled \verb|isodate| to work without
106 % \verb|babel|. He also helped me to improve the documentation and
107 % sent me a link to the ISO 8601 norm \cite{iso8601a}.
108 % Svend Tollak Munkejord has added the Norwegian language, Christian
109 % Schlauer has added Swedish, Philip Ratcliffe has added Italian.
110 %
111 % \section*{Requirements}
112 %
113 % The package |isodate| needs the package |substr.sty| which can be
114 % obtained from |CTAN:macros/latex/contrib/substr/|.
115 %
116 % \section{Commands}
117 %
118 % \subsection{Switching the date output format}
119 %
120 % \DescribeMacro{\isodate}%
121 % \DescribeMacro{\numdate}%
122 % \DescribeMacro{\shortdate}%
123 % \DescribeMacro{\TeXdate}%
124 % \DescribeMacro{\origdate}%
125 % \changes{2.05}{2001/05/19}{Added an original format with a two digit year.}%
126 % \DescribeMacro{\shortorigdate}%
127 % \DescribeMacro{\Romandate}%
128 % \DescribeMacro{\romandate}%
129 % This package provides five commands to switch the output format of
130 % all commands that print dates (described later):
131 % \DescribeMacro{\shortRomandate}%
132 % \DescribeMacro{\shortromandate}%
133 % \medskip
134 %
135 % \begin{longtable}[l]{@{}ll}
136 % \verb|\isodate|&date format described in ISO 8601 and DIN 5008
137 % \cite{iso8601a}\\
138 % &(yyyy-mm-dd)\\
139 % \verb|\numdate|&numeric date format with four digits of the year\\
140 % \verb|\shortdate|&short numeric date format with two digits of the
141 % year\\
142 % \verb|\TeXdate|&date format used for version description of
143 % packages\\
144 % &(yyyy/mm/dd)\\
145 % \verb|\origdate|&original \LaTeX\ format\\
146 % \verb|\shortorigdate|&original \LaTeX\ format with two instead of four
147 % digits of\\
148 % &the year\\
149 % \verb|\Romandate|& As \cs{numdate} but with uppercase Roman numerals
150 % \\
151 % & for the month\\
152 % \verb|\romandate|& As \cs{numdate} but with lowercase Roman numerals
153 % \\
154 % & for the month\\
155 % \verb|\shortRomandate|& As \cs{shortdate} but with uppercase Roman numerals
156 % \\
157 % & for the month\\
158 % \verb|\shortromandate|& As \cs{shortdate} but with lowercase Roman numerals
159 % \\
160 % & for the month\\
161 % \end{longtable}
162 % \medskip
163 %
164 % These commands \emph{do not} print any dates and they don't take an
165 % argument.
166 % They just switch the format for later usage of the date-printing
167 % commands \cs{today}, \cs{printdate}, \cs{printdateTeX}, and
168 % \cs{daterange}.
169 %
170 % The numeric and short numeric as well as the Roman numbered formats
171 % change their behaviour depending on the current language:
172 %
173 % \noindent\begin{tabular}{@{}llll@{}}
174 % German, nGerman&\verb|dd.\,mm.~yyyy|&resp.&\verb|dd.\,mm.\,yy|\\
175 % US English&\verb|mm/dd/yyyy|&resp.&\verb|mm/dd/yy|\\
176 % other languages&\verb|dd/mm/yyyy|&resp.&\verb|dd/mm/yy|
177 % \end{tabular}
178 %
179 % This package supports German (old and new rules, Austrian), US
180 % English, French, Danish, Italian, Swedish, and Norwegian.
181 % Switching the language by using \verb|\selectlanguage| does \emph{not}
182 % switch back to the original date format. So the current date format
183 % stays active when changing the language.
184 %
185 % The change of the date format works locally. So it is possible to
186 % change it locally inside a group; e.g.,
187 % \begin{verbatim}
188 %\today, {\origdate\today}, \today\end{verbatim}
189 % leads to `\today, {\origdate\today}, \today'.
190 %
191 % \DescribeMacro{\printyearoff}%
192 % \DescribeMacro{\printyearon}%
193 % By default, all formats print the day, month, and year.
194 % Sometimes, you may want to print the date without the year.
195 % This can be reached by using the command \cs{printyearoff}.
196 % You can switch back with \cs{printyearon} or by using
197 % \cs{printyearoff} inside a group (e.g., an environment).
198 % To switch globally, preceed the command by \cs{global}.
199 % An example:
200 % \begin{verbatim}
201 %\today, {\printyearoff\today}, \today\end{verbatim}
202 % leads to `{\origdate\today, {\printyearoff\today}, \today}'.
203 %
204 % \DescribeMacro{\printdayoff}%
205 % \DescribeMacro{\printdayon}%
206 % Likewise you can switch on or off printing the day using
207 % \cs{printdayon} and \cs{printdayoff}.
208 % Note that you still have to provide complete dates in the
209 % \cs{printdate} command, described in Section~\ref{sec:anydate} below.
210 %
211 % \subsection{Printing today's date}
212 %
213 % \DescribeMacro{\today}%
214 % As usual, the command \cs{today} prints the date of today. Its
215 % appearance is influenced by the current date format
216 %
217 % \subsection{Printing any date}
218 % \label{sec:anydate}
219 %
220 % \DescribeMacro{\printdate}%
221 % The command \verb|\printdate{#1}| prints any date in the current
222 % format. The argument may be a date in German, British English, or
223 % ISO format, e.g.,
224 % \begin{verbatim}
225 %\printdate{24.12.2000}
226 %\printdate{24/12/2000}
227 %\printdate{2000-12-24}\end{verbatim}
228 %
229 % \DescribeMacro{\printdateTeX}%
230 % The command \verb|\printdateTeX{#1}| prints any date in the actual
231 % format. The argument must be in the \LaTeX\ format
232 % \verb|yyyy/mm/dd|, e.g.,
233 % \begin{verbatim}
234 %\printdateTeX{2000/12/24}\end{verbatim}
235 % This command is useful for printing version information stored in a
236 % macro. For example the version of this package is stored in
237 % the macro \verb|\filedate| (`\filedate'). To print it with the actual
238 % date format you can use the command \verb|\printdateTeX{\filedate}|
239 % which leads to e.g., `\printdateTeX{\filedate}' or
240 % {\origdate`\printdateTeX{\filedate}'}.
241 % Another possibility is to switch the input format to |tex| using
242 % \cs{dateinputformat}, described below.
243 %
244 % \subsection{Printing date ranges}
245 %
246 % \DescribeMacro{\daterange}%
247 % The command \verb|\daterange{#1}{#2}| prints a date range in the current
248 % format. The arguments may be a date in German, British English, or
249 % ISO format (see above). But there is a limitation: Both arguments
250 % must have the same input format.
251 %
252 % Depending on the language and date format, this commands leaves out
253 % some of the data. The simplest way to understand it is to watch some
254 % examples:
255 % \par\medskip\noindent
256 % \verb|{\isodate|{\isodate\\
257 % \verb|\daterange{1999-05-03}{1999-05-31}| $\longrightarrow$
258 % \daterange{1999-05-03}{1999-05-31}\\
259 % \verb|\daterange{1999-05-03}{1999-11-03}| $\longrightarrow$
260 % \daterange{1999-05-03}{1999-11-03}\\
261 % \verb|\daterange{1999-05-03}{2000-04-07}| $\longrightarrow$
262 % \daterange{1999-05-03}{2000-04-07}\\
263 % \verb|}|}\\
264 % \verb|{\origdate|{\origdate\\
265 % \verb|\daterange{1999-05-03}{1999-05-31}| $\longrightarrow$
266 % \daterange{1999-05-03}{1999-05-31}\\
267 % \verb|\daterange{1999-05-03}{1999-11-03}| $\longrightarrow$
268 % \daterange{1999-05-03}{1999-11-03}\\
269 % \verb|\daterange{1999-05-03}{2000-04-07}| $\longrightarrow$
270 % \daterange{1999-05-03}{2000-04-07}\\
271 % \verb|}|}
272 %
273 % \subsection{Changing the ISO format}
274 %
275 % \DescribeMacro{\isodash}%
276 % The ISO norm says that the date format is `yyyy-mm-dd' or
277 % `yyyymmdd' \cite{iso8601a}.
278 % By default I use the hyphen `-' as separator. You can change this
279 % using the \verb|\isodash|\footnote{The name `isodash' is a little
280 % bit confusing and was chosen due to my limited knowledge in
281 % English. It should be named `isoseparator' or `isosep'. But for
282 % compatiblity reasons I will not change it.} command, e.g.,
283 % \begin{verbatim}
284 %\printdate{24/12/2000},
285 %\isodash{--}%
286 %\printdate{24/12/2000},
287 %\isodash{}%
288 %\printdate{24/12/2000}\end{verbatim}
289 % leads to `2000-12-24, 2000--12--24, 20001224'. Or for example
290 % \begin{verbatim}
291 %\isodash{$\cdot$}
292 %\printdate{24/12/2000}\end{verbatim}
293 % leads to `2000$\cdot$12$\cdot$24'.
294 %
295 %
296 % \subsection{Changing the original and short original format}
297 %
298 % \DescribeMacro{\isospacebeforeday}%
299 % \DescribeMacro{\isospacebeforemonth}%
300 % \DescribeMacro{\isospacebeforeyear}%
301 %
302 % By default, the original and short original format prints
303 % unbreakable spaces between the parts of the dates, e.g.,
304 % `|19~May~2001|'.
305 % If you want to allow breakable spaces or other characters, you can
306 % redefine the spaces using \cs{isospacebeforeday},
307 % \cs{isospacebeforemonth}, and \cs{isospacebeforeyear}:
308 % \begin{verbatim}
309 %\isospacebeforeyear{\ }\end{verbatim}
310 % leads to `|19~May\ 2001|'. Notice that the space is written as
311 % \verb*|\ | to ensure that the space is not getting lost under all
312 % circumstances.
313 %
314 % As the names imply, the spaces before the specified part (day, month,
315 % or year) is changed. For most formats, only \cs{isospacebeforemonth}
316 % and \cs{isospacebeforeyear} are relevant, while for US English,
317 % \cs{isospacebeforeday} and \cs{isospacebeforeyear} are used.
318 %
319 % This only effects the \verb|orig| and \verb|shortorig| formats.
320 %
321 %
322 % \subsection{Changing the short original format}
323 %
324 % \DescribeMacro{\shortyearsign}%
325 %
326 % The short original format normally prints the year with two digits, e.g.,
327 % `19th May 01'.
328 % Some people want to add an additional sign before the year, e.g.,
329 % `19th May '01'.
330 % This can be achieved by using the command \verb|\shortyearsign|, e.g.,
331 % \begin{verbatim}
332 %\printdate{24/12/2000},
333 %\shortyearsign{'}%
334 %\printdate{24/12/2000}\end{verbatim}
335 % leads to `24 december 00, 24 december '00' in English.
336 %
337 % This only effects the \verb|shortorig| format. The \verb|short| numerical
338 % format stays unchanged.
339 %
340 %
341 % \subsection{Changing the German format}
342 %
343 % \changes{2.03}{2001/05/04}{Allow change of spaces for German language}%
344 % The spacings for the numerical formats in the German language
345 % (24.\,12.~2000 resp. 24.\,12.\,00) were taken from the Duden
346 % \cite{duden1996a} and are the defaults when using one of the
347 % German derivatives.
348 % Some people want to use different spacings. Thus from version 2.03 on it
349 % is possible to change them.
350 % \DescribeMacro{\daymonthsepgerman}%
351 % \DescribeMacro{\monthyearsepgerman}%
352 % \DescribeMacro{\monthyearsepnodaygerman}%
353 % You can change the spacing between the day and the month using the
354 % command \cs{daymonthsepgerman}. Using the command
355 % \cs{monthyearsepgerman} you can change the spacing between the
356 % month and the year for the long and the short format, e.g.,
357 % \begin{verbatim}
358 %\daymonthsepgerman{\quad}%
359 %\monthyearsepgerman{\qquad}{\quad}%
360 %{\numdate\printdate{24.12.2000}}, {\shortdate\printdate{24.12.2000}}\end{verbatim}
361 % leads to `24.\quad12.\qquad2000, 24.\quad12.\quad00'.
362 %
363 % The default values are `\cs{,}' for the separator between day and
364 % month resp.\ `\cs{,}' between month and year in the short format
365 % and `|~|' in the long format.
366 %
367 % Likewise, \cs{monthyearsepnodaygerman} is used for defining the
368 % spacing between the month and the year when printing the day is
369 % switched off (using \cs{printdayoff}).
370 % The arguments are the same as for \cs{monthyearsepgerman}.
371 % Default is no space for long and short format.
372 %
373 %
374 % \subsection{Changing the English format}
375 %
376 % \changes{2.28}{2005/04/15}{Introduce option cleanlook for English
377 % date format}%
378 % By default, the English date format looks like `24th December
379 % 2000'.
380 % During the last years, a change has occured in many documents
381 % towards `24 December 2000'.
382 % This new format is called `clean look'.
383 % \DescribeMacro{\cleanlookdateon}%
384 % \DescribeMacro{\cleanlookdateoff}%
385 % Isodate's behaviour can be changed towards it using
386 % \cs{cleanlookdateon} and \cs{cleanlookdateoff}.
387 % This can also be done globally using the |cleanlook| package option.
388 %
389 % At the moment, the `clean look' functionality only affects British
390 % English.
391 % If this trend also counts for different languages, please tell it me
392 % that I can add support for them.
393 %
394 %
395 %
396 % \subsection{User defined month formatting}
397 %
398 % Internally, the formats using Roman numerals for the month are just
399 % links to the \cs{numdate} and \cs{shortdate} formats with a changed
400 % format for printing the month.
401 % Therefore, the command \cs{Romandate} calls \cs{numdate} by
402 % following sequence:
403 % \begin{verbatim}
404 %\numdate[Roman]%
405 %\isotwodigitdayfalse\end{verbatim}
406 % This tells \cs{numdate} to format the month using the \cs{Roman}
407 % command and to typeset the day without a leading zero if it is
408 % less than ten.
409 %
410 % You may do similar things, e.g.,
411 % \begin{verbatim}
412 %\numdate[Alph]\end{verbatim}
413 % prints the months with the command \cs{Alph}, `A', `B', \ldots{}
414 % The day is printed with two digits since every call of \cs{numdate}
415 % or \cs{shortdate} calls \cs{isotwodigitdaytrue} which switches
416 % printing the day with two digits on.
417 % This does not make any sence but may serve as example.
418 % If you want to enable days with one digit, append
419 % \cs{isotwodigitdaytrue}:
420 % \begin{verbatim}
421 %\numdate[Alph]%
422 %\isotwodigitdaytrue\end{verbatim}
423 %
424 % You may declare any command that typesets a counter that is given as
425 % its mandatory argument (e.g., \cs{alph}, \cs{Alph}, \cs{arabic},
426 % \ldots) in the optional argument of the \cs{numdate},
427 % \cs{shortdate}, \cs{isodate}, and \cs{TeXdate} commands, without the
428 % leading backslash.
429 % You can, of course, define own commands that do it.
430 % For instance,
431 % \begin{verbatim}
432 %{\def\boldnum#1{\textbf{\twodigitarabic{#1}}}%
433 %\numdate[boldnum]%
434 %\printdate{24.3.2000}}\end{verbatim}
435 % leas to
436 % `{\def\boldnum#1{\textbf{\twodigitarabic{#1}}}\ignorespaces
437 % \numdate[boldnum]\ignorespaces
438 % \printdate{24.3.2000}}'.
439 % \DescribeMacro{\twodigitarabic}
440 % Here, the \cs{twodigitarabic} command has been used that prints a
441 % positive number with at least two digits.\footnote{This command is
442 % also used for the numerical date formats.}
443 %
444 % If you, for example want a numerical date format with the day and
445 % month printed with the `natural' number of digits rather than with
446 % two digits, you may do it as follows:
447 % \begin{verbatim}
448 %{\numdate[arabic]\isotwodigitdayfalse
449 %\printdate{1.2.2000}}\end{verbatim}
450 % which leads to `{\numdate[arabic]\isotwodigitdayfalse
451 % \printdate{1.2.2000}}'.
452 %
453 % Using one of the other date formats reset the numerical format to
454 % its standard settings with arabic numerals (with two digits), e.g.,
455 % \begin{verbatim}
456 %{\numdate[Alph]\printdate{6.12.2000};
457 %\isodate\printdate{6.12.2000};
458 %\numdate\printdate{6.12.2000}}\end{verbatim}
459 % leads to `{\numdate[Alph]\isotwodigitdayfalse\printdate{6.12.2000};
460 % \isodate\printdate{6.12.2000};
461 % \numdate\printdate{6.12.2000}}'.
462 %
463 % \subsection{Switching the date input format}
464 %
465 % \DescribeMacro{\dateinputformat}%
466 % As described above, the date can be given in different formats.
467 % For the German format |dd.mm.yyyy| and the ISO format |yyyy-mm-dd|,
468 % the input format is definite.
469 % But when using slashes to seperate the day, month, and year,
470 % different formats exist.
471 % British people use |dd/mm/yyyy|, American people use |mm/dd/yyyy|,
472 % while \TeX\ uses |yyyy/mm/dd| which in fact is an ISO format with
473 % slashes instead of dashes.
474 %
475 % By default, the British format is used.
476 % If the user wants to give the American or \TeX\ format as argument
477 % of the \cs{printdate} or \cs{daterange} commands, the macro
478 % \cs{dateinputformat} can be used to change the behaviour.
479 % This macro takes the name of the input format as single parameter,
480 % e.g., \cs{dateinputformat\{american\}}, for switching to American
481 % behaviour, e.i., |mm/dd/yyyy|.
482 % For example,
483 % \begin{verbatim}
484 %\numdate
485 %\selectlanguage{UKenglish}%
486 %\dateinputformat{american}%
487 %\printdate{12/31/2004}\end{verbatim}
488 % gives
489 % \begingroup
490 % \numdate
491 % \selectlanguage{UKenglish}\dateinputformat{american}\printdate{12/31/2004}.
492 % \endgroup
493 % In this example, \emph{input} format is American while the
494 % \emph{output} format is English.
495 %
496 % Valid arguments for the \cs{dateinputformat} command are |english|,
497 % |UKenglish|, |british|, |american|, |USenglish|, |tex|, |latex|,
498 % |TeX|, |LaTeX|.
499 % The meaning of most possibilities should be clear; |english| means
500 % British English.
501 %
502 % Beware that the input format may only be changed for the date format
503 % using slashes.
504 % Thus, you don't have to and are not allowed to specify input formats
505 % other than these described above.
506 % For example, \cs{dateinputformat\{german\}} is not
507 % allowed (and not necessary).
508 %
509 % \section{Calling the package}
510 %
511 % The package is called using the \verb|\usepackage| command:\\
512 % \verb|\usepackage[|option\verb|]{isodate}|.
513 %
514 % The possible package options can be seen in table~\ref{tab:options}.
515 % %
516 % \begin{table}[!tbp]
517 % \centering
518 % \caption{Package options}
519 % \label{tab:options}
520 % \begin{minipage}{\linewidth}
521 % \begin{tabular}{ll}\hline
522 % option&function\\ \hline
523 % \verb|iso|&start with ISO date format\\
524 % \verb|num|&start with numeric date format with 4 digits of the year\\
525 % \verb|short|&start with numeric date format with 2 digits of the year\\
526 % \verb|TeX|&start with \LaTeX\ numeric date format (yyyy/mm/dd)\\
527 % \verb|orig|&start with normal \LaTeX\ date format
528 % (default\footnote{The original format is used as default in order
529 % to avoid a different document output by just including the package.})\\
530 % \verb|shortorig|&start with short normal \LaTeX\ date format (2 digits)\\
531 % \verb|Roman|&start with numeric date format (month in uppercase\\
532 % & Roman numerals)\\
533 % \verb|roman|&start with numeric date format (month in lowercase\\
534 % & Roman numerals)\\
535 % \verb|shortRoman|&start with short Roman format\\
536 % \verb|shortroman|&start with short roman format\\
537 % \hline
538 % \verb|american|&support American English date format\\
539 % \verb|austrian|&support Austrian date format\\
540 % \verb|british|&support British English date format\\
541 % \verb|danish|&support Danish date format\\
542 % \verb|english|&support British English date format\\
543 % \verb|french|&support French date format\\
544 % \verb|german|&support German date format\\
545 % \verb|naustrian|&support new Austrian date format\\
546 % \verb|ngerman|&support new German date format\\
547 % \verb|italian|&support Italian date format\\
548 % \verb|norsk|&support Norwegian date format\\
549 % \verb|norwegian|&support Norwegian date format\\
550 % \verb|swedish|&support Swedish date format\\
551 % \verb|UKenglish|&support British English date format\\
552 % \verb|USenglish|&support American English date format\\
553 % \hline
554 % \verb|inputenglish|& English date input format (default)\\
555 % \verb|inputbritish|& English date input format (default)\\
556 % \verb|inputUKenglish|& English date input format (default)\\
557 % \verb|inputamerican|& American date input format\\
558 % \verb|inputUSenglish|& American date input format\\
559 % \verb|inputtex|& \TeX\ date input format\\
560 % \verb|inputTeX|& \TeX\ date input format\\
561 % \verb|inputlatex|& \TeX\ date input format\\
562 % \verb|inputLaTeX|& \TeX\ date input format\\
563 % \hline
564 % \verb|cleanlook|&use `clean look' for English dates\\
565 % \verb|nocleanlook|&don't use `clean look' for English dates (default)\\
566 % \hline
567 % \verb|printdayon|&print complete date including the day (default)\\
568 % \verb|printdayoff|&omit the day in the date\\
569 % \hline
570 % \end{tabular}
571 % \end{minipage}
572 % \end{table}
573 %
574 % \emph{Be aware that at least one language option must be set when calling
575 % isodate.} The last language in the option list is the default language.
576 %
577 % The package isodate works well together with \verb|babel.sty|,
578 % \verb|german.sty|, or \verb|ngerman.sty|.
579 % It does not matter if \verb|isodate| is loaded before or after the
580 % used language package.
581 %
582 % It is also possible to use isodate without one of the language
583 % packages. Then it is not possible to switch between languages using
584 % the \verb|\selectlanguage| command.\footnote{Yes, there is a way to
585 % change the date language, but it is a little bit tricky:\\
586 % \texttt{\textbackslash makeatletter\\
587 % \textbackslash def\textbackslash iso@languagename\{german\}\%\\
588 % \textbackslash dategerman\%\\
589 % \textbackslash makeatother}}
590 % Then the default language is the last one in the option list. If an
591 % error occurs when using isodate without one of the packages
592 % \verb|babel.sty|, \verb|german.sty|, and \verb|ngerman.sty| please
593 % run \verb|tstlang.tex| through latex and send the file
594 % \verb|tstlang.log| to the address \verb|[email protected]|.
595 %
596 % If using isodate
597 % together with babel it can be useful to put the language options as
598 % global options into the optional parameters of the
599 % \verb|\documentclass| command.
600 % Then automatically the available languages are the same for the text
601 % and the dates, and the default language is also the same.
602 % For example:
603 % \begin{verbatim}
604 %\documentclass[english,german]{article}
605 %\usepackage{babel}
606 %\usepackage[num]{isodate}\end{verbatim}
607 %
608 % The input format options specify the input format that is used at
609 % the begin of the document.
610 % You don't have to define multiple options if you want to change the
611 % input format in the document using \cs{dateinputformat}.
612 % For example,
613 % \begin{verbatim}
614 %\documentclass[american,german,british]{article}
615 %\usepackage{babel}
616 %\usepackage[iso,inputamerican]{isodate}
617 %\begin{document}
618 %D \printdate{28.2.2000}\par
619 %ISO \printdate{2000-2-28}\par
620 %US \printdate{2/28/2000}\par
621 %\dateinputformat{british}UK \printdate{28/2/2000}\par
622 %\dateinputformat{tex}\TeX\ \printdate{2000/2/28}
623 %\end{document}\end{verbatim}
624 % works as expected.
625 %
626 % Beware that only the mentioned input formats are defined.
627 % For example, |inputgerman| does not exist because it is not
628 % necessary.
629 %
630 %
631 % \section{Add new languages to the package}
632 %
633 % The easiest way to add new languages to the package is to copy one
634 % of the simple language files \verb|danish.idf| or \verb|french.idf|
635 % to the new language name, e.g., \verb|plattdeutsch.idf|, and change it
636 % as necessary.
637 %
638 % This new file can be used without changing \verb|isodate.sty| if you
639 % use its name explicitly in the optional parameter of the
640 % \verb|\usepackage| command. If you have added support for a new
641 % language please mail me.
642 %
643 % \changes{2.04}{2001/05/17}{Added section for solvable problems.}
644 % \changes{2.10}{2003/10/13}{Removed section about solvable problems
645 % since it was wrong.}
646 %
647 % \appendix
648 %
649 % \section{Licence}
650 %
651 % Copyright 2000--2010 Harald Harders
652 %
653 % This program can be redistributed and/or modified under the terms
654 % of the LaTeX Project Public License Distributed from CTAN
655 % archives in directory macros/latex/base/lppl.txt; either
656 % version 1 of the License, or any later version.
657 %
658 % \section{Known errors}
659 %
660 % \begin{itemize}
661 % \item The \cs{printdate} and \cs{printdateTeX} commands are not
662 % very good in checking the argument for correct syntax.
663 % \item The language definition files \verb|french.idf| and
664 % \verb|german.idf| are not yet commented.
665 % \item Isodate and draftcopy do not work together.
666 % \item Documentation of the code is partly poor.
667 % \end{itemize}
668 %
669 % \section{Planned features and changes}
670 %
671 % \begin{itemize}
672 % \item Add other languages.
673 % Please help me with this topic. I don't know the date formats in
674 % other languages.
675 % \item Format short given years to four digits and calculate
676 % reasonable first and second digits.
677 % \end{itemize}
678 %
679 % \begin{thebibliography}{1}
680 % \bibitem{iso8601a}
681 % International Standard: ISO~8601.
682 % \newblock \url{http://www.iso.ch/markete/8601.pdf}, 1988-06-15.
683 % \bibitem{duden1996a}
684 % DUDEN Band 1.
685 % \newblock Die deutsche Rechtschreibung.
686 % \newblock 21. Auf\/lage, Dudenverlag, Mannheim, Germany, 1996.
687 % \end{thebibliography}
688 %
689 % \StopEventually{\PrintChanges \PrintIndex}
690 %
691 %
692 % \section{The implementation}
693 %
694 % \subsection{Package file isodate.sty}
695 %
696 % Heading of the files:
697 % \begin{macrocode}
698 %<isodate>\NeedsTeXFormat{LaTeX2e}
699 %<isodate>\ProvidesPackage{isodate}
700 %<danish>\ProvidesFile{danish.idf}
701 %<english>\ProvidesFile{english.idf}
702 %<french>\ProvidesFile{french.idf}
703 %<german>\ProvidesFile{german.idf}
704 %<italian>\ProvidesFile{italian.idf}
705 %<norsk>\ProvidesFile{norsk.idf}
706 %<swedish>\ProvidesFile{swedish.idf}
707 %<isodate> [2010/01/03 v2.30 Print dates with different formats (HH)]
708 %<language> [2010/01/03 v2.30 Language definitions for isodate package (HH)]
709 % \end{macrocode}
710 % The package:
711 % \begin{macrocode}
712 %<*isodate>
713 \RequirePackage{ifthen}
714 \IfFileExists{substr.sty}{\RequirePackage{substr}%
715 }{\PackageError{isodate.sty}{Package file substr.sty not found}
716 {This version of isodate.sty needs the package substr.sty.^^J%
717 You can download it from
718 CTAN:/macros/latex/contrib/substr/^^J%
719 e.g., one CTAN node is ftp.dante.de.
720 Install substr.sty into your TeX tree.}}
721 % \end{macrocode}
722 % Declare the options for the default date format.
723 % \changes{2.05}{2001/05/19}{Execute options at the end of the package instead
724 % of at the end of the preamble.}
725 % \changes{2.10}{2003/10/13}{Add month in Roman numerals}%
726 % \begin{macrocode}
727 \DeclareOption{iso}{\AtEndOfPackage{\isodate}}
728 \DeclareOption{num}{\AtEndOfPackage{\numdate}}
729 \DeclareOption{short}{\AtEndOfPackage{\shortdate}}
730 \DeclareOption{TeX}{\AtEndOfPackage{\TeXdate}}
731 \DeclareOption{orig}{\AtEndOfPackage{\origdate}}
732 \DeclareOption{shortorig}{\AtEndOfPackage{\shortorigdate}}
733 \DeclareOption{Roman}{\AtEndOfPackage{\Romandate}}
734 \DeclareOption{roman}{\AtEndOfPackage{\romandate}}
735 \DeclareOption{shortRoman}{\AtEndOfPackage{\shortRomandate}}
736 \DeclareOption{shortroman}{\AtEndOfPackage{\shortromandate}}
737 \DeclareOption{cleanlook}{\AtEndOfPackage{\cleanlookdateon}}
738 \DeclareOption{nocleanlook}{\AtEndOfPackage{\cleanlookdateoff}}
739 % \end{macrocode}
740 % \changes{2.30}{2010/01/03}{Add a month-year format}%
741 % Declare the options which decide wheather day is printed.
742 % \begin{macrocode}
743 \DeclareOption{printdayoff}{\AtEndOfPackage{\printdayoff}}
744 \DeclareOption{printdayon}{\AtEndOfPackage{\printdayon}}
745 % \end{macrocode}
746 % \changes{2.26}{2005/03/10}{Support different input formats
747 % containing slashes}%
748 % Declare the options for the default date input format.
749 % \begin{macrocode}
750 \DeclareOption{inputenglish}{\AtEndOfPackage{\dateinputformat{english}}}
751 \DeclareOption{inputbritish}{\AtEndOfPackage{\dateinputformat{english}}}
752 \DeclareOption{inputUKenglish}{\AtEndOfPackage{\dateinputformat{english}}}
753 \DeclareOption{inputamerican}{\AtEndOfPackage{\dateinputformat{american}}}
754 \DeclareOption{inputUSenglish}{\AtEndOfPackage{\dateinputformat{american}}}
755 \DeclareOption{inputtex}{\AtEndOfPackage{\dateinputformat{tex}}}
756 \DeclareOption{inputTeX}{\AtEndOfPackage{\dateinputformat{tex}}}
757 \DeclareOption{inputlatex}{\AtEndOfPackage{\dateinputformat{tex}}}
758 \DeclareOption{inputLaTeX}{\AtEndOfPackage{\dateinputformat{tex}}}
759 % \end{macrocode}
760 % Declare the options for language support.
761 % \changes{2.07}{2003/07/29}{Add Swedish language}%
762 % \changes{2.20}{2003/12/06}{Add Australian and New Zealand}%
763 % \changes{2.24}{2005/02/17}{Add option frenchb}%
764 % \changes{2.26}{2005/03/10}{Add option british}%
765 % \begin{macrocode}
766 \DeclareOption{american}{\input{english.idf}}
767 \DeclareOption{australian}{\input{english.idf}}
768 \DeclareOption{austrian}{\input{german.idf}}
769 \DeclareOption{danish}{\input{danish.idf}}
770 \DeclareOption{english}{\input{english.idf}}
771 \DeclareOption{british}{\input{english.idf}}
772 \DeclareOption{french}{\input{french.idf}}
773 \DeclareOption{frenchb}{\input{french.idf}}
774 \DeclareOption{german}{\input{german.idf}}
775 \DeclareOption{italian}{\input{italian.idf}}
776 \DeclareOption{naustrian}{\input{german.idf}}
777 \DeclareOption{newzealand}{\input{english.idf}}
778 \DeclareOption{ngerman}{\input{german.idf}}
779 \DeclareOption{norsk}{\input{norsk.idf}}
780 \DeclareOption{norwegian}{\input{norsk.idf}}
781 \DeclareOption{swedish}{\input{swedish.idf}}
782 \DeclareOption{UKenglish}{\input{english.idf}}
783 \DeclareOption{USenglish}{\input{english.idf}}
784 % \end{macrocode}
785 % Make it possible to load language definition files that are not
786 % known by this package.
787 % \begin{macrocode}
788 \DeclareOption*{%
789 \InputIfFileExists{\CurrentOption.idf}{}{%
790 \PackageError{isodate}{%
791 Isodate definition file \CurrentOption.idf not found}{%
792 Maybe you misspelled the language option?}}%
793 }
794 % \end{macrocode}
795 % Set default option to \verb|orig|.
796 % \begin{macrocode}
797 \ExecuteOptions{orig,nocleanlook,printdayon}
798 % \end{macrocode}
799 % Process the options.
800 % \begin{macrocode}
801 \ProcessOptions*
802 % \end{macrocode}
803 % Handle the case that no language was given. Throw an error message.
804 % Each language definition file \verb|*.idf| must contain a line
805 % \begin{verbatim}
806 %\let\iso@languageloaded\active\end{verbatim}
807 % that defines the command \verb|\iso@languageloaded|.
808 % \begin{macrocode}
809 \ifx\iso@languageloaded\@undefined
810 \PackageError{isodate}{%
811 You haven't specified a language option}{%
812 You need to specify a language, either as a global
813 option\MessageBreak
814 or as an optional argument to the \string\usepackage\space
815 command.\MessageBreak
816 If you have used the old isodate package (version <=1.06) you can
817 change the\MessageBreak
818 usepackage command to \protect\usepackage{isodate}.\MessageBreak
819 You shouldn't try to proceed from here, type x to quit.}
820 \fi
821 % \end{macrocode}
822 % \changes{2.10}{2003/10/13}{Add month in Roman numerals}%
823 % \begin{macro}{\iso@printday}
824 % \changes{2.14}{2003/10/26}{Control the number of digits for the day
825 % by a boolean rather than by the command calls}%
826 % Prints a day.
827 % \begin{macrocode}
828 \newcommand*\iso@printday[1]{%
829 \ifisotwodigitday
830 \ifthenelse{\number#1<10}{0}{}%
831 \fi
832 \number#1%
833 }%
834 % \end{macrocode}
835 % \end{macro}
836 % \begin{macro}{\twodigitarabic}
837 % \changes{2.10}{2003/10/13}{Added \cs{twodigitarabic}}%
838 % Typesets the given counter with at least two digits.
839 % This command is very simple and does only work for positive numbers
840 % below 100.
841 % \begin{macrocode}
842 \newcommand*\twodigitarabic[1]{%
843 \ifthenelse{\number\arabic{#1}<10}{0}{}%
844 \arabic{#1}%
845 }
846 % \end{macrocode}
847 % \end{macro}
848 % \begin{macro}{\iso@printmonth}
849 % \changes{2.10}{2003/10/13}{Use \cs{twodigitarabic}}%
850 % Prints a month using \cs{theiso@tmpmonth} as output fourmat.
851 % \begin{macrocode}
852 \newcommand*\iso@printmonth[1]{%
853 \setcounter{iso@tmpmonth}{#1}%
854 \theiso@tmpmonth%
855 }
856 % \end{macrocode}
857 % Define the help counter that prints the month and initialize it to
858 % print arabic numbers.
859 % \begin{macrocode}
860 \newcounter{iso@tmpmonth}
861 %\def\theiso@tmpmonth{\arabic{iso@tmpmonth}}
862 % \end{macrocode}
863 % \end{macro}
864 % \begin{macro}{\iso@yeartwo}
865 % Prints the argument of the command with two
866 % digits.
867 %
868 % Example: \verb|\iso@yeartwo{1873}| $\longrightarrow$
869 % \makeatletter\iso@yeartwo{1873}\makeatother.
870 % \begin{macrocode}
871 \newcounter{iso@yeartwo}%
872 \newcommand*\iso@yeartwo[1]{%
873 \setcounter{iso@yeartwo}{\number#1}%
874 \whiledo{\theiso@yeartwo>99}{%
875 \addtocounter{iso@yeartwo}{-100}}{}%
876 \ifthenelse{\number\theiso@yeartwo<10}{0}{}\theiso@yeartwo
877 }
878 % \end{macrocode}
879 % \end{macro}
880 % \begin{macro}{\iso@yearfour}
881 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
882 % Prints the argument of the command with four digits.
883 % \begin{macrocode}
884 \newcommand*\iso@yearfour[1]{%
885 \ifthenelse{\number#1<1000}{0}{}%
886 \ifthenelse{\number#1<100}{0}{}%
887 \ifthenelse{\number#1<10}{0}{}%
888 \number#1%
889 }%
890 % \end{macrocode}
891 % \end{macro}
892 % \changes{2.14}{2003/10/26}{Control the number of digits for the day
893 % by a boolean rather than by the command calls}%
894 % \begin{macro}{\ifisotwodigitday}
895 % Print day with two digits or natural number of digits?
896 % \begin{macrocode}
897 \newif\ifisotwodigitday
898 % \end{macrocode}
899 % \end{macro}
900 % \begin{macro}{\iso@dateformat}
901 % In this command, the current active date format ist stored. Possible
902 % values are: \verb|numeric|, \verb|short|, \verb|iso|, \verb|orig|,
903 % \verb|shortorig|, \verb|TeX|.
904 % \begin{macrocode}
905 \def\iso@dateformat{numeric}
906 % \end{macrocode}
907 % \end{macro}
908 % \begin{macro}{\iso@inputformat}
909 % \changes{2.26}{2005/03/10}{Support different input formats
910 % containing slashes}%
911 % This macro stores which input format is used for dates given with
912 % slashes. Valid formats are |english| (dd/mm/yyyy), |american|
913 % (mm/dd/yyyy), and |tex| (yyyy/mm/dd). By default, English is used.
914 % \begin{macrocode}
915 \DeclareRobustCommand*\dateinputformat[1]{%
916 \ifthenelse{%
917 \equal{#1}{english}\OR
918 \equal{#1}{british}\OR
919 \equal{#1}{UKenglish}}{%
920 \def\iso@inputformat{english}%
921 }{%
922 \ifthenelse{%
923 \equal{#1}{american}\OR
924 \equal{#1}{USenglish}}{%
925 \def\iso@inputformat{american}%
926 }{%
927 \ifthenelse{%
928 \equal{#1}{tex}\OR
929 \equal{#1}{TeX}\OR
930 \equal{#1}{latex}\OR
931 \equal{#1}{LaTeX}}{%
932 \def\iso@inputformat{tex}%
933 }{%
934 \PackageError{isodate}{Invalid date input format}{%
935 Maybe you misspelled the language option (english, american,
936 tex)?}%
937 }%
938 }%
939 }%
940 }
941 % \end{macrocode}
942 % \end{macro}
943 % \begin{macro}{\iso@inputformat}
944 % \changes{2.26}{2005/03/10}{Support different input formats
945 % containing slashes}%
946 % This macro stores which input format is used for dates given with
947 % slashes. Valid formats are |english| (dd/mm/yyyy), |american|
948 % (mm/dd/yyyy), and |tex| (yyyy/mm/dd). By default, English is used.
949 % \begin{macrocode}
950 \dateinputformat{english}
951 % \end{macrocode}
952 % \end{macro}
953 % \changes{2.10}{2003/10/13}{Add month in Roman numerals}%
954 % \begin{macro}{\numdate}
955 % Switches to long numerical date format.
956 % \begin{macrocode}
957 \DeclareRobustCommand*\numdate[1][twodigitarabic]{%
958 \def\iso@dateformat{numeric}%
959 \isotwodigitdaytrue
960 \def\theiso@tmpmonth{\csname #1\endcsname{iso@tmpmonth}}%
961 }
962 % \end{macrocode}
963 % \end{macro}
964 % \changes{2.10}{2003/10/13}{Add month in Roman numerals}%
965 % \changes{2.14}{2003/10/26}{Don't print day with two digits when
966 % Roman numerals are used for the month}%
967 % \begin{macro}{\shortdate}
968 % Switches to short numerical date format.
969 % \begin{macrocode}
970 \DeclareRobustCommand*\shortdate[1][twodigitarabic]{%
971 \def\iso@dateformat{short}%
972 \isotwodigitdaytrue
973 \def\theiso@tmpmonth{\csname #1\endcsname{iso@tmpmonth}}%
974 }
975 % \end{macrocode}
976 % \end{macro}
977 % \changes{2.12}{2003/10/14}{Wrong one-digit months avoided}%
978 % \begin{macro}{\isodate}
979 % \changes{2.14}{2003/10/26}{Allow change in format for month}%
980 % Switches to ISO date format.
981 % \begin{macrocode}
982 \DeclareRobustCommand*\isodate[1][twodigitarabic]{%
983 \def\iso@dateformat{iso}%
984 \isotwodigitdaytrue
985 \def\theiso@tmpmonth{\csname #1\endcsname{iso@tmpmonth}}%
986 }
987 % \end{macrocode}
988 % \end{macro}
989 % \begin{macro}{\origdate}
990 % Switches to the original date format.
991 % \begin{macrocode}
992 \DeclareRobustCommand*\origdate{%
993 \def\iso@dateformat{orig}%
994 \isotwodigitdayfalse
995 \def\theiso@tmpmonth{\twodigitarabic{iso@tmpmonth}}%
996 }
997 % \end{macrocode}
998 % \end{macro}
999 % \begin{macro}{\shortorigdate}
1000 % Switches to the short original date format.
1001 % \begin{macrocode}
1002 \DeclareRobustCommand*\shortorigdate{%
1003 \def\iso@dateformat{shortorig}%
1004 \isotwodigitdayfalse
1005 \def\theiso@tmpmonth{\twodigitarabic{iso@tmpmonth}}%
1006 }
1007 % \end{macrocode}
1008 % \end{macro}q
1009 % \begin{macro}{\TeXdate}
1010 % \changes{2.14}{2003/10/26}{Allow change in format for month}%
1011 % Switches to \LaTeX\ date format.
1012 % \begin{macrocode}
1013 \DeclareRobustCommand*\TeXdate[1][twodigitarabic]{%
1014 \def\iso@dateformat{TeX}%
1015 \isotwodigitdaytrue
1016 \def\theiso@tmpmonth{\csname #1\endcsname{iso@tmpmonth}}%
1017 }
1018 % \end{macrocode}
1019 % \end{macro}
1020 % \changes{2.10}{2003/10/13}{Add month in Roman numerals}%
1021 % \begin{macro}{\Romandate}
1022 % Switches to long numerical date format with month printed in
1023 % uppercase Roman numerals.
1024 % \begin{macrocode}
1025 \DeclareRobustCommand*\Romandate{%
1026 \numdate[Roman]%
1027 \isotwodigitdayfalse
1028 }
1029 % \end{macrocode}
1030 % \end{macro}
1031 % \begin{macro}{\romandate}
1032 % Switches to long numerical date format with month printed in
1033 % lowercase Roman numerals.
1034 % \begin{macrocode}
1035 \DeclareRobustCommand*\romandate{%
1036 \numdate[roman]%
1037 \isotwodigitdayfalse
1038 }
1039 % \end{macrocode}
1040 % \end{macro}
1041 % \begin{macro}{\shortRomandate}
1042 % Switches to short numerical date format with month printed in
1043 % uppercase Roman numerals.
1044 % \begin{macrocode}
1045 \DeclareRobustCommand*\shortRomandate{%
1046 \shortdate[Roman]%
1047 \isotwodigitdayfalse
1048 }
1049 % \end{macrocode}
1050 % \end{macro}
1051 % \begin{macro}{\shortromandate}
1052 % Switches to short numerical date format with month printed in
1053 % lowercase Roman numerals.
1054 % \begin{macrocode}
1055 \DeclareRobustCommand*\shortromandate{%
1056 \shortdate[roman]%
1057 \isotwodigitdayfalse
1058 }
1059 % \end{macrocode}
1060 % \end{macro}
1061 % \begin{macro}{\isodash}
1062 % Changes the dash in the ISO date format. The default is `-'.
1063 % \begin{macrocode}
1064 \def\iso@isodash{-}%
1065 \DeclareRobustCommand*\isodash[1]{\def\iso@isodash{#1}}%
1066 % \end{macrocode}
1067 % \end{macro}
1068 % Define the sign that is printed before a two digit year in the short
1069 % original format. Default is nothing.
1070 % \begin{macro}{\shortyearsign}
1071 % \begin{macrocode}
1072 \def\iso@twodigitsign{}
1073 \DeclareRobustCommand*\shortyearsign[1]{\def\iso@twodigitsign{#1}}%
1074 % \end{macrocode}
1075 % \end{macro}
1076 % \begin{macro}{\isorangesign}
1077 % Defines the sign or word that is printed between the two dates in a
1078 % date range. e.g., in English the default is `~to~'.
1079 % \begin{macrocode}
1080 \def\iso@rangesign{\csname iso@rangesign@\iso@languagename\endcsname}%
1081 \DeclareRobustCommand*\isorangesign[1]{\def\iso@rangesign{#1}}%
1082 % \end{macrocode}
1083 % \end{macro}
1084 % \begin{macro}{\printyearoff}
1085 % \begin{macro}{\printyearon}
1086 % \changes{2.21}{2003/12/06}{Switch on or off printing of year}%
1087 % Switches printing of the year on or off.
1088 % Default is to print the year.
1089 % \begin{macrocode}
1090 \newif\ifiso@printyear
1091 \DeclareRobustCommand*\printyearon{\iso@printyeartrue}
1092 \DeclareRobustCommand*\printyearoff{\iso@printyearfalse}
1093 \printyearon
1094 % \end{macrocode}
1095 % \end{macro}
1096 % \end{macro}
1097 % \begin{macro}{\printdayoff}
1098 % \begin{macro}{\printdayon}
1099 % \changes{2.30}{2010/01/03}{Add a month-year format}%
1100 % Switch on or off suppressing the day in date output.
1101 % Default is not print the day.
1102 % \begin{macrocode}
1103 \newif\ifiso@doprintday
1104 \DeclareRobustCommand*\printdayon{\iso@doprintdaytrue}
1105 \DeclareRobustCommand*\printdayoff{\iso@doprintdayfalse}
1106 \printdayon
1107 % \end{macrocode}
1108 % \end{macro}
1109 % \end{macro}
1110 % \begin{macro}{\cleanlookdateoff}
1111 % \begin{macro}{\cleanlookdateon}
1112 % \changes{2.28}{2005/04/15}{Introduce option cleanlook for English
1113 % date format}%
1114 % Switch on or off `clean look' for English dates.
1115 % Default is not to use `clean look'.
1116 % \begin{macrocode}
1117 \newif\ifiso@cleanlook
1118 \DeclareRobustCommand*\cleanlookdateon{\iso@cleanlooktrue}
1119 \DeclareRobustCommand*\cleanlookdateoff{\iso@cleanlookfalse}
1120 \cleanlookdateoff
1121 % \end{macrocode}
1122 % \end{macro}
1123 % \end{macro}
1124 % \begin{macro}{\isospacebeforeday}
1125 % \begin{macro}{\isospacebeforemonth}
1126 % \begin{macro}{\isospacebeforeyear}
1127 % \changes{2.29}{2007/04/09}{Allow to change the unbreakable spaces in
1128 % the orig and shortorig format}%
1129 % Change the spaces in the orig and short orig format.
1130 % Default is |~| for all of them.
1131 % \begin{macrocode}
1132 \newcommand*\iso@daysep{~}
1133 \newcommand*\iso@monthsep{~}
1134 \newcommand*\iso@yearsep{~}
1135 \DeclareRobustCommand*\isospacebeforeday[1]{\def\iso@daysep{#1}}
1136 \DeclareRobustCommand*\isospacebeforemonth[1]{\def\iso@monthsep{#1}}
1137 \DeclareRobustCommand*\isospacebeforeyear[1]{\def\iso@yearsep{#1}}
1138 % \end{macrocode}
1139 % \end{macro}
1140 % \end{macro}
1141 % \end{macro}
1142 % \begin{macro}{\iso@printdate}
1143 % Defines the command \verb|iso@printdate| which takes three arguments
1144 % (year, month, day) and prints the date by using the \cs{today} command.
1145 % \begin{macrocode}
1146 \newcommand*\iso@printdate[3]{%
1147 \begingroup%
1148 % \end{macrocode}
1149 % \changes{2.25}{2005/02/21}{Warning for unknown languages}%
1150 % \changes{2.25}{2005/02/21}{Fall-back format for unknown languages}%
1151 % Generate a warning if the active language is not known by |isodate|.
1152 % \begin{macrocode}
1153 \@ifundefined{iso@printdate@\iso@languagename}{%
1154 \PackageWarning{isodate}{Language \iso@languagename\space unknown
1155 to isodate.\MessageBreak
1156 Using default format}%
1157 }{}%
1158 % \end{macrocode}
1159 % \changes{2.25}{2005/02/21}{Changed \cs{year}, \cs{month}, and
1160 % \cs{day} from macros to counters}%
1161 % The counters \cs{year}, \cs{month}, and \cs{day} are preserved as
1162 % counters instead of changed to macros (as it has been done until
1163 % version 2.25) to avoid problems with languages that are not defined
1164 % in |isodate.sty|.
1165 % \begin{macrocode}
1166 \year=#1 %
1167 \month=#2 %
1168 \day=#3 %
1169 \today%
1170 \endgroup%
1171 }
1172 % \end{macrocode}
1173 % \end{macro}
1174 % \begin{macro}{\printdate}
1175 % Prints a date that is given as one argument in one of these formats:
1176 % \verb|yyyy-mm-dd|, \verb|dd/mm/yyyy|, \verb|dd.mm.yyyy|.
1177 % \begin{macrocode}
1178 \DeclareRobustCommand*\printdate[1]{%
1179 % \end{macrocode}
1180 % Define \verb|\iso@date| command to expand the argument \verb|#1|.
1181 % \begin{macrocode}
1182 \edef\iso@date{#1}%
1183 % \end{macrocode}
1184 % Count appearances of `/', `-', and `.' in the argument.
1185 % \begin{macrocode}
1186 \SubStringsToCounter{iso@slash}{/}{\iso@date}%
1187 \SubStringsToCounter{iso@minus}{-}{\iso@date}%
1188 \SubStringsToCounter{iso@dot}{.}{\iso@date}%
1189 % \end{macrocode}
1190 % If number of `.' in the argument is equal to 2 then the German
1191 % format \verb|dd.mm.yyyy| is used.
1192 % \begin{macrocode}
1193 \ifthenelse{\equal{\theiso@dot}{2}}{%
1194 \expandafter\iso@input@german\iso@date\@empty}{%
1195 % \end{macrocode}
1196 % If number of `-' in the argument is equal to 2 then the ISO
1197 % format \verb|yyyy-mm-dd| is used.
1198 % \begin{macrocode}
1199 \ifthenelse{\equal{\theiso@minus}{2}}{%
1200 \expandafter\iso@input@iso\iso@date\@empty}{%
1201 % \end{macrocode}
1202 % If number of `/' in the argument is equal to 2 then the British English
1203 % format \verb|dd/mm/yyyy| is used.
1204 % \begin{macrocode}
1205 \ifthenelse{\equal{\theiso@slash}{2}}{%
1206 \expandafter\iso@input@english\iso@date\@empty}{%
1207 % \end{macrocode}
1208 % Else no of the formats above is used an thus an error message is thrown.
1209 % \begin{macrocode}
1210 ????\iso@isodash ??\iso@isodash ??%
1211 \PackageError{isodate}{unrecognized date format}{Use one of
1212 the following formats as macro argument:^^J%
1213 \space\space dd.mm.yyyy^^J%
1214 \space\space dd/mm/yyyy^^J%
1215 \space\space yyyy-mm-dd^^J%
1216 Don't use any spaces or commands like \protect\, or
1217 \protect~ inside the argument.}%
1218 }}}%
1219 }
1220 % \end{macrocode}
1221 % \end{macro}
1222 % \begin{macro}{\iso@input@iso}
1223 % Converts a string with the format \verb|yyyy-mm-dd| to three
1224 % arguments \verb|{#1}{#2}{#3}| and calls \verb|\iso@printdate|.
1225 % \begin{macrocode}
1226 \def\iso@input@iso#1-#2-#3\@empty{\iso@printdate{#1}{#2}{#3}}
1227 % \end{macrocode}
1228 % \end{macro}
1229 % \begin{macro}{\iso@input@german}
1230 % Converts a string with the format \verb|dd.mm.yyyy| to three
1231 % arguments \verb|{#3}{#2}{#1}| and calls \verb|\iso@printdate|.
1232 % \begin{macrocode}
1233 \def\iso@input@german#1.#2.#3\@empty{\iso@printdate{#3}{#2}{#1}}
1234 % \end{macrocode}
1235 % \end{macro}
1236 % \begin{macro}{\iso@input@english}
1237 % \changes{2.26}{2005/03/10}{Support different input formats
1238 % containing slashes}%
1239 % Converts a string with the format \verb|dd/mm/yyyy| to three
1240 % arguments \verb|{#3}{#2}{#1}| and calls \verb|\iso@printdate|.
1241 % \begin{macrocode}
1242 \def\iso@input@english#1/#2/#3\@empty{%
1243 \ifthenelse{\equal{\iso@inputformat}{tex}}{%
1244 \iso@printdate{#1}{#2}{#3}%
1245 }{%
1246 \ifthenelse{\equal{\iso@inputformat}{american}}{%
1247 \iso@printdate{#3}{#1}{#2}%
1248 }{%
1249 \iso@printdate{#3}{#2}{#1}%
1250 }%
1251 }%
1252 }
1253 % \end{macrocode}
1254 % \end{macro}
1255 % \begin{macro}{\printdateTeX}
1256 % Prints a date that is given as one argument in the format
1257 % \verb|yyyy/mm/dd|.
1258 % \begin{macrocode}
1259 \DeclareRobustCommand*\printdateTeX[1]{%
1260 % \end{macrocode}
1261 % Define \verb|\iso@date| command to expand the argument \verb|#1|.
1262 % \begin{macrocode}
1263 \edef\iso@date{#1}%
1264 % \end{macrocode}
1265 % Count appearances of `/' in the argument.
1266 % \begin{macrocode}
1267 \SubStringsToCounter{iso@slash}{/}{\iso@date}%
1268 % \end{macrocode}
1269 % If number of `/' in the argument is equal to 2 then the \LaTeX\
1270 % format \verb|yyyy/mm/dd| is used.
1271 % \begin{macrocode}
1272 \ifthenelse{\equal{\theiso@slash}{2}}{%
1273 \expandafter\iso@input@TeX\iso@date\@empty}{%
1274 % \end{macrocode}
1275 % Else no of the formats above is used an thus an error message is thrown.
1276 % \begin{macrocode}
1277 ????\iso@isodash ??\iso@isodash ??%
1278 \PackageError{isodate}{unrecognized date format}{Use one of
1279 the following formats as macro argument:^^J%
1280 \space\space dd.mm.yyyy^^J%
1281 \space\space dd/mm/yyyy^^J%
1282 \space\space yyyy-mm-dd^^J%
1283 Don't use any spaces or commands like \protect\, or
1284 \protect~ inside the argument.}%
1285 }}
1286 % \end{macrocode}
1287 % \end{macro}
1288 % \begin{macro}{\iso@input@TeX}
1289 % Converts a string with the format \verb|yyyy/mm/dd| to three
1290 % arguments \verb|{#1}{#2}{#3}| and calls \verb|\iso@printdate|.
1291 % \begin{macrocode}
1292 \def\iso@input@TeX#1/#2/#3\@empty{\iso@printdate{#1}{#2}{#3}}
1293 % \end{macrocode}
1294 % \end{macro}
1295 % \begin{macro}{\iso@printmonthday@int}
1296 % ??????
1297 % \begin{macrocode}
1298 \def\iso@printmonthday@int#1#2{%
1299 \ifthenelse{\equal{\iso@dateformat}{iso}}{%
1300 \iso@printmonth{#1}%
1301 \ifiso@doprintday
1302 \iso@isodash\iso@printday{#2}%
1303 \fi
1304 }{%
1305 \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
1306 \iso@printmonth{#1}%
1307 \ifiso@doprintday
1308 /\iso@printday{#2}%
1309 \fi
1310 }{%
1311 \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname:
1312 Invalid date format `\iso@dateformat'}{Internal error. Please
1313 report to the package author.}
1314 }%
1315 }%
1316 }
1317 % \end{macrocode}
1318 % \end{macro}
1319 % \begin{macro}{\iso@printdate@int}
1320 % ??????
1321 % \begin{macrocode}
1322 \def\iso@printdate@int#1#2#3{%
1323 \ifiso@printyear
1324 \ifthenelse{\equal{\iso@dateformat}{iso}}{%
1325 \iso@yearfour{\number#1}\iso@isodash%
1326 }{%
1327 \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
1328 \iso@yearfour{\number#1}/%
1329 }{%
1330 \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname:
1331 Invalid date format `\iso@dateformat'}{Internal error. Please
1332 report to the package author.}
1333 }%
1334 }%
1335 \fi
1336 \csname iso@printmonthday@int\endcsname{\number#2}{\number#3}%
1337 }
1338 % \end{macrocode}
1339 % \end{macro}
1340 % \begin{macro}{\iso@daterange@int}
1341 % ??????
1342 % \begin{macrocode}
1343 \def\iso@daterange@int#1#2#3#4#5#6{%
1344 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1345 \equal{\iso@dateformat}{TeX}}{%
1346 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
1347 \iso@rangesign%
1348 \ifthenelse{\equal{\number#1}{\number#4}}{%
1349 \ifthenelse{\equal{\number#2}{\number#5}}{%
1350 \ifiso@doprintday
1351 \iso@printday{#6}%
1352 \else
1353 \iso@printmonthday@int{#5}{#6}%
1354 \fi
1355 }{%
1356 \iso@printmonthday@int{#5}{#6}%
1357 }%
1358 }{%
1359 \iso@printdate@int{#4}{#5}{#6}%
1360 }%
1361 }{%
1362 \PackageError{isodate.sty}{\csname iso@printmonthday\endcsname:
1363 Invalid date format `\iso@dateformat'}{Internal error. Please
1364 report to the package author.}
1365 }%
1366 }
1367 % \end{macrocode}
1368 % \end{macro}
1369 % \begin{macro}{\daterange}
1370 % Prints a date range.
1371 % \begin{macrocode}
1372 \DeclareRobustCommand*\daterange[2]{%
1373 % \end{macrocode}
1374 % Define \verb|\iso@date| and \verb|\iso@@date| commands to expand the
1375 % argument \verb|#1| and \verb|#2|. Define \verb|\iso@@@date| which
1376 % contains both arguments devided by a komma.
1377 % \begin{macrocode}
1378 \edef\iso@date{#1}%
1379 \edef\iso@@date{#2}%
1380 \edef\iso@@@date{\iso@date,\iso@@date}%
1381 % \end{macrocode}
1382 % Count appearances of `/', `-', and `.' in the arguments.
1383 % \begin{macrocode}
1384 \SubStringsToCounter{iso@slash}{/}{\iso@date}%
1385 \SubStringsToCounter{iso@minus}{-}{\iso@date}%
1386 \SubStringsToCounter{iso@dot}{.}{\iso@date}%
1387 \SubStringsToCounter{iso@@slash}{/}{\iso@@date}%
1388 \SubStringsToCounter{iso@@minus}{-}{\iso@@date}%
1389 \SubStringsToCounter{iso@@dot}{.}{\iso@@date}%
1390 % \end{macrocode}
1391 % If number of `.' in both arguments is equal to 2 then the German
1392 % format \verb|dd.mm.yyyy| is used.
1393 % \begin{macrocode}
1394 \ifthenelse{\equal{\theiso@dot}{2}\AND\equal{\theiso@@dot}{2}}{%
1395 \expandafter\iso@range@input@german\iso@@@date\@empty}{%
1396 % \end{macrocode}
1397 % If number of `-' in both arguments is equal to 2 then the ISO
1398 % format \verb|yyyy-mm-dd| is used.
1399 % \begin{macrocode}
1400 \ifthenelse{\equal{\theiso@minus}{2}\AND\equal{\theiso@@minus}{2}}{%
1401 \expandafter\iso@range@input@iso\iso@@@date\@empty}{%
1402 % \end{macrocode}
1403 % If number of `/' in both arguments is equal to 2 then the British English
1404 % format \verb|dd/mm/yyyy| is used.
1405 % \begin{macrocode}
1406 \ifthenelse{\equal{\theiso@slash}{2}\AND
1407 \equal{\theiso@@slash}{2}}{%
1408 \expandafter\iso@range@input@english\iso@@@date\@empty}{%
1409 % \end{macrocode}
1410 % Else no of the formats above is used an thus an error message is thrown.
1411 % \begin{macrocode}
1412 ????\iso@isodash ??\iso@isodash ??%
1413 \PackageError{isodate}{unrecognized date format}{Use one of
1414 the following formats as macro argument:^^J%
1415 \space\space dd.mm.yyyy^^J%
1416 \space\space dd/mm/yyyy^^J%
1417 \space\space yyyy-mm-dd^^J%
1418 Don't use any spaces or commands like \protect\, or
1419 \protect~ inside the argument.^^J
1420 Use the same format for both arguments.}%
1421 }}}%
1422 }
1423 % \end{macrocode}
1424 % \end{macro}
1425 % \begin{macro}{\iso@range@input@iso}
1426 % \changes{2.21}{2003/12/06}{Support to print date without year}%
1427 % Converts a string with the format \verb|yyyy-mm-dd,yyyy-mm-dd| to six
1428 % arguments \verb|{#1}{#2}{#3}{#4}{#5}{#6}| and calls
1429 % \verb|\iso@daterange@|language.
1430 % \begin{macrocode}
1431 \def\iso@range@input@iso#1-#2-#3,#4-#5-#6\@empty{%
1432 \begingroup
1433 % \end{macrocode}
1434 % \changes{2.25}{2005/02/21}{Warning for unknown languages}%
1435 % Generate a warning if the active language is not known by |isodate|.
1436 % \begin{macrocode}
1437 \@ifundefined{iso@daterange@\iso@languagename}{%
1438 \PackageWarning{isodate}{Language \iso@languagename\space unknown
1439 to isodate.\MessageBreak
1440 Using default date range\MessageBreak
1441 with range sign --}%
1442 \expandafter\def\csname iso@printdate@\iso@languagename\endcsname{}%
1443 % \end{macrocode}
1444 % \changes{2.25}{2005/02/21}{Fall-back format for unknown languages}%
1445 % Print date range in fall-back format.
1446 % \begin{macrocode}
1447 \iso@printdate{#1}{#2}{#3}--\iso@printdate{#4}{#5}{#6}%
1448 }{%
1449 % \end{macrocode}
1450 % Print date range in the chosen |isodate| format.
1451 % \begin{macrocode}
1452 \ifthenelse{\equal{\number#1}{\number#4}}{}{\printyearon}%
1453 \csname iso@daterange@\iso@languagename\endcsname{%
1454 #1}{#2}{#3}{#4}{#5}{#6}%
1455 }%
1456 \endgroup
1457 }
1458 % \end{macrocode}
1459 % \end{macro}
1460 % \begin{macro}{\iso@range@input@german}
1461 % \changes{2.21}{2003/12/06}{Support to print date without year}%
1462 % Converts a string with the format \verb|dd.mm.yyyy,dd.mm.yyyy| to six
1463 % arguments \verb|{#3}{#2}{#1}{#6}{#5}{#4}| and calls
1464 % \verb|\iso@daterange@|language.
1465 % \begin{macrocode}
1466 \def\iso@range@input@german#1.#2.#3,#4.#5.#6\@empty{%
1467 \begingroup
1468 % \end{macrocode}
1469 % \changes{2.25}{2005/02/21}{Warning for unknown languages}%
1470 % Generate a warning if the active language is not known by |isodate|.
1471 % \begin{macrocode}
1472 \@ifundefined{iso@daterange@\iso@languagename}{%
1473 \PackageWarning{isodate}{Language \iso@languagename\space unknown
1474 to isodate.\MessageBreak
1475 Using default date range\MessageBreak
1476 with range sign --}%
1477 \expandafter\def\csname iso@printdate@\iso@languagename\endcsname{}%
1478 % \end{macrocode}
1479 % \changes{2.25}{2005/02/21}{Fall-back format for unknown languages}%
1480 % Print date range in fall-back format.
1481 % \begin{macrocode}
1482 \iso@printdate{#3}{#2}{#1}--\iso@printdate{#6}{#5}{#4}%
1483 }{%
1484 % \end{macrocode}
1485 % Print date range in the chosen |isodate| format.
1486 % \begin{macrocode}
1487 \ifthenelse{\equal{\number#3}{\number#6}}{}{\printyearon}%
1488 \csname iso@daterange@\iso@languagename\endcsname{%
1489 #3}{#2}{#1}{#6}{#5}{#4}%
1490 }%
1491 \endgroup
1492 }
1493 % \end{macrocode}
1494 % \end{macro}
1495 % \begin{macro}{\iso@range@input@english}
1496 % \changes{2.21}{2003/12/06}{Support to print date without year}%
1497 % Converts a string with the format \verb|dd/mm/yyyy,dd/mm/yyyy| to six
1498 % arguments \verb|{#3}{#2}{#1}{#6}{#5}{#4}| and calls
1499 % \verb|\iso@daterange@|language.
1500 % \begin{macrocode}
1501 \def\iso@range@input@english#1/#2/#3,#4/#5/#6\@empty{%
1502 \begingroup
1503 % \end{macrocode}
1504 % \changes{2.25}{2005/02/21}{Warning for unknown languages}%
1505 % Generate a warning if the active language is not known by |isodate|.
1506 % \begin{macrocode}
1507 \@ifundefined{iso@daterange@\iso@languagename}{%
1508 \PackageWarning{isodate}{Language \iso@languagename\space unknown
1509 to isodate.\MessageBreak
1510 Using default date range\MessageBreak
1511 with range sign --}%
1512 \expandafter\def\csname iso@printdate@\iso@languagename\endcsname{}%
1513 % \end{macrocode}
1514 % \changes{2.26}{2005/03/10}{Support different input formats
1515 % containing slashes}%
1516 % \changes{2.25}{2005/02/21}{Fall-back format for unknown languages}%
1517 % Print date range in fall-back format.
1518 % \begin{macrocode}
1519 \ifthenelse{\equal{\iso@inputformat}{tex}}{%
1520 \iso@printdate{#1}{#2}{#3}--\iso@printdate{#4}{#5}{#6}%
1521 }{%
1522 \ifthenelse{\equal{\iso@inputformat}{american}}{%
1523 \iso@printdate{#3}{#1}{#2}--\iso@printdate{#6}{#4}{#5}%
1524 }{%
1525 \iso@printdate{#3}{#2}{#1}--\iso@printdate{#6}{#5}{#4}%
1526 }%
1527 }%
1528 }{%
1529 % \end{macrocode}
1530 % \changes{2.26}{2005/03/10}{Support different input formats
1531 % containing slashes}%
1532 % Print date range in the chosen |isodate| format.
1533 % \begin{macrocode}
1534 \ifthenelse{\equal{\number#3}{\number#6}}{}{\printyearon}%
1535 \ifthenelse{\equal{\iso@inputformat}{tex}}{%
1536 \csname iso@daterange@\iso@languagename\endcsname{%
1537 #1}{#2}{#3}{#4}{#5}{#6}%
1538 }{%
1539 \ifthenelse{\equal{\iso@inputformat}{american}}{%
1540 \csname iso@daterange@\iso@languagename\endcsname{%
1541 #3}{#1}{#2}{#6}{#4}{#5}%
1542 }{%
1543 \csname iso@daterange@\iso@languagename\endcsname{%
1544 #3}{#2}{#1}{#6}{#5}{#4}%
1545 }%
1546 }%
1547 }%
1548 \endgroup
1549 }
1550 % \end{macrocode}
1551 % \end{macro}
1552 % Define the counters for conting the appearances of `.', `-', and
1553 % '/' in the arguments.
1554 % \begin{macrocode}
1555 \newcounter{iso@slash}
1556 \newcounter{iso@minus}
1557 \newcounter{iso@dot}
1558 \newcounter{iso@@slash}
1559 \newcounter{iso@@minus}
1560 \newcounter{iso@@dot}
1561 % \end{macrocode}
1562 % The command \verb|\iso@languagename| is defined to be able to use
1563 % this package without loading one of the language packages
1564 % babel.sty, german.sty, or ngerman.sty.
1565 %
1566 % If neither babel.sty nor german.sty nor ngerman.sty is loaded my
1567 % computer returns `nohyphenation' when using \verb|\languagename|.
1568 % So this is the indication that none of the above packages is loaded.
1569 % \changes{2.01}{2000/08/24}{Handle case of not loaded language
1570 % package babel, german and ngerman}
1571 % \changes{2.12}{2003/10/14}{Test for babel improved}%
1572 % \changes{2.14}{2003/10/26}{Test on babel, german, and ngerman}%
1573 % \begin{macrocode}
1574 \AtBeginDocument{%
1575 \@tempswafalse
1576 \@ifpackageloaded{babel}{%
1577 \@tempswatrue
1578 \typeout{isodate: babel.sty has been loaded}%
1579 }{}%
1580 \@ifpackageloaded{german}{%
1581 \@tempswatrue
1582 \typeout{isodate: german.sty has been loaded}%
1583 }{}%
1584 \@ifpackageloaded{ngerman}{%
1585 \@tempswatrue
1586 \typeout{isodate: ngerman.sty has been loaded}%
1587 }{}%
1588 % \end{macrocode}
1589 % The language is not equal `nohyphenation'. So one of the language
1590 % packages is loaded. Replace the internal language name
1591 % \verb|\iso@languagename| by the global language name \verb|\languagename|.
1592 % \begin{macrocode}
1593 \if@tempswa
1594 \gdef\iso@languagename{\languagename}%
1595 % \end{macrocode}
1596 % Reload language to surely switch to new date format. The
1597 % languagename gets first expanded because of errors that would occur
1598 % otherwise.
1599 % \begin{macrocode}
1600 \edef\iso@tmplang{\languagename}%
1601 \expandafter\selectlanguage\expandafter{\iso@tmplang}%
1602 \else
1603 % \end{macrocode}
1604 % At the end of the preamble still none of the language packages are loaded.
1605 % So no language switching
1606 % is possible. Set the date language manually to the last language
1607 % that was loaded for isodate.
1608 % \begin{macrocode}
1609 \typeout{isodate: babel.sty, (n)german.sty have not been loaded}%
1610 \csname date\iso@languagename\endcsname%
1611 \fi
1612 }
1613 %</isodate>
1614 % \end{macrocode}
1615 %
1616 % \subsection{Language definition file danish.idf}
1617 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
1618 %
1619 % \begin{macro}{\iso@languageloaded}
1620 % Define the command \verb|\iso@languageloaded| in order to enable
1621 % \verb|isodate.sty| to determine if at least one language is loaded.
1622 % \begin{macrocode}
1623 %<*danish>
1624 \let\iso@languageloaded\active
1625 \typeout{Define commands for Danish date format}
1626 % \end{macrocode}
1627 % \end{macro}
1628 % \begin{macro}{\month@danish}
1629 % Prints the name of today's month in the long form for the original
1630 % date format.
1631 % \begin{macrocode}
1632 \def\month@danish{\ifcase\month\or
1633 januar\or februar\or marts\or april\or maj\or juni\or
1634 juli\or august\or september\or oktober\or november\or december\fi}
1635 % \end{macrocode}
1636 % \end{macro}
1637 % \begin{macro}{\iso@printmonthday@danish}
1638 % Prints the month and the day given as two arguments
1639 % (\verb|{mm}{dd}|) in the current date format.
1640 % \begin{macrocode}
1641 \def\iso@printmonthday@danish#1#2{%
1642 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1643 \equal{\iso@dateformat}{TeX}}{%
1644 \iso@printmonthday@int{#1}{#2}%
1645 }{%
1646 % \end{macrocode}
1647 % Numeric and short date format: \verb|dd/mm/|
1648 % \begin{macrocode}
1649 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
1650 \equal{\iso@dateformat}{short}}{%
1651 \ifiso@doprintday
1652 \iso@printday{#2}/%
1653 \fi
1654 \iso@printmonth{#1}%
1655 }{%
1656 % \end{macrocode}
1657 % Original date format: \verb|d. mmm|
1658 % \begin{macrocode}
1659 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
1660 \equal{\iso@dateformat}{shortorig}}{%
1661 \ifiso@doprintday
1662 \iso@printday{#2}.\iso@monthsep
1663 \fi
1664 \begingroup
1665 \edef\lmonth{#1}\def\month{\lmonth}%
1666 \month@danish%
1667 \endgroup
1668 }{}%
1669 }%
1670 }%
1671 }
1672 % \end{macrocode}
1673 % \end{macro}
1674 % \begin{macro}{\iso@printdate@danish}
1675 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
1676 % the actual date format
1677 % \begin{macrocode}
1678 \def\iso@printdate@danish#1#2#3{%
1679 % \end{macrocode}
1680 % ISO or \LaTeX date format: \verb|yyyy\iso@printmonthday@danish|
1681 % \begin{macrocode}
1682 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1683 \equal{\iso@dateformat}{TeX}}{%
1684 \iso@printdate@int{#1}{#2}{#3}%
1685 }{%
1686 \iso@printmonthday@danish{\number#2}{\number#3}%
1687 \ifiso@printyear
1688 % \end{macrocode}
1689 % ?????
1690 % \begin{macrocode}
1691 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
1692 \equal{\iso@dateformat}{shortorig}}{%
1693 }{%
1694 /%
1695 }%
1696 % \end{macrocode}
1697 % numeric date format: \verb|\iso@printmonthday@danish yyyy|
1698 % \begin{macrocode}
1699 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
1700 \iso@yearfour{\number#1}%
1701 }{%
1702 % \end{macrocode}
1703 % original date format: \verb|\iso@printmonthday@danish~yyyy|
1704 % \begin{macrocode}
1705 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
1706 \iso@yearsep\iso@yearfour{\number#1}%
1707 }{%
1708 % \end{macrocode}
1709 % short original date format: \verb|\iso@printmonthday@danish~yy|
1710 % \begin{macrocode}
1711 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
1712 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
1713 }{%
1714 % \end{macrocode}
1715 % short date format: \verb|\iso@printmonthday@danish yy|
1716 % \begin{macrocode}
1717 \ifthenelse{\equal{\iso@dateformat}{short}}{%
1718 \iso@yeartwo{\number#1}%
1719 }{}%
1720 }%
1721 }%
1722 }%
1723 \fi
1724 }%
1725 }
1726 % \end{macrocode}
1727 % \end{macro}
1728 % \begin{macro}{\iso@datedanish}
1729 % This command redefines the \cs{today} command to print in the
1730 % actual date format.
1731 % \begin{macrocode}
1732 \def\iso@datedanish{%
1733 \def\today{\iso@printdate@danish{\year}{\month}{\day}}}%
1734 % \end{macrocode}
1735 % \end{macro}
1736 % \begin{macro}{\iso@daterange@...}
1737 % Define date-range commands for dialects.
1738 % \begin{macrocode}
1739 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
1740 \iso@daterange@danish}%
1741 % \end{macrocode}
1742 % \end{macro}
1743 % \begin{macro}{\iso@daterange@danish}
1744 % This command takes six arguments
1745 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
1746 % date range in the actual date format.
1747 % \begin{macrocode}
1748 \def\iso@daterange@danish#1#2#3#4#5#6{%
1749 % \end{macrocode}
1750 % ISO or \LaTeX\ date format.
1751 % \begin{macrocode}
1752 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1753 \equal{\iso@dateformat}{TeX}}{%
1754 % \end{macrocode}
1755 % Call the appropriate international routine.
1756 % \begin{macrocode}
1757 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
1758 }{%
1759 % \end{macrocode}
1760 % Numeric, short, or original date format.
1761 %
1762 % If year and month are equal, only print the day of the start date. If
1763 % only the year is equal, only print month and day of the start
1764 % date. Otherwise print the whole start date.
1765 % \begin{macrocode}
1766 \ifthenelse{\equal{\number#1}{\number#4}}{%
1767 \ifthenelse{\equal{\number#2}{\number#5}}{%
1768 \ifiso@doprintday
1769 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
1770 \equal{\iso@dateformat}{shortorig}}{%
1771 \iso@printday{#3}.%
1772 }{%
1773 \iso@printday{#3}%
1774 }%
1775 \else
1776 \iso@printmonthday@danish{#2}{#3}%
1777 \fi
1778 }{%
1779 \iso@printmonthday@danish{#2}{#3}%
1780 }%
1781 }{%
1782 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
1783 }%
1784 % \end{macrocode}
1785 % Print the end date.
1786 % \begin{macrocode}
1787 \iso@rangesign
1788 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
1789 }%
1790 }
1791 % \end{macrocode}
1792 % \end{macro}
1793 % \begin{macro}{\iso@rangesign@danish}
1794 % Sets the word between start and end date in a date range to `~til~'.
1795 % \begin{macrocode}
1796 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~til~}
1797 % \end{macrocode}
1798 % \end{macro}
1799 % Define the language name that will the active language for isodate
1800 % if none of the packages babel.sty, german.sty, and ngerman.sty is
1801 % loaded and if this is the last language that is used for isodate.
1802 % If one of the above packages is used this definition will be
1803 % overridden by the command \verb|\languagename| that will always
1804 % return the current used language.
1805 % \begin{macrocode}
1806 \def\iso@languagename{danish}%
1807 % \end{macrocode}
1808 % Redefine the command \verb|\datedanish| that is used by babel to
1809 % switch to the original Danish date format to enable the use of
1810 % different date formats.
1811 % This has to be done after the preamble in order to ensure to overwrite
1812 % the babel command.
1813 % \begin{macrocode}
1814 \AtBeginDocument{%
1815 \ifx\undefined\iso@datedanish\else
1816 \def\datedanish{\iso@datedanish}%
1817 \fi
1818 }
1819 %</danish>
1820 % \end{macrocode}
1821 %
1822 % \subsection{Language definition file english.idf}
1823 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
1824 %
1825 % \begin{macro}{\iso@languageloaded}
1826 % Define the command \verb|\iso@languageloaded| in order to enable
1827 % \verb|isodate.sty| to determine if at least one language is loaded.
1828 % \begin{macrocode}
1829 %<*english>
1830 \let\iso@languageloaded\active
1831 % \end{macrocode}
1832 % \end{macro}
1833 % \begin{macro}{\month@english}
1834 % Prints the name of today's month in the long form for the original
1835 % date format.
1836 % \begin{macrocode}
1837 \def\month@english{\ifcase\month\or
1838 January\or February\or March\or April\or May\or June\or
1839 July\or August\or September\or October\or November\or December\fi}
1840 % \end{macrocode}
1841 % \end{macro}
1842 % British and American English dates are very different. So handle
1843 % them seperately. It might have been easier to put them in different
1844 % files but I wanted to organize my files analogous to babel.
1845 %
1846 % First handle British English.
1847 % \begin{macrocode}
1848 \ifthenelse{\equal{\CurrentOption}{english}\OR
1849 \equal{\CurrentOption}{british}\OR
1850 \equal{\CurrentOption}{UKenglish}}{%
1851 \typeout{Define commands for English date format}
1852 % \end{macrocode}
1853 % \begin{macro}{\day@english}
1854 % \changes{2.28}{2005/04/15}{Introduce option cleanlook for English
1855 % date format}%
1856 % Prints today's day for the original date format.
1857 % \begin{macrocode}
1858 \def\day@english{%
1859 \ifiso@cleanlook
1860 \day
1861 \else
1862 \ifcase\day\or
1863 1st\or 2nd\or 3rd\or 4th\or 5th\or
1864 6th\or 7th\or 8th\or 9th\or 10th\or
1865 11th\or 12th\or 13th\or 14th\or 15th\or
1866 16th\or 17th\or 18th\or 19th\or 20th\or
1867 21st\or 22nd\or 23rd\or 24th\or 25th\or
1868 26th\or 27th\or 28th\or 29th\or 30th\or
1869 31st%
1870 \fi
1871 \fi
1872 }
1873 % \end{macrocode}
1874 % \end{macro}
1875 % \begin{macro}{\iso@printmonthday@english}
1876 % Prints the month and the day given as two arguments
1877 % (\verb|{mm}{dd}|) in the current date format.
1878 % \begin{macrocode}
1879 \def\iso@printmonthday@english#1#2{%
1880 % \end{macrocode}
1881 % Numeric and short date format: \verb|dd/mm/|
1882 % \begin{macrocode}
1883 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1884 \equal{\iso@dateformat}{TeX}}{%
1885 \iso@printmonthday@int{#1}{#2}%
1886 }{%
1887 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
1888 \equal{\iso@dateformat}{short}}{%
1889 \ifiso@doprintday
1890 \iso@printday{#2}/%
1891 \fi
1892 \iso@printmonth{#1}%
1893 }{%
1894 % \end{macrocode}
1895 % Original date format: \verb|ddd mmm|
1896 % \begin{macrocode}
1897 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
1898 \equal{\iso@dateformat}{shortorig}}{%
1899 \begingroup
1900 \edef\lday{#2}\def\day{\lday}%
1901 \edef\lmonth{#1}\def\month{\lmonth}%
1902 \ifiso@doprintday
1903 \day@english\iso@monthsep\@empty
1904 \fi
1905 \month@english
1906 \endgroup
1907 }{}%
1908 }%
1909 }%
1910 }
1911 % \end{macrocode}
1912 % \end{macro}
1913 % \begin{macro}{\iso@printdate@english}
1914 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
1915 % the actual date format.
1916 % \begin{macrocode}
1917 \def\iso@printdate@english#1#2#3{%
1918 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1919 \equal{\iso@dateformat}{TeX}}{%
1920 \iso@printdate@int{#1}{#2}{#3}%
1921 }{%
1922 % \end{macrocode}
1923 % ISO date format: \verb|yyyy-\iso@printmonthday@english|
1924 % \begin{macrocode}
1925 \iso@printmonthday@english{\number#2}{\number#3}%
1926 % \end{macrocode}
1927 % Numeric date format: \verb|\iso@printmonthday@english yyyy|
1928 % \begin{macrocode}
1929 \ifiso@printyear
1930 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
1931 \equal{\iso@dateformat}{shortorig}}{%
1932 }{%
1933 /%
1934 }%
1935 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
1936 \iso@yearfour{\number#1}%
1937 }{%
1938 % \end{macrocode}
1939 % Original date format: \verb|\iso@printmonthday@english~yyyy|
1940 % \begin{macrocode}
1941 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
1942 \iso@yearsep\iso@yearfour{\number#1}%
1943 }{%
1944 % \end{macrocode}
1945 % Short original date format: \verb|\iso@printmonthday@english~yy|
1946 % \begin{macrocode}
1947 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
1948 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
1949 }{%
1950 % \end{macrocode}
1951 % Short date format: \verb|\iso@printmonthday@english yy|
1952 % \begin{macrocode}
1953 \ifthenelse{\equal{\iso@dateformat}{short}}{%
1954 \iso@yeartwo{\number#1}%
1955 }{}%
1956 }%
1957 }%
1958 }%
1959 \fi
1960 }%
1961 }
1962 % \end{macrocode}
1963 % \end{macro}
1964 % \begin{macro}{\iso@printdate@UKenglish}
1965 % Just a second name for \verb|\iso@printdate@UKenglish|.
1966 % \begin{macrocode}
1967 \def\iso@printdate@UKenglish{\iso@printdate@english}
1968 \def\iso@printdate@british{\iso@printdate@english}
1969 % \end{macrocode}
1970 % \end{macro}
1971 % \begin{macro}{\iso@dateenglish}
1972 % This command redefines the \cs{today} command to print in the
1973 % actual date format.
1974 % \begin{macrocode}
1975 \def\iso@dateenglish{%
1976 \def\today{\iso@printdate@english{\year}{\month}{\day}}}%
1977 % \end{macrocode}
1978 % \end{macro}
1979 % \begin{macro}{\iso@daterange@...}
1980 % Define date-range commands for dialects of English.
1981 % \begin{macrocode}
1982 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
1983 \iso@daterange@english}%
1984 % \end{macrocode}
1985 % \end{macro}
1986 % \begin{macro}{\iso@daterange@english}
1987 % This command takes six arguments
1988 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
1989 % date range in the actual date format.
1990 % \begin{macrocode}
1991 \def\iso@daterange@english#1#2#3#4#5#6{%
1992 % \end{macrocode}
1993 % ISO or \LaTeX\ date format.
1994 % \begin{macrocode}
1995 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
1996 \equal{\iso@dateformat}{TeX}}{%
1997 % \end{macrocode}
1998 % Print the start date.
1999 % \begin{macrocode}
2000 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2001 }{%
2002 % \end{macrocode}
2003 % Numeric, short, or original date format.
2004 %
2005 % If year and month are equal, only print the day of the start date. If
2006 % only the year is equal, only print month and day of the start
2007 % date. Otherwise print the whole start date.
2008 % \begin{macrocode}
2009 \ifthenelse{\equal{\number#1}{\number#4}}{%
2010 \ifthenelse{\equal{\number#2}{\number#5}}{%
2011 \ifiso@doprintday
2012 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2013 \equal{\iso@dateformat}{shortorig}}{%
2014 \begingroup
2015 \edef\lday{#3}\def\day{\lday}%
2016 \day@english
2017 \endgroup
2018 }{%
2019 \iso@printday{#3}%
2020 }%
2021 \else
2022 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2023 \fi
2024 }{%
2025 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2026 }%
2027 }{%
2028 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2029 }%
2030 % \end{macrocode}
2031 % Print the end date.
2032 % \begin{macrocode}
2033 \iso@rangesign
2034 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2035 }%
2036 }
2037 % \end{macrocode}
2038 % \end{macro}
2039 % Define the language name that will the active language for isodate
2040 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2041 % loaded and if this is the last language that is used for isodate.
2042 % If one of the above packages is used this definition will be
2043 % overridden by the command \verb|\languagename| that will always
2044 % return the current used language.
2045 % \begin{macrocode}
2046 \def\iso@languagename{english}%
2047 % \end{macrocode}
2048 % The end of the British section.
2049 %
2050 % \changes{2.20}{2003/12/06}{Add Australian and New Zealand}%
2051 % Second handle Australian and New Zealand.
2052 % \begin{macrocode}
2053 }{%
2054 \ifthenelse{\equal{\CurrentOption}{australian}\OR
2055 \equal{\CurrentOption}{newzealand}}{%
2056 \typeout{Define commands for Australian date format}
2057 % \end{macrocode}
2058 % \begin{macro}{\iso@printmonthday@australian}
2059 % Prints the month and the day given as two arguments
2060 % (\verb|{mm}{dd}|) in the current date format.
2061 % \begin{macrocode}
2062 \def\iso@printmonthday@australian#1#2{%
2063 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2064 \equal{\iso@dateformat}{TeX}}{%
2065 \iso@printmonthday@int{#1}{#2}%
2066 }{%
2067 % \end{macrocode}
2068 % Numeric and short date format: \verb|dd/mm/|
2069 % \begin{macrocode}
2070 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
2071 \equal{\iso@dateformat}{short}}{%
2072 \ifiso@doprintday
2073 \iso@printday{#2}/%
2074 \fi
2075 \iso@printmonth{#1}%
2076 }{%
2077 % \end{macrocode}
2078 % Original date format: \verb|ddd mmm|
2079 % \begin{macrocode}
2080 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2081 \equal{\iso@dateformat}{shortorig}}{%
2082 \begingroup
2083 \edef\lmonth{#1}\def\month{\lmonth}%
2084 \ifiso@doprintday
2085 \iso@printday{#2}\iso@monthsep\@empty
2086 \fi
2087 \month@english
2088 \endgroup
2089 }{}%
2090 }%
2091 }%
2092 }
2093 % \end{macrocode}
2094 % \end{macro}
2095 % \begin{macro}{\iso@printdate@australian}
2096 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
2097 % the actual date format.
2098 % \begin{macrocode}
2099 \def\iso@printdate@australian#1#2#3{%
2100 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2101 \equal{\iso@dateformat}{TeX}}{%
2102 \iso@printdate@int{#1}{#2}{#3}%
2103 }{%
2104 \iso@printmonthday@australian{\number#2}{\number#3}%
2105 % \end{macrocode}
2106 % Numeric date format: \verb|\iso@printmonthday@australian yyyy|
2107 % \begin{macrocode}
2108 \ifiso@printyear
2109 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2110 \equal{\iso@dateformat}{shortorig}}{%
2111 }{%
2112 /%
2113 }%
2114 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
2115 \iso@yearfour{\number#1}%
2116 }{%
2117 % \end{macrocode}
2118 % Original date format: \verb|\iso@printmonthday@australian~yyyy|
2119 % \begin{macrocode}
2120 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2121 \iso@yearsep\iso@yearfour{\number#1}%
2122 }{%
2123 % \end{macrocode}
2124 % Short original date format: \verb|\iso@printmonthday@australian~yy|
2125 % \begin{macrocode}
2126 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
2127 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
2128 }{%
2129 % \end{macrocode}
2130 % Short date format: \verb|\iso@printmonthday@australian yy|
2131 % \begin{macrocode}
2132 \ifthenelse{\equal{\iso@dateformat}{short}}{%
2133 \iso@yeartwo{\number#1}%
2134 }{}%
2135 }%
2136 }%
2137 }%
2138 \fi
2139 }%
2140 }
2141 % \end{macrocode}
2142 % \end{macro}
2143 % \begin{macro}{\iso@printdate@newzealand}
2144 % Just a second name for \verb|\iso@printdate@UKenglish|.
2145 % \begin{macrocode}
2146 \def\iso@printdate@newzealand{\iso@printdate@australian}
2147 % \end{macrocode}
2148 % \end{macro}
2149 % \begin{macro}{\iso@dateaustralian}
2150 % This command redefines the \cs{today} command to print in the
2151 % actual date format.
2152 % \begin{macrocode}
2153 \def\iso@dateaustralian{%
2154 \def\today{\iso@printdate@australian{\year}{\month}{\day}}}%
2155 % \end{macrocode}
2156 % \end{macro}
2157 % \begin{macro}{\iso@daterange@...}
2158 % Define date-range commands for dialects of Australian.
2159 % \begin{macrocode}
2160 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
2161 \iso@daterange@australian}%
2162 % \end{macrocode}
2163 % \end{macro}
2164 % \begin{macro}{\iso@daterange@australian}
2165 % This command takes six arguments
2166 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
2167 % date range in the actual date format.
2168 % \begin{macrocode}
2169 \def\iso@daterange@australian#1#2#3#4#5#6{%
2170 % \end{macrocode}
2171 % ISO or \LaTeX\ date format.
2172 % \begin{macrocode}
2173 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2174 \equal{\iso@dateformat}{TeX}}{%
2175 % \end{macrocode}
2176 % Print the start date.
2177 % \begin{macrocode}
2178 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2179 }{%
2180 % \end{macrocode}
2181 % Numeric, short, or original date format.
2182 %
2183 % If year and month are equal, only print the day of the start date. If
2184 % only the year is equal, only print month and day of the start
2185 % date. Otherwise print the whole start date.
2186 % \begin{macrocode}
2187 \ifthenelse{\equal{\number#1}{\number#4}}{%
2188 \ifthenelse{\equal{\number#2}{\number#5}}{%
2189 \ifiso@doprintday
2190 \iso@printday{#3}%
2191 \else
2192 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2193 \fi
2194 }{%
2195 \iso@printmonthday@australian{#2}{#3}%
2196 }%
2197 }{%
2198 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2199 }%
2200 % \end{macrocode}
2201 % Print the end date.
2202 % \begin{macrocode}
2203 \iso@rangesign
2204 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2205 }%
2206 }
2207 % \end{macrocode}
2208 % \end{macro}
2209 % Define the language name that will the active language for isodate
2210 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2211 % loaded and if this is the last language that is used for isodate.
2212 % If one of the above packages is used this definition will be
2213 % overridden by the command \verb|\languagename| that will always
2214 % return the current used language.
2215 % \begin{macrocode}
2216 \def\iso@languagename{australian}%
2217 % \end{macrocode}
2218 % The end of the Australian section.
2219 %
2220 % Third, handle American.
2221 % \begin{macrocode}
2222 }{%
2223 \typeout{Define commands for American date format}
2224 % \end{macrocode}
2225 % \begin{macro}{\iso@printmonthday@american}
2226 % Prints the month and the day given as two arguments
2227 % (\verb|{mm}{dd}|) in the current date format.
2228 % \begin{macrocode}
2229 \def\iso@printmonthday@american#1#2{%
2230 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2231 \equal{\iso@dateformat}{TeX}}{%
2232 \iso@printmonthday@int{#1}{#2}%
2233 }{%
2234 % \end{macrocode}
2235 % Numeric and short date format: \verb|mm/dd/|
2236 % \begin{macrocode}
2237 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
2238 \equal{\iso@dateformat}{short}}{%
2239 \iso@printmonth{#1}%
2240 \ifiso@doprintday
2241 /\iso@printday{#2}%
2242 \fi
2243 }{%
2244 % \end{macrocode}
2245 % Original date format: \verb|mmm d|
2246 % \begin{macrocode}
2247 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2248 \equal{\iso@dateformat}{shortorig}}{%
2249 \begingroup%
2250 \edef\lmonth{#1}%
2251 \def\month{\lmonth}%
2252 \month@english%
2253 \endgroup
2254 \ifiso@doprintday
2255 \iso@daysep\iso@printday{#2}%
2256 \fi
2257 }{}%
2258 }%
2259 }%
2260 }
2261 % \end{macrocode}
2262 % \end{macro}
2263 % \begin{macro}{\iso@printdate@american}
2264 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
2265 % the actual date format.
2266 % \begin{macrocode}
2267 \def\iso@printdate@american#1#2#3{%
2268 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2269 \equal{\iso@dateformat}{TeX}}{%
2270 \iso@printdate@int{#1}{#2}{#3}%
2271 }{%
2272 \iso@printmonthday@american{\number#2}{\number#3}%
2273 % \end{macrocode}
2274 % Numeric date format: \verb|\iso@printmonthday@american yyyy|
2275 % \begin{macrocode}
2276 \ifiso@printyear
2277 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2278 \equal{\iso@dateformat}{shortorig}}{%
2279 }{%
2280 /%
2281 }%
2282 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
2283 \iso@yearfour{\number#1}%
2284 }{%
2285 % \end{macrocode}
2286 % Original date format: \verb|\iso@printmonthday@american,~yyyy|
2287 % \begin{macrocode}
2288 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2289 \ifiso@doprintday,\fi
2290 \iso@yearsep\iso@yearfour{\number#1}%
2291 }{%
2292 % \end{macrocode}
2293 % Short original date format: \verb|\iso@printmonthday@american,~yyyy|
2294 % \begin{macrocode}
2295 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
2296 \ifiso@doprintday,\fi
2297 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
2298 }{%
2299 % \end{macrocode}
2300 % Short date format: \verb|\iso@printmonthday@american yy|
2301 % \begin{macrocode}
2302 \ifthenelse{\equal{\iso@dateformat}{short}}{%
2303 \iso@yeartwo{\number#1}%
2304 }{}%
2305 }%
2306 }%
2307 }%
2308 \fi
2309 }%
2310 }
2311 % \end{macrocode}
2312 % \end{macro}
2313 % \begin{macro}{\iso@printdate@USenglish}
2314 % Just a second name for \verb|\iso@printdate@UKamerican|.
2315 % \begin{macrocode}
2316 \def\iso@printdate@USenglish{\iso@printdate@american}
2317 % \end{macrocode}
2318 % \end{macro}
2319 % \begin{macro}{\iso@dateamerican}
2320 % This command redefines the \cs{today} command to print in the
2321 % actual date format.
2322 % \begin{macrocode}
2323 \def\iso@dateamerican{%
2324 \def\today{\iso@printdate@american{\year}{\month}{\day}}}%
2325 % \end{macrocode}
2326 % \end{macro}
2327 % \begin{macro}{\iso@daterange@...}
2328 % Define date-range commands for dialects of American.
2329 % \begin{macrocode}
2330 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
2331 \iso@daterange@american}%
2332 % \end{macrocode}
2333 % \end{macro}
2334 % \begin{macro}{\iso@daterange@american}
2335 % This command takes six arguments
2336 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
2337 % date range in the actual date format.
2338 % \begin{macrocode}
2339 \def\iso@daterange@american#1#2#3#4#5#6{%
2340 % \end{macrocode}
2341 % ISO or \LaTeX\ date format.
2342 % \begin{macrocode}
2343 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2344 \equal{\iso@dateformat}{TeX}}{%
2345 % \end{macrocode}
2346 % Print the start date.
2347 % \begin{macrocode}
2348 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2349 }{%
2350 % \end{macrocode}
2351 % Original date format.
2352 %
2353 % If year and month are equal, print \verb|mmm d1 to d2, yyyy|. If
2354 % only the year is equal, print \verb|mmm1 d1 to mmm2 d2, yyyy|.
2355 % Otherwise print the whole start and end date.
2356 % \begin{macrocode}
2357 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2358 \equal{\iso@dateformat}{shortorig}}{%
2359 \ifthenelse{\equal{\number#1}{\number#4}}{%
2360 \ifthenelse{\equal{\number#2}{\number#5}}{%
2361 \iso@printmonthday@american{#2}{#3}%
2362 \iso@rangesign
2363 \ifiso@doprintday
2364 \iso@printday{#6},\iso@yearsep\@empty
2365 \else
2366 \iso@printmonthday@american{#5}{#6}\iso@yearsep\@empty
2367 \fi
2368 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2369 \iso@yearfour{\number#4}%
2370 }{%
2371 \iso@twodigitsign\iso@yeartwo{\number#4}%
2372 }%
2373 }{%
2374 \iso@printmonthday@american{#2}{#3}%
2375 \iso@rangesign
2376 \csname iso@printdate@\iso@languagename\endcsname{%
2377 #4}{#5}{#6}%
2378 }%
2379 }{%
2380 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2381 \iso@rangesign%
2382 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2383 }%
2384 }{%
2385 % \end{macrocode}
2386 % Numeric or short date format.
2387 %
2388 % If year and month are equal, only print the day of the end date.
2389 % Otherwise print the whole end date.
2390 % \begin{macrocode}
2391 \ifthenelse{\equal{\number#1}{\number#4}}{%
2392 \iso@printmonthday@american{#2}{#3}%
2393 }{%
2394 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2395 }%
2396 % \end{macrocode}
2397 % Print the end date.
2398 % \begin{macrocode}
2399 \iso@rangesign
2400 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2401 }%
2402 }%
2403 }
2404 % \end{macrocode}
2405 % \end{macro}
2406 % Define the language name that will the active language for isodate
2407 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2408 % loaded and if this is the last language that is used for isodate.
2409 % If one of the above packages is used this definition will be
2410 % overridden by the command \verb|\languagename| that will always
2411 % return the current used language.
2412 % \begin{macrocode}
2413 \def\iso@languagename{american}%
2414 % \end{macrocode}
2415 % The end of the American section.
2416 % \begin{macrocode}
2417 }
2418 }
2419 % \end{macrocode}
2420 % \begin{macro}{\iso@rangesign@...}
2421 % Sets the word between start and end date in a date range to `~to'.
2422 % \begin{macrocode}
2423 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~to~}
2424 % \end{macrocode}
2425 % \end{macro}
2426 % Redefine the command \verb|date|language that is used by babel.sty,
2427 % german.sty, and ngerman.sty to switch to the original
2428 % English/American date format to enable the use of different date
2429 % formats.
2430 % This has to be done after the preamble in order to ensure to overwrite
2431 % the babel command.
2432 %
2433 % Do this only if \verb|\iso@date|language is defined.
2434 % \begin{macrocode}
2435 \AtBeginDocument{%
2436 \ifx\undefined\iso@dateenglish\else
2437 \def\dateenglish{\iso@dateenglish}%
2438 \def\datebritish{\iso@dateenglish}%
2439 \def\dateUKenglish{\iso@dateenglish}%
2440 \fi
2441 \ifx\undefined\iso@dateaustralian\else
2442 \def\dateaustralian{\iso@dateaustralian}%
2443 \def\datenewzealand{\iso@dateaustralian}%
2444 \fi
2445 \ifx\undefined\iso@dateamerican\else
2446 \def\dateamerican{\iso@dateamerican}%
2447 \def\dateUSenglish{\iso@dateamerican}%
2448 \fi
2449 }
2450 %</english>
2451 % \end{macrocode}
2452 %
2453 % \subsection{Language definition file french.idf}
2454 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
2455 %
2456 % \begin{macro}{\iso@languageloaded}
2457 % Define the command \verb|\iso@languageloaded| in order to enable
2458 % \verb|isodate.sty| to determine if at least one language is loaded.
2459 % \begin{macrocode}
2460 %<*french>
2461 \let\iso@languageloaded\active
2462 \typeout{Define commands for French date format}
2463 % \end{macrocode}
2464 % \end{macro}
2465 % \begin{macrocode}
2466 \def\month@french{\ifcase\month\or
2467 janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
2468 juillet\or ao\^ut\or septembre\or octobre\or novembre\or
2469 d\'ecembre\fi}
2470 % \end{macrocode}
2471 % \begin{macrocode}
2472 \def\iso@printmonthday@french#1#2{%
2473 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2474 \equal{\iso@dateformat}{TeX}}{%
2475 \iso@printmonthday@int{#1}{#2}%
2476 }{%
2477 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
2478 \equal{\iso@dateformat}{short}}{%
2479 \ifiso@doprintday
2480 \iso@printday{#2}/%
2481 \fi
2482 \iso@printmonth{#1}%
2483 }{%
2484 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2485 \equal{\iso@dateformat}{shortorig}}{%
2486 \begingroup
2487 \edef\lday{#2}\edef\day{\lday}%
2488 \edef\lmonth{#1}\def\month{\lmonth}%
2489 \ifiso@doprintday
2490 \number\day\ifnum1=\day \noexpand\ier\fi\iso@monthsep
2491 \fi
2492 \month@french
2493 \endgroup
2494 }{}%
2495 }%
2496 }%
2497 }
2498 % \end{macrocode}
2499 % \begin{macrocode}
2500 \def\iso@printdate@french#1#2#3{%
2501 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2502 \equal{\iso@dateformat}{TeX}}{%
2503 \iso@printdate@int{#1}{#2}{#3}%
2504 }{%
2505 \iso@printmonthday@french{\number#2}{\number#3}%
2506 \ifiso@printyear
2507 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2508 \equal{\iso@dateformat}{shortorig}}{%
2509 }{%
2510 /%
2511 }%
2512 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
2513 \iso@yearfour{\number#1}%
2514 }{%
2515 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2516 \iso@yearsep\iso@yearfour{\number#1}%
2517 }{%
2518 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
2519 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
2520 }{%
2521 \ifthenelse{\equal{\iso@dateformat}{short}}{%
2522 \iso@yeartwo{\number#1}%
2523 }{}%
2524 }%
2525 }%
2526 }%
2527 \fi
2528 }%
2529 }
2530 % \end{macrocode}
2531 % \begin{macrocode}
2532 \def\iso@datefrench{%
2533 \def\today{\iso@printdate@french{\year}{\month}{\day}}}%
2534 % \end{macrocode}
2535 % \begin{macro}{\iso@daterange@...}
2536 % Define date-range commands for dialects.
2537 % \begin{macrocode}
2538 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
2539 \iso@daterange@french}%
2540 % \end{macrocode}
2541 % \end{macro}
2542 % \begin{macrocode}
2543 \def\iso@daterange@french#1#2#3#4#5#6{%
2544 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2545 \equal{\iso@dateformat}{TeX}}{%
2546 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2547 }{%
2548 % \end{macrocode}
2549 % \begin{macrocode}
2550 \ifthenelse{\equal{\number#1}{\number#4}}{%
2551 \ifthenelse{\equal{\number#2}{\number#5}}{%
2552 \ifiso@doprintday
2553 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2554 \begingroup
2555 \edef\lday{#3}\edef\day{\lday}%
2556 \number\day\ifnum1=\day \noexpand\ier\fi
2557 \endgroup
2558 }{%
2559 \iso@printday{#3}%
2560 }%
2561 \else
2562 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2563 \fi
2564 }{%
2565 \iso@printmonthday@french{#2}{#3}%
2566 }%
2567 }{%
2568 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2569 }%
2570 \iso@rangesign
2571 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2572 }%
2573 }
2574 % \end{macrocode}
2575 % \begin{macrocode}
2576 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~au~}
2577 % \end{macrocode}
2578 % \changes{2.06}{2002/04/08}{Changed range sign for French language,
2579 % thanks to Felix P\"utsch}
2580 % Define the language name that will the active language for isodate
2581 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2582 % loaded and if this is the last language that is used for isodate.
2583 % If one of the above packages is used this definition will be
2584 % overridden by the command \verb|\languagename| that will always
2585 % return the current used language.
2586 % \begin{macrocode}
2587 \def\iso@languagename{french}%
2588 % \end{macrocode}
2589 % \changes{2.03}{2001/05/04}{Fixed a bug in the French language that caused
2590 % not to switch to it correctly on startup.}
2591 % \verb|\datefrenchb| has to be defined additionally because babel starts
2592 % with language frenchb instead of french.
2593 % \begin{macrocode}
2594 \AtBeginDocument{%
2595 \ifx\undefined\iso@datefrench\else
2596 \def\datefrench{\iso@datefrench}%
2597 \def\datefrenchb{\iso@datefrench}%
2598 \fi
2599 }
2600 %</french>
2601 % \end{macrocode}
2602 %
2603 % \subsection{Language definition file german.idf}
2604 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
2605 %
2606 % \begin{macro}{\iso@languageloaded}
2607 % Define the command \verb|\iso@languageloaded| in order to enable
2608 % \verb|isodate.sty| to determine if at least one language is loaded.
2609 % \begin{macrocode}
2610 %<*german>
2611 \let\iso@languageloaded\active
2612 \typeout{Define commands for German date format (\CurrentOption)}
2613 % \end{macrocode}
2614 % \end{macro}
2615 % \changes{2.03}{2001/05/04}{Allow change of spaces for German language}%
2616 % Define spaces between day and month resp. month and year. \verb|dm|
2617 % stands for day-month and \verb|my| for month-year. The defaults are taken
2618 % from the Duden \cite{duden1996a}.
2619 % \begin{macrocode}
2620 \def\iso@dmsepgerman{\,}%
2621 \def\iso@mylongsepgerman{~}%
2622 \def\iso@myshortsepgerman{\,}%
2623 \def\iso@mylongsepnodaygerman{}%
2624 \def\iso@myshortsepnodaygerman{}%
2625 % \end{macrocode}
2626 % \begin{macro}{\daymonthsepgerman}
2627 % Change space between day and month in numeric date formats for the
2628 % German language. The only parameter is the new spacing.
2629 % \begin{macrocode}
2630 \DeclareRobustCommand*\daymonthsepgerman[1]{\def\iso@dmsepgerman{#1}}
2631 % \begin{macrocode}
2632 % \end{macro}
2633 % \begin{macro}{\monthyearsepgerman}
2634 % Change space between month and year in numeric date formats for the
2635 % German language. The first parameter is the new spacing for the long
2636 % format and the second for the short format.
2637 % \begin{macrocode}
2638 \DeclareRobustCommand*\monthyearsepgerman[2]{%
2639 \def\iso@mylongsepgerman{#1}%
2640 \def\iso@myshortsepgerman{#2}}
2641 \DeclareRobustCommand*\monthyearsepnodaygerman[2]{%
2642 \def\iso@mylongsepnodaygerman{#1}%
2643 \def\iso@myshortsepnodaygerman{#2}}
2644 % \end{macrocode}
2645 % \end{macro}
2646 % \changes{2.02}{2000/10/03}{Changed the umlauts to normal \TeX\ commands to
2647 % be able to use German dates without german.sty or babel.sty.}
2648 % \begin{macrocode}
2649 \def\month@german{\ifcase\month\or
2650 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
2651 Juli\or August\or September\or Oktober\or November\or Dezember\fi}
2652 \def\month@ngerman{\month@german}
2653 \def\month@austrian{\ifnum1=\month
2654 J\"anner\else \month@german\fi}
2655 \def\month@naustrian{\month@austrian}
2656 % \end{macrocode}
2657 % \begin{macrocode}
2658 \@namedef{iso@printmonthday@\CurrentOption}#1#2{%
2659 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2660 \equal{\iso@dateformat}{TeX}}{%
2661 \iso@printmonthday@int{#1}{#2}%
2662 }{%
2663 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
2664 \equal{\iso@dateformat}{short}}{%
2665 \ifiso@doprintday
2666 \iso@printday{#2}.\iso@dmsepgerman
2667 \fi
2668 \iso@printmonth{#1}%
2669 }{%
2670 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2671 \equal{\iso@dateformat}{shortorig}}{%
2672 \ifiso@doprintday
2673 \iso@printday{#2}.\iso@monthsep\@empty
2674 \fi
2675 \begingroup
2676 \edef\lmonth{#1}%
2677 \def\month{\lmonth}\csname month@\iso@languagename\endcsname%
2678 \endgroup
2679 }{}%
2680 }%
2681 }%
2682 }
2683 % \end{macrocode}
2684 % \begin{macrocode}
2685 \@namedef{iso@printdate@\CurrentOption}#1#2#3{%
2686 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2687 \equal{\iso@dateformat}{TeX}}{%
2688 \iso@printdate@int{#1}{#2}{#3}%
2689 }{%
2690 \csname iso@printmonthday@\iso@languagename\endcsname{%
2691 \number#2}{\number#3}%
2692 \ifiso@printyear
2693 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2694 \equal{\iso@dateformat}{shortorig}}{%
2695 }{%
2696 \ifiso@doprintday.\else/\fi
2697 }%
2698 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
2699 \ifiso@doprintday
2700 \iso@mylongsepgerman\@empty
2701 \else
2702 \iso@mylongsepnodaygerman\@empty
2703 \fi
2704 \iso@yearfour{\number#1}%
2705 }{%
2706 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2707 \iso@yearsep\iso@yearfour{\number#1}%
2708 }{%
2709 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
2710 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
2711 }{%
2712 \ifthenelse{\equal{\iso@dateformat}{short}}{%
2713 \ifiso@doprintday
2714 \iso@myshortsepgerman\@empty
2715 \else
2716 \iso@myshortsepnodaygerman\@empty
2717 \fi
2718 \iso@yeartwo{\number#1}%
2719 }{}%
2720 }%
2721 }%
2722 }%
2723 \fi
2724 }%
2725 }
2726 % \end{macrocode}
2727 % \begin{macrocode}
2728 \@namedef{iso@daterange@\CurrentOption}#1#2#3#4#5#6{%
2729 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2730 \equal{\iso@dateformat}{TeX}}{%
2731 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2732 }{%
2733 % \end{macrocode}
2734 % \begin{macrocode}
2735 \ifthenelse{\equal{\number#1}{\number#4}}{%
2736 \ifthenelse{\equal{\number#2}{\number#5}}{%
2737 \ifiso@doprintday
2738 \iso@printday{#3}.%
2739 \else
2740 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2741 \fi
2742 }{%
2743 \csname iso@printmonthday@\iso@languagename\endcsname{#2}{#3}%
2744 }%
2745 }{%
2746 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2747 }%
2748 \iso@rangesign
2749 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2750 }%
2751 }
2752 % \end{macrocode}
2753 % \begin{macrocode}
2754 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~bis~}
2755 % \end{macrocode}
2756 % \begin{macrocode}
2757 \ifthenelse{\equal{\CurrentOption}{german}}{%
2758 \def\iso@dategerman{%
2759 \def\today{\iso@printdate@german{\year}{\month}{\day}}}%
2760 % \end{macrocode}
2761 % Define the language name that will the active language for isodate
2762 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2763 % loaded and if this is the last language that is used for isodate.
2764 % If one of the above packages is used this definition will be
2765 % overridden by the command \verb|\languagename| that will always
2766 % return the current used language.
2767 % \begin{macrocode}
2768 \def\iso@languagename{german}%
2769 }{%
2770 % \end{macrocode}
2771 % \begin{macrocode}
2772 \ifthenelse{\equal{\CurrentOption}{ngerman}}{%
2773 \def\iso@datengerman{%
2774 \def\today{\iso@printdate@ngerman{\year}{\month}{\day}}}%
2775 % \end{macrocode}
2776 % Define the language name that will the active language for isodate
2777 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2778 % loaded and if this is the last language that is used for isodate.
2779 % If one of the above packages is used this definition will be
2780 % overridden by the command \verb|\languagename| that will always
2781 % return the current used language.
2782 % \begin{macrocode}
2783 \def\iso@languagename{ngerman}%
2784 }{%
2785 % \end{macrocode}
2786 % \begin{macrocode}
2787 \ifthenelse{\equal{\CurrentOption}{austrian}}{%
2788 \def\iso@dateaustrian{%
2789 \def\today{\iso@printdate@austrian{\year}{\month}{\day}}}%
2790 % \end{macrocode}
2791 % Define the language name that will the active language for isodate
2792 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2793 % loaded and if this is the last language that is used for isodate.
2794 % If one of the above packages is used this definition will be
2795 % overridden by the command \verb|\languagename| that will always
2796 % return the current used language.
2797 % \begin{macrocode}
2798 \def\iso@languagename{austrian}%
2799 }{%
2800 % \end{macrocode}
2801 % \begin{macrocode}
2802 \ifthenelse{\equal{\CurrentOption}{naustrian}}{%
2803 \def\iso@datenaustrian{%
2804 \def\today{\iso@printdate@naustrian{\year}{\month}{\day}}}%
2805 % \end{macrocode}
2806 % Define the language name that will the active language for isodate
2807 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2808 % loaded and if this is the last language that is used for isodate.
2809 % If one of the above packages is used this definition will be
2810 % overridden by the command \verb|\languagename| that will always
2811 % return the current used language.
2812 % \begin{macrocode}
2813 \def\iso@languagename{naustrian}%
2814 }{%
2815 }}}}
2816 % \end{macrocode}
2817 % Redefine the command \verb|date|language that is used by babel.sty,
2818 % german.sty, and ngerman.sty to switch to the original
2819 % German date format to enable the use of different date
2820 % formats.
2821 % This has to be done after the preamble in order to ensure to overwrite
2822 % the babel command.
2823 %
2824 % Do this only if \verb|\iso@date|language is defined.
2825 % \begin{macrocode}
2826 \AtBeginDocument{%
2827 \ifx\undefined\iso@dategerman\else
2828 \def\dategerman{\iso@dategerman}%
2829 \fi
2830 \ifx\undefined\iso@datengerman\else
2831 \def\datengerman{\iso@datengerman}%
2832 \fi
2833 \ifx\undefined\iso@dateaustrian\else
2834 \def\dateaustrian{\iso@dateaustrian}%
2835 \fi
2836 \ifx\undefined\iso@datenaustrian\else
2837 \def\datenaustrian{\iso@datenaustrian}%
2838 \fi
2839 }
2840 %</german>
2841 % \end{macrocode}
2842 %
2843 % \subsection{Language definition file italian.idf}
2844 % \changes{2.28}{2005/04/15}{Add Italian language by Philip Ratcliffe}%
2845 %
2846 % \begin{macro}{\iso@languageloaded}
2847 % Define the command \verb|\iso@languageloaded| in order to enable
2848 % \verb|isodate.sty| to determine if at least one language is loaded.
2849 % \begin{macrocode}
2850 %<*italian>
2851 \let\iso@languageloaded\active
2852 \typeout{Define commands for Italian date format}
2853 % \end{macrocode}
2854 % \end{macro}
2855 % \begin{macrocode}
2856 \def\month@italian{\ifcase\month\or
2857 gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
2858 luglio\or agosto\or settembre\or ottobre\or novembre\or
2859 dicembre\fi}
2860 % \end{macrocode}
2861 % \begin{macrocode}
2862 \def\iso@printmonthday@italian#1#2{%
2863 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2864 \equal{\iso@dateformat}{TeX}}{%
2865 \iso@printmonthday@int{#1}{#2}%
2866 }{%
2867 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
2868 \equal{\iso@dateformat}{short}}{%
2869 \ifiso@doprintday
2870 \iso@printday{#2}/%
2871 \fi
2872 \iso@printmonth{#1}%
2873 }{%
2874 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2875 \equal{\iso@dateformat}{shortorig}}{%
2876 \begingroup
2877 \edef\lday{#2}\edef\day{\lday}%
2878 \edef\lmonth{#1}\def\month{\lmonth}%
2879 \ifiso@doprintday
2880 \number\day\ifnum1=\day \noexpand\textordmasculine\fi
2881 \iso@monthsep
2882 \fi
2883 \month@italian
2884 \endgroup
2885 }{}%
2886 }%
2887 }%
2888 }
2889 % \end{macrocode}
2890 % \begin{macrocode}
2891 \def\iso@printdate@italian#1#2#3{%
2892 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2893 \equal{\iso@dateformat}{TeX}}{%
2894 \iso@printdate@int{#1}{#2}{#3}%
2895 }{%
2896 \iso@printmonthday@italian{\number#2}{\number#3}%
2897 \ifiso@printyear
2898 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
2899 \equal{\iso@dateformat}{shortorig}}{%
2900 }{%
2901 /%
2902 }%
2903 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
2904 \iso@yearfour{\number#1}%
2905 }{%
2906 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2907 \iso@yearsep\iso@yearfour{\number#1}%
2908 }{%
2909 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
2910 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
2911 }{%
2912 \ifthenelse{\equal{\iso@dateformat}{short}}{%
2913 \iso@yeartwo{\number#1}%
2914 }{}%
2915 }%
2916 }%
2917 }%
2918 \fi
2919 }%
2920 }
2921 % \end{macrocode}
2922 % \begin{macrocode}
2923 \def\iso@dateitalian{%
2924 \def\today{\iso@printdate@italian{\year}{\month}{\day}}}%
2925 % \end{macrocode}
2926 % \begin{macro}{\iso@daterange@...}
2927 % Define date-range commands for dialects.
2928 % \begin{macrocode}
2929 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
2930 \iso@daterange@italian}%
2931 % \end{macrocode}
2932 % \end{macro}
2933 % \begin{macrocode}
2934 \def\iso@daterange@italian#1#2#3#4#5#6{%
2935 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
2936 \equal{\iso@dateformat}{TeX}}{%
2937 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
2938 }{%
2939 % \end{macrocode}
2940 % \begin{macrocode}
2941 \ifthenelse{\equal{\number#1}{\number#4}}{%
2942 \ifthenelse{\equal{\number#2}{\number#5}}{%
2943 \ifiso@doprintday
2944 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
2945 \begingroup
2946 \edef\lday{#3}\edef\day{\lday}%
2947 \number\day\ifnum1=\day \noexpand\textordmasculine\fi
2948 \endgroup
2949 }{%
2950 \iso@printday{#3}%
2951 }%
2952 \else
2953 \iso@printmonthday@italian{#2}{#3}%
2954 \fi
2955 }{%
2956 \iso@printmonthday@italian{#2}{#3}%
2957 }%
2958 }{%
2959 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
2960 }%
2961 \iso@rangesign
2962 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
2963 }%
2964 }
2965 % \end{macrocode}
2966 % \begin{macrocode}
2967 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~al~}
2968 % \end{macrocode}
2969 % Define the language name that will the active language for isodate
2970 % if none of the packages babel.sty, german.sty, and ngerman.sty is
2971 % loaded and if this is the last language that is used for isodate.
2972 % If one of the above packages is used this definition will be
2973 % overridden by the command \verb|\languagename| that will always
2974 % return the current used language.
2975 % \begin{macrocode}
2976 \def\iso@languagename{italian}%
2977 % \end{macrocode}
2978 % \begin{macrocode}
2979 \AtBeginDocument{%
2980 \ifx\undefined\iso@dateitalian\else
2981 \def\dateitalian{\iso@dateitalian}%
2982 \fi
2983 }
2984 %</italian>
2985 % \end{macrocode}
2986 %
2987 % \changes{2.02}{2001/04/30}{Added Norwegian language by Svend Tollak
2988 % Munkejord}
2989 % \subsection{Language definition file norsk.idf}
2990 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
2991 %
2992 % This file was provided by Svend Tollak Munkejord
2993 % ([email protected]).
2994 %
2995 % \begin{macro}{\iso@languageloaded}
2996 % Define the command \verb|\iso@languageloaded| in order to enable
2997 % \verb|isodate.sty| to determine if at least one language is loaded.
2998 % \begin{macrocode}
2999 %<*norsk>
3000 \let\iso@languageloaded\active
3001 \typeout{Define commands for Norwegian date format}
3002 % \end{macrocode}
3003 % \end{macro}
3004 % \begin{macro}{\month@norsk}
3005 % Prints the name of today's month in the long form for the original
3006 % date format.
3007 % \begin{macrocode}
3008 \def\month@norsk{\ifcase\month\or
3009 januar\or februar\or mars\or april\or mai\or juni\or
3010 juli\or august\or september\or oktober\or november\or desember\fi}
3011 % \end{macrocode}
3012 % \end{macro}
3013 % \begin{macro}{\iso@printmonthday@norsk}
3014 % Prints the month and the day given as two arguments
3015 % (\verb|{mm}{dd}|) in the current date format.
3016 % \begin{macrocode}
3017 \def\iso@printmonthday@norsk#1#2{%
3018 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3019 \equal{\iso@dateformat}{TeX}}{%
3020 \iso@printmonthday@int{#1}{#2}%
3021 }{%
3022 % \end{macrocode}
3023 % Numeric and short date format: \verb|dd/mm/|
3024 % \begin{macrocode}
3025 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
3026 \equal{\iso@dateformat}{short}}{%
3027 \ifiso@doprintday
3028 \iso@printday{#2}/%
3029 \fi
3030 \iso@printmonth{#1}%
3031 }{%
3032 % \end{macrocode}
3033 % Original date format: \verb|d. mmm|
3034 % \begin{macrocode}
3035 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3036 \equal{\iso@dateformat}{shortorig}}{%
3037 \ifiso@doprintday
3038 \iso@printday{#2}.\iso@monthsep
3039 \fi
3040 \begingroup
3041 \edef\lmonth{#1}\def\month{\lmonth}%
3042 \month@norsk%
3043 \endgroup
3044 }{}%
3045 }%
3046 }%
3047 }
3048 % \end{macrocode}
3049 % \end{macro}
3050 % \begin{macro}{\iso@printdate@norsk}
3051 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
3052 % the actual date format
3053 % \begin{macrocode}
3054 \def\iso@printdate@norsk#1#2#3{%
3055 % \end{macrocode}
3056 % ISO or \LaTeX date format: \verb|yyyy\iso@printmonthday@norsk|
3057 % \begin{macrocode}
3058 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3059 \equal{\iso@dateformat}{TeX}}{%
3060 \iso@printdate@int{#1}{#2}{#3}%
3061 }{%
3062 \iso@printmonthday@norsk{\number#2}{\number#3}%
3063 % \end{macrocode}
3064 % numeric date format: \verb|\iso@printmonthday@norsk yyyy|
3065 % \begin{macrocode}
3066 \ifiso@printyear
3067 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3068 \equal{\iso@dateformat}{shortorig}}{%
3069 }{%
3070 /%
3071 }%
3072 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
3073 \iso@yearfour{\number#1}%
3074 }{%
3075 % \end{macrocode}
3076 % original date format: \verb|\iso@printmonthday@norsk~yyyy|
3077 % \begin{macrocode}
3078 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
3079 \iso@yearsep\iso@yearfour{\number#1}%
3080 }{%
3081 % \end{macrocode}
3082 % short original date format: \verb|\iso@printmonthday@norsk~yyyy|
3083 % \begin{macrocode}
3084 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
3085 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
3086 }{%
3087 % \end{macrocode}
3088 % short date format: \verb|\iso@printmonthday@norsk yy|
3089 % \begin{macrocode}
3090 \ifthenelse{\equal{\iso@dateformat}{short}}{%
3091 \iso@yeartwo{\number#1}%
3092 }{}%
3093 }%
3094 }%
3095 }%
3096 \fi
3097 }%
3098 }
3099 % \end{macrocode}
3100 % \end{macro}
3101 % \begin{macro}{\iso@datenorsk}
3102 % This command redefines the \cs{today} command to print in the
3103 % actual date format.
3104 % \begin{macrocode}
3105 \def\iso@datenorsk{%
3106 \def\today{\iso@printdate@norsk{\year}{\month}{\day}}}%
3107 % \end{macrocode}
3108 % \end{macro}
3109 % \begin{macro}{\iso@daterange@...}
3110 % Define date-range commands for dialects.
3111 % \begin{macrocode}
3112 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
3113 \iso@daterange@norsk}%
3114 % \end{macrocode}
3115 % \end{macro}
3116 % \begin{macro}{\iso@daterange@norsk}
3117 % This command takes six arguments
3118 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
3119 % date range in the actual date format.
3120 % \begin{macrocode}
3121 \def\iso@daterange@norsk#1#2#3#4#5#6{%
3122 % \end{macrocode}
3123 % ISO or \LaTeX\ date format.
3124 % \begin{macrocode}
3125 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3126 \equal{\iso@dateformat}{TeX}}{%
3127 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
3128 }{%
3129 % \end{macrocode}
3130 % Numeric, short, or original date format.
3131 %
3132 % If year and month are equal, only print the day of the start date. If
3133 % only the year is equal, only print month and day of the start
3134 % date. Otherwise print the whole start date.
3135 % \begin{macrocode}
3136 \ifthenelse{\equal{\number#1}{\number#4}}{%
3137 \ifthenelse{\equal{\number#2}{\number#5}}{%
3138 \ifiso@doprintday
3139 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3140 \equal{\iso@dateformat}{shortorig}}{%
3141 \iso@printday{#3}.%
3142 }{%
3143 \iso@printday{#3}%
3144 }%
3145 \else
3146 \iso@printmonthday@norsk{#2}{#3}%
3147 \fi
3148 }{%
3149 \iso@printmonthday@norsk{#2}{#3}%
3150 }%
3151 }{%
3152 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
3153 }%
3154 % \end{macrocode}
3155 % Print the end date.
3156 % \begin{macrocode}
3157 \iso@rangesign
3158 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
3159 }%
3160 }
3161 % \end{macrocode}
3162 % \end{macro}
3163 % \begin{macro}{\iso@rangesign@norsk}
3164 % Sets the word between start and end date in a date range to `~til~'.
3165 % \begin{macrocode}
3166 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~til~}
3167 % \end{macrocode}
3168 % \end{macro}
3169 % Define the language name that will the active language for isodate
3170 % if none of the packages babel.sty, german.sty, and ngerman.sty is
3171 % loaded and if this is the last language that is used for isodate.
3172 % If one of the above packages is used this definition will be
3173 % overridden by the command \verb|\languagename| that will always
3174 % return the current used language.
3175 % \begin{macrocode}
3176 \def\iso@languagename{norsk}%
3177 % \end{macrocode}
3178 % Redefine the command \verb|\datenorsk| that is used by babel to
3179 % switch to the original Norsk date format to enable the use of
3180 % different date formats.
3181 % This has to be done after the preamble in order to ensure to overwrite
3182 % the babel command.
3183 % \begin{macrocode}
3184 \AtBeginDocument{%
3185 \ifx\undefined\iso@datenorsk\else
3186 \def\datenorsk{\iso@datenorsk}%
3187 \fi
3188 }
3189 %</norsk>
3190 % \end{macrocode}
3191 %
3192 % \changes{2.07}{2003/07/29}{Add Swedish language by Christian
3193 % Schlauer}
3194 % \subsection{Language definition file swedish.idf}
3195 % \changes{2.26}{2005/03/10}{Force year in four digits for long formats}%
3196 %
3197 % This file was provided by Christian Schlauer
3198 % ([email protected]).
3199 %
3200 % \begin{macro}{\iso@languageloaded}
3201 % Define the command \verb|\iso@languageloaded| in order to enable
3202 % \verb|isodate.sty| to determine if at least one language is loaded.
3203 % \begin{macrocode}
3204 %<*swedish>
3205 \let\iso@languageloaded\active
3206 \typeout{Define commands for Swedish date format}
3207 % \end{macrocode}
3208 % \end{macro}
3209 % \begin{macro}{\month@swedish}
3210 % Prints the name of today's month in the long form for the original
3211 % date format.
3212 % \begin{macrocode}
3213 \def\month@swedish{\ifcase\month\or
3214 januari\or februari\or mars\or april\or maj\or juni\or
3215 juli\or augusti\or september\or oktober\or november\or december\fi}
3216 % \end{macrocode}
3217 % \end{macro}
3218 % \begin{macro}{\iso@printmonthday@swedish}
3219 % Prints the month and the day given as two arguments
3220 % (\verb|{mm}{dd}|) in the current date format.
3221 % \begin{macrocode}
3222 \def\iso@printmonthday@swedish#1#2{%
3223 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3224 \equal{\iso@dateformat}{TeX}}{%
3225 \iso@printmonthday@int{#1}{#2}%
3226 }{%
3227 % \end{macrocode}
3228 % Numeric and short date format: \verb|dd/mm/|
3229 % \begin{macrocode}
3230 \ifthenelse{\equal{\iso@dateformat}{numeric}\OR
3231 \equal{\iso@dateformat}{short}}{%
3232 \ifiso@doprintday
3233 \iso@printday{#2}/%
3234 \fi
3235 \iso@printmonth{#1}%
3236 }{%
3237 % \end{macrocode}
3238 % Original date format: \verb|d. mmm|
3239 % \begin{macrocode}
3240 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3241 \equal{\iso@dateformat}{shortorig}}{%
3242 \ifiso@doprintday
3243 \iso@printday{#2}.\iso@monthsep
3244 \fi
3245 \begingroup
3246 \edef\lmonth{#1}\def\month{\lmonth}%
3247 \month@swedish%
3248 \endgroup
3249 }{}%
3250 }%
3251 }%
3252 }
3253 % \end{macrocode}
3254 % \end{macro}
3255 % \begin{macro}{\iso@printdate@swedish}
3256 % Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
3257 % the actual date format
3258 % \begin{macrocode}
3259 \def\iso@printdate@swedish#1#2#3{%
3260 % \end{macrocode}
3261 % ISO or \LaTeX date format: \verb|yyyy\iso@printmonthday@swedish|
3262 % \begin{macrocode}
3263 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3264 \equal{\iso@dateformat}{TeX}}{%
3265 \iso@printdate@int{#1}{#2}{#3}%
3266 }{%
3267 \iso@printmonthday@swedish{\number#2}{\number#3}%
3268 % \end{macrocode}
3269 % numeric date format: \verb|\iso@printmonthday@swedish yyyy|
3270 % \begin{macrocode}
3271 \ifiso@printyear
3272 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3273 \equal{\iso@dateformat}{shortorig}}{%
3274 }{%
3275 /%
3276 }%
3277 \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
3278 \iso@yearfour{\number#1}%
3279 }{%
3280 % \end{macrocode}
3281 % original date format: \verb|\iso@printmonthday@swedish~yyyy|
3282 % \begin{macrocode}
3283 \ifthenelse{\equal{\iso@dateformat}{orig}}{%
3284 \iso@yearsep\iso@yearfour{\number#1}%
3285 }{%
3286 % \end{macrocode}
3287 % short original date format: \verb|\iso@printmonthday@swedish~yy|
3288 % \begin{macrocode}
3289 \ifthenelse{\equal{\iso@dateformat}{shortorig}}{%
3290 \iso@yearsep\iso@twodigitsign\iso@yeartwo{\number#1}%
3291 }{%
3292 % \end{macrocode}
3293 % short date format: \verb|\iso@printmonthday@swedish yy|
3294 % \begin{macrocode}
3295 \ifthenelse{\equal{\iso@dateformat}{short}}{%
3296 \iso@yeartwo{\number#1}%
3297 }{}%
3298 }%
3299 }%
3300 }%
3301 \fi
3302 }%
3303 }
3304 % \end{macrocode}
3305 % \end{macro}
3306 % \begin{macro}{\iso@dateswedish}
3307 % This command redefines the \cs{today} command to print in the
3308 % actual date format.
3309 % \begin{macrocode}
3310 \def\iso@dateswedish{%
3311 \def\today{\iso@printdate@swedish{\year}{\month}{\day}}}%
3312 % \end{macrocode}
3313 % \end{macro}
3314 % \begin{macro}{\iso@daterange@...}
3315 % Define date-range commands for dialects.
3316 % \begin{macrocode}
3317 \expandafter\def\csname iso@daterange@\CurrentOption\endcsname{%
3318 \iso@daterange@swedish}%
3319 % \end{macrocode}
3320 % \end{macro}
3321 % \begin{macro}{\iso@daterange@swedish}
3322 % This command takes six arguments
3323 % (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
3324 % date range in the actual date format.
3325 % \begin{macrocode}
3326 \def\iso@daterange@swedish#1#2#3#4#5#6{%
3327 % \end{macrocode}
3328 % ISO or \LaTeX\ date format.
3329 % \begin{macrocode}
3330 \ifthenelse{\equal{\iso@dateformat}{iso}\OR
3331 \equal{\iso@dateformat}{TeX}}{%
3332 \iso@daterange@int{#1}{#2}{#3}{#4}{#5}{#6}%
3333 }{%
3334 % \end{macrocode}
3335 % Numeric, short, or original date format.
3336 %
3337 % If year and month are equal, only print the day of the start date. If
3338 % only the year is equal, only print month and day of the start
3339 % date. Otherwise print the whole start date.
3340 % \begin{macrocode}
3341 \ifthenelse{\equal{\number#1}{\number#4}}{%
3342 \ifthenelse{\equal{\number#2}{\number#5}}{%
3343 \ifiso@doprintday
3344 \ifthenelse{\equal{\iso@dateformat}{orig}\OR
3345 \equal{\iso@dateformat}{shortorig}}{%
3346 \iso@printday{#3}.%
3347 }{%
3348 \iso@printday{#3}%
3349 }%
3350 \else
3351 \iso@printmonthday@swedish{#2}{#3}%
3352 \fi
3353 }{%
3354 \iso@printmonthday@swedish{#2}{#3}%
3355 }%
3356 }{%
3357 \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
3358 }%
3359 % \end{macrocode}
3360 % Print the end date.
3361 % \begin{macrocode}
3362 \iso@rangesign
3363 \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}%
3364 }%
3365 }
3366 % \end{macrocode}
3367 % \end{macro}
3368 % \begin{macro}{\iso@rangesign@swedish}
3369 % Sets the word between start and end date in a date range to `~till~'.
3370 % \begin{macrocode}
3371 \expandafter\def\csname iso@rangesign@\CurrentOption\endcsname{~till~}
3372 % \end{macrocode}
3373 % \end{macro}
3374 % Define the language name that will the active language for isodate
3375 % if none of the packages babel.sty, german.sty, and ngerman.sty is
3376 % loaded and if this is the last language that is used for isodate.
3377 % If one of the above packages is used this definition will be
3378 % overridden by the command \verb|\languagename| that will always
3379 % return the current used language.
3380 % \begin{macrocode}
3381 \def\iso@languagename{swedish}%
3382 % \end{macrocode}
3383 % Redefine the command \verb|\dateswedish| that is used by babel to
3384 % switch to the original Swedish date format to enable the use of
3385 % different date formats.
3386 % This has to be done after the preamble in order to ensure to overwrite
3387 % the babel command.
3388 % \begin{macrocode}
3389 \AtBeginDocument{%
3390 \ifx\undefined\iso@dateswedish\else
3391 \def\dateswedish{\iso@dateswedish}%
3392 \fi
3393 }
3394 %</swedish>
3395 % \end{macrocode}
3396 %
3397 % \Finale