diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
commit | 849996eca72af498b48b10fbea7f14c4b9d21b8f (patch) | |
tree | 2d40d42dfc9fc0b0622212cc220868f98345305f /Master/texmf-dist/tex/latex/stex/workaddress | |
parent | d82e1c23973fd0271f93686f487bd1cee8dcd947 (diff) |
restore stex (ca. 28jan12)
git-svn-id: svn://tug.org/texlive/trunk@25792 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 | 136 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml | 63 |
2 files changed, 199 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty new file mode 100644 index 00000000000..4dc956dd97f --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty @@ -0,0 +1,136 @@ +%% +%% This is file `workaddress.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% workaddress.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{workaddress}[2012/01/28 v0.4 WorkAddress] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\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} +\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} +\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} +\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}} +\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}} + \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}} +\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}}} +\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 new file mode 100644 index 00000000000..be79b087423 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml @@ -0,0 +1,63 @@ +# -*- 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; |