summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty518
1 files changed, 312 insertions, 206 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
index ed85cf6c564..b34d23a7912 100644
--- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
+++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
@@ -10,29 +10,34 @@
%% nameauth:| Name authority management for consistency in text and index
%% Author:| Charles P. Schaum
%% E-mail:| charles dot schaum at comcast dot net
-%% License:| Released under the LaTeX Project Public License v1.3c or later
+%% License:| Released under the LaTeX Project Public License 1.3c or later
%% See:| http://www.latex-project.org/lppl.txt
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nameauth}
- [2016/11/01 v3.03 Name authority management for consistency in text and index]
+ [2017/01/13 3.1 Name authority management for consistency in text and index]
\newif\if@nameauth@InAKA
\newif\if@nameauth@InName
\newif\if@nameauth@Xref
\newif\if@nameauth@Lock
\newif\if@nameauth@InHook
\newif\if@nameauth@DoIndex
+\newif\if@nameauth@SkipIndex
+\newif\if@nameauth@JustIndex
\newif\if@nameauth@Pretag
\newif\if@nameauth@SeeAlso
\newif\if@nameauth@MainFormat
\newif\if@nameauth@AKAFormat
\newif\if@nameauth@LocalNames
+\newif\if@nameauth@Forget
+\newif\if@nameauth@Subvert
\newif\if@nameauth@FirstFormat
\newif\if@nameauth@AlwaysFormat
\newif\if@nameauth@AlwaysComma
\newif\if@nameauth@ShowComma
\newif\if@nameauth@NoComma
\newif\if@nameauth@NBSP
+\newif\if@nameauth@NBSPX
\newif\if@nameauth@Punct
\newif\if@nameauth@FullName
\newif\if@nameauth@FirstName
@@ -49,6 +54,8 @@
\newif\if@nameauth@DoCaps
\newif\if@nameauth@UTF
\newif\if@nameauth@Accent
+\newif\if@nameauth@AltFormat
+\newif\if@nameauth@DoAlt
\newif\if@nameauth@Verbose
\newtoks\@nameauth@toksa%
\newtoks\@nameauth@toksb%
@@ -68,7 +75,7 @@
\DeclareOption{mainmatter}{\@nameauth@MainFormattrue}
\DeclareOption{frontmatter}{\@nameauth@MainFormatfalse}
\DeclareOption{formatAKA}{\@nameauth@AKAFormattrue}
-\DeclareOption{oldAKA}{\@nameauth@oldAKAtrue}
+\DeclareOption{oldAKA}{\@nameauth@OldAKAtrue}
\DeclareOption{index}{\@nameauth@DoIndextrue}
\DeclareOption{noindex}{\@nameauth@DoIndexfalse}
\DeclareOption{pretag}{\@nameauth@Pretagtrue}
@@ -78,7 +85,7 @@
\DeclareOption{allreversed}%
{\@nameauth@RevAlltrue\@nameauth@RevAllCommafalse}
\DeclareOption{allrevcomma}%
- {\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue}
+ {\@nameauth@RevAllfalse\@nameauth@RevAllCommatrue}
\DeclareOption{notreversed}%
{\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue}
@@ -87,14 +94,10 @@
\DeclareOption{boldface}{\renewcommand*\NamesFormat{\bfseries}}
\DeclareOption{noformat}{\renewcommand*\NamesFormat{}}
\DeclareOption{verbose}{\@nameauth@Verbosetrue}
+\DeclareOption{altformat}{\@nameauth@AltFormattrue\@nameauth@DoAlttrue}
\ExecuteOptions%
- {nocomma,%
- mainmatter,%
- index,%
- pretag,%
- normalcaps,%
- notreversed,%
- noformat}
+ {nocomma,mainmatter,index,pretag,%
+ normalcaps,notreversed,noformat}
\ProcessOptions\relax
\RequirePackage{etoolbox}
\RequirePackage{suffix}
@@ -107,36 +110,38 @@
\newcommand*\@nameauth@TagRoot[1]{\@nameauth@TrimTag#1|\\}
\def\@nameauth@TrimTag#1|#2\\{#1}
\newcommand*\@nameauth@Suffix[1]{\@nameauth@TrimSuffix#1,,\\}
-\def\@nameauth@TrimSuffix#1,#2,#3\\{%
- \ifx\\#2\\\@empty\else\trim@spaces{#2}\fi}
-\newcommand*\@nameauth@AllCapRoot[1]
- {\uppercase{\@nameauth@Root{#1}}}
+\def\@nameauth@TrimSuffix#1,#2,#3\\%
+ {\ifx\\#2\\\@empty\else\trim@spaces{#2}\fi}
\newcommand*\@nameauth@UTFtest[1]
{%
\ifdefined\Umathchar
\@nameauth@UTFfalse%
\else
\ifdefined\UTFviii@two@octets
- \toks@\expandafter{\@car#1\@nil}%
- \edef\one{\the\toks@}%
- \toks@\expandafter{\@carß\@nil}%
- \edef\two{\the\toks@}%
- \ifx\one\two\@nameauth@UTFtrue\else\@nameauth@UTFfalse\fi
\if@nameauth@Accent
- \@nameauth@UTFtrue%
- \@nameauth@Accentfalse%
+ \@nameauth@UTFtrue\@nameauth@Accentfalse%
+ \else
+ \toks@\expandafter{\@car#1\@nil}%
+ \edef\one{\the\toks@}%
+ \toks@\expandafter{\@carß\@nil}%
+ \edef\two{\the\toks@}%
+ \ifx\one\two\@nameauth@UTFtrue\else\@nameauth@UTFfalse\fi
\fi
- \else\@nameauth@UTFfalse\fi
+ \else
+ \@nameauth@UTFfalse%
+ \fi
\fi
}
-\newcommand*\@nameauth@CapRoot[1]
+\newcommand*\@nameauth@Cap[1]
{%
- \if@nameauth@UTF \@nameauth@CRiii#1\\%
- \else \@nameauth@CRii#1\\%
+ \if@nameauth@UTF \@nameauth@Ciii#1\\%
+ \else \@nameauth@Cii#1\\%
\fi
}
-\def\@nameauth@CRii#1#2\\{\@nameauth@Root{\uppercase{#1}#2}}
-\def\@nameauth@CRiii#1#2#3\\{\@nameauth@Root{\uppercase{#1#2}#3}}
+\def\@nameauth@Cii#1#2\\%
+ {\expandafter\trim@spaces\expandafter{\uppercase{#1}#2}}
+\def\@nameauth@Ciii#1#2#3\\%
+ {\expandafter\trim@spaces\expandafter{\uppercase{#1#2}#3}}
\newcommand*\@nameauth@TestDot[1]
{%
\def\TestDot##1.\TestEnd##2\\{\TestPunct{##2}}%
@@ -171,61 +176,94 @@
}
\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty]
{%
- \if@nameauth@Lock\else
- \@nameauth@Locktrue%
- \@nameauth@InNametrue%
- \@nameauth@Error{#2}{macro \string\@nameauth@name}%
- \leavevmode\hbox{}%
- \IndexName[#1]{#2}[#3]%
- \if@nameauth@MainFormat
- \@nameauth@Parse[#1]{#2}[#3]{!MN}%
- \else
- \@nameauth@Parse[#1]{#2}[#3]{!NF}%
- \fi
- \IndexName[#1]{#2}[#3]%
- \@nameauth@Lockfalse%
- \@nameauth@InNamefalse%
- \@nameauth@NBSPfalse%
- \@nameauth@DoCapsfalse%
- \@nameauth@Accentfalse%
- \@nameauth@AllThisfalse%
- \@nameauth@ShowCommafalse%
- \@nameauth@NoCommafalse%
- \@nameauth@RevThisfalse%
- \@nameauth@RevThisCommafalse%
- \@nameauth@ShortSNNfalse%
- \@nameauth@EastFNfalse%
+ \unless\if@nameauth@Lock
+ \@nameauth@Locktrue%
+ \@nameauth@InNametrue%
+ \@nameauth@Error{#2}{macro \string\@nameauth@name}%
+ \if@nameauth@JustIndex
+ \IndexName[#1]{#2}[#3]%
+ \@nameauth@InNamefalse%
+ \@nameauth@Lockfalse%
+ \@nameauth@JustIndexfalse%
+ \else
+ \if@nameauth@Forget
+ \ForgetName[#1]{#2}[#3]%
+ \else
+ \if@nameauth@Subvert
+ \SubvertName[#1]{#2}[#3]%
+ \fi
+ \fi
+ \leavevmode\hbox{}%
+ \unless\if@nameauth@SkipIndex\IndexName[#1]{#2}[#3]\fi
+ \if@nameauth@MainFormat
+ \@nameauth@Parse[#1]{#2}[#3]{!MN}%
+ \else
+ \@nameauth@Parse[#1]{#2}[#3]{!NF}%
+ \fi
+ \unless\if@nameauth@SkipIndex\IndexName[#1]{#2}[#3]\fi
+ \@nameauth@SkipIndexfalse%
+ \@nameauth@Forgetfalse%
+ \@nameauth@Subvertfalse%
+ \@nameauth@Lockfalse%
+ \@nameauth@InNamefalse%
+ \@nameauth@NBSPfalse%
+ \@nameauth@NBSPXfalse%
+ \@nameauth@DoCapsfalse%
+ \@nameauth@Accentfalse%
+ \@nameauth@AllThisfalse%
+ \@nameauth@ShowCommafalse%
+ \@nameauth@NoCommafalse%
+ \@nameauth@RevThisfalse%
+ \@nameauth@RevThisCommafalse%
+ \@nameauth@ShortSNNfalse%
+ \@nameauth@EastFNfalse%
+ \fi
\fi
\if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
\newcommandx*\@nameauth@Parse[4][1=\@empty, 3=\@empty]
{%
\if@nameauth@Lock
+ \let\ex\expandafter%
\protected@edef\arga{\trim@spaces{#1}}%
- \protected@edef\argc{\trim@spaces{#3}}%
+ \protected@edef\rootb{\@nameauth@Root{#2}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\if@nameauth@AllCaps\@nameauth@AllThistrue\fi
\if@nameauth@RevAll\@nameauth@RevThistrue\fi
\if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi
- \if@nameauth@DoCaps
- \@nameauth@UTFtest{#2}%
- \protected@edef\rootb{\@nameauth@CapRoot{#2}}%
- \else
- \if@nameauth@AllThis
- \protected@edef\rootb{\@nameauth@AllCapRoot{#2}}%
- \else
- \protected@edef\rootb{\@nameauth@Root{#2}}%
- \fi
- \fi
\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}%
+ \if@nameauth@DoCaps
+ \let\csuffb\suffb%
+ \let\cargc\argc%
+ \unless\if@nameauth@AltFormat
+ \ex\@nameauth@UTFtest\ex{\rootb}%
+ \edef\crootb{\noexpand\@nameauth@Cap{\rootb}}%
+ \unless\ifx\suffb\@empty
+ \ex\@nameauth@UTFtest\ex{\suffb}%
+ \edef\csuffb{\noexpand\@nameauth@Cap{\suffb}}%
+ \fi
+ \unless\ifx\argc\@empty
+ \ex\@nameauth@UTFtest\ex{\argc}%
+ \edef\cargc{\noexpand\@nameauth@Cap{\argc}}%
+ \fi
+ \let\rootb\crootb%
+ \fi
+ \else
+ \if@nameauth@AllThis
+ \protected@edef\rootb{\uppercase{\@nameauth@Root{#2}}}%
+ \fi
+ \fi
\edef\Space{\space}%
+ \edef\SpaceX{\space}%
\if@nameauth@NBSP\edef\Space{\nobreakspace}\fi
- \ifx\arga\@empty\else
+ \if@nameauth@NBSPX\edef\SpaceX{\nobreakspace}\fi
+ \unless\ifx\arga\@empty
\if@nameauth@AlwaysComma
\edef\Space{,\space}%
\if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi
@@ -243,15 +281,18 @@
\ifx\arga\@empty
\ifx\argc\@empty
\let\FNN\suffb%
+ \unless\ifx\suffb\@empty
+ \if@nameauth@DoCaps\let\FNN\csuffb\fi
+ \fi
\let\SNN\rootb%
\@nameauth@NonWest{\csb#4}%
\else
\ifx\suffb\@empty
- \let\FNN\argc%
+ \if@nameauth@DoCaps\let\FNN\cargc\else\let\FNN\argc\fi
\let\SNN\rootb%
\@nameauth@NonWest{\csbc#4}%
\else
- \let\FNN\argc%
+ \if@nameauth@DoCaps\let\FNN\cargc\else\let\FNN\argc\fi
\let\SNN\rootb%
\@nameauth@NonWest{\csb#4}%
\fi
@@ -262,8 +303,7 @@
\else
\let\FNN\argc%
\fi
- \ifx\suffb\@empty
- \else
+ \unless\ifx\suffb\@empty
\protected@edef\SNN{\rootb\Space\suffb}%
\if@nameauth@ShortSNN\let\SNN\rootb\fi
\fi
@@ -274,7 +314,7 @@
\newcommand*\@nameauth@NonWest[1]
{%
\if@nameauth@Lock
- \ifcsname#1\endcsname\else
+ \unless\ifcsname#1\endcsname
\@nameauth@FirstFormattrue%
\fi
\if@nameauth@InAKA
@@ -287,7 +327,7 @@
\@nameauth@FirstNamefalse%
\fi
\else
- \ifcsname#1\endcsname\else
+ \unless\ifcsname#1\endcsname
\@nameauth@FullNametrue%
\@nameauth@FirstNamefalse%
\fi
@@ -316,8 +356,8 @@
\fi
\fi
\fi
- \ifcsname#1\endcsname\else
- \if@nameauth@InAKA\else\csgdef{#1}{}\fi%
+ \unless\ifcsname#1\endcsname
+ \unless\if@nameauth@InAKA\csgdef{#1}{}\fi
\fi
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
@@ -326,7 +366,7 @@
\newcommand*\@nameauth@West[1]
{%
\if@nameauth@Lock
- \ifcsname#1\endcsname\else
+ \unless\ifcsname#1\endcsname
\@nameauth@FirstFormattrue%
\fi
\if@nameauth@InAKA
@@ -338,7 +378,7 @@
\@nameauth@FirstNamefalse%
\fi
\else
- \ifcsname#1\endcsname\else
+ \unless\ifcsname#1\endcsname
\@nameauth@FullNametrue%
\@nameauth@FirstNamefalse%
\fi
@@ -348,13 +388,13 @@
\fi
\if@nameauth@FullName
\if@nameauth@RevThis
- \@nameauth@Hook{\SNN\space\FNN}%
+ \@nameauth@Hook{\SNN\SpaceX\FNN}%
\else
\if@nameauth@RevThisComma
- \edef\RevSpace{,\space}%
+ \edef\RevSpace{,\SpaceX}%
\@nameauth@Hook{\SNN\RevSpace\FNN}%
\else
- \@nameauth@Hook{\FNN\space\SNN}%
+ \@nameauth@Hook{\FNN\SpaceX\SNN}%
\fi
\fi
\else
@@ -364,8 +404,8 @@
\@nameauth@Hook{\rootb}%
\fi
\fi
- \ifcsname#1\endcsname\else
- \if@nameauth@InAKA\else\csgdef{#1}{}\fi%
+ \unless\ifcsname#1\endcsname
+ \unless\if@nameauth@InAKA\csgdef{#1}{}\fi
\fi
\@nameauth@FullNamefalse%
\@nameauth@FirstNamefalse%
@@ -381,7 +421,7 @@
\if@nameauth@AlwaysFormat
\@nameauth@FirstFormattrue%
\else
- \if@nameauth@AKAFormat\else
+ \unless\if@nameauth@AKAFormat
\@nameauth@FirstFormatfalse\fi
\fi
\if@nameauth@MainFormat
@@ -470,15 +510,57 @@
{\@nameauth@RevAllCommafalse}
\newcommand*\ReverseCommaActive%
{\@nameauth@RevAllCommatrue}
+\newcommand*\AltFormatActive{%
+ \global\@nameauth@AltFormattrue%
+ \global\@nameauth@DoAlttrue%
+}
+\WithSuffix{\newcommand*}\AltFormatActive*{%
+ \global\@nameauth@AltFormattrue%
+ \global\@nameauth@DoAltfalse%
+}
+\newcommand*\AltFormatInactive{%
+ \global\@nameauth@AltFormatfalse%
+ \global\@nameauth@DoAltfalse%
+}
+\newcommand*\AltOn{%
+ \if@nameauth@InHook
+ \if@nameauth@AltFormat\@nameauth@DoAlttrue\fi
+ \fi
+}
+\newcommand*\AltOff{%
+ \if@nameauth@InHook
+ \if@nameauth@AltFormat\@nameauth@DoAltfalse\fi
+ \fi
+}
+\newcommand*\AltCaps[1]{%
+ \if@nameauth@InHook
+ \if@nameauth@DoCaps\uppercase{#1}\else#1\fi
+ \else#1%
+ \fi
+}
+\newcommand*\textSC[1]{%
+ \if@nameauth@DoAlt\textsc{#1}\else#1\fi}
+\newcommand*\textUC[1]{%
+ \if@nameauth@DoAlt\uppercase{#1}\else#1\fi}
+\newcommand*\textIT[1]{%
+ \if@nameauth@DoAlt\textit{#1}\else#1\fi}
+\newcommand*\textBF[1]{%
+ \if@nameauth@DoAlt\textbf{#1}\else#1\fi}
\newcommand*\ShowComma{\@nameauth@ShowCommatrue}
\newcommand*\NoComma{\@nameauth@NoCommatrue}
\newcommand*\DropAffix{\@nameauth@ShortSNNtrue}
\newcommand*\KeepAffix{\@nameauth@NBSPtrue}
+\newcommand*\KeepName{\@nameauth@NBSPtrue\@nameauth@NBSPXtrue}
\newcommand*\NamesInactive{\@nameauth@MainFormatfalse}
\newcommand*\NamesActive{\@nameauth@MainFormattrue}
+\newcommand*\ForgetThis{\@nameauth@Forgettrue}
+\newcommand*\SubvertThis{\@nameauth@Subverttrue}
+\newcommand*\ForceName{\@nameauth@FirstFormattrue}
\newcommand*\LocalNames{\global\@nameauth@LocalNamestrue}
\newcommand*\GlobalNames{\global\@nameauth@LocalNamesfalse}
\newcommand*\IndexInactive{\@nameauth@DoIndexfalse}
+\newcommand*\SkipIndex{\@nameauth@SkipIndextrue}
+\newcommand*\JustIndex{\@nameauth@JustIndextrue}
\newcommand*\IndexActive{\@nameauth@DoIndextrue}
\newcommand*\IndexActual[1]
{\global\renewcommand*\@nameauth@Actual{#1}}
@@ -494,7 +576,27 @@
\let\FNN\argc%
\fi
\ifx\suffb\@empty
- \SNN%
+ \ifx\FNN\@empty
+ \SNN%
+ \else
+ \if@nameauth@FullName%
+ \if@nameauth@RevThis
+ \FNN\Space\SNN%
+ \else
+ \SNN\Space\FNN%
+ \fi
+ \else
+ \if@nameauth@FirstName
+ \if@nameauth@EastFN
+ \FNN%
+ \else
+ \SNN%
+ \fi
+ \else
+ \SNN%
+ \fi
+ \fi
+ \fi
\else
\if@nameauth@FullName
\if@nameauth@RevThis
@@ -520,19 +622,18 @@
\else
\let\FNN\argc%
\fi
- \ifx\suffb\@empty
- \else
+ \unless\ifx\suffb\@empty
\protected@edef\SNN{\rootb\Space\suffb}%
\if@nameauth@ShortSNN\let\SNN\rootb\fi%
\fi
\if@nameauth@FullName
\if@nameauth@RevThis
- \SNN\space\FNN%
+ \SNN\SpaceX\FNN%
\else
\if@nameauth@RevThisComma
\SNN\RevSpace\FNN%
\else
- \FNN\space\SNN%
+ \FNN\SpaceX\SNN%
\fi
\fi
\else
@@ -554,32 +655,27 @@
{\@nameauth@FirstNametrue\NameauthFName}
\newcommandx*\IndexName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
\protected@edef\arga{\trim@spaces{#1}}%
- \protected@edef\testb{\trim@spaces{#2}}%
\protected@edef\rootb{\@nameauth@Root{#2}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
- \protected@edef\testc{#3}%
\protected@edef\argc{\trim@spaces{#3}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\IndexName}%
- \let\Short\rootb%
- \ifx\suffb\@empty
- \let\SNN\rootb%
- \else
- \protected@edef\SNN{\rootb\space\suffb}%
- \fi
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\if@nameauth@Verbose
\PackageWarning{nameauth}%
{macro \IndexName: XRef: #2 exists}%
\fi
\else
- \@nameauth@Index{\csb}{\SNN}%
+ \ifx\suffb\@empty
+ \@nameauth@Index{\csb}{\rootb}%
+ \else
+ \@nameauth@Index{\csb}{\rootb\space\suffb}%
+ \fi
\fi
\else
\ifx\suffb\@empty
@@ -589,7 +685,7 @@
{macro \IndexName: XRef: #2 #3 exists}%
\fi
\else
- \@nameauth@Index{\csbc}{\SNN\space\argc}%
+ \@nameauth@Index{\csbc}{\rootb\space\argc}%
\fi
\else
\ifcsname\csb!PN\endcsname
@@ -598,7 +694,7 @@
{macro \IndexName: XRef: #2 exists}%
\fi
\else
- \@nameauth@Index{\csb}{\SNN}%
+ \@nameauth@Index{\csb}{\rootb\space\suffb}%
\fi
\fi
\fi
@@ -611,21 +707,19 @@
\else
\ifx\suffb\@empty
\@nameauth@Index{\csab}%
- {\Short,\space\arga}%
+ {\rootb,\space\arga}%
\else
\@nameauth@Index{\csab}%
- {\Short,\space\arga,\space\suffb}%
+ {\rootb,\space\arga,\space\suffb}%
\fi
\fi
\fi
}
\newcommandx*\IndexRef[4][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
\protected@edef\arga{\trim@spaces{#1}}%
\protected@edef\rootb{\@nameauth@Root{#2}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
- \protected@edef\testc{#3}%
\protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\target{#4}%
\def\csb{\@nameauth@Clean{#2}}%
@@ -634,24 +728,26 @@
\let\ex\expandafter%
\@nameauth@Error{#2}{macro \string\IndexRef}%
\@nameauth@Xreftrue%
- \let\Short\rootb%
- \ifx\suffb\@empty
- \let\SNN\rootb%
- \else
- \protected@edef\SNN{\rootb\space\suffb}%
- \fi
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\if@nameauth@Verbose
\PackageWarning{nameauth}%
{macro \IndexRef: XRef: #2 exists}%
\fi
\else
- \if@nameauth@SeeAlso
- \@nameauth@Index{\csb}{\SNN|seealso{\target}}%
+ \ifx\suffb\@empty
+ \if@nameauth@SeeAlso
+ \@nameauth@Index{\csb}{\rootb|seealso{\target}}%
+ \else
+ \@nameauth@Index{\csb}{\rootb|see{\target}}%
+ \fi
\else
- \@nameauth@Index{\csb}{\SNN|see{\target}}%
+ \if@nameauth@SeeAlso
+ \@nameauth@Index{\csb}{\rootb\space\suffb|seealso{\target}}%
+ \else
+ \@nameauth@Index{\csb}{\rootb\space\suffb|see{\target}}%
+ \fi
\fi
\csgdef{\csb!PN}{}%
\fi
@@ -665,10 +761,10 @@
\else
\if@nameauth@SeeAlso
\@nameauth@Index{\csbc}%
- {\SNN\space\argc|seealso{\target}}%
+ {\rootb\space\argc|seealso{\target}}%
\else
\@nameauth@Index{\csbc}%
- {\SNN\space\argc|see{\target}}%
+ {\rootb\space\argc|see{\target}}%
\fi
\csgdef{\csbc!PN}{}%
\fi
@@ -681,10 +777,10 @@
\else
\if@nameauth@SeeAlso
\@nameauth@Index{\csb}%
- {\SNN|seealso{\target}}%
+ {\rootb\space\suffb|seealso{\target}}%
\else
\@nameauth@Index{\csb}%
- {\SNN|see{\target}}%
+ {\rootb\space\suffb|see{\target}}%
\fi
\csgdef{\csb!PN}{}%
\fi
@@ -700,18 +796,18 @@
\ifx\suffb\@empty
\if@nameauth@SeeAlso
\@nameauth@Index{\csab}%
- {\Short,\space\arga|seealso{\target}}%
+ {\rootb,\space\arga|seealso{\target}}%
\else
\@nameauth@Index{\csab}%
- {\Short,\space\arga|see{\target}}%
+ {\rootb,\space\arga|see{\target}}%
\fi
\else
\if@nameauth@SeeAlso
\@nameauth@Index{\csab}%
- {\Short,\space\arga,\space\suffb|seealso{\target}}%
+ {\rootb,\space\arga,\space\suffb|seealso{\target}}%
\else
\@nameauth@Index{\csab}%
- {\Short,\space\arga,\space\suffb|see{\target}}%
+ {\rootb,\space\arga,\space\suffb|see{\target}}%
\fi
\fi
\csgdef{\csab!PN}{}%
@@ -722,15 +818,15 @@
}
\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\ExcludeName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\if@nameauth@Verbose
\ifcsname\csb!MN\endcsname
\PackageWarning{nameauth}%
@@ -814,51 +910,50 @@
}
\newcommandx*\IncludeName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\IncludeName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\edef\testex{\csname\csb!PN\endcsname}%
- \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi
+ \unless\ifx\testex\@empty\global\csundef{\csb!PN}\fi
\fi
\else
\ifx\suffb\@empty
\ifcsname\csbc!PN\endcsname
\edef\testex{\csname\csbc!PN\endcsname}%
- \ifx\testex\@empty\else\global\csundef{\csbc!PN}\fi
+ \unless\ifx\testex\@empty\global\csundef{\csbc!PN}\fi
\fi
\else
\ifcsname\csb!PN\endcsname
\edef\testex{\csname\csb!PN\endcsname}%
- \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi
+ \unless\ifx\testex\@empty\global\csundef{\csb!PN}\fi
\fi
\fi
\fi
\else
\ifcsname\csab!PN\endcsname
\edef\testex{\csname\csab!PN\endcsname}%
- \ifx\testex\@empty\else\global\csundef{\csab!PN}\fi
+ \unless\ifx\testex\@empty\global\csundef{\csab!PN}\fi
\fi
\fi
}
\WithSuffix{\newcommandx*}\IncludeName*[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
- \edef\testa{!}%
\@nameauth@Error{#2}{macro \string\IncludeName*}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\global\csundef{\csb!PN}%
\else
\ifx\suffb\@empty
@@ -873,15 +968,15 @@
}
\newcommandx*\PretagName[4][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\PretagName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\if@nameauth@Verbose
\PackageWarning{nameauth}%
@@ -920,15 +1015,15 @@
}
\newcommandx*\TagName[4][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\TagName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\if@nameauth@Verbose
\PackageWarning{nameauth}%
@@ -971,15 +1066,15 @@
}
\newcommandx*\UntagName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\UntagName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\global\csundef{\csb!TAG}%
\else
\ifx\suffb\@empty
@@ -994,15 +1089,15 @@
}
\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\Suff{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\NameAddInfo}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\csgdef{\csb!DB}{#4}%
\else
\ifx\Suff\@empty
@@ -1015,17 +1110,17 @@
\csgdef{\csab!DB}{#4}%
\fi
}
-\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty]
+\newcommandx*\NameQueryInfo[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\Suff{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\NameQueryInfo}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi
\else
\ifx\Suff\@empty
@@ -1040,15 +1135,15 @@
}
\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\Suff{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\NameClearInfo}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\global\csundef{\csb!DB}%
\else
\ifx\Suff\@empty
@@ -1063,15 +1158,15 @@
}
\newcommandx\IfMainName[5][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\IfMainName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!MN\endcsname{#4}\else{#5}\fi
\else
\ifx\suffb\@empty
@@ -1086,15 +1181,15 @@
}
\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\IfFrontName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!NF\endcsname{#4}\else{#5}\fi
\else
\ifx\suffb\@empty
@@ -1109,15 +1204,15 @@
}
\newcommandx\IfAKA[6][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\IfAKA}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\ifcsname\csb!PN\endcsname
\edef\testex{\csname\csb!PN\endcsname}%
\ifx\testex\@empty{#4}\else{#6}\fi
@@ -1144,15 +1239,15 @@
}
\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\ForgetName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\if@nameauth@LocalNames
\if@nameauth@MainFormat
\global\csundef{\csb!MN}%
@@ -1203,15 +1298,15 @@
}
\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty]
{%
- \protected@edef\testa{#1}%
- \protected@edef\testc{#3}%
+ \protected@edef\arga{\trim@spaces{#1}}%
+ \protected@edef\argc{\trim@spaces{#3}}%
\protected@edef\suffb{\@nameauth@Suffix{#2}}%
\def\csb{\@nameauth@Clean{#2}}%
\def\csbc{\@nameauth@Clean{#2,#3}}%
\def\csab{\@nameauth@Clean{#1!#2}}%
\@nameauth@Error{#2}{macro \string\SubvertName}%
- \ifx\testa\@empty
- \ifx\testc\@empty
+ \ifx\arga\@empty
+ \ifx\argc\@empty
\if@nameauth@LocalNames
\if@nameauth@MainFormat
\csgdef{\csb!MN}{}%
@@ -1234,17 +1329,17 @@
\csgdef{\csbc!MN}{}%
\csgdef{\csbc!NF}{}%
\fi
- \fi
- \else
- \if@nameauth@LocalNames
- \if@nameauth@MainFormat
- \csgdef{\csb!MN}{}%
+ \else
+ \if@nameauth@LocalNames
+ \if@nameauth@MainFormat
+ \csgdef{\csb!MN}{}%
+ \else
+ \csgdef{\csb!NF}{}%
+ \fi
\else
+ \csgdef{\csb!MN}{}%
\csgdef{\csb!NF}{}%
\fi
- \else
- \csgdef{\csb!MN}{}%
- \csgdef{\csb!NF}{}%
\fi
\fi
\else
@@ -1262,34 +1357,38 @@
}
\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]
{%
- \if@nameauth@Lock\else
+ \unless\if@nameauth@Lock
\@nameauth@Locktrue%
+ \@nameauth@JustIndexfalse%
\@nameauth@InAKAtrue%
\@nameauth@Error{#2}{macro \string\AKA}%
\@nameauth@Error{#4}{macro \string\AKA}%
\leavevmode\hbox{}%
- \protected@edef\testi{#1}%
\protected@edef\argi{\trim@spaces{#1}}%
\protected@edef\rooti{\@nameauth@Root{#2}}%
\protected@edef\suffi{\@nameauth@Suffix{#2}}%
\@nameauth@Parse[#3]{#4}[#5]{!PN}%
- \ifx\testi\@empty
- \ifx\suffi\@empty
- \IndexRef[#3]{#4}[#5]{\rooti}%
- \else
- \IndexRef[#3]{#4}[#5]{\rooti\space\suffi}%
- \fi
- \else
- \ifx\suffi\@empty
- \IndexRef[#3]{#4}[#5]{\rooti,\space\argi}%
+ \unless\if@nameauth@SkipIndex
+ \ifx\argi\@empty
+ \ifx\suffi\@empty
+ \IndexRef[#3]{#4}[#5]{\rooti}%
+ \else
+ \IndexRef[#3]{#4}[#5]{\rooti\space\suffi}%
+ \fi
\else
- \IndexRef[#3]{#4}[#5]{\rooti,\space\argi,\space\suffi}%
+ \ifx\suffi\@empty
+ \IndexRef[#3]{#4}[#5]{\rooti,\space\argi}%
+ \else
+ \IndexRef[#3]{#4}[#5]{\rooti,\space\argi,\space\suffi}%
+ \fi
\fi
\fi
+ \@nameauth@SkipIndexfalse%
\@nameauth@Lockfalse%
\@nameauth@InAKAfalse%
\@nameauth@AltAKAfalse%
\@nameauth@NBSPfalse%
+ \@nameauth@NBSPXfalse%
\@nameauth@DoCapsfalse%
\@nameauth@Accentfalse%
\@nameauth@AllThisfalse%
@@ -1304,7 +1403,14 @@
}
\WithSuffix{\newcommand*}\AKA*{\@nameauth@AltAKAtrue\AKA}
\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty]
-{\NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])}
+{%
+ \@nameauth@JustIndexfalse%
+ \if@nameauth@SkipIndex
+ \NameauthName[#1]{#2}\space(\SkipIndex\AKA[#1]{#2}[#3]{#4}[#5])%
+ \else
+ \NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])%
+ \fi
+}
\WithSuffix{\newcommand*}\PName*{\@nameauth@FullNametrue\PName}
\newenvironment{nameauth}{%
\begingroup%
@@ -1390,7 +1496,7 @@
}\ignorespaces%
}{\endgroup\ignorespaces}
%%
-%% Copyright (C) 2016 by Charles P. Schaum <charles dot schaum at comcast dot net>
+%% Copyright (C) 2017 by Charles P. Schaum <charles dot schaum at comcast dot net>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either