summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty
blob: a7cf322fcafa312abe4b377ea73e78b351f91ed6 (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
%%
%% This is file `dcm.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% dcm.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{dcm}[2010/06/25 v0.3 Dublin Core Metadata]
\RequirePackage{sref}
\omdaddkey{dcm@person}{id}
\omdaddkey{dcm@person}{birthdate}
\omdaddkey{dcm@person}{email}
\omdaddkey{dcm@person}{url}
\omdaddkey{dcm@person}{affiliation}
\omdaddkey{dcm@person}{personaltitle}
\omdaddkey{dcm@person}{academictitle}
\omdaddkey{dcm@person}{department}
\omdaddkey{dcm@person}{workaddress}
\omdaddkey{dcm@person}{privaddress}
\omdaddkey{dcm@person}{worktel}
\omdaddkey{dcm@person}{privtel}
\omdaddkey{dcm@person}{workfax}
\omdaddkey{dcm@person}{privfax}
\omdaddkey{dcm@person}{worktelfax}
\omdaddkey{dcm@person}{privtelfax}
\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
\newcommand{\DCMperson}[2][]{\omdsetkeys{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}
\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}}
\def\dc@mtabline#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}
\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}}
\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}
\def\DCMtitle#1{\def\dcm@title{#1}\providecommand{\dcm@shorttitle}{#1}}
\def\dcm@subtitle{}
\def\DCMsubtitle#1{\def\dcm@subtitle{#1}}
\def\dcm@shorttitle{}
\def\DCMshorttitle#1{\def\dcm@shorttitle{#1}}
\def\DCMsubject#1{\def\dcm@subject{#1}}
\long\def\DCMdescription#1{\long\def\dcm@description{#1}}
\def\DCMpublisher#1{\def\dcm@publisher{#1}}
\def\dcm@date{\today}
\def\DCMdate#1{\def\dcm@date{#1}}
\def\DCMtype#1{\def\dcm@type{#1}}
\def\DCMidentifier#1#2{\def\dcm@scheme{#1}\def\dcm@identifier{#2}}
\def\DCMsource#1{\def\dcm@source{#1}}
\def\DCMlanguage#1{\def\dcm@language{#1}}
\def\DCMrelation#1{\def\dcm@relation{#1}}
\def\DCMrights#1{\long\def\dcm@rights{#1}}
\def\DCMlicense#1{\def\dcm@license{#1}}
\def\dcm@license{All rights reserved}
\def\DCMlicensenotice#1{\long\def\dcm@license{\\[1ex]License: #1}}
\def\DCMcopyrightnotice#1#2{\DCMrights{Copyright {\copyright} #1: #2}}
\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}}}
\long\def\DCMabstract#1{\long\def\dcm@abstract{#1}}
\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}}
\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}}
\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}
\srefaddidkey{dcm@sect}
\omdaddkey{dcm@sect}{short}
\omdaddkey{dcm@sect}{creators}
\omdaddkey{dcm@sect}{contributors}
\def\dcm@section#1#2#3{\def\dcm@sect@type{#1}\omdsetkeys{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}}}
\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}
\newcommand{\DCMchapter}[2][]%
{\dcm@section{chapter}{#2}{#1}\sref@label@id{\dcm@chapter@heading\ \thechapter}}
\newcommand{\DCMsection}[2][]%
{\dcm@section{section}{#2}{#1}\sref@label@id{\dcm@section@heading\ \thesection}}
\newcommand{\DCMsubsection}[2][]%
{\dcm@section{subsection}{#2}{#1}\sref@label@id{\dcm@subsection@heading\ \thesubsection}}
\newcommand{\DCMsubsubsection}[2][]%
{\dcm@section{subsubsection}{#2}{#1}\sref@label@id{\dcm@subsubsection@heading\ \thesubsubsection}}
\newcommand{\DCMparagraph}[2][]%
{\dcm@section{paragraph}{#2}{#1}\sref@label@id{this \dcm@paragraph@heading}}
\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}
\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}
\endinput
%%
%% End of file `dcm.sty'.