diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
commit | ddfe3a4eaf95167482e923d4da3de2917a7dbfbb (patch) | |
tree | 0acc1bb60b37392451f5e79e00c33c487c19abcf /Master/texmf-dist/tex/latex/stex/workaddress | |
parent | a04ae5a947a6b06bc717719f6ad63e6de5cb5af6 (diff) |
stex (7apr16)
git-svn-id: svn://tug.org/texlive/trunk@40320 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/workaddress')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty | 235 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml | 63 |
2 files changed, 131 insertions, 167 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty index 4dc956dd97f..ef90ccbb509 100644 --- a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty +++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty @@ -7,130 +7,157 @@ %% workaddress.dtx (with options: `package') %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{workaddress}[2012/01/28 v0.4 WorkAddress] -\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProvidesPackage{workaddress}[2016/04/06 v0.4 WorkAddress] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}} \ProcessOptions \RequirePackage{sref} -\RequirePackage{pgf} -\addmetakey{wa@person}{id} -\addmetakey{wa@person}{birthdate} -\addmetakey{wa@person}{email} -\addmetakey{wa@person}{url} -\addmetakey{wa@person}{affiliation} -\addmetakey{wa@person}{personaltitle} -\addmetakey{wa@person}{academictitle} -\addmetakey{wa@person}{department} -\addmetakey{wa@person}{workaddress} -\addmetakey{wa@person}{privaddress} -\addmetakey{wa@person}{worktel} -\addmetakey{wa@person}{privtel} -\addmetakey{wa@person}{workfax} -\addmetakey{wa@person}{privfax} -\addmetakey{wa@person}{worktelfax} -\addmetakey{wa@person}{privtelfax} +\addmetakey*{wa@person}{id} +\addmetakey*{wa@person}{birthdate} +\addmetakey*{wa@person}{email} +\addmetakey*{wa@person}{url} +\addmetakey*{wa@person}{affiliation} +\addmetakey*{wa@person}{personaltitle} +\addmetakey*{wa@person}{academictitle} +\addmetakey*{wa@person}{department} +\addmetakey*{wa@person}{workaddress} +\addmetakey*{wa@person}{privaddress} +\addmetakey*{wa@person}{worktel} +\addmetakey*{wa@person}{privtel} +\addmetakey*{wa@person}{workfax} +\addmetakey*{wa@person}{privfax} +\addmetakey*{wa@person}{worktelfax} +\addmetakey*{wa@person}{privtelfax} \def\wa@def#1#2#3#4{\expandafter\xdef\csname wa@#1@#2@#3\endcsname{#4}} \def\wa@ref@test#1#2#3{% -\@ifundefined{wa@#1@#2@#3}% -{\PackageError{workaddress}{reference to undefined #3 of #1 #2}% -{you must define a #1 with #2=#3\MessageBreak% -via the macro \protect\WA#1, before you can use it!}} -{}} -\def\wa@ref#1#2#3{\wa@ref@test{#1}{#2}{#3}\csname wa@#1@#2@#3\endcsname} + \@ifundefined{wa@#1@#2@#3}{% + \PackageError{workaddress}{reference to undefined #3 of #1 #2}% + {you must define a #1 with #2=#3\MessageBreak% + via the macro \protect\WA#1, before you can use it!} + }{}% +}% +\def\wa@ref#1#2#3{% + \wa@ref@test{#1}{#2}{#3}% + \csname wa@#1@#2@#3\endcsname% +}% \let\wa@persons=\relax -\newcommand{\WAperson}[2][]{\metasetkeys{wa@person}{#1} -\ifx\wa@person@id\@empty\@latex@warning{key 'id' undefined in WAperson}\else -\wa@def{person}\wa@person@id{id}{\wa@person@id}% redundant, but useful for checking -\wa@def{person}\wa@person@id{name}{#2} -\wa@def{person}\wa@person@id{email}{\wa@person@email} -\wa@def{person}\wa@person@id{birthdate}{\wa@person@birthdate} -\wa@def{person}\wa@person@id{url}{\wa@person@url} -\wa@def{person}\wa@person@id{affiliation}{\wa@person@affiliation} -\wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} -\wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} -\wa@def{person}\wa@person@id{personaltitle}{\wa@person@personaltitle} -\wa@def{person}\wa@person@id{academictitle}{\wa@person@academictitle} -\wa@def{person}\wa@person@id{department}{\wa@person@department} -\wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} -\wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} -\wa@def{person}\wa@person@id{worktel}{\wa@person@worktel} -\wa@def{person}\wa@person@id{privtel}{\wa@person@privtel} -\wa@def{person}\wa@person@id{workfax}{\wa@person@workfax} -\wa@def{person}\wa@person@id{privfax}{\wa@person@privfax} -\wa@def{person}\wa@person@id{worktelfax}{\wa@person@worktelfax} -\wa@def{person}\wa@person@id{privtelfax}{\wa@person@privtelfax} -\@ifundefined{wa@persons} -{\xdef\wa@persons{\wa@person@id}} -{\xdef\wa@persons{\wa@persons,\wa@person@id}} -\fi} -\newcommand\DCMperson[2][]{\WAperson[#1]{#2}% -\PackageWarning{workaddress}{\protect\DCMperson\space is deprecated, use \protect\WAperson\space instead}} -\addmetakey{wa@institution}{id} -\addmetakey{wa@institution}{shortname} -\addmetakey{wa@institution}{acronym} -\addmetakey{wa@institution}{url} -\addmetakey{wa@institution}{partof} -\addmetakey{wa@institution}{countryshort} -\addmetakey{wa@institution}{logo} -\addmetakey{wa@institution}{streetaddress} -\addmetakey{wa@institution}{townzip} -\addmetakey{wa@institution}{type} -\addmetakey{wa@institution}{country} +\newcommand\WAperson[2][]{% + \metasetkeys{wa@person}{#1}% + \ifx\wa@person@id\@empty% + \@latex@warning{key 'id' undefined in WAperson}% + \else% + \wa@def{person}\wa@person@id{id}{\wa@person@id}% redundant, but useful for checking + \wa@def{person}\wa@person@id{name}{#2} + \wa@def{person}\wa@person@id{email}{\wa@person@email} + \wa@def{person}\wa@person@id{birthdate}{\wa@person@birthdate} + \wa@def{person}\wa@person@id{url}{\wa@person@url} + \wa@def{person}\wa@person@id{affiliation}{\wa@person@affiliation} + \wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} + \wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} + \wa@def{person}\wa@person@id{personaltitle}{\wa@person@personaltitle} + \wa@def{person}\wa@person@id{academictitle}{\wa@person@academictitle} + \wa@def{person}\wa@person@id{department}{\wa@person@department} + \wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} + \wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} + \wa@def{person}\wa@person@id{worktel}{\wa@person@worktel} + \wa@def{person}\wa@person@id{privtel}{\wa@person@privtel} + \wa@def{person}\wa@person@id{workfax}{\wa@person@workfax} + \wa@def{person}\wa@person@id{privfax}{\wa@person@privfax} + \wa@def{person}\wa@person@id{worktelfax}{\wa@person@worktelfax} + \wa@def{person}\wa@person@id{privtelfax}{\wa@person@privtelfax} + \@ifundefined{wa@persons}{% + \xdef\wa@persons{\wa@person@id}% + }{% + \xdef\wa@persons{\wa@persons,\wa@person@id}% + }% + \fi% +}% +\newcommand\DCMperson[2][]{% + \WAperson[#1]{#2}% + \PackageWarning{workaddress}{\protect\DCMperson\space is deprecated, use \protect\WAperson\space instead} +}% +\addmetakey*{wa@institution}{id} +\addmetakey*{wa@institution}{shortname} +\addmetakey*{wa@institution}{acronym} +\addmetakey*{wa@institution}{url} +\addmetakey*{wa@institution}{partof} +\addmetakey*{wa@institution}{countryshort} +\addmetakey*{wa@institution}{logo} +\addmetakey*{wa@institution}{streetaddress} +\addmetakey*{wa@institution}{townzip} +\addmetakey*{wa@institution}{type} +\addmetakey*{wa@institution}{country} \let\wa@institutions=\relax -\newcommand{\WAinstitution}[2][]{\metasetkeys{wa@institution}{#1} -\ifx\wa@institution@id\@empty\@latex@warning{key 'id' undefined in WAinstitution}\else -\wa@def{institution}\wa@institution@id{id}{\wa@institution@id}% redundant, but useful for checking -\wa@def{institution}\wa@institution@id{name}{#2} -\wa@def{institution}\wa@institution@id{shortname}{\wa@institution@shortname} -\wa@def{institution}\wa@institution@id{acronym}{\wa@institution@acronym} -\wa@def{institution}\wa@institution@id{url}{\wa@institution@url} -\wa@def{institution}\wa@institution@id{partof}{\wa@institution@partof} -\wa@def{institution}\wa@institution@id{countryshort}{\wa@institution@countryshort} -\wa@def{institution}\wa@institution@id{logo}{\wa@institution@logo} -\wa@def{institution}\wa@institution@id{townzip}{\wa@institution@townzip} -\wa@def{institution}\wa@institution@id{streetaddress}{\wa@institution@streetaddress} -\wa@def{institution}\wa@institution@id{country}{\wa@institution@country} -\wa@def{institution}\wa@institution@id{type}{\wa@institution@type} -\@ifundefined{wa@institutions} -{\xdef\wa@institutions{\wa@institution@id}} -{\xdef\wa@institutions{\wa@institutions,\wa@institution@id}} -\fi} -\newcommand\DCMinstitution[2][]{\WAinstitution[#1]{#2}% -\PackageWarning{workaddress}{\protect\DCMinstitution\space is deprecated, use \protect\WAinstitution\space instead}} +\newcommand\WAinstitution[2][]{% + \metasetkeys{wa@institution}{#1}% + \ifx\wa@institution@id\@empty% + \@latex@warning{key 'id' undefined in WAinstitution}% + \else% + \wa@def{institution}\wa@institution@id{id}{\wa@institution@id}% redundant, but useful for checking + \wa@def{institution}\wa@institution@id{name}{#2} + \wa@def{institution}\wa@institution@id{shortname}{\wa@institution@shortname} + \wa@def{institution}\wa@institution@id{acronym}{\wa@institution@acronym} + \wa@def{institution}\wa@institution@id{url}{\wa@institution@url} + \wa@def{institution}\wa@institution@id{partof}{\wa@institution@partof} + \wa@def{institution}\wa@institution@id{countryshort}{\wa@institution@countryshort} + \wa@def{institution}\wa@institution@id{logo}{\wa@institution@logo} + \wa@def{institution}\wa@institution@id{townzip}{\wa@institution@townzip} + \wa@def{institution}\wa@institution@id{streetaddress}{\wa@institution@streetaddress} + \wa@def{institution}\wa@institution@id{country}{\wa@institution@country} + \wa@def{institution}\wa@institution@id{type}{\wa@institution@type} + \@ifundefined{wa@institutions}{% + \xdef\wa@institutions{\wa@institution@id}% + }{% + \xdef\wa@institutions{\wa@institutions,\wa@institution@id}% + }% + \fi% +}% +\newcommand\DCMinstitution[2][]{% + \WAinstitution[#1]{#2}% + \PackageWarning{workaddress}{\protect\DCMinstitution\space is deprecated, use \protect\WAinstitution\space instead}% +}% \addmetakey[false]{WAauthorblock}{dept}[true] \addmetakey[false]{WAauthorblock}{aff}[true] \addmetakey[false]{WAauthorblock}{url}[true] \def\@true{true} \newcounter{authors} \newcommand\WAauthorblock[2][]{% -\metasetkeys{WAauthorblock}{#1} -{\let\tabularnewline\relax - \@for\@I:=#2\do{\stepcounter{authors}} - \def\@authors{}\def\@affs{}\def\@depts{}\def\@urls{} - \@for\@I:=#2\do - {\xdef\@authors{\@authors&\wa@ref{person}\@I{name}} - \xdef\@@dept{\wa@ref{person}\@I{department}} - \xdef\@shortname{\csname wa@institution@\@@dept @shortname\endcsname} - \xdef\@dept{\ifx\@shortname\@empty\wa@ref{institution}\@@dept{name}\else\@shortname\fi} - \xdef\@depts{\@depts&\@dept} - \xdef\@@aff{\wa@ref{person}\@I{affiliation}} - \xdef\@shortname{\csname wa@institution@\@@aff @shortname\endcsname} - \xdef\@aff{\ifx\@shortname\@empty\wa@ref{institution}\@@aff{name}\else\@shortname\fi} - \xdef\@affs{\@affs&\@aff} - \xdef\@urls{\@urls&\wa@ref{person}\@I{url}}} - \message{\theauthors authors: \@authors}} + \metasetkeys{WAauthorblock}{#1} + {\let\tabularnewline\relax + \@for\@I:=#2\do{\stepcounter{authors}} + \def\@authors{}% + \def\@affs{}% + \def\@depts{}% + \def\@urls{}% + \@for\@I:=#2\do{% + \xdef\@authors{\@authors&\wa@ref{person}\@I{name}} + \xdef\@@dept{\wa@ref{person}\@I{department}} + \xdef\@shortname{\csname wa@institution@\@@dept @shortname\endcsname} + \xdef\@dept{\ifx\@shortname\@empty\wa@ref{institution}\@@dept{name}\else\@shortname\fi} + \xdef\@depts{\@depts&\@dept} + \xdef\@@aff{\wa@ref{person}\@I{affiliation}} + \xdef\@shortname{\csname wa@institution@\@@aff @shortname\endcsname} + \xdef\@aff{\ifx\@shortname\@empty\wa@ref{institution}\@@aff{name}\else\@shortname\fi} + \xdef\@affs{\@affs&\@aff} + \xdef\@urls{\@urls&\wa@ref{person}\@I{url}} + }% + \message{\theauthors authors: \@authors}% + }% \begin{tabular}[t]{l*{\theauthors}{c}} \@authors\\ \ifx\WAauthorblock@dept\@true\@depts\\\fi \ifx\WAauthorblock@aff\@true\@affs\\\fi \ifx\WAauthorblock@url\@true\@urls\\\fi -\end{tabular}} + \end{tabular} +}% \newcommand\wapname[1]{\wa@ref{person}{#1}{name}} \newcommand\waptname[1]{\wa@ref{person}{#1}{personaltitle} \wa@ref{person}{#1}{name}} \newcommand\wa@institution@logo[2][]{% -\pgfdeclareimage[#1]{logo}{\wa@ref{institution}{#2}{logo}} -\IfFileExists{\wa@ref{institution}{#2}{logo}}% -{\pgfuseimage{logo}} -{\fbox{#2 logo}\message{still need logo for #2}}} + \IfFileExists{\wa@ref{institution}{#2}{logo}}{% + \includegraphics{\wa@ref{institution}{#2}{logo}}% + }{% + \fbox{#2 logo}\message{still need logo for #2}% + }% +}% \endinput %% %% End of file `workaddress.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml deleted file mode 100644 index be79b087423..00000000000 --- a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml +++ /dev/null @@ -1,63 +0,0 @@ -# -*- CPERL -*- -package LaTeXML::Package::Pool; -use strict; -use LaTeXML::Global; -use LaTeXML::Package; -RequirePackage('sref'); - sub getKeyValue_noDelim { - my ($keyval,$key)=@_; - my $valuelist = $keyval && 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('WA_'.$id.'_email',$email,'global') if $email; - AssignValue('WA_'.$id.'_affiliation',$affill,'global') if $affill; - AssignValue('WA_'.$id.'_address',$email,'global') if $email; - AssignValue('WA_'.$id.'_url',$url,'global') if $url; - AssignValue('WA_'.$id.'_name',$name,'global') if $name; - } else {print STDERR "Warning: key 'id' undefined in \\WAperson\n"}; - return;}#$ -DefKeyVal('wa@person','id','Semiverbatim'); -DefKeyVal('wa@person','birthdate','Semiverbatim'); -DefKeyVal('wa@person','email','Semiverbatim'); -DefKeyVal('wa@person','url','Semiverbatim'); -DefKeyVal('wa@person','affiliation','Semiverbatim'); -DefKeyVal('wa@person','personaltitle','Semiverbatim'); -DefKeyVal('wa@person','academictitle','Semiverbatim'); -DefKeyVal('wa@person','department','Semiverbatim'); -DefKeyVal('wa@person','workaddress','Semiverbatim'); -DefKeyVal('wa@person','privaddress','Semiverbatim'); -DefKeyVal('wa@person','worktel','Semiverbatim'); -DefKeyVal('wa@person','privtel','Semiverbatim'); -DefKeyVal('wa@person','workfax','Semiverbatim'); -DefKeyVal('wa@person','privfax','Semiverbatim'); -DefKeyVal('wa@person','worktelfax','Semiverbatim'); -DefKeyVal('wa@person','privtelfax','Semiverbatim'); - -DefConstructor('\WAperson OptionalKeyVals:wa@person {}','', -afterDigest=>sub { - my ($stomach,$whatsit)=@_; - my $keys=$whatsit->getArg(1); - my $name=ToString($whatsit->getArg(2)); - $keys->setValue('name',$name); - ExportMetadata($keys); - return; -});#$ -DefKeyVal('wa@institution','id','Semiverbatim'); -DefKeyVal('wa@institution','url','Semiverbatim'); -DefKeyVal('wa@institution','partof','Semiverbatim'); -DefConstructor('\WAinstitution OptionalKeyVals:wa@institution {}','', -afterDigest=>sub { - my ($stomach,$whatsit)=@_; - my $keys=$whatsit->getArg(1); - my $name=ToString($whatsit->getArg(2)); - $keys->setValue('name',$name); - ExportMetadata($keys); - return; -});#$ -1; |