summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/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/source/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/source/latex/stex/workaddress')
-rw-r--r--Master/texmf-dist/source/latex/stex/workaddress/workaddress.dtx83
1 files changed, 45 insertions, 38 deletions
diff --git a/Master/texmf-dist/source/latex/stex/workaddress/workaddress.dtx b/Master/texmf-dist/source/latex/stex/workaddress/workaddress.dtx
index d3fa2fb6b37..e3cb1f717e2 100644
--- a/Master/texmf-dist/source/latex/stex/workaddress/workaddress.dtx
+++ b/Master/texmf-dist/source/latex/stex/workaddress/workaddress.dtx
@@ -10,10 +10,11 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{workaddress}[2016/04/07 v0.4 WorkAddress]
+\ProvidesPackage{workaddress}[2019/03/20 v0.5 WorkAddress]
%</package>
%<*driver>
\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
\usepackage{workaddress,sref,url,array,float}
\usepackage[show]{ed}
\usepackage[hyperref=auto,style=alphabetic]{biblatex}
@@ -43,8 +44,11 @@
{Safe and Secure Cognitive Systems}
\WAinstitution[id=dfki,url=http://dfki.de,acronym=DFKI,shortname=DFKI]
{German Research Center for Artificial Intelligence}
-\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}}
-\begin{document}\DocInput{workaddress.dtx}\end{document}
+\def\githubissue#1{\cite{sTeX:github:on}, \hyperlink{https://github.com/KWARC/sTeX/issues/#1}{issue #1}}
+\begin{document}
+\RecordChanges
+\DocInput{workaddress.dtx}
+\end{document}
%</driver>
% \fi
%
@@ -52,6 +56,7 @@
%
% \changes{v0.4}{2011/11/04}{Extracting from dcm.sty}
% \changes{v0.4}{2012/01/18}{new functionality for logos}
+% \changes{v0.5}{2016/07/06}{giving \texttt{\textbackslash wp@ref} a first argument for errors}
%
% \GetFileInfo{workaddress.sty}
%
@@ -180,9 +185,9 @@
% 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 GitHub repository~\cite{sTeX:github:on}.
-% \begin{compactenum}
+% \begin{enumerate}
% \item none reported yet
-% \end{compactenum}
+% \end{enumerate}
%
% \StopEventually{\printbibliography}
%
@@ -236,29 +241,31 @@
% \end{macrocode}
% \end{macro}
%
-%
-% \begin{macro}{\wa@ref@test}
-% This macro tests whether the information specified is defined, and gives an error
-% message else.
-% \begin{macrocode}
-\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!}
- }{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% With this, referencing is simple
-%
% \begin{macro}{\wa@ref}
+% This macro looks up the information specified in the three last arguments. The first
+% argument determines the behavior if that information is undefined: |\wa@ref0| fails
+% silently (no output, no message), |\waref1| raises a warning but outputs nothing, and
+% |\wa@ref2{|\meta{a}|}{|\meta{b}|}{|\meta{c}|}| raises a warning and outputs
+% |?|\meta{a}|?|\meta{b}|?|\meta{b}|?|, Finally |\wa@ref3| gives an error and aborts.
% \begin{macrocode}
-\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}}%
% \end{macrocode}
% \end{macro}
%
@@ -272,7 +279,7 @@
\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}
@@ -334,7 +341,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}
@@ -382,16 +389,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}%
}%
@@ -407,21 +414,21 @@
%
% \begin{macro}{\wapname}
% \begin{macrocode}
-\newcommand\wapname[1]{\wa@ref{person}{#1}{name}}
+\newcommand\wapname[1]{\wa@ref3{person}{#1}{name}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\waptname}
% \begin{macrocode}
-\newcommand\waptname[1]{\wa@ref{person}{#1}{personaltitle} \wa@ref{person}{#1}{name}}
+\newcommand\waptname[1]{\wa@ref3{person}{#1}{personaltitle} \wa@ref3{person}{#1}{name}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\wa@institution@logo}
% \begin{macrocode}
\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}%
}%