summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx
blob: ba7bdc3df31a761c6576ee6e9de505d52843c72c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
% \iffalse meta-comment
% An Infrastructure for marking up Dublin Core Metadata in LaTeX documents
% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/dcm/dcm.dtx $ 
% $Rev: 1671 $; last modified by $Author: kohlhase $ 
% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $
% Copyright (c) 2007 Michael Kohlhase, all rights reserved
%               this file is released under the
%               LaTeX Project Public License (LPPL)
% \fi
% 
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{dcm}[2010/06/25 v0.3 Dublin Core Metadata]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage{dcm,sref,url,array,float}
\usepackage[show]{ed}
\usepackage[hyperref=auto,style=alphabetic]{biblatex}
\bibliography{kwarc}
\usepackage{../ctansvn}
\usepackage{hyperref}
\usepackage{stex-logo}
\usepackage[eso-foot,today]{svninfo}
\svnInfo $Id: dcm.dtx 1671 2010-11-06 07:05:15Z kohlhase $
\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/dcm/dcm.dtx $
\makeindex
\floatstyle{boxed}
\newfloat{exfig}{thp}{lop}
\floatname{exfig}{Example}
\DCMperson[id=jdoe,affiliation={DFKI Bremen},
           url=http://dfki.de/jdoe]{John Doe}
\DCMperson[id=miko,affiliation={Jacobs University, Bremen},
           url=http://kwarc.info/kohlhase]{Michael Kohlhase}
\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}}
\begin{document}\DocInput{dcm.dtx}\end{document}
%</driver>
% \fi
%
%\iffalse\CheckSum{667}\fi
%
% \changes{v0.1}{2007/01/02}{First Hack for OMDoc spec}
% \changes{v0.2}{2008/06/17}{First Version with Documentation}
% \changes{v0.2}{2008/07/02}{Renamed to dcm}
% \changes{v0.3}{2009/09/21}{much more documentation of the user interface}
% \changes{v0.3}{2009/09/21}{Adding sref support and made generated headings configurable}
% \changes{v0.3}{2010/01/11}{Eliminating stub author index that never worked anyways}
% 
% \GetFileInfo{dcm.sty}
% 
% \MakeShortVerb{\|}
% \def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}}
% \def\latexml{\scsys{LaTeXML}}
%
% \begin{DCmetadata}[maketitle] 
%   \DCMtitle{{\texttt{dcm.sty}}: An Infrastructure for marking up Dublin Core Metadata in {\LaTeX}
%     documents\thanks{Version {\fileversion} (last revised {\filedate})}}
%   \DCMcreators{miko,jdoe}
%   \DCMabstract{The |dcm| package allows mark up Dublin
%     Core Metadata in {\LaTeX} documents that can be harvested by automated tools or
%     exported to PDF, while at the same time generating conventional title information.}
% \end{DCmetadata}
%
% \setcounter{tocdepth}{2}\tableofcontents\newpage
%
%\DCMsection[id=intro,creators={miko}]{Introduction}
%
% The |dcm| packge allows mark up Dublin Core Metadata~\cite{DCMI:dmt03} in {\LaTeX}
% documents so that it can be harvested by automated tools or exported to PDF\ednote{This
%   still needs to be implemented, see \texttt{http://www.wlug.org.nz/PdfLatexNotes} for
%   details}. This package allows to attribute authorship to arbitrary text
% fragments.\ednote{continue}
% 
% \DCMsection[id=user,creators={miko,jdoe}]{The User Interface}
% 
% \DCMsubsection[id=user.options]{Package Options}
% 
% The |dcm| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If this is
% set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details and
% customization options).
%
% \DCMsubsection{Persons}
% 
% The |dcm| package recognizes that from a metadata perspective, persons are complex
% entities. In particular, specifying metadata is a tedious and repetitive task that leads
% to embarrassing errors. Therefore the |dcm| package takes a hint from bibTeX and allows
% to specify personal metadata in a database and use it by a database key.
% \begin{exfig}[ht]
% \begin{verbatim}
% \DCMperson[id=jdoe,affiliation={DFKI Bremen},
%            url=http://dfki.de/jdoe]{John Doe}
% \DCMperson[id=miko,affiliation={Jacobs University, Bremen},
%            url=http://kwarc.info/kohlhase]{Michael Kohlhase}
% \end{verbatim}
% \caption{A small database of Persons}
% \label{fig:persons}
% \end{exfig}
% The \DescribeMacro{\DCMperson}|\DCMperson| macro allows to specify personal metadata\ednote{This
% should be synchronized with the FOAF specification~\cite{FOAF:spec}} with the following
% keys: 
% \begin{center}
% \begin{tabular}{|l|l|}\hline
% key & comment\\\hline\hline
% id & identifier of this person\\\hline
% birthdate & birthdate \\\hline
% email & the primary e-mail address\\\hline
% url & the URI of the primary home page \\\hline
% affiliation & the primary professional affiliation\\\hline
% personaltitle & the personal title e.g. {\texttt{King}}\\\hline
% academictitle & the academic title e.g. {\texttt{Prof. Dr.}}\\\hline
% department & the department specified in the work address\\\hline
% workaddress & the work address \\\hline
% privaddress & the private address \\\hline
% worktel & work telephone number \\\hline
% privtel & private telephone number\\\hline
% workfax & work fax number \\\hline
% privfax & private fax number \\\hline
% worktelfax & if the phone and fax share a prefix, give this as well \\\hline
% privtelfax & dito\\\hline
% \end{tabular}
% \end{center}
% In Figure~\ref{fig:persons} we have specified (minimal) metadata for the authors of the
% |dcm| package. The metadata can be accessed by specifying the identifiers (given by the
% |id| key) in the |dcm| macros defined below, see for instance the |\DCMcreators| macro
% in Figure~\ref{fig:dcmblock}, which leads to the title block of this note.
% 
% Like in bibTeX~\cite{Patashnik:b88}, it is a good idea to collect the metadata in a separate
% file that is input in the document. In practice it may be possible to generate these
% files from conventional address databases.
% 
% \DCMsubsection[id=user.dcm.mdblock]{The DC Metadata Block}
% 
% \DescribeEnv{DCmetadata} The |dcm| provides the environment |DCmetadata| for Dublin Core
% Metadata Blocks. |DCmetadata| defines local macros for the specifying the relevant
% Dublin Core metadata fields and takes an optional argument that specifies the
% presentation of the metadata block, see Figure~\ref{fig:dcmblock} for an example which
% would generate the title block for the |dcm| package. Let us now come to the macros themselves
%
% \DescribeMacro{\DCMcreators}\DescribeMacro{\DCMcontributors} The |\DCMcreators| and
% |\DCMcontributors| macros are used to specify the authors and contributors to a text
% fragments. These macros take one argument, the authorship of a document specified in
% terms of |id|s of persons specified via |\DCMperson| before. They can occur multiply in
% a metadata block.
%
% \DescribeMacro{\DCMtitle} The |\DCMtitle| macro takes one argument, the 
%
% \DescribeMacro{\DCMshorttitle} The |\DCMshorttitle| macro takes one argument, the 
%
% \DescribeMacro{\DCMsubject} The |\DCMsubject| macro takes one argument, the 
%
% \DescribeMacro{\DCMdescription} The |\DCMdescription| macro takes one argument, the 
%
% \DescribeMacro{\DCMpublisher} The |\DCMpublisher| macro takes one argument, the 
%
% \DescribeMacro{\DCMdate} The |\DCMdate| macro takes one argument, the 
%
% \DescribeMacro{\DCMtype} The |\DCMtype| macro takes one argument, the 
%
% \DescribeMacro{\DCMidentifier} The |\DCMidentifier| macro takes two arguments, the first one
% is the identification system, and the second one the identifier string itself.
%
% \DescribeMacro{\DCMsource} The |\DCMsource| macro takes one argument, the 
%
% \DescribeMacro{\DCMlanguage} The |\DCMlanguage| macro takes one argument, the 
%
% \DescribeMacro{\DCMrelation} The |\DCMrelation| macro takes one argument, the 
%
% \DescribeMacro{\DCMrights} The |\DCMrights| macro takes one argument, the 
%
% \DescribeMacro{\DCMlicense} The |\DCMlicense| macro takes one argument, the 
%
% \DescribeMacro{\DCMabstract} The |\DCMabstract| macro takes one argument, the 
%
% \DescribeMacro{\DCMlicensenotice} The |\DCMlicensenotice| macro takes one argument, the 
%
% \DescribeMacro{\DCMcopyrightnotice} The |\DCMcopyrightnotice| macro takes one argument, the 
%
% \DescribeMacro{\DCMcclicense} The |\DCMcclicense| macro 
%
% \DescribeMacro{\attribution} 
%
% \DescribeMacro{\noncommercial}
%
% \DescribeMacro{\sharealike}
% 
% \DescribeMacro{\noderivativeworks}
% 
% \begin{exfig}[ht]
% \begin{verbatim}
% \begin{DCmetadata}[maketitle] 
%   \DCMtitle{An Infrastructure for marking up Dublin Core Metadata in 
%        {\LaTeX} documents\thanks{Version {\fileversion} 
%          (last revised {\filedate})}}
%   \DCMcreators{miko,jdoe}
%   \DCMdate{\today}
%   \DCMcopyrightnotice{2008}{Michael Kohlhase}
%   \DCMlicensenotice{Copyright (c) 2008 Michael Kohlhase, all rights 
%      reserved. This file is released under the LaTeX Project Public 
%      License (LPPL)}
%   \DCMabstract{The {\texttt{dcm}} packge allows mark up Dublin
%      Core Metadata in {\LaTeX} documents that can be harvested by 
%      automated tools or exported to PDF, while at the same time 
%      generating conventional title information.}
% \end{DCmetadata}
% \end{verbatim}
% \caption{The DC Metadata block for the {\texttt{dcm}} package documentation}
% \label{fig:dcmblock}
% \end{exfig}
%
% \DCMsubsection[creators=jdoe,id=user.blockstyles]{DCM Metadata Block Styles}
% 
% The |DCmetadata| environment takes an optional argument that specifies the style the
% metadata block is rendered in. The |dcm| package supplies two styles:
% \DescribeMacro{maketitle}|maketitle| and \DescribeMacro{titlepage}|titlepage|. The
% former uses the |\maketitle| macro from the calling class to assemble a title, whereas
% the latter builds a title page from scratch. The title block of this documentation has
% been created by the |maketitle| style.
% 
% To add a further metadata block style \meta{sty}, we simply have to supply a
% \DescribeMacro{\dcm@*@block}|\dcm@|\meta{sty}|@block| macro that expands to the intended
% presentation. This macro does not take any arguments, but can use the internal token
% registers defined by the |DCmetadata| environment. Generally, for any of the metadata
% commands |\DCM|\meta{md} defined in {\sref{user.dcm.mdblock}} there is a token register
% |\dcm@|\meta{md} that contains the value specified in the key.
% 
% \DCMsubsection{Augmented Sectioning Macros}
% 
% The |dcm| package supplies sectioning commands customized for metadata handling: The
% \DescribeMacro{\DCMchapter}|\DCMchatper| \DescribeMacro{\DCMsection}|\DCMsection|
% \DescribeMacro{\DCMsubsection}|\DCMsubsection|, and
% \DescribeMacro{\DCMsubsubsection}|\DCMsubsubsection| macros behave like their regular
% {\LaTeX} counterpart, except that the optional argument, which is used to specify a
% short title there, is now a KeyVal argument. The |short| key takes over the role of
% specifying a short title in |\DCM|\meta{sect}. The |id| key allows to specify an
% identifier, which can be used for {\LaTeX}-style referencing (use
% |\ref{|\meta{sect}|.|\meta{id}|}|) or |sref|-style referencing~\ctancite{Kohlhase:sref}
% (use |\sref{|\meta{id}|}|). Finally, the keys |creators| and |contributors| can be used
% to specify the authors (creators in Dublin Core speak~\cite{DCMI:dmt03}) and
% contributors. For instance the following line was used to specify the heading of
% {\sref{user}}.
% \begin{verbatim}
% \DCMsection[id=user,creators={miko,jdoe}]{The User Interface}
% \end{verbatim}
% Finally, the |style| key can be used to specify a style. 
% 
% \DCMsubsection[id=user.conig]{Configuration}
% 
% The |dcm| package provides a set of macros that customize (e.g. for multiple languages)
% the generated
% content. 
% \DescribeMacro{\dcm@abstract@heading}
% \DescribeMacro{\dcm@creators@heading}
% \DescribeMacro{\dcm@contributors@connector}
% \DescribeMacro{\dcm@chapter@heading}
% \DescribeMacro{\dcm@section@heading}
% \DescribeMacro{\dcm@subsection@heading}
% \DescribeMacro{\dcm@subsubsection@heading}
% \begin{center}\makeatletter
% \begin{tabular}{|l|l|}\hline
% Macro &  Default\\\hline\hline
% |\dcm@abstract@heading| &  \dcm@abstract@heading \\\hline
% |\dcm@creators@heading| &  \dcm@creators@heading \\\hline
% |\dcm@contributors@connector| & \dcm@contributors@connector \\\hline\hline
% |\dcm@chapter@heading| &  \dcm@chapter@heading \\\hline
% |\dcm@section@heading| &  \dcm@section@heading \\\hline
% |\dcm@subsection@heading| &  \dcm@subsection@heading \\\hline
% |\dcm@subsubsection@heading| &  \dcm@subsubsection@heading \\\hline
% \end{tabular}
% \end{center}
% 
%
% \section{Limitations}\label{sec:limitations}
% 
% In this section we document known limitations. If you want to help alleviate them,
% please feel free to contact the package author. Some of them are currently discussed in
% the \sTeX TRAC~\cite{sTeX:online}. 
% \begin{compactenum}
% \item none reported yet
% \end{compactenum}
% 
% \StopEventually{\printbibliography}
% 
% \DCMsection[creators=jdoe,id=impl]{The Implementation}
%
% The |dcm| package generates two files: the {\LaTeX} package (all the code between
% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the
% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and
%     $\langle$/ltxml$\rangle$}}). We keep the corresponding code fragments together,
% since the documentation applies to both of them and to prevent them from getting out of
% sync.
%
% \DCMsubsection[id=impl.options]{Package Options}
% The first step is to declare (a few) package options that handle whether certain
% information is printed or not. They all come with their own conditionals that are set by
% the options.
%
%    \begin{macrocode}
%<*package>
\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
\ProcessOptions
%</package>
%    \end{macrocode}
%
% The first measure is to ensure that the |KeyVal| package is loaded (in the right
% version). For {\latexml} we also initialize the package inclusions.
%    \begin{macrocode}
%<*package>
\RequirePackage{sref}
%</package>
%<*ltxml>
# -*- CPERL -*-
package LaTeXML::Package::Pool;
use strict;
use LaTeXML::Global;
use LaTeXML::Package;
RequirePackage('sref');
%</ltxml>
%    \end{macrocode}
%
% \DCMsubsection{Persons}
% 
% To implement the |\DCMperson| macro, we need to implement its keywords first and also
% the |\dcm@person@clear@keys| macro that clears them. \ednote{need some DCM stuff here}
%
%    \begin{macrocode}
%<*package>
\addmetakey{dcm@person}{id}
\addmetakey{dcm@person}{birthdate}
\addmetakey{dcm@person}{email}
\addmetakey{dcm@person}{url}
\addmetakey{dcm@person}{affiliation}
\addmetakey{dcm@person}{personaltitle}
\addmetakey{dcm@person}{academictitle}
\addmetakey{dcm@person}{department}
\addmetakey{dcm@person}{workaddress}
\addmetakey{dcm@person}{privaddress}
\addmetakey{dcm@person}{worktel}
\addmetakey{dcm@person}{privtel}
\addmetakey{dcm@person}{workfax}
\addmetakey{dcm@person}{privfax}
\addmetakey{dcm@person}{worktelfax}
\addmetakey{dcm@person}{privtelfax}
%</package>
%    \end{macrocode}
% 
% The next macro is an auxiliary one that puts the value into an appropriate token
% register. At the {\latexml} side we have a function |ExportMetadata| that does a similar
% job, fishing out the metadata keys from the keyval arguments and storing them in a safe
% place so they can be accessed later.
% 
%    \begin{macrocode}
%<*package>
\def\dcm@pers@def#1#2{\expandafter\xdef\csname dcm@person@\dcm@person@id @#1\endcsname{#2}}
\def\dcm@pers@ref#1#2{\csname dcm@person@#1@#2\endcsname}
\let\dcm@persons=\relax
%</package>
%<*ltxml>
 sub getKeyValue_noDelim {
 my ($keyval,$key)=@_;
 my $valuelist = ToString($keyval->getValue($key));
 $valuelist =~ s/^{(.*)}$/$1/g if $valuelist;
 return $valuelist;
}
sub ExportMetadata {
  my $keys = shift;
  my($id, $email,$affill,$address,$url,$name)=$keys
    && map(getKeyValue_noDelim($keys,$_),qw(id email affiliation address url name));
  if ($id) {
   AssignValue('DCM_'.$id.'_email',$email,'global') if $email;
   AssignValue('DCM_'.$id.'_affiliation',$affill,'global') if $affill;
   AssignValue('DCM_'.$id.'_address',$email,'global') if $email;
   AssignValue('DCM_'.$id.'_url',$url,'global') if $url;
   AssignValue('DCM_'.$id.'_name',$name,'global') if $name;
  } else {print STDERR "Warning: key 'id' undefined in \\DCMperson\n"};
  return;} 
%</ltxml>
%    \end{macrocode}
%
% With this we can define the |\DCMperson| macro, it just clears the keys, sets them
% again, and stores them in token registers. If course only if a |id| attribute is given,
% else we raise an error.
% 
% \begin{macro}{DCMPerson}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMperson}[2][]{\metasetkeys{dcm@person}{#1}
\ifx\dcm@person@id\@empty\@latex@warning{key 'id' undefined in DCMperson}\else
\dcm@pers@def{name}{#2}
\dcm@pers@def{email}{\dcm@person@email}
\dcm@pers@def{birthdate}{\dcm@person@birthdate}
\dcm@pers@def{url}{\dcm@person@url}
\dcm@pers@def{affiliation}{\dcm@person@affiliation}
\dcm@pers@def{workaddress}{\dcm@person@workaddress}
\dcm@pers@def{privaddress}{\dcm@person@privaddress}
\dcm@pers@def{personaltitle}{\dcm@person@personaltitle}
\dcm@pers@def{academictitle}{\dcm@person@academictitle}
\dcm@pers@def{department}{\dcm@person@department}
\dcm@pers@def{workaddress}{\dcm@person@workaddress}
\dcm@pers@def{privaddress}{\dcm@person@privaddress}
\dcm@pers@def{worktel}{\dcm@person@worktel}
\dcm@pers@def{privtel}{\dcm@person@privtel}
\dcm@pers@def{workfax}{\dcm@person@workfax}
\dcm@pers@def{privfax}{\dcm@person@privfax}
\dcm@pers@def{worktelfax}{\dcm@person@worktelfax}
\dcm@pers@def{privtelfax}{\dcm@person@privtelfax}
\@ifundefined{dcm@persons}{\xdef\dcm@persons{\dcm@person@id}}{\xdef\dcm@persons{\dcm@persons,\dcm@person@id}}
\fi}
%</package>
%<*ltxml>
DefKeyVal('dcm@person','id','Semiverbatim');
DefKeyVal('dcm@person','birthdate','Semiverbatim');
DefKeyVal('dcm@person','email','Semiverbatim');
DefKeyVal('dcm@person','url','Semiverbatim');
DefKeyVal('dcm@person','affiliation','Semiverbatim');
DefKeyVal('dcm@person','personaltitle','Semiverbatim');
DefKeyVal('dcm@person','academictitle','Semiverbatim');
DefKeyVal('dcm@person','department','Semiverbatim');
DefKeyVal('dcm@person','workaddress','Semiverbatim');
DefKeyVal('dcm@person','privaddress','Semiverbatim');
DefKeyVal('dcm@person','worktel','Semiverbatim');
DefKeyVal('dcm@person','privtel','Semiverbatim');
DefKeyVal('dcm@person','workfax','Semiverbatim');
DefKeyVal('dcm@person','privfax','Semiverbatim');
DefKeyVal('dcm@person','worktelfax','Semiverbatim');
DefKeyVal('dcm@person','privtelfax','Semiverbatim');

DefConstructor('\DCMperson OptionalKeyVals:dcm@person {}','', 
afterDigest=>sub {
  my ($stomach,$whatsit)=@_;
  my $keys=$whatsit->getArg(1);
  my $name=ToString($whatsit->getArg(2));
  $keys->setValue('name',$name);
  ExportMetadata($keys);
  return;
});#$
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% Furthermore, we need a couple of helper functions for the 
% 
%    \begin{macrocode}
%<*ltxml>
sub FishOutMetadata {
  my ($document,$keyvals)=@_;
  foreach my $role(qw(creators contributors)) {
    my $idlist_string=getKeyValue_noDelim($keyvals,$role);
    my @ids = split(/,\s*/, $idlist_string);
    foreach my $id(@ids) {
      my $name = LookupValue('DCM_'.$id.'_name');
      if ($name) {
        my $prop_role = $role;
	chop $prop_role if $prop_role;
        $document->insertElement("dc:$prop_role",$name) if $role;
      } else {print STDERR "Warning: no $role with 'id' $id !\n";}
    }
  }
  return;}#$
%</ltxml>
%    \end{macrocode}
% 
% \DCMsubsection{The DC Metadata Block}
% 
% Then we make an environment for defining the metadata.  Note that since we have defined
% the |omdoc:metadata| element to auto-open and auto-close, we do not have to (and should
% not for that matter) supply it in the |DCmetadata| element.
%
% \begin{environment}{DCmetadata}
%    \begin{macrocode}
%<*package>
\newenvironment{DCmetadata}[1][]%
{\def\@style{#1}} % to set the way things are presented.
{\@ifundefined{dcm@\@style @block}{\message{style {\@style} not defined}}{\csname dcm@\@style @block\endcsname}}
%</package>
%<*ltxml>
DefEnvironment('{DCmetadata}[]', "<omdoc:metadata>#body</omdoc:metadata>");
%</ltxml>
%    \end{macrocode}
% \end{environment}
% 
% Now some auxiliary macros to make author blocks. \ednote{use and document them!}
%
%    \begin{macrocode}
%<*package>
\def\dcm@tabline#1#2{\xdef\tab@line{}%
\@for\@p:={#1}\do{\xdef\tab@line{\tab@line&\dcm@pers@ref\@p{#2}}}
\tab@line}
\def\dcm@atabline#1#2#3{\xdef\tab@line{}%
\@for\@p:={#1}\do{\xdef\tab@line{\tab@line&#2: \dcm@pers@ref\@p{#3}}}
\tab@line}
\def\dcm@bitabline#1#2#3#4{\xdef\tab@line{}%
\@for\@p:={#1}\do{\xdef\tab@line{\tab@line&\dcm@pers@ref\@p{#2} #3 \dcm@pers@ref\@p{#4}}}
\tab@line}
%</package>
%    \end{macrocode}
% Here come the constructors, most of them are relatively straightforward
% \begin{macro}{\DCMcreators}
%   the |\DCMcreators| macro checks whether all ids are defined.
%    \begin{macrocode}
%<*package>
\def\DCMcreators#1{\@for\@I:=#1\do{%
\ifx\csname dcm@person@\@I @id\endcsname\@empty% undefined \dcm@person@id
\PackageError{dcm}{reference to undefined DCMperson \@I}%
{you must define a person with id=\@I\MessageBreak% 
via the macro \protect\DCMperson, before you can use it in \protect\DCMcreators}\fi}%
\def\dcm@creators{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMcreators{}',sub{
  my ($document,$args,%properties) = @_;
  my $keyval = LaTeXML::KeyVals->new('dcm@person',T_BEGIN,T_END,('creators'=>$args));
  FishOutMetadata($document,$keyval);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMcontributors}
%   the |\DCMcontributors| macro also checks whether all ids are defined.
%    \begin{macrocode}
%<*package>
\def\DCMcontributors#1{\@for\@I:=#1\do{%
\ifx\csname dcm@person@\@I @id\endcsname\@empty% undefined \dcm@person@id
\PackageError{dcm}{reference to undefined DCMperson \@I}%
{you must define a person with id=\@I\MessageBreak% 
via the macro \protect\DCMperson, before you can use it in \protect\DCMcontributors}}%
\else% all \dcm@person@id in the list are defined
\def\dcm@contributors{#1}\fi}
%</package>
%<*ltxml>
DefConstructor('\DCMcontributors{}',sub{
  my ($document,$args,%properties) = @_;
  my $keyval = LaTeXML::KeyVals->new('dcm@person',T_BEGIN,T_END,('contributors'=>$args));
  FishOutMetadata($document,$keyval);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMtitle}
%    \begin{macrocode}
%<*package>
\def\DCMtitle#1{\def\dcm@title{#1}\providecommand{\dcm@shorttitle}{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMtitle{}',"<dc:title>#1</dc:title>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMsubtitle}
%    \begin{macrocode}
%<*package>
\def\dcm@subtitle{}
\def\DCMsubtitle#1{\def\dcm@subtitle{#1}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMshorttitle}
%    \begin{macrocode}
%<*package>
\def\dcm@shorttitle{}
\def\DCMshorttitle#1{\def\dcm@shorttitle{#1}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMsubject}
%    \begin{macrocode}
%<*package>
\def\DCMsubject#1{\def\dcm@subject{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMsubject{}',"<dc:subject>#1</dc:subject>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMdescription}
%    \begin{macrocode}
%<*package>
\long\def\DCMdescription#1{\long\def\dcm@description{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMdescription{}',"<dc:description>#1</dc:description>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMpublisher}
%    \begin{macrocode}
%<*package>
\def\DCMpublisher#1{\def\dcm@publisher{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMpublisher{}',"<dc:publisher>#1</dc:publisher>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMdate}
%   the |\DCMdate| uses |\today| as a default\ednote{@DEYAN: do that in latexml}
%    \begin{macrocode}
%<*package>
\def\dcm@date{\today}
\def\DCMdate#1{\def\dcm@date{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMdate{}',"<dc:date>#1</dc:date>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMtype}
%    \begin{macrocode}
%<*package>
\def\DCMtype#1{\def\dcm@type{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMtype{}',"<dc:type>#1</dc:type>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMidentifier}
%    \begin{macrocode}
%<*package>
\def\DCMidentifier#1#2{\def\dcm@scheme{#1}\def\dcm@identifier{#2}}
%</package>
%<*ltxml>
DefConstructor('\DCMidentifier{}{}',"<dc:identifier scheme='#1'>#2</dc:identifier>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMsource}
%    \begin{macrocode}
%<*package>
\def\DCMsource#1{\def\dcm@source{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMsource{}',"<dc:source>#1</dc:source>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMlanguage}
%    \begin{macrocode}
%<*package>
\def\DCMlanguage#1{\def\dcm@language{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMlanguage{}',"<dc:language>#1</dc:language>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMrelation}
%    \begin{macrocode}
%<*package>
\def\DCMrelation#1{\def\dcm@relation{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMrelation{}',"<dc:relation>#1</dc:relation>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMrights}
%    \begin{macrocode}
%<*package>
\def\DCMrights#1{\long\def\dcm@rights{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMrights{}',"<dc:rights>#1</dc:rights>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMlicense}
%    \begin{macrocode}
%<*package>
\def\DCMlicense#1{\def\dcm@license{#1}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMlicensenotice}
%   here we have a default
%    \begin{macrocode}
%<*package>
\def\dcm@license{All rights reserved}
\def\DCMlicensenotice#1{\long\def\dcm@license{\\[1ex]License: #1}}
%</package>
%<*ltxml>
DefMacro('\DCMlicensenotice{}','\DCMrights{#1}');
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMcopyrightnotice}
%    \begin{macrocode}
%<*package>
\def\DCMcopyrightnotice#1#2{\DCMrights{Copyright {\copyright} #1: #2}}
%</package>
%<*ltxml>
DefMacro('\DCMcopyrightnotice{}{}','\DCMrights{Copyright {\copyright} #1: #2}'); 
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cclicense}
%    \begin{macrocode}
%<*package>
\def\cclicense#1{\def\attribution{\def\dcm@by{yes}}
  \def\noncommercial{\def\dcm@nc{yes}}
  \def\sharealike{\defdcm@sharealike{yes}}
  \def\noderivativeworks{\def\dcm@derivatives{no}}}
%</package>
%<*ltxml>
DefConstructor('\cclicense{}',"<cc:license>#1</cc:license>");
DefConstructor('\attribution',"<cc:attribution/>");
DefConstructor('\noncommercial',"<cc:noncommercial/>");
DefConstructor('\sharealike',"<cc:sharealike/>");
DefConstructor('\noderivativeworks',"<cc:noderivativeworks>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMabstract}
%    \begin{macrocode}
%<*package>
\long\def\DCMabstract#1{\long\def\dcm@abstract{#1}}
%</package>
%<*ltxml>
DefConstructor('\DCMabstract{}',"<dc:description>#1</dc:description>");
%</ltxml>
%    \end{macrocode}
% \end{macro}
% 
% \DCMsubsection[creators=jdoe,id=impl.blockstyles]{DCM Block Styles}
% 
% We now define various commonly used styles.  
%
% \begin{macro}{\dcm@authorblock}
%   This internal macro builds an author block from a list of |\DCMperson| labels in
%   |\dcm@creators|.
%    \begin{macrocode}
%<*package>
\def\dcm@authorblock{\newcounter{authors}\stepcounter{authors}
{\let\tabularnewline\relax
  \@for\@I:=\dcm@creators\do{\stepcounter{authors}}
  \def\@authors{}\def\@affs{}\def\@urls{}
  \@for\@I:=\dcm@creators\do
    {\xdef\@authors{\@authors&\csname dcm@person@\@I @name\endcsname}
     \xdef\@affs{\@affs&\csname dcm@person@\@I @affiliation\endcsname}
     \xdef\@urls{\@urls&\csname dcm@person@\@I @url\endcsname}}
  \message{authors: \@authors}}
  \begin{tabular}[t]{l*{\theauthors}{c}}\@authors\\\@affs\\\@urls\end{tabular}}
%</package>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\dcm@titlepage@block}
% This style builds up a title page from scratch
%    \begin{macrocode}
%<*package>
\def\dcm@titlepage@block{\begin{titlepage}
    \null\vfil\vskip 60\p@
    \begin{center}
      \ifx\dcm@title\@empty
      \PackageWarning{dcm}{No title specified}{\LARGE Add title here\par}
      \else\LARGE \dcm@title \par\fi
      \ifx\dcm@subtitle\@empty
      \vskip 3em\Large \dcm@subtitle \par\vskip 3em
      \else\large\lineskip .75em\dcm@authorblock\vskip 1.5em\fi
      \ifx\dcm@date\@empty
      \PackageWarning{dcm}{No date specified}{\large\today\par}
      \else{\large\dcm@date\par}\vskip 2em\fi
  \end{center}\vskip2em
  \ifx\dcm@abstract\@empty
  \PackageWarning{dcm}{No Abstract specified}\else
  \begin{quote}\textbf\dcm@abstract@heading:\dcm@abstract\end{quote}\fi
  \vskip 2em\par\vfil\noindent
  {\small\noindent\dcm@rights\dcm@license}
  \end{titlepage}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dcm@maketitle@block}
%   This style makes use of the title facility of the document class.
%    \begin{macrocode}
%<*package>
\def\dcm@maketitle@block{\def\@title{\dcm@title\ifx\dcm@subtitle\empty\else\newline\dcm@subtitle\fi}
\def\@author{\dcm@authorblock}\def\@date{\dcm@date}\maketitle}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \DCMsubsection{Augmented Sectioning Macros}
%
% \begin{macro}{\dcm@sect@clear@keys}
%   We first define the sectioning keys with the infrastructure from the |metakeys|
%   package~\ctancite{Kohlhase:metakeys}
%    \begin{macrocode}
%<*package>
\srefaddidkey{dcm@sect}
\addmetakey{dcm@sect}{short}
\addmetakey{dcm@sect}{creators}
\addmetakey{dcm@sect}{contributors}
%</package>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\dcm@section}
%   The next step is to define an auxiliary macro that does all the
%   work. |\dcm@section{|\meta{type}|}{|\meta{title}|}{|\meta{keys}|}| delegates the
%   presentation of the \meta{title} and the metadata in \meta{keys} to the
%   |\dcm@section@*@style| macro specified \meta{style}.
%    \begin{macrocode}
%<*package>
\def\dcm@section#1#2#3{\def\dcm@sect@type{#1}\metasetkeys{dcm@sect}{#3}\sref@target%
\ifx\dcm@sect@short\@empty\csname #1\endcsname{#2}%
\else\csname #1\endcsname[\dcm@sect@short]{#2}\fi~% 
\@ifundefined{sect@style} %
{\dcm@section@default@style{#1}}%
{\csname dcm@section@\sect@style @style\endcsname{#1}}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dcm@section@default@style}
%   This is the default style for sectional metadata
%    \begin{macrocode}
%<*package>
\def\dcm@section@default@style#1{%
\ifx\dcm@sect@creators\@empty\else%
\textbf{\dcm@creators@heading}:%
\@for\@I:=\dcm@sect@creators\do{~\csname dcm@person@\@I @name\endcsname}\fi% 
\ifx\dcm@sect@contributors\@empty\else% there are contributors 
\dcm@contributors@connector%
\@for\@I:=\dcm@sect@contributors\do{~\csname dcm@person@\@I @name\endcsname}\\\fi}
%</package>
%    \end{macrocode}
% \end{macro}
%
% Armed with these, the rest is very simple
%
% \begin{macro}{\DCMchapter}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMchapter}[2][]%
{\dcm@section{chapter}{#2}{#1}\sref@label@id{\dcm@chapter@heading\ \thechapter}}
%</package>
%    \end{macrocode}
% For the {\latexml} bindings we have to be a bit more creative. We only open the
% |omgroup| element (and declare it to autoclose)\ednote{@DEYAN, we need to document more
% here; and we should also close the metadata element just to be more tidy.}
%    \begin{macrocode}
%<*ltxml>
Tag('omdoc:omgroup', autoClose=>1);
DefConstructor('\DCMchapter OptionalKeyVals:omgroup {}',sub {
  my ($document,$keyvals,$title,%properties) = @_;
  my $id=$keyvals->getValue('id')||"";
  $document->openElement('omdoc:chapter',('xml:id'=>$id));
  $document->openElement('omdoc:metadata');
  $document->insertElement('dc:title',$title);
  FishOutMetadata($document,$keyvals);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
% \ednote{@DEYAN: I guess since they all do the same as {\texttt{DCMchapter}}, we may
%   actually get away with \texttt{Let(DCMsection,DCMchapter);} here.}
% \begin{macro}{\DCMsection}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMsection}[2][]%
{\dcm@section{section}{#2}{#1}\sref@label@id{\dcm@section@heading\ \thesection}}
%</package>
%<*ltxml>
DefConstructor('\DCMsection OptionalKeyVals:omgroup {}',sub{
  my ($document,$keyvals,$title,%properties) = @_;
  my $id=$keyvals->getValue('id')||"";
  $document->openElement('omdoc:section',('xml:id'=>$id));
  $document->openElement('omdoc:metadata');
  $document->insertElement('dc:title',$title);
  FishOutMetadata($document,$keyvals);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMsubsection}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMsubsection}[2][]%
{\dcm@section{subsection}{#2}{#1}\sref@label@id{\dcm@subsection@heading\ \thesubsection}}
%</package>
%<*ltxml>
DefConstructor('\DCMsubsection OptionalKeyVals:omgroup {}',sub{
  my ($document,$keyvals,$title,%properties) = @_;
  my $id=$keyvals->getValue('id')||"";
  $document->openElement('omdoc:subsection',('xml:id'=>$id));
  $document->openElement('omdoc:metadata');
  $document->insertElement('dc:title',$title);
  FishOutMetadata($document,$keyvals);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\DCMsubsubsection}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMsubsubsection}[2][]%
{\dcm@section{subsubsection}{#2}{#1}\sref@label@id{\dcm@subsubsection@heading\ \thesubsubsection}}
%</package>
%<*ltxml>
DefConstructor('\DCMsubsubsection OptionalKeyVals:omgroup {}',sub{
  my ($document,$keyvals,$title,%properties) = @_;
  my $id=$keyvals->getValue('id')||"";
  $document->openElement('omdoc:subsubsection',('xml:id'=>$id));
  $document->openElement('omdoc:metadata');
  $document->insertElement('dc:title',$title);
  FishOutMetadata($document,$keyvals);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DCMparagraph}
%    \begin{macrocode}
%<*package>
\newcommand{\DCMparagraph}[2][]%
{\dcm@section{paragraph}{#2}{#1}\sref@label@id{this \dcm@paragraph@heading}}
%</package>
%<*ltxml>
DefConstructor('\DCMparagraph OptionalKeyVals:omgroup {}',sub{
  my ($document,$keyvals,$title,%properties) = @_;
  my $id=$keyvals->getValue('id')||"";
  $document->openElement('omdoc:paragraph',('xml:id'=>$id));
  $document->openElement('omdoc:metadata');
  $document->insertElement('dc:title',$title);
  FishOutMetadata($document,$keyvals);
  return;});
%</ltxml>
%    \end{macrocode}
% \end{macro}
%
% We have to make sure that the DCM sectioning and metadata commands have IDs, so that we doc not get
% duplicates.
%
%    \begin{macrocode}
%<*ltxml>
Tag('omdoc:chapter',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('omdoc:section',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('omdoc:subsection',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('omdoc:subsubsection',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('omdoc:paragraph',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('omdoc:subparagraph',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:description',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:date',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:creator',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:contributor',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:title',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:subject',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:publisher',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:type',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:identifier',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:language',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
Tag('dc:rights',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1);
%</ltxml>
%    \end{macrocode}
%
% \DCMsubsection{Dealing with ISO Dates}
%
% The first step is to build a macro for making ISO dates.\ednote{make better ltxml}
%
%    \begin{macrocode}
%<*package>
\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours
\count2=\count1\multiply\count2 by 60% minutes in \count1 hours
\count3=\time\advance\count3 by -\count2 % minutes
\the\year -\ifnum\month>9\else0\fi\the\month-\ifnum\day>9\else0\fi\the\day
T\ifnum\count1>9\else0\fi\the\count1:\ifnum\count3>9\else0\fi\the\count3:00Z}
%</package>
%<*ltxml>
RawTeX('\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours
\count2=\count1\multiply\count2 by 60% minutes in \count1 hours
\count3=\time\advance\count3 by -\count2 % minutes
\the\year -\the\month-\the\day T\the\count1:\the\count3:00Z}');
%</ltxml>
%    \end{macrocode}
% 
%\DCMsubsection{Configuration}
%
%    \begin{macrocode}
%<*package>
\def\dcm@abstract@heading{Abstract}
\def\dcm@creators@heading{Author(s)}
\def\dcm@contributors@connector{with contributions from}
\def\dcm@chapter@heading{Chapter}
\def\dcm@section@heading{Section}
\def\dcm@subsection@heading{Subsection}
\def\dcm@subsubsection@heading{Subsubsection}
\def\dcm@paragraph@heading{Paragraph}
%</package>
%    \end{macrocode}
%
% \DCMsubsection[id=sec:impl:ids]{Providing IDs for {\omdoc} Elements}
% 
%   To provide default identifiers, we tag all {\omdoc} elements that allow |xml:id|
%   attributes by executing the |numberIt| procedure below.
% 
%    \begin{macrocode}
%<*ltxml>
Tag('dc:title',afterOpen=>\&numberIt,afterClose=>\&locateIt);
%</ltxml>
%    \end{macrocode}
%
%\DCMsubsection{Finale}
%
% Finally, we need to terminate the file with a success mark for perl.
%    \begin{macrocode}
%<ltxml>1;
%    \end{macrocode}
% \Finale
\endinput
% \iffalse
% LocalWords:  GPL structuresharing STR LaTeX dcm dtx keyval sref CPERL url qw
%%% Local Variables: 
%%% mode: doctex
%%% TeX-master: t
%%% End: 
% \fi

% LocalWords:  RequirePackage birthdate personaltitle academictitle workaddress
% LocalWords:  privaddress worktel privtel workfax privfax worktelfax noDelim
% LocalWords:  privtelfax getKeyValue valuelist ToString getValue affill STDERR
% LocalWords:  ExportMetadata AssignValue DCMperson DefConstructor afterDigest
% LocalWords:  getArg setValue FishOutMetadata keyvals foreach idlist tabline
% LocalWords:  LookupValue insertElement atabline bitabline shorttitle nc args
% LocalWords:  sharealike noderivativeworks DefMacro authorblock subsubsection
% LocalWords:  contribs OptionalKeyVals omgroup omdoc srcref locator xml RawTeX
% LocalWords:  openElement iffalse kohlhase Thu scsys sc sc latexml DCmetadata
% LocalWords:  maketitle DCMtitle texttt fileversion DCMcreators miko jdoe impl
% LocalWords:  DCMabstract setcounter tocdepth tableofcontents newpage dmt03
% LocalWords:  DCMsection ednote DCMsubsection exfig hline dcmblock Patashnik
% LocalWords:  DescribeEnv DCMcontributors DCMshorttitle DCMshorttitle DCMdate
% LocalWords:  DCMsubject DCMsubject DCMdescription DCMdescription DCMpublisher
% LocalWords:  DCMpublisher DCMdate DCMtype DCMtype DCMidentifier DCMidentifier
% LocalWords:  DCMsource DCMsource DCMlanguage DCMlanguage DCMrelation ctancite
% LocalWords:  DCMrelation DCMrights DCMrights DCMlicense DCMlicense titlepage
% LocalWords:  DCMlicensenotice DCMlicensenotice DCMcopyrightnotice titlepage
% LocalWords:  DCMcopyrightnotice DCMcclicense DCMcclicense user.blockstyles
% LocalWords:  DCMchapter DCMchatper DCMsubsubsection DCMsubsubsection ltxml
% LocalWords:  user.conig makeatletter printbibliography expandafter
% LocalWords:  xdef csname endcsname newcommand ifx ifundefined affs
% LocalWords:  Semiverbatim whatsit newenvironment mtabline providecommand vfil
% LocalWords:  DCMsubtitle cclicense defdcm impl.blockstyles newcounter vskip
% LocalWords:  stepcounter tabularnewline theauthors lineskip textbf noindent
% LocalWords:  omd omd srefaddidkey thechapter autoclose thesection ifnum ifnum
% LocalWords:  thesubsection thesubsubsection DCMparagraph ISOtimestamp doctex