summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-19 22:14:45 +0000
committerKarl Berry <karl@freefriends.org>2016-03-19 22:14:45 +0000
commit0d26f0823e8224951350c294f343df779c68105f (patch)
treec5f912d689176b16edb334963708cc26542b4081 /Master/texmf-dist/tex/latex/nameauth
parent619a3feba04810e6c12a1007bafb3209a6597071 (diff)
nameauth (19mar16)
git-svn-id: svn://tug.org/texlive/trunk@40080 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty406
1 files changed, 263 insertions, 143 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
index 3845762c79c..d5e44e32cb6 100644
--- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
+++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
@@ -14,32 +14,43 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nameauth}
- [2016/01/05 v2.3 Name authority mechanism for consistency in text and index]
+ [2016/03/18 v2.42 Name authority mechanism for consistency in text and index]
\newif\if@nameauth@AlwaysComma
\newif\if@nameauth@ShowComma
\newif\if@nameauth@DoFormat
\newif\if@nameauth@LocalNames
\newif\if@nameauth@DoIndex
\newif\if@nameauth@Pretag
+\newif\if@nameauth@FullName
+\newif\if@nameauth@FirstName
+\newif\if@nameauth@AltAKA
\newif\if@nameauth@AllCaps
\newif\if@nameauth@AllThis
\newif\if@nameauth@RevAll
\newif\if@nameauth@RevThis
\newif\if@nameauth@RevAllComma
\newif\if@nameauth@RevThisComma
-\newif\if@nameauth@FirstFormat
-\newif\if@nameauth@AlwaysFormat
-\newif\if@nameauth@FullName
-\newif\if@nameauth@FirstName
-\newif\if@nameauth@AltAKA
-\newif\if@nameauth@NBSP
-\newif\if@nameauth@Punct
\newif\if@nameauth@DoCaps
\newif\if@nameauth@Accent
+\newif\if@nameauth@NBSP
+\newif\if@nameauth@Punct
+\newif\if@nameauth@FirstFormat
+\newif\if@nameauth@AlwaysFormat
+\newif\if@nameauth@InAKA
+\newif\if@nameauth@InName
+\newif\if@nameauth@Lock
\newcommand*{\NamesFormat}{}
+\newcommand*{\MainNameHook}{}
+\newcommand*{\FrontNameHook}{}
\newcommand*{\NameauthName}{\@nameauth@Name}
\newcommand*{\NameauthLName}{\@nameauth@Name}
\newcommand*{\NameauthFName}{\@nameauth@Name}
+\newtoks\@nameauth@toksa%
+\newtoks\@nameauth@toksb%
+\newtoks\@nameauth@toksc%
+\newtoks\@nameauth@etoksb%
+\newtoks\@nameauth@etoksc%
+\newtoks\@nameauth@etoksd%
\DeclareOption{comma}{\@nameauth@AlwaysCommatrue}
\DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse}
\DeclareOption{mainmatter}{\@nameauth@DoFormattrue}
@@ -76,7 +87,6 @@
\RequirePackage{trimspaces}
\RequirePackage{suffix}
\RequirePackage{xargs}
-\newcommand*\@nameauth@Actual{@}
\newcommand*{\@nameauth@Clean}[1]%
{\expandafter\zap@space\detokenize{#1} \@empty}
\newcommand*{\@nameauth@Root}[1]%
@@ -125,12 +135,13 @@
\if@nameauth@FirstFormat
\bgroup\NamesFormat{#1}\egroup%
\else
- #1%
+ \bgroup\MainNameHook{#1}\egroup%
\fi
\else
- #1%
+ \bgroup\FrontNameHook{#1}\egroup%
\fi
}
+\newcommand*\@nameauth@Actual{@}
\newcommand*{\@nameauth@Index}[2]%
{%
\def\cseq{#1}%
@@ -152,6 +163,9 @@
}
\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty]%
{%
+ \if@nameauth@Lock\else
+ \@nameauth@Locktrue%
+ \@nameauth@InNametrue%
\let\ex\expandafter%
\leavevmode\hbox{}%
\protected@edef\testa{#1}%
@@ -163,6 +177,9 @@
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
+ \@nameauth@toksa\expandafter{#1}%
+ \@nameauth@toksb\expandafter{#2}%
+ \@nameauth@toksc\expandafter{#3}%
\ifx\testb\@empty
\PackageError{nameauth}%
{macro \Name: Essential name missing}%
@@ -269,12 +286,12 @@
\@nameauth@FirstFormattrue%
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csb!MN}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\Reversed}%
\else
\ex\@nameauth@FmtName\ex{\SNN}%
\fi
+ \csgdef{\csb!MN}{}%
\fi
\else
\ifcsname\csb!NF\endcsname
@@ -295,12 +312,12 @@
\else
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csb!NF}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\Reversed}%
\else
\ex\@nameauth@FmtName\ex{\SNN}%
\fi
+ \csgdef{\csb!NF}{}%
\fi
\fi
\else
@@ -334,12 +351,12 @@
\@nameauth@FirstFormattrue%
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csbc!MN}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\ex\argc\ex\space\SNN}%
\else
\ex\@nameauth@FmtName\ex{\ex\SNN\ex\space\argc}%
\fi
+ \csgdef{\csbc!MN}{}%
\fi
\else
\ifcsname\csbc!NF\endcsname
@@ -364,12 +381,12 @@
\else
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csbc!NF}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\ex\argc\ex\space\SNN}%
\else
\ex\@nameauth@FmtName\ex{\ex\SNN\ex\space\argc}%
\fi
+ \csgdef{\csbc!NF}{}%
\fi
\fi
\fi
@@ -415,12 +432,12 @@
\@nameauth@FirstFormattrue%
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csab!MN}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}%
\else
\ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}%
\fi
+ \csgdef{\csab!MN}{}%
\fi
\else
\ifcsname\csab!NF\endcsname
@@ -442,15 +459,17 @@
\else
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
- \csgdef{\csab!NF}{}%
\if@nameauth@RevThis
\ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}%
\else
\ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}%
\fi
+ \csgdef{\csab!NF}{}%
\fi
\fi
\fi
+ \@nameauth@Lockfalse%
+ \@nameauth@InNamefalse%
\@nameauth@FirstFormatfalse%
\@nameauth@NBSPfalse%
\@nameauth@DoCapsfalse%
@@ -459,38 +478,42 @@
\@nameauth@ShowCommafalse%
\@nameauth@RevThisfalse%
\@nameauth@RevThisCommafalse%
+ \fi
\if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
\newcommand*{\CapThis}{\@nameauth@DoCapstrue}
\newcommand*{\AccentCapThis}{\@nameauth@Accenttrue\@nameauth@DoCapstrue}
\newcommand*{\CapName}{\@nameauth@AllThistrue}
-\newcommand*{\RevName}{\@nameauth@RevThistrue}
-\newcommand*{\RevComma}%
- {\@nameauth@RevThistrue\@nameauth@RevThisCommatrue}
-\newcommand*{\ShowComma}{\@nameauth@ShowCommatrue}
-\newcommand*{\KeepAffix}{\@nameauth@NBSPtrue}
-\newcommand*{\NamesInactive}{\@nameauth@DoFormatfalse}
-\newcommand*{\NamesActive}{\@nameauth@DoFormattrue}
\newcommand*{\AllCapsInactive}{\@nameauth@AllCapsfalse}
\newcommand*{\AllCapsActive}{\@nameauth@AllCapstrue}
+\newcommand*{\RevName}{\@nameauth@RevThistrue}
\newcommand*{\ReverseInactive}{\@nameauth@RevAllfalse}
\newcommand*{\ReverseActive}{\@nameauth@RevAlltrue}
+\newcommand*{\RevComma}%
+ {\@nameauth@RevThistrue\@nameauth@RevThisCommatrue}
\newcommand*{\ReverseCommaInactive}%
{\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
\newcommand*{\ReverseCommaActive}%
{\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue}
+\newcommand*{\ShowComma}{\@nameauth@ShowCommatrue}
+\newcommand*{\KeepAffix}{\@nameauth@NBSPtrue}
+\newcommand*{\NamesInactive}{\@nameauth@DoFormatfalse}
+\newcommand*{\NamesActive}{\@nameauth@DoFormattrue}
+\newcommand*\LocalNames{\global\@nameauth@LocalNamestrue}
+\newcommand*\GlobalNames{\global\@nameauth@LocalNamesfalse}
\newcommand*{\IndexInactive}{\@nameauth@DoIndexfalse}
\newcommand*{\IndexActive}{\@nameauth@DoIndextrue}
\newcommand*{\IndexActual}[1]%
{\global\renewcommand*\@nameauth@Actual{#1}}
-\newcommand*\LocalNames{\@nameauth@LocalNamestrue}
-\newcommand*\GlobalNames{\@nameauth@LocalNamesfalse}
\def\Name{\NameauthName}
\WithSuffix\def\Name*{\@nameauth@FullNametrue\NameauthLName}
\def\FName{\@nameauth@FirstNametrue\NameauthFName}
\WithSuffix\def\FName*{\@nameauth@FirstNametrue\NameauthFName}
\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]%
{%
+ \if@nameauth@Lock\else
+ \@nameauth@Locktrue%
+ \@nameauth@InAKAtrue%
\let\ex\expandafter%
\leavevmode\hbox{}%
\protected@edef\testa{#1}%
@@ -499,6 +522,7 @@
\protected@edef\testbr{\@nameauth@Root{#2}}%
\protected@edef\testc{#3}%
\protected@edef\argc{\trim@spaces{#3}}%
+ \def\argd{\trim@spaces{#3}}%
\protected@edef\testd{\trim@spaces{#4}}%
\protected@edef\testdr{\@nameauth@Root{#4}}%
\protected@edef\teste{#5}%
@@ -506,6 +530,9 @@
\def\csd{\@nameauth@Clean{#4}}%
\def\csde{\@nameauth@Clean{#4#5}}%
\def\cscd{\@nameauth@Clean{#3!#4}}%
+ \@nameauth@toksa\expandafter{#3}%
+ \@nameauth@toksb\expandafter{#4}%
+ \@nameauth@toksc\expandafter{#5}%
\ifx\testb\@empty
\PackageError{nameauth}%
{macro \AKA: Essential name missing}%
@@ -596,7 +623,6 @@
\PackageWarning{nameauth}%
{macro \AKA: Name reference: #4 exists; no xref}%
\else
- \csgdef{\csd!PN}{}%
\ifx\testa\@empty
\@nameauth@Index{\csd}%
{\ISNNd|see{\SNNb}}%
@@ -624,6 +650,7 @@
\else
\ex\@nameauth@FmtName\ex{\SNNd}%
\fi
+ \ifcsname\csd!PN\endcsname\else\csgdef{\csd!PN}{}\fi
\else
\ifcsname\csde!PN\endcsname
\PackageWarning{nameauth}%
@@ -637,7 +664,6 @@
\PackageWarning{nameauth}%
{macro \AKA: Name reference: #4 #5 exists; no xref}%
\else
- \csgdef{\csde!PN}{}%
\ifx\testa\@empty
\@nameauth@Index{\csde}%
{\ISNNd\ISpace\arge|see{\SNNb}}%
@@ -669,6 +695,7 @@
\ex\@nameauth@FmtName\ex{\ex\SNNd\ex\space\arge}%
\fi
\fi
+ \ifcsname\csde!PN\endcsname\else\csgdef{\csde!PN}{}\fi
\fi
\else
\ifcsname\cscd!PN\endcsname
@@ -683,7 +710,6 @@
\PackageWarning{nameauth}%
{macro \AKA: Name reference: #3 #4 exists; no xref}%
\else
- \csgdef{\cscd!PN}{}%
\ifx\testa\@empty
\ifx\Suffd\@empty
\@nameauth@Index{\cscd}%
@@ -733,7 +759,11 @@
\ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNNd}%
\fi
\fi
+ \ifcsname\cscd!PN\endcsname\else\csgdef{\cscd!PN}{}\fi
\fi
+ \@nameauth@Lockfalse%
+ \@nameauth@InAKAfalse%
+ \@nameauth@FirstFormatfalse%
\@nameauth@NBSPfalse%
\@nameauth@AltAKAfalse%
\@nameauth@DoCapsfalse%
@@ -742,6 +772,7 @@
\@nameauth@ShowCommafalse%
\@nameauth@RevThisfalse%
\@nameauth@RevThisCommafalse%
+ \fi
\if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
\WithSuffix\def\AKA*{\@nameauth@AltAKAtrue\AKA}
@@ -750,7 +781,7 @@
\NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])%
}
\WithSuffix\def\PName*{\@nameauth@FullNametrue\PName}
-\newcommandx*\TagName[4][1=\@empty, 3=\@empty]%
+\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -760,39 +791,24 @@
\def\csab{\@nameauth@Clean{#1!#2}}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \TagName: Essential name missing}%
+ {macro \NameInfo: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \TagName: Essential name malformed}%
+ {macro \NameInfo: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \ifcsname\csb!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \TagName: not tagging xref: #2}%
- \else
- \csgdef{\csb!TAG}{#4}%
- \fi
+ \csgdef{\csb!DB}{#4}%
\else
- \ifcsname\csbc!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \TagName: not tagging xref: #2 #3}%
- \else
- \csgdef{\csbc!TAG}{#4}%
- \fi
+ \csgdef{\csbc!DB}{#4}%
\fi
\else
- \ifcsname\csab!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \TagName: not tagging xref: #1 #2}%
- \else
- \csgdef{\csab!TAG}{#4}%
- \fi
+ \csgdef{\csab!DB}{#4}%
\fi
}
-\newcommandx*\UntagName[3][1=\@empty, 3=\@empty]%
+\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -802,24 +818,24 @@
\def\csab{\@nameauth@Clean{#1!#2}}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \UntagName: Essential name missing}%
+ {macro \NameInfo: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \UntagName: Essential name malformed}%
+ {macro \NameInfo: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \global\csundef{\csb!TAG}%
+ \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi
\else
- \global\csundef{\csbc!TAG}%
+ \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi
\fi
\else
- \global\csundef{\csab!TAG}%
+ \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi
\fi
}
-\newcommandx*\PretagName[4][1=\@empty, 3=\@empty]%
+\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -829,33 +845,21 @@
\def\csab{\@nameauth@Clean{#1!#2}}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \TagName: Essential name missing}%
+ {macro \UntagName: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \TagName: Essential name malformed}%
+ {macro \UntagName: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \ifcsname\csb!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \PretagName: tagging xref: #2}%
- \fi
- \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi
+ \global\csundef{\csb!DB}%
\else
- \ifcsname\csbc!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \PretagName: tagging xref: #2 #3}%
- \fi
- \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi
+ \global\csundef{\csbc!DB}%
\fi
\else
- \ifcsname\csab!PN\endcsname
- \PackageWarning{nameauth}%
- {macro \PretagName: tagging xref: #1 #2}%
- \fi
- \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi
+ \global\csundef{\csab!DB}%
\fi
}
\newcommandx*\IndexName[3][1=\@empty, 3=\@empty]%
@@ -923,6 +927,114 @@
\fi
\@nameauth@ShowCommafalse%
}
+\newcommandx*\TagName[4][1=\@empty, 3=\@empty]%
+{%
+ \protected@edef\testa{#1}%
+ \protected@edef\testb{\trim@spaces{#2}}%
+ \protected@edef\testc{#3}%
+ \def\csb{\@nameauth@Clean{#2}}%
+ \def\csbc{\@nameauth@Clean{#2#3}}%
+ \def\csab{\@nameauth@Clean{#1!#2}}%
+ \ifx\testb\@empty
+ \PackageError{nameauth}%
+ {macro \TagName: Essential name missing}%
+ \else
+ \ifx\csb\@empty
+ \PackageError{nameauth}%
+ {macro \TagName: Essential name malformed}%
+ \fi
+ \fi
+ \ifx\testa\@empty
+ \ifx\testc\@empty
+ \ifcsname\csb!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \TagName: not tagging xref: #2}%
+ \else
+ \csgdef{\csb!TAG}{#4}%
+ \fi
+ \else
+ \ifcsname\csbc!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \TagName: not tagging xref: #2 #3}%
+ \else
+ \csgdef{\csbc!TAG}{#4}%
+ \fi
+ \fi
+ \else
+ \ifcsname\csab!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \TagName: not tagging xref: #1 #2}%
+ \else
+ \csgdef{\csab!TAG}{#4}%
+ \fi
+ \fi
+}
+\newcommandx*\UntagName[3][1=\@empty, 3=\@empty]%
+{%
+ \protected@edef\testa{#1}%
+ \protected@edef\testb{\trim@spaces{#2}}%
+ \protected@edef\testc{#3}%
+ \def\csb{\@nameauth@Clean{#2}}%
+ \def\csbc{\@nameauth@Clean{#2#3}}%
+ \def\csab{\@nameauth@Clean{#1!#2}}%
+ \ifx\testb\@empty
+ \PackageError{nameauth}%
+ {macro \UntagName: Essential name missing}%
+ \else
+ \ifx\csb\@empty
+ \PackageError{nameauth}%
+ {macro \UntagName: Essential name malformed}%
+ \fi
+ \fi
+ \ifx\testa\@empty
+ \ifx\testc\@empty
+ \global\csundef{\csb!TAG}%
+ \else
+ \global\csundef{\csbc!TAG}%
+ \fi
+ \else
+ \global\csundef{\csab!TAG}%
+ \fi
+}
+\newcommandx*\PretagName[4][1=\@empty, 3=\@empty]%
+{%
+ \protected@edef\testa{#1}%
+ \protected@edef\testb{\trim@spaces{#2}}%
+ \protected@edef\testc{#3}%
+ \def\csb{\@nameauth@Clean{#2}}%
+ \def\csbc{\@nameauth@Clean{#2#3}}%
+ \def\csab{\@nameauth@Clean{#1!#2}}%
+ \ifx\testb\@empty
+ \PackageError{nameauth}%
+ {macro \TagName: Essential name missing}%
+ \else
+ \ifx\csb\@empty
+ \PackageError{nameauth}%
+ {macro \TagName: Essential name malformed}%
+ \fi
+ \fi
+ \ifx\testa\@empty
+ \ifx\testc\@empty
+ \ifcsname\csb!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \PretagName: tagging xref: #2}%
+ \fi
+ \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi
+ \else
+ \ifcsname\csbc!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \PretagName: tagging xref: #2 #3}%
+ \fi
+ \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi
+ \fi
+ \else
+ \ifcsname\csab!PN\endcsname
+ \PackageWarning{nameauth}%
+ {macro \PretagName: tagging xref: #1 #2}%
+ \fi
+ \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi
+ \fi
+}
\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
@@ -995,7 +1107,7 @@
\fi
\fi
}
-\newcommandx\IfAKA[6][1=\@empty, 3=\@empty]%
+\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -1005,30 +1117,24 @@
\def\csab{\@nameauth@Clean{#1!#2}}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name missing}%
+ {macro \IfFrontName: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name malformed}%
+ {macro \IfFrontName: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \ifcsname\csb!PN\endcsname
- \ifcsempty{\csb!PN}{#4}{#6}%
- \else#5\fi
+ \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi
\else
- \ifcsname\csbc!PN\endcsname
- \ifcsempty{\csbc!PN}{#4}{#6}%
- \else#5\fi
+ \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi
\fi
\else
- \ifcsname\csab!PN\endcsname
- \ifcsempty{\csab!PN}{#4}{#6}%
- \else#5\fi
+ \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi
\fi
}
-\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty]%
+\newcommandx\IfMainName[5][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -1038,24 +1144,24 @@
\def\csab{\@nameauth@Clean{#1!#2}}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name missing}%
+ {macro \IfMainName: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name malformed}%
+ {macro \IfMainName: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \ifcsname\csb!NF\endcsname#4\else#5\fi
+ \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi
\else
- \ifcsname\csbc!NF\endcsname#4\else#5\fi
+ \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi
\fi
\else
- \ifcsname\csab!NF\endcsname#4\else#5\fi
+ \ifcsname\csab!MN\endcsname{#4}\else{#5}\fi
\fi
}
-\newcommandx\IfMainName[5][1=\@empty, 3=\@empty]%
+\newcommandx\IfAKA[6][1=\@empty, 3=\@empty]%
{%
\protected@edef\testa{#1}%
\protected@edef\testb{\trim@spaces{#2}}%
@@ -1063,23 +1169,33 @@
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
+ \def\test{!}%
\ifx\testb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name missing}%
+ {macro \IfAKA: Essential name missing}%
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \ExcludeName: Essential name malformed}%
+ {macro \IfAKA: Essential name malformed}%
\fi
\fi
\ifx\testa\@empty
\ifx\testc\@empty
- \ifcsname\csb!MN\endcsname#4\else#5\fi
+ \ifcsname\csb!PN\endcsname
+ \edef\testa{\csname\csb!PN\endcsname}%
+ \ifx\testa\test{#6}\else{#4}\fi
+ \else{#5}\fi
\else
- \ifcsname\csbc!MN\endcsname#4\else#5\fi
+ \ifcsname\csbc!PN\endcsname
+ \edef\testa{\csname\csbc!PN\endcsname}%
+ \ifx\testa\test{#6}\else{#4}\fi
+ \else{#5}\fi
\fi
\else
- \ifcsname\csab!MN\endcsname#4\else#5\fi
+ \ifcsname\csab!PN\endcsname
+ \edef\testa{\csname\csab!PN\endcsname}%
+ \ifx\testa\test{#6}\else{#4}\fi
+ \else{#5}\fi
\fi
}
\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty]%
@@ -1193,80 +1309,84 @@
\begingroup%
\let\ex\expandafter%
\csdef{<}##1&##2&##3&##4>{%
- \protected@edef\arga{\trim@spaces{##1}}%
- \protected@edef\testb{\trim@spaces{##2}}%
- \protected@edef\testc{\trim@spaces{##3}}%
- \protected@edef\testd{\trim@spaces{##4}}%
- \newtoks\tokb%
- \newtoks\tokc%
- \newtoks\tokd%
- \tokb\expandafter{##2}%
- \tokc\expandafter{##3}%
- \tokd\expandafter{##4}%
- \ifx\arga\@empty
+ \protected@edef\@arga{\trim@spaces{##1}}%
+ \protected@edef\@testb{\trim@spaces{##2}}%
+ \protected@edef\@testc{\trim@spaces{##3}}%
+ \protected@edef\@testd{\trim@spaces{##4}}%
+ \@nameauth@etoksb\expandafter{##2}%
+ \@nameauth@etoksc\expandafter{##3}%
+ \@nameauth@etoksd\expandafter{##4}%
+ \ifx\@arga\@empty
\PackageError{nameauth}%
{environment nameauth: Control sequence missing}%
\else
- \ifx\testc\@empty
+ \ifx\@testc\@empty
\PackageError{nameauth}%
{environment nameauth: Essential name missing}%
\else
- \ifcsname\arga\endcsname
+ \ifcsname\@arga\endcsname
\PackageWarning{nameauth}%
{environment nameauth: Redefinition of shorthands}%
\fi
- \ifx\testd\@empty
- \ifx\testb\@empty
- \ex\csgdef\ex{\ex\arga\ex}\ex{\ex\NameauthName\ex{\the\tokc}}%
- \ex\csgdef\ex{\ex L\ex\arga\ex}\ex{\ex\@nameauth@FullNametrue%
- \ex\NameauthLName\ex{\the\tokc}}%
- \ex\csgdef\ex{\ex S\ex\arga\ex}\ex{\ex\@nameauth@FirstNametrue%
- \ex\NameauthFName\ex{\the\tokc}}%
+ \ifx\@testd\@empty
+ \ifx\@testb\@empty
+ \ex\csgdef\ex{\ex\@arga\ex}\ex{\ex\NameauthName\ex{%
+ \the\@nameauth@etoksc}}%
+ \ex\csgdef\ex{\ex L\ex\@arga\ex}\ex{%
+ \ex\@nameauth@FullNametrue%
+ \ex\NameauthLName\ex{\the\@nameauth@etoksc}}%
+ \ex\csgdef\ex{\ex S\ex\@arga\ex}\ex{%
+ \ex\@nameauth@FirstNametrue%
+ \ex\NameauthFName\ex{\the\@nameauth@etoksc}}%
\else
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\arga\ex\ex\ex}%
- \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[\ex\the\ex\tokb\ex]%
- \ex{\the\tokc}}%
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\arga%
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}%
+ \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[%
+ \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}%
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga%
\ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue%
- \ex\ex\ex\NameauthLName\ex\ex\ex[\ex\the\ex\tokb\ex]\ex{\the\tokc}}%
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\arga%
+ \ex\ex\ex\NameauthLName\ex\ex\ex[%
+ \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}%
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga%
\ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue%
\ex\ex\ex\NameauthFName\ex\ex\ex[%
- \ex\the\ex\tokb\ex]\ex{\the\tokc}}%
+ \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}%
\fi
\else
- \ifx\testb\@empty
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\arga\ex\ex\ex}%
- \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{\ex\the\ex\tokc\ex}%
- \ex[\the\tokd]}%
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\arga%
+ \ifx\@testb\@empty
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}%
+ \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{%
+ \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}%
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga%
\ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue%
\ex\ex\ex\NameauthLName\ex\ex\ex{%
- \ex\the\ex\tokc\ex}\ex[\the\tokd]}%
- \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\arga%
+ \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}%
+ \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga%
\ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue%
\ex\ex\ex\NameauthFName\ex\ex\ex{%
- \ex\the\ex\tokc\ex}\ex[\the\tokd]}%
+ \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}%
\else
\ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
- \ex\ex\ex\ex\ex\ex\ex\arga\ex\ex\ex\ex\ex\ex\ex}%
+ \ex\ex\ex\ex\ex\ex\ex\@arga\ex\ex\ex\ex\ex\ex\ex}%
\ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName%
- \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\tokb%
- \ex\ex\ex]\ex\ex\ex{\ex\the\ex\tokc\ex}\ex[\the\tokd]}%
+ \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb%
+ \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[%
+ \the\@nameauth@etoksd]}%
\ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
- \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\arga%
+ \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\@arga%
\ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{%
\ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue%
- \ex\ex\ex\ex\ex\ex\ex\NameauthLName%
- \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\tokb%
- \ex\ex\ex]\ex\ex\ex{\ex\the\ex\tokc\ex}\ex[\the\tokd]}%
+ \ex\ex\ex\ex\ex\ex\ex\NameauthLName\ex\ex\ex\ex\ex\ex\ex[%
+ \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb%
+ \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[%
+ \the\@nameauth@etoksd]}%
\ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{%
- \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\arga%
+ \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\@arga%
\ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{%
\ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue%
\ex\ex\ex\ex\ex\ex\ex\NameauthFName\ex\ex\ex\ex\ex\ex\ex[%
- \ex\ex\ex\the\ex\ex\ex\tokb\ex\ex\ex]%
- \ex\ex\ex{\ex\the\ex\tokc\ex}\ex[\the\tokd]}%
+ \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb\ex\ex\ex]%
+ \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[%
+ \the\@nameauth@etoksd]}%
\fi
\fi
\fi