Debian Codegraph @

texmf-dist/source/latex/datetime2-dutch/datetime2-dutch.dtx

raw
1 %\iffalse
2 %<*package>
3 %% \CharacterTable
4 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
5 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
6 %% Digits \0\1\2\3\4\5\6\7\8\9
7 %% Exclamation \! Double quote \" Hash (number) \#
8 %% Dollar \$ Percent \% Ampersand \&
9 %% Acute accent \' Left paren \( Right paren \)
10 %% Asterisk \* Plus \+ Comma \,
11 %% Minus \- Point \. Solidus \/
12 %% Colon \: Semicolon \; Less than \<
13 %% Equals \= Greater than \> Question mark \?
14 %% Commercial at \@ Left bracket \[ Backslash \\
15 %% Right bracket \] Circumflex \^ Underscore \_
16 %% Grave accent \` Left brace \{ Vertical bar \|
17 %% Right brace \} Tilde \~}
18 %</package>
19 %\fi
20 % \iffalse
21 % Doc-Source file to use with LaTeX2e
22 % Copyright (C) 2018 Nicola Talbot, all rights reserved.
23 % (New maintainer add relevant lines here.)
24 % \fi
25 % \iffalse
26 %<*driver>
27 \documentclass{ltxdoc}
28
29 \usepackage{alltt}
30 \usepackage{graphicx}
31 \usepackage[utf8]{inputenc}
32 \usepackage[T1]{fontenc}
33 \usepackage[colorlinks,
34 bookmarks,
35 hyperindex=false,
36 pdfauthor={Nicola L.C. Talbot},
37 pdftitle={datetime2.sty Dutch Module}]{hyperref}
38
39
40 \CheckSum{246}
41
42 \renewcommand*{\usage}[1]{\hyperpage{#1}}
43 \renewcommand*{\main}[1]{\hyperpage{#1}}
44 \IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
45 \setcounter{IndexColumns}{2}
46
47 \newcommand*{\sty}[1]{\textsf{#1}}
48 \newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
49
50 \RecordChanges
51 \PageIndex
52 \CodelineNumbered
53
54 \begin{document}
55 \DocInput{datetime2-dutch.dtx}
56 \end{document}
57 %</driver>
58 %\fi
59 %
60 %\MakeShortVerb{"}
61 %
62 %\title{Dutch Module for datetime2 Package}
63 %\author{Nicola L. C. Talbot (inactive)}
64 %\date{2018-04-06 (v1.1)}
65 %\maketitle
66 %
67 %This module is currently unmaintained and may be subject to change.
68 %If you want to volunteer to take over maintanance, contact me at
69 %\url{http://www.dickimaw-books.com/contact.html}
70 %
71 %\begin{abstract}
72 %This is the Dutch language module for the \sty{datetime2}
73 %package. If you want to use the settings in this module you must
74 %install it in addition to installing \sty{datetime2}. If you use
75 %\sty{babel} or \sty{polyglossia}, you will need this module to
76 %prevent them from redefining \cs{today}. The \sty{datetime2}
77 % \opt{useregional} setting must be set to "text" or "numeric"
78 % for the language styles to be set.
79 % Alternatively, you can set the style in the document using
80 % \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
81 % depending on the value of the \opt{useregional} setting.
82 %\end{abstract}
83 %
84 %I've copied the date style from \texttt{babel-dutch}'s \cs{today}.
85 %
86 %I don't know if these settings are correct.
87 %In particular, I don't know if the "dutch" time style is
88 %correct. Currently this just uses the "default" time style. Please
89 %be aware that this may change. Whoever takes over maintanance
90 %of this module may can change it as appropriate.
91 %
92 %The new maintainer should add the line:
93 %\begin{verbatim}
94 % The Current Maintainer of this work is Name.
95 %\end{verbatim}
96 %to the preamble part in \texttt{datetime2-dutch.ins} where Name
97 %is the name of the maintainer(s) and replace
98 %the `inactive' status to `maintained'.
99 %
100 %Currently there is only a regionless style.
101 %
102 %\StopEventually{%
103 %\clearpage
104 %\phantomsection
105 %\addcontentsline{toc}{section}{Change History}%
106 %\PrintChanges
107 %\addcontentsline{toc}{section}{\indexname}%
108 %\PrintIndex}
109 %\section{The Code}
110 %At the moment there is only the one ".ldf" file.
111 %
112 %\subsection{Main Dutch Module (\texttt{datetime2-dutch.ldf})}
113 %\changes{1.0}{2015-03-29}{Initial release}
114 %
115 %\iffalse
116 % \begin{macrocode}
117 %<*datetime2-dutch.ldf>
118 % \end{macrocode}
119 %\fi
120 %
121 % Identify Module
122 % \begin{macrocode}
123 \ProvidesDateTimeModule{dutch}[2018/04/06 v1.1]
124 % \end{macrocode}
125 %\begin{macro}{\DTMdutchordinal}
126 % I don't know if this is correct, but it's provided in case
127 % a suffix is required.
128 % \begin{macrocode}
129 \newcommand*{\DTMdutchordinal}[1]{%
130 \number#1 % space intended
131 }
132 % \end{macrocode}
133 %\end{macro}
134 %
135 %\begin{macro}{\DTMdutchmonthname}
136 % Dutch month names.
137 % \begin{macrocode}
138 \newcommand*{\DTMdutchmonthname}[1]{%
139 \ifcase#1
140 \or
141 januari%
142 \or
143 februari%
144 \or
145 maart%
146 \or
147 april%
148 \or
149 mei%
150 \or
151 juni%
152 \or
153 juli%
154 \or
155 augustus%
156 \or
157 september%
158 \or
159 oktober%
160 \or
161 november%
162 \or
163 december%
164 \fi
165 }
166 % \end{macrocode}
167 %\end{macro}
168 %
169 %\begin{macro}{\DTMdutchMonthname}
170 % As above but start with a capital.
171 % \begin{macrocode}
172 \newcommand*{\DTMdutchMonthname}[1]{%
173 \ifcase#1
174 \or
175 Januari%
176 \or
177 Februari%
178 \or
179 Maart%
180 \or
181 April%
182 \or
183 Mei%
184 \or
185 Juni%
186 \or
187 Juli%
188 \or
189 Augustus%
190 \or
191 September%
192 \or
193 Oktober%
194 \or
195 November%
196 \or
197 December%
198 \fi
199 }
200 % \end{macrocode}
201 %\end{macro}
202 %
203 % Week day names are provided but currently not used in the date style.
204 %
205 %\begin{macro}{\DTMdutchweekdayname}
206 % Dutch day of week names.
207 % \begin{macrocode}
208 \newcommand*{\DTMdutchweekdayname}[1]{%
209 \ifcase#1
210 maandag%
211 \or
212 dinsdag%
213 \or
214 woensdag%
215 \or
216 donderdag%
217 \or
218 vrijdag%
219 \or
220 zaterdag%
221 \or
222 zondag%
223 \fi
224 }
225 % \end{macrocode}
226 %\end{macro}
227 %
228 %\begin{macro}{\DTMdutchWeekdayname}
229 % As above but start with a capital.
230 % \begin{macrocode}
231 \newcommand*{\DTMdutchWeekdayname}[1]{%
232 \ifcase#1
233 Maandag%
234 \or
235 Dinsdag%
236 \or
237 Woensdag%
238 \or
239 Donderdag%
240 \or
241 Vrijdag%
242 \or
243 Zaterdag%
244 \or
245 Zondag%
246 \fi
247 }
248 % \end{macrocode}
249 %\end{macro}
250 %
251 %\begin{macro}{\DTMdutchshortweekdayname}
252 % Abbreviated day of week names.
253 % \begin{macrocode}
254 \newcommand*{\DTMdutchshortweekdayname}[1]{%
255 \ifcase#1
256 ma%
257 \or
258 di%
259 \or
260 wo%
261 \or
262 do%
263 \or
264 vr%
265 \or
266 za%
267 \or
268 zo%
269 \fi
270 }
271 % \end{macrocode}
272 %\end{macro}
273 %
274 %\begin{macro}{\DTMdutchshortWeekdayname}
275 % As above but start with a capital.
276 % \begin{macrocode}
277 \newcommand*{\DTMdutchshortWeekdayname}[1]{%
278 \ifcase#1
279 Ma%
280 \or
281 Di%
282 \or
283 Wo%
284 \or
285 Do%
286 \or
287 Vr%
288 \or
289 Za%
290 \or
291 Zo%
292 \fi
293 }
294 % \end{macrocode}
295 %\end{macro}
296 %
297 % Define the \texttt{dutch} style.
298 % The time style is the same as the "default" style
299 % provided by \sty{datetime2}. This may need correcting. For
300 % example, if a 12 hour style similar to the "englishampm" (from the
301 % "english-base" module) is required.
302 %
303 % Allow the user a way of configuring the "dutch" and
304 % "dutch-numeric" styles. This doesn't use the package wide
305 % separators such as
306 % \cs{dtm@datetimesep} in case other date formats are also required.
307 %\begin{macro}{\DTMdutchdaymonthsep}
308 % The separator between the day and month for the text format.
309 % \begin{macrocode}
310 \newcommand*{\DTMdutchdaymonthsep}{%
311 \DTMtexorpdfstring{\protect~}{\space}}
312 % \end{macrocode}
313 %\end{macro}
314 %
315 %\begin{macro}{\DTMdutchmonthyearsep}
316 % The separator between the month and year for the text format.
317 % \begin{macrocode}
318 \newcommand*{\DTMdutchmonthyearsep}{\space}
319 % \end{macrocode}
320 %\end{macro}
321 %
322 %\begin{macro}{\DTMdutchdatetimesep}
323 % The separator between the date and time blocks in the full format
324 % (either text or numeric).
325 % \begin{macrocode}
326 \newcommand*{\DTMdutchdatetimesep}{\space}
327 % \end{macrocode}
328 %\end{macro}
329 %
330 %\begin{macro}{\DTMdutchtimezonesep}
331 % The separator between the time and zone blocks in the full format
332 % (either text or numeric).
333 % \begin{macrocode}
334 \newcommand*{\DTMdutchtimezonesep}{\space}
335 % \end{macrocode}
336 %\end{macro}
337 %
338 %\begin{macro}{\DTMdutchdatesep}
339 % The separator for the numeric date format.
340 % \begin{macrocode}
341 \newcommand*{\DTMdutchdatesep}{-}
342 % \end{macrocode}
343 %\end{macro}
344 %
345 %\begin{macro}{\DTMdutchtimesep}
346 % The separator for the numeric time format.
347 % \begin{macrocode}
348 \newcommand*{\DTMdutchtimesep}{:}
349 % \end{macrocode}
350 %\end{macro}
351 %
352 %Provide keys that can be used in \cs{DTMlangsetup} to set these
353 %separators.
354 % \begin{macrocode}
355 \DTMdefkey{dutch}{daymonthsep}{\renewcommand*{\DTMdutchdaymonthsep}{#1}}
356 \DTMdefkey{dutch}{monthyearsep}{\renewcommand*{\DTMdutchmonthyearsep}{#1}}
357 \DTMdefkey{dutch}{datetimesep}{\renewcommand*{\DTMdutchdatetimesep}{#1}}
358 \DTMdefkey{dutch}{timezonesep}{\renewcommand*{\DTMdutchtimezonesep}{#1}}
359 \DTMdefkey{dutch}{datesep}{\renewcommand*{\DTMdutchdatesep}{#1}}
360 \DTMdefkey{dutch}{timesep}{\renewcommand*{\DTMdutchtimesep}{#1}}
361 % \end{macrocode}
362 %
363 % TODO: provide a boolean key to switch between full and abbreviated
364 % formats if appropriate. (I don't know how the date should be
365 % abbreviated.)
366 %
367 % Define a boolean key that determines if the time zone mappings
368 % should be used.
369 % \begin{macrocode}
370 \DTMdefboolkey{dutch}{mapzone}[true]{}
371 % \end{macrocode}
372 % The default is to use mappings.
373 % \begin{macrocode}
374 \DTMsetbool{dutch}{mapzone}{true}
375 % \end{macrocode}
376 %
377 % Define a boolean key that determines if the day of month should be
378 % displayed.
379 % \begin{macrocode}
380 \DTMdefboolkey{dutch}{showdayofmonth}[true]{}
381 % \end{macrocode}
382 % The default is to show the day of month.
383 % \begin{macrocode}
384 \DTMsetbool{dutch}{showdayofmonth}{true}
385 % \end{macrocode}
386 %
387 % Define a boolean key that determines if the year should be
388 % displayed.
389 % \begin{macrocode}
390 \DTMdefboolkey{dutch}{showyear}[true]{}
391 % \end{macrocode}
392 % The default is to show the year.
393 % \begin{macrocode}
394 \DTMsetbool{dutch}{showyear}{true}
395 % \end{macrocode}
396 %
397 % Define the "dutch" style. (TODO: implement day of week?)
398 % \begin{macrocode}
399 \DTMnewstyle
400 {dutch}% label
401 {% date style
402 \renewcommand*\DTMdisplaydate[4]{%
403 \DTMifbool{dutch}{showdayofmonth}
404 {\DTMdutchordinal{##3}\DTMdutchdaymonthsep}%
405 {}%
406 \DTMdutchmonthname{##2}%
407 \DTMifbool{dutch}{showyear}%
408 {%
409 \DTMdutchmonthyearsep
410 \number##1 % space intended
411 }%
412 {}%
413 }%
414 \renewcommand*\DTMDisplaydate[4]{%
415 \DTMifbool{dutch}{showdayofmonth}
416 {%
417 \DTMdutchordinal{##3}\DTMdutchdaymonthsep
418 \DTMdutchmonthname{##2}%
419 }%
420 {%
421 \DTMdutchMonthname{##2}%
422 }%
423 \DTMifbool{dutch}{showyear}%
424 {%
425 \DTMdutchmonthyearsep
426 \number##1 % space intended
427 }%
428 {}%
429 }%
430 }%
431 {% time style (use default)
432 \DTMsettimestyle{default}%
433 }%
434 {% zone style
435 \DTMresetzones
436 \DTMdutchzonemaps
437 \renewcommand*{\DTMdisplayzone}[2]{%
438 \DTMifbool{dutch}{mapzone}%
439 {\DTMusezonemapordefault{##1}{##2}}%
440 {%
441 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
442 \ifDTMshowzoneminutes\DTMdutchtimesep\DTMtwodigits{##2}\fi
443 }%
444 }%
445 }%
446 {% full style
447 \renewcommand*{\DTMdisplay}[9]{%
448 \ifDTMshowdate
449 \DTMdisplaydate{##1}{##2}{##3}{##4}%
450 \DTMdutchdatetimesep
451 \fi
452 \DTMdisplaytime{##5}{##6}{##7}%
453 \ifDTMshowzone
454 \DTMdutchtimezonesep
455 \DTMdisplayzone{##8}{##9}%
456 \fi
457 }%
458 \renewcommand*{\DTMDisplay}[9]{%
459 \ifDTMshowdate
460 \DTMDisplaydate{##1}{##2}{##3}{##4}%
461 \DTMdutchdatetimesep
462 \fi
463 \DTMdisplaytime{##5}{##6}{##7}%
464 \ifDTMshowzone
465 \DTMdutchtimezonesep
466 \DTMdisplayzone{##8}{##9}%
467 \fi
468 }%
469 }%
470 % \end{macrocode}
471 %
472 % Define numeric style.
473 % \begin{macrocode}
474 \DTMnewstyle
475 {dutch-numeric}% label
476 {% date style
477 \renewcommand*\DTMdisplaydate[4]{%
478 \DTMifbool{dutch}{showdayofmonth}%
479 {%
480 \number##3 % space intended
481 \DTMdutchdatesep
482 }%
483 {}%
484 \number##2 % space intended
485 \DTMifbool{dutch}{showyear}%
486 {%
487 \DTMdutchdatesep
488 \number##1 % space intended
489 }%
490 {}%
491 }%
492 \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
493 }%
494 {% time style
495 \renewcommand*\DTMdisplaytime[3]{%
496 \number##1
497 \DTMdutchtimesep\DTMtwodigits{##2}%
498 \ifDTMshowseconds\DTMdutchtimesep\DTMtwodigits{##3}\fi
499 }%
500 }%
501 {% zone style
502 \DTMresetzones
503 \DTMdutchzonemaps
504 \renewcommand*{\DTMdisplayzone}[2]{%
505 \DTMifbool{dutch}{mapzone}%
506 {\DTMusezonemapordefault{##1}{##2}}%
507 {%
508 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
509 \ifDTMshowzoneminutes\DTMdutchtimesep\DTMtwodigits{##2}\fi
510 }%
511 }%
512 }%
513 {% full style
514 \renewcommand*{\DTMdisplay}[9]{%
515 \ifDTMshowdate
516 \DTMdisplaydate{##1}{##2}{##3}{##4}%
517 \DTMdutchdatetimesep
518 \fi
519 \DTMdisplaytime{##5}{##6}{##7}%
520 \ifDTMshowzone
521 \DTMdutchtimezonesep
522 \DTMdisplayzone{##8}{##9}%
523 \fi
524 }%
525 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
526 }
527 % \end{macrocode}
528 %
529 %\begin{macro}{\DTMdutchzonemaps}
530 % The time zone mappings are set through this command, which can be
531 % redefined if extra mappings are required or mappings need to be
532 % removed.
533 % \begin{macrocode}
534 \newcommand*{\DTMdutchzonemaps}{%
535 \DTMdefzonemap{01}{00}{CET}%
536 \DTMdefzonemap{02}{00}{CEST}%
537 }
538 % \end{macrocode}
539 %\end{macro}
540
541 % Switch style according to the \opt{useregional} setting.
542 % \begin{macrocode}
543 \DTMifcaseregional
544 {}% do nothing
545 {\DTMsetstyle{dutch}}
546 {\DTMsetstyle{dutch-numeric}}
547 % \end{macrocode}
548 %
549 % Redefine \cs{datedutch} (or \cs{date}\meta{dialect}) to prevent
550 % \sty{babel} from resetting \cs{today}. (For this to work,
551 % \sty{babel} must already have been loaded if it's required.)
552 %\changes{1.1}{2018-04-06}{removed spurious space}
553 % \begin{macrocode}
554 \ifcsundef{date\CurrentTrackedDialect}
555 {%
556 \ifundef\datedutch
557 {% do nothing
558 }%
559 {%
560 \def\datedutch{%
561 \DTMifcaseregional
562 {}% do nothing
563 {\DTMsetstyle{dutch}}%
564 {\DTMsetstyle{dutch-numeric}}%
565 }%
566 }%
567 }%
568 {%
569 \csdef{date\CurrentTrackedDialect}{%
570 \DTMifcaseregional
571 {}% do nothing
572 {\DTMsetstyle{dutch}}%
573 {\DTMsetstyle{dutch-numeric}}%
574 }%
575 }%
576 % \end{macrocode}
577 %\iffalse
578 % \begin{macrocode}
579 %</datetime2-dutch.ldf>
580 % \end{macrocode}
581 %\fi
582 %\Finale
583 \endinput