summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/workaddress
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-20 22:31:24 +0000
committerKarl Berry <karl@freefriends.org>2019-03-20 22:31:24 +0000
commit2b006ec0e0cafe12255f874f9c44786ab6f38901 (patch)
treec40f5796e1b34e3f051abd84d049e092e4ffd0ab /Master/texmf-dist/tex/latex/stex/workaddress
parent8e508e8b0218f17eb318645073096f2cf645cc78 (diff)
stex (20mar19)
git-svn-id: svn://tug.org/texlive/trunk@50489 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.sty55
1 files changed, 31 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty
index ef90ccbb509..597a36553b9 100644
--- a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty
+++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty
@@ -7,7 +7,7 @@
%% workaddress.dtx (with options: `package')
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{workaddress}[2016/04/06 v0.4 WorkAddress]
+\ProvidesPackage{workaddress}[2019/03/20 v0.5 WorkAddress]
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sref}}
\ProcessOptions
\RequirePackage{sref}
@@ -28,22 +28,29 @@
\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%
-}%
+\newcommand\wa@ref[4]{%
+ \@ifundefined{wa@#2@#3@#4}{%
+ \ifcase#1 {}\or%
+ \PackageWarning{workaddress}{reference to undefined #4 of #2 #3\MessageBreak%
+ you must define a #2 with #3=#4\MessageBreak%
+ via the macro \protect\WA#2, before you can use it!}%
+ \or
+ \PackageWarning{workaddress}{reference to undefined #4 of #2 #3\MessageBreak%
+ you must define a #2 with #3=#4\MessageBreak%
+ via the macro \protect\WA#2, before you can use it!}%
+ ?#2?#3?#4?
+ \or
+ \PackageError{workaddress}{reference to undefined #4 of #2 #3}%
+ {you must define a #2 with #3=#4\MessageBreak%
+ via the macro \protect\WA#2, before you can use it!}
+ \else\PackageError{workaddress}{\protect\wa@ref#1 not defined}{}
+ \fi
+ }{\csname wa@#2@#3@#4\endcsname}}%
\let\wa@persons=\relax
\newcommand\WAperson[2][]{%
\metasetkeys{wa@person}{#1}%
\ifx\wa@person@id\@empty%
- \@latex@warning{key 'id' undefined in WAperson}%
+ \PackageWarning{workaddress}{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}
@@ -90,7 +97,7 @@
\newcommand\WAinstitution[2][]{%
\metasetkeys{wa@institution}{#1}%
\ifx\wa@institution@id\@empty%
- \@latex@warning{key 'id' undefined in WAinstitution}%
+ \PackageWarning{workaddress}{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}
@@ -129,16 +136,16 @@
\def\@depts{}%
\def\@urls{}%
\@for\@I:=#2\do{%
- \xdef\@authors{\@authors&\wa@ref{person}\@I{name}}
- \xdef\@@dept{\wa@ref{person}\@I{department}}
+ \xdef\@authors{\@authors&\wa@ref2{person}\@I{name}}
+ \xdef\@@dept{\wa@ref1{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\@dept{\ifx\@shortname\@empty\wa@ref0{institution}\@@dept{name}\else\@shortname\fi}
\xdef\@depts{\@depts&\@dept}
- \xdef\@@aff{\wa@ref{person}\@I{affiliation}}
+ \xdef\@@aff{\wa@ref0{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\@aff{\ifx\@shortname\@empty\wa@ref0{institution}\@@aff{name}\else\@shortname\fi}
\xdef\@affs{\@affs&\@aff}
- \xdef\@urls{\@urls&\wa@ref{person}\@I{url}}
+ \xdef\@urls{\@urls&\wa@ref0{person}\@I{url}}
}%
\message{\theauthors authors: \@authors}%
}%
@@ -149,11 +156,11 @@
\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\wapname[1]{\wa@ref3{person}{#1}{name}}
+\newcommand\waptname[1]{\wa@ref3{person}{#1}{personaltitle} \wa@ref3{person}{#1}{name}}
\newcommand\wa@institution@logo[2][]{%
- \IfFileExists{\wa@ref{institution}{#2}{logo}}{%
- \includegraphics{\wa@ref{institution}{#2}{logo}}%
+ \IfFileExists{\wa@ref2{institution}{#2}{logo}}{%
+ \includegraphics{\wa@ref2{institution}{#2}{logo}}%
}{%
\fbox{#2 logo}\message{still need logo for #2}%
}%