summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/dcm/dcm.dtx')
-rw-r--r--Master/texmf-dist/source/latex/stex/dcm/dcm.dtx232
1 files changed, 19 insertions, 213 deletions
diff --git a/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx b/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx
index 279530cd17c..a5b54b1b3a1 100644
--- a/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx
+++ b/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx
@@ -1,30 +1,28 @@
% \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: 1999 $; last modified by $Author: kohlhase $
-% $Date: 2012-01-28 08:32:11 +0100 (Sat, 28 Jan 2012) $
% Copyright (c) 2007-2011 Michael Kohlhase, all rights reserved
% this file is released under the
% LaTeX Project Public License (LPPL)
+% The original of this file is in the public repository at
+% http://github.com/KWARC/sTeX/
% \fi
%
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{dcm}[2012/01/28 v0.3 Dublin Core Metadata]
+\ProvidesPackage{dcm}[2016/04/07 v0.3 Dublin Core Metadata]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage{dcm,modules,stex-logo,url,array,float}
\usepackage[show]{ed}
\usepackage[hyperref=auto,style=alphabetic]{biblatex}
-\bibliography{kwarc}
-\usepackage{../ctansvn}
+\addbibresource{kwarcpubs.bib}
+\addbibresource{extpubs.bib}
+\addbibresource{kwarccrossrefs.bib}
+\addbibresource{extcrossrefs.bib}
+\usepackage{ctangit}
\usepackage{hyperref}
-\importmodule[dcmi]{dcmi}
-\usepackage[eso-foot,today]{svninfo}
-\svnInfo $Id: dcm.dtx 1999 2012-01-28 07:32:11Z kohlhase $
-\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/dcm/dcm.dtx $
\makeindex
\floatstyle{boxed}
\newfloat{exfig}{thp}{lop}
@@ -50,7 +48,7 @@ Systems,acronym=SKS]
%</driver>
% \fi
%
-%\CheckSum{337}
+%\CheckSum{291}
%
% \changes{v0.1}{2007/01/02}{First Hack for OMDoc spec}
% \changes{v0.2}{2008/06/17}{First Version with Documentation}
@@ -77,7 +75,7 @@ Systems,acronym=SKS]
%
% \setcounter{tocdepth}{2}\tableofcontents\newpage
%
-%\section[id=intro,creator=miko]{Introduction}
+%\section[id=intro]{Introduction}
%
% The |dcm| package 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
@@ -85,7 +83,7 @@ Systems,acronym=SKS]
% details}. This package allows to attribute authorship to arbitrary text
% fragments.\ednote{continue}
%
-% \section[id=user,creator={miko,jdoe}]{The User Interface}
+% \section[id=user]{The User Interface}
%
% \subsection[id=user.options]{Package Options}
%
@@ -172,7 +170,7 @@ Systems,acronym=SKS]
% \label{fig:dcmblock}
% \end{exfig}
%
-% \subsection[creator=jdoe,id=user.blockstyles]{DCM Metadata Block Styles}
+% \subsection[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:
@@ -218,21 +216,14 @@ Systems,acronym=SKS]
%
% 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}.
+% the \sTeX GitHub repository~\cite{sTeX:github:on}.
% \begin{compactenum}
% \item none reported yet
% \end{compactenum}
%
% \StopEventually{\printbibliography}
%
-% \section[creator=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.
+% \section[id=impl]{The Implementation}
%
% \subsection[id=impl.options]{Package Options}
% The first step is to declare (a few) package options that handle whether certain
@@ -241,51 +232,18 @@ Systems,acronym=SKS]
%
% \begin{macrocode}
%<*package>
-\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{rdfmeta}
+ \PassOptionsToPackage{\CurrentOption}{workaddress}}
\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{workaddress}
\RequirePackage[sectioning]{rdfmeta}
-%</package>
-%<*ltxml>
-# -*- CPERL -*-
-package LaTeXML::Package::Pool;
-use strict;
-use LaTeXML::Global;
-use LaTeXML::Package;
-RequirePackage('rdfmeta');
-RequirePackage('workaddress');
-%</ltxml>
% \end{macrocode}
%
-% 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}
-%
% \subsection{The DC Metadata Block}
%
% Then we make an environment for defining the metadata. Note that since we have defined
@@ -294,16 +252,11 @@ sub FishOutMetadata {
%
% \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}
%
@@ -312,247 +265,143 @@ DefEnvironment('{DCmetadata}[]', "<omdoc:metadata>#body</omdoc:metadata>");
% \begin{macro}{\DCMcreators}
% the |\DCMcreators| macro checks whether all ids are defined.
% \begin{macrocode}
-%<*package>
\def\DCMcreators#1{\@for\@I:=#1\do{\wa@ref@test{person}\@I{id}}
\gdef\dcm@creators{#1}}
-%</package>
-%<*ltxml>
-DefConstructor('\DCMcreators{}',sub{
- my ($document,$args,%properties) = @_;
- my $keyval = LaTeXML::KeyVals->new('wa@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{\wa@ref@test{person}\@I{id}}%
\def\dcm@contributors{#1}}
-%</package>
-%<*ltxml>
-DefConstructor('\DCMcontributors{}',sub{
- my ($document,$args,%properties) = @_;
- my $keyval = LaTeXML::KeyVals->new('wa@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}
%
-% \subsection[creator=jdoe,id=impl.blockstyles]{DCM Block Styles}
+% \subsection[id=impl.blockstyles]{DCM Block Styles}
%
% We now define various commonly used styles.
%
% \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}
@@ -572,60 +421,33 @@ DefConstructor('\DCMabstract{}',"<dc:description>#1</dc:description>");
\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{\WAauthorblock\dcm@creators}%
\def\@date{\dcm@date}\maketitle}
-%</package>
% \end{macrocode}
% \end{macro}
%
-% We have to make sure that the DCM metadata commands have IDs, so that we doc not get
-% duplicates.
-%
-% \begin{macrocode}
-%<*ltxml>
-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}
-%
% \subsection{Dealing with ISO Dates}
%
-% The first step is to build a macro for making ISO dates.\ednote{make better ltxml}
+% The first step is to build a macro for making ISO dates.
%
% \begin{macrocode}
-%<ltxml>RawTeX('
-%<*package|ltxml>
\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>
-%<ltxml>');
% \end{macrocode}
%
%\subsection{Configuration}
%
% \begin{macrocode}
-%<*package>
\def\dcm@abstract@heading{Abstract}
\def\dcm@creators@heading{Author(s)}
\def\dcm@contributors@connector{with contributions from}
@@ -634,26 +456,10 @@ T\ifnum\count1>9\else0\fi\the\count1:\ifnum\count3>9\else0\fi\the\count3:00Z}
\def\dcm@subsection@heading{Subsection}
\def\dcm@subsubsection@heading{Subsubsection}
\def\dcm@paragraph@heading{Paragraph}
+\def\omdoc{OMDoc}
%</package>
% \end{macrocode}
%
-% \subsection[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}
-%
-%\subsection{Finale}
-%
-% Finally, we need to terminate the file with a success mark for perl.
-% \begin{macrocode}
-%<ltxml>1;
-% \end{macrocode}
% \Finale
\endinput
% \iffalse