% \iffalse meta-comment
% vim: textwidth=75
%<*internal>
\iffalse
%</internal>
%<*readme>
|
--------:| ----------------------------------------------------------------
nameauth:| Name authority mechanism 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
     See:| http://www.latex-project.org/lppl.txt


Short description:

The nameauth package automates the formatting and indexing of names.
This aids the use of a name authority and the process of textual reordering
and revision without needing to retype name references.

Files		 Distribution

README       This file
nameauth.pdf Documentation
examples.tex Some longer example macros from the documentation

Makefile     Automates building with GNU make 3.81
nameauth.dtx Documented LaTeX file containing both code and documentation

Installation

Unpack nameauth.zip in an appropriate directory.

Note that the instructions below assume that you are using a *nix-
compatible computer. If that is otherwise, you will need to modify
these instructions to your needs.

If you have a make utility compatible with GNU make you can type

	make inst

to install the package into your $TEXMFHOME tree or

	make install

to install the package into your $TEXMFLOCAL tree for all users.

Manually, you can generate the package files. First you generate the
installer driver, README, and style files, with a preliminary PDF:

	pdflatex -shell-escape -recorder -interaction=batchmode nameauth.dtx

Next you generate the PDF with a table of contents and all cross-references
validated, so that the index entries will not move:

	pdflatex --recorder --interaction=nonstopmode nameauth.dtx
	
The next commands generate the glossary/index and final pdf file
	
	makeindex -q -s gglo.ist -o nameauth.gls nameauth.glo
	makeindex -q -s gind.ist -o nameauth.ind nameauth.idx
	pdflatex --recorder --interaction=nonstopmode nameauth.dtx
	pdflatex --recorder --interaction=nonstopmode nameauth.dtx

Normally you create the following manual installation directories for user:

	$TEXMFHOME/source/latex/nameauth		dtx file
	$TEXMFHOME/tex/latex/nameauth			sty file
	$TEXMFHOME/doc/latex/nameauth			pdf file, README, examples.tex
		
and you create the following manual installation directories for local site:

	$TEXMFLOCAL/source/latex/nameauth		dtx file
	$TEXMFLOCAL/tex/latex/nameauth			sty file
	$TEXMFLOCAL/doc/latex/nameauth			pdf file, README, examples.tex

The above environment variables often are /usr/local/texlive/texmf-local and
~/texmf.

Run mktexlsr with the appropriate level of permissions to complete the install.

Testing notes:

This packages works and builds with latex, lualatex, pdflatex, and xelatex.
It can be used with makeindex and texindy. The documentation builds with
lualatex, pdflatex, and xelatex, using makeindex.

For testing, the make file permits one to change the typesetting engine
on the command line. The default is to build the package and documentation
with pdflatex. See the make file for details.

License

This material is subject to the LaTeX Project Public License:
http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html

Happy TeXing!
%</readme>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
  \expandafter\begingroup
\fi
%</internal>
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
--------:| ----------------------------------------------------------------
nameauth:| Name authority mechanism 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
     See:| http://www.latex-project.org/lppl.txt

\endpreamble
\postamble

Copyright (C) 2016 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
version 1.3c of this license or (at your option) any later
version.  The latest version of this license is in the file:

http://www.latex-project.org/lppl.txt

This work is "maintained" (as per LPPL maintenance status) by
Charles P. Schaum.

This work consists of the files nameauth.dtx, examples.tex, and a Makefile.
Running "make" generates the derived files README, nameauth.pdf and nameauth.sty.
Running "make inst" installs the files in the user's TeX tree.
Running "make install" installs the files in the local TeX tree.

\endpostamble

\usedir{tex/latex/nameauth}
\generate{
  \file{\jobname.sty}{\from{\jobname.dtx}{package}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/latex/nameauth}
\generate{
  \file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\nopreamble\nopostamble
\usedir{doc/latex/nameauth}
\generate{
  \file{README.txt}{\from{\jobname.dtx}{readme}}
}
\ifx\fmtname\nameofplainTeX
  \expandafter\endbatchfile
\else
  \expandafter\endgroup
\fi
%</internal>
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{nameauth.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{nameauth}
%<*package>
    [2016/04/06 v2.5 Name authority mechanism for consistency in text and index]
%</package>
%<*driver>
\documentclass[11pt]{ltxdoc}
\usepackage[textwidth=135mm,textheight=237mm,right=25mm,nohead]{geometry}
\usepackage[numbered]{hypdoc}
\usepackage{enumitem}
\usepackage{\jobname}
\usepackage[ngerman,american]{babel}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage[toc]{multitoc}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{tikz}
\usepackage{ifxetex}
\usepackage{ifluatex}
\usepackage{ifpdf}
\ifxetex
  \usepackage{fontspec}
  \defaultfontfeatures{Mapping=tex-text}
  \usepackage{xunicode}
  \usepackage{xltxtra}
\else
  \ifluatex
    \usepackage{fontspec}
    \defaultfontfeatures{Ligatures=TeX}
  \else
    \usepackage[utf8]{inputenc}
    \usepackage[TS1,T1]{fontenc}
    \usepackage{newunicodechar}
    \usepackage{lmodern}
    \DeclareTextSymbolDefault{\textlongs}{TS1}
    \DeclareTextSymbol{\textlongs}{TS1}{115}
    \newunicodechar{ſ}{\textlongs}
    \newunicodechar{ā}{\=a}
    \newunicodechar{ṃ}{\d m}
  \fi
\fi
\setlist{rightmargin=\leftmargin,itemsep=0pt}
\frenchspacing
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\begin{nameauth}
  \< Wash & George & Washington & >
  \< Soto & Hernando & de Soto & >
  \< JRII & John David & Rockefeller, II & >
  \< JRIV & John David & Rockefeller, IV & >
  \< JayR & John David & Rockefeller, IV & Jay >
  \< Aris & & Aristotle & >
  \< Eliz & & Elizabeth, I & >
  \< Attil & & Attila, the Hun & >
  \< Dagb & & Dagobert & I > 
  \< Konoe & Fumimaro & Konoe & >
  \< Yamt & & Yamamoto, Isoroku & >
  \< Yosh & & Yoshida & Shigeru >
  \< Einstein & Albert & Einstein & >
  \< Cicero & M.T. & Cicero & >
  \< Confucius & & Confucius & >
  \< CBald & & Charles, the Bald & >
  \< Smith & John & Smith & >
  \< JQP & J.Q. & Public & >
  \< Patton & George S. & Patton, Jr. & >
  \< Francis & & Francis, I & >
  \< Dem & & Demetrius, I Soter & >
  \< Sun & & Sun, Yat-sen & >
  \< Plato & & Plato & >
  \< Henry & & Henry & VIII >
  \< Ptol & & Ptolemy & I Soter >
  \< Mao & & Mao & Tse-tung >
  \< DLM & Walter & de la Mare & >
  \< JWG & Johann Wolfgang von & Goethe & >
  \< Harnack & Adolf & Harnack & >
  \< Bier & Johann & Bier\-mann & >
  \< Howell & Thurston & \textsc{Howell},\textsc{III} &>
  \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & >
  \< KempMed & & Thomas, à~Kempis & >
  \< KempW & Thomas & à~Kempis & >
  \< Lewis & Clive Staples & Lewis & C.S. >
  \< Jack & Clive Staples & Lewis & Jack >
  \< JQA & John Quincy & \noexpand\DoFormat{Adams} & >
  \< Aeths & & \noexpand\DoFormat{Æþelstan} & >
  \< Chas & & \noexpand\DoFormat{Charles}, I & >
  \< Cao & & \noexpand\DoFormat{Cao}, Cao & >
  \< JRIII & John David & \noexpand\DoFormat{Rockefeller}, III & >
  \< SDJR & Sammy & \noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}. & >
\end{nameauth}
\TagName[George]{Washington}{, president|hyperpage}
\TagName[Hernando]{de Soto}{|hyperpage}
\TagName[John David]{Rockefeller, II}{|hyperpage}
\TagName[John David]{Rockefeller, IV}{|hyperpage}
\TagName{Aristotle}{|hyperpage}
\TagName{Elizabeth, I}{, queen|hyperpage}
\TagName{Attila, the Hun}{|hyperpage}
\TagName{Dagobert}[I]{, king|hyperpage}
\TagName[Fumimaro]{Konoe}{, PM\dag|hyperpage}
\TagName{Yamamoto, Isoroku}{|hyperpage}
\TagName{Yoshida}[Shigeru]{, PM|hyperpage}
\TagName[Albert]{Einstein}{|hyperpage}
\TagName[M.T.]{Cicero}{|hyperpage}
\TagName{Confucius}{|hyperpage}
\TagName{Charles, the Bald}{, emperor|hyperpage}
\TagName[George S.]{Patton, Jr.}{|hyperpage}
\TagName{Francis, I}{, king|hyperpage}
\TagName{Demetrius, I Soter}{, king|hyperpage}
\TagName{Sun, Yat-sen}{, president|hyperpage}
\TagName{Plato}{|hyperpage}
\TagName{Henry}[VIII]{, king|hyperpage}
\TagName{Henry, VIII}{, king|hyperpage}
\TagName{Ptolemy I}[Soter]{, king|hyperpage}
\TagName{Mao}[Tse-tung]{, chairman|hyperpage}
\TagName[Walter]{de la Mare}{|hyperpage}
\TagName[Johann Wolfgang von]{Goethe}{|hyperpage}
\TagName[Adolf]{Harnack}{|hyperpage}
\TagName{Antiochus, IV}{ Epi\-phanes, king|hyperpage}
\TagName{Chiang}[Kai-shek]{, president|hyperpage}
\TagName{Louis, XIV}{, king|hyperpage}
\TagName{Leo, I}{, pope|hyperpage}
\TagName{Gregory, I}{, pope|hyperpage}
\TagName[John]{Smith}{*|hyperpage}
\TagName[J.Q.]{Public}{*|hyperpage}
\TagName[James Earl]{Carter, Jr.}{, president|hyperpage}
\TagName{Jean, sans Peur}{, duke|hyperpage}
\PretagName[E.\,B.]{White}{White, E. B.}
\TagName[E.\,B.]{White}{|hyperpage}
\TagName{Anaximander}{|hyperpage}
\TagName{Arai, Akino}{|hyperpage}
\TagName{Boris, the Animal}{*|hyperpage}
\TagName[Rudolph]{Carnap}{|hyperpage}
\TagName[Patrick]{Cousot}{|hyperpage}
\TagName[Marc van]{Dongen}{|hyperpage}
\TagName[W.E.B.]{Du Bois}{|hyperpage}
\TagName[Charles]{du Fresne}{|hyperpage}
\TagName[George]{Eliot}{|hyperpage}
\TagName[Louis]{Gossett, Jr.}{|hyperpage}
\TagName[Enrico]{Gregorio}{|hyperpage}
\TagName[Oskar]{Hammerstein, II}{|hyperpage}
\TagName[Lafcadio]{Hearn}{|hyperpage}
\TagName[Bob]{Hope}{|hyperpage}
\TagName{Ishida}[Yoko]{|hyperpage}
\TagName{John, Eriugena}{|hyperpage}
\TagName[Yoko]{Kanno}{\dag|hyperpage}
\TagName[Martin Luther]{King, Jr.}{|hyperpage}
\TagName[The Amazing]{Kreskin}{|hyperpage}
\TagName{Lao-tzu}{|hyperpage}
\TagName[Uwe]{Lueck}{|hyperpage}
\TagName[Dan]{Luecking}{|hyperpage}
\TagName{Maimonides}{|hyperpage}
\TagName[Nicolas]{Malebranche}{|hyperpage}
\TagName[J.S.]{Mill}{|hyperpage}
\TagName[Aiko]{Nakano}{\dag|hyperpage}
\TagName{Nogawa}[Sakura]{|hyperpage}
\TagName[Heiko]{Oberdiek}{|hyperpage}
\TagName{Rambam}{|hyperpage}
\TagName[Robert]{Schlicht}{|hyperpage}
\TagName{Shikata, Akiko}{|hyperpage}
\TagName[Rudolph]{Snel van Royen}{|hyperpage}
\TagName[Willebrord]{Snel van Royen}{|hyperpage}
\TagName[Philipp]{Stephani}{|hyperpage}
\TagName[John]{Strietelmeier}{|hyperpage}
\TagName[Johann]{Bier\-mann}{*|hyperpage}
\TagName[Chesley B.]{Sullenberger, III}{|hyperpage}
\TagName{Thomas, Aquinas}{|hyperpage}
\TagName[Mark]{Twain}{|hyperpage}
\TagName[Mike]{Tyson}{|hyperpage}
\TagName{Vlad II, Dracul}{|hyperpage}
\TagName{Vlad III, Dracula}{|hyperpage}
\TagName{Voltaire}{|hyperpage}
\TagName{Yohko}{|hyperpage}
\TagName[Johann]{Andreä}{|hyperpage}
\PretagName{Æthelred, II}{Aethelred 2}
\TagName{Æthelred, II}{, king|hyperpage}
\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan}
\TagName[Jan]{Łukasiewicz}{|hyperpage}
\PretagName{Vlad, Ţepeş}{Vlad Tepes}
\TagName[Patrick]{Cousot}{|hyperpage}
\PretagName[Greta]{\textsc{Garbo}}{Garbo, Greta}
\TagName[Greta]{\textsc{Garbo}}{|hyperpage}
\PretagName[Thurston]{\textsc{Howell},\textsc{III}}{Howell, Thurston 3}
\TagName[Thurston]{\textsc{Howell},\textsc{III}}{*|hyperpage}
\PretagName{\uppercase{Fukuyama}, Takeshi}{Fukuyama, T}
\TagName{\uppercase{Fukuyama}, Takeshi}{|hyperpage}
\PretagName{Thomas, à~Kempis}{Thomas a Kempis}
\TagName{Thomas, à~Kempis}{|hyperpage}
\TagName[Clive Staples]{Lewis}{|hyperpage}
\PretagName[Heinz]{\textsc{Rühmann}}{Ruehmann, Heinz}
\TagName[Heinz]{\textsc{Rühmann}}{|hyperpage}
\PretagName[Heinrich Wilhelm]{\textsc{Rühmann}}{Ruehmann, Heinrich Wilhelm}
\TagName{William, I}{|hyperpage}
\TagName[Charlie]{Chaplin}{|hyperpage}
\TagName[John Maynard]{Keynes}{|hyperpage}
\PretagName{Atatürk}{Ataturk}
\TagName[Mustafa]{Kemal}{|hyperpage}
\PretagName[Catherine]{\textsc{de'~Medici}}{de Medici, Catherine}
\TagName[Catherine]{\textsc{de'~Medici}}{|hyperpage}
\PretagName[John Quincy]{\noexpand\DoFormat{Adams}}{Adams, John Quincy}
\TagName[John Quincy]{\noexpand\DoFormat{Adams}}{, president|hyperpage}
\PretagName{\noexpand\DoFormat{Æþelstan}}{Aethelstan}
\TagName{\noexpand\DoFormat{Æþelstan}}{, king|hyperpage}
\PretagName{\noexpand\DoFormat{Charles}, I}{Charles 1}
\TagName{\noexpand\DoFormat{Charles}, I}{, king|hyperpage}
\PretagName{\noexpand\DoFormat{Cao}, Cao}{Cao Cao}
\TagName{\noexpand\DoFormat{Cao}, Cao}{|hyperpage}
\PretagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{Rockefeller, John David, III}
\TagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{|hyperpage}
\PretagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{Davis, Sammy, Jr.}
\TagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{|hyperpage}
\PretagName{\noexpand\DoFormat{Mengde}}{Mengde}
\IndexActual{=}
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{3321}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v0.7}{2011/12/26}{Initial release}
% \changes{v0.8}{2012/01/29}{Add features, bugfixes}
% \changes{v0.85}{2012/02/05}{Add package options}
% \changes{v0.86}{2012/02/06}{Fix regressions}
% \changes{v0.9}{2012/02/10}{Add first name formatting; affix handling expandable}
% \changes{v0.94}{2012/02/15}{Add index suppression, error checking, name particle caps}
% \changes{v0.95}{2012/02/17}{Bugfixes}
% \changes{v0.96}{2012/02/19}{Bugfixes}
% \changes{v1.0}{2012/02/20}{Works fully with \textsf{microtype} and \textsf{memoir}}
% \changes{v1.1}{2012/03/08}{Bugfixes}
% \changes{v1.4}{2012/07/24}{Add features, bugfixes}
% \changes{v1.5}{2013/02/22}{Add features, bugfixes, options}
% \changes{v1.6}{2013/03/10}{Add |nameauth| environment}
% \changes{v1.7}{2013/04/02}{Fix options processing}
% \changes{v1.8}{2013/09/19}{Update docs}
% \changes{v1.9}{2015/07/09}{Better Eastern name support; fix |nameauth| bugs, global un-tagging}
% \changes{v2.0}{2015/11/11}{Use dtxgen template instead of dtxtut; update docs}
% \changes{v2.1}{2015/11/24}{Isolate Unicode issues}
% \changes{v2.2}{2015/12/01}{Add interface hooks and docs; fix bugs}
% \changes{v2.3}{2016/01/05}{Improve docs and hooks; add features}
% \changes{v2.4}{2016/03/15}{Add text tagging features, add generic hooks, and prevent recursion}
% \changes{v2.41}{2016/03/17}{Instantiate token registers only once}
% \changes{v2.42}{2016/03/18}{Do not use \cmd{\cmd} in section headings}
% \changes{v2.5}{2016/04/06}{More examples; no default formatting}
% \GetFileInfo{\jobname.dtx}
% \DoNotIndex{\@empty, \@gobble, \@period, \@token, \trim@spaces, \zap@space}
% \DoNotIndex{\begingroup, \bfseries, \bgroup, \csdef, \csgdef, \csname, \csundef, \DeclareOption, \def, \detokenize, \edef, \egroup, \else, \endcsname, \endgroup, \endinput, \ExecuteOptions, \expandafter, \fi, \futurelet, \global, \hbox, \if, \ifcsname, \ifx, \ignorespaces, \index, \itshape, \leavevmode, \let, \newcommand, \newcommandx, \newenvironment, \newif, \nobreakspace, \PackageError, \PackageWarning, \ProcessOptions, \relax, \renewcommand, \RequirePackage, \scshape, \space, \textbackslash, \uppercase}
%
% \newif\ifSC
% \SCtrue
% \def\DoFormat#1{\ifSC\textsc{#1}\else#1\fi}
%
%\title{\textsf{nameauth} --- Name authority mechanism for consistency in text and index\thanks{This file
%   describes version \fileversion, last revised \filedate.}
%}
%\author{Charles P. Schaum\thanks{E-mail: charles dot schaum at comcast dot net}}
%\date{Released \filedate}
%
%\maketitle
% 
% \begin{abstract}
% \noindent The \textsf{nameauth} package automates the formatting and indexing of names. This aids the use of a \textbf{name authority} and the process of textual reordering and revision without needing to retype name references.
% \end{abstract}
%
% {\small\tableofcontents}
% \setlength{\parskip}{0.15\baselineskip plus .15\baselineskip minus .15\baselineskip}
%
% \section{Introduction}
%
% \subsection{Summary Overview}
%
% When publications use hundreds of names, it takes time and money to check them. This package automates much of that work:
% \begin{itemize}
% \item \textbf{Context} determines name forms unless otherwise modified.
% \item The macros \textbf{reduce retyping of names} when editing a document.
% \item You can implement a \textbf{name authority}, a master list of names that permits known name variants.
% \item \textbf{Consistent index entries} work with these variants.
% \item Some \textbf{cross-cultural naming conventions} are possible.
% \item \textbf{index automatic sort keys and tags} aid cross-cultural work.
% \end{itemize}
%
% This package grew from generalized needs for translating old German and Latin texts. Design principles include:
% \begin{enumerate}\small
% \item Format and vary name forms according to standard syntax in the body text, independent of the index, following English standards:
% \begin{itemize}[noitemsep]
%   \item Default to long name references first, then shorter ones.
%   \item Use alternate names only in the body text, not the index.
%   \item Perform name caps and reversing only in the body text.
% \end{itemize}
% \item Post-process names only in the body text. Reflect English conventions by default, but only \emph{after} syntactic formatting is complete.
% \item Enable Continental and non-English standards through modularized post-processing, whose English-standard defaults may be bypassed and modified (Sections~\ref{sec:accents}, \ref{sec:formatting}, \ref{sec:IndexSort}, and~\ref{sec:Hooksc}).
% \item Reduce keystrokes while accommodating the broadest set of names.
% \end{enumerate}
%
% \subsection{Milestone Changes}
%
% With version 2.5 the \textsf{nameauth} package turns a corner to a new period of cross-cultural use. No formatting is selected by default. Now you can have one format for first uses of names in the main matter, another for first uses in the front matter, and one each for subsequent uses in the main and front matter. This allows for greater customization, depending on individual needs.
%
% \subsection{Technical Notes}
% This manual performs something of a ``torture test'' on this package. You might want to avoid doing that if you are a beginner. It is designed to be compatible with A4 and US letter. Macro references are minimized for a ``clean'' index, showing how \textsf{nameauth} handles indexing.
%
% \textsf{Nameauth} depends on \textsf{etoolbox}, \textsf{ifxetex}, \textsf{ifluatex}, \textsf{suffix}, \textsf{trimspaces}, and \textsf{xargs}. It was tested with \texttt{latex,} \texttt{lualatex,} \texttt{pdflatex,} and \texttt{xelatex,} along with \texttt{makeindex} and \texttt{texindy.} This manual was typeset with \ifxetex\texttt{xelatex}\else\ifluatex\ifpdf\texttt{lualatex} in \texttt{pdf} mode\else\texttt{lualatex} in \texttt{dvi} mode\fi\else\ifpdf\texttt{pdflatex}\else\texttt{latex}\fi\fi\fi{} using \texttt{makeindex} and \texttt{gind.ist.}
%
% Indexing generally conforms to the standard in Nancy C. Mulvany, \emph{Indexing Books} (Chicago: University of Chicago Press, 1994). This should be suitable for a very wide application across a number of disciplines. 
%
% \subsection{Thanks}
%
% Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, \Name[Uwe]{Lueck}, and \Name[Robert]{Schlicht} for their assistance in the early versions of this package.
%
%
% \subsection{Disclaimer}
%
% This documentation uses names of living and historical figures because users refer to real people. At no time do I intend any disrespect or statement of bias regarding any particular person, culture, or tradition. All names are used only for teaching purposes.
%\clearpage
%
% \subsection{What's In A Name?}
% \label{sec:NameTypes}
%
% Name forms are ambiguous apart from historical and cultural contexts. The \textsf{nameauth} package helps you encode names from as many contexts as possible. In this manual we refer to three classes of names, shown below. Professional writing often calls for the full form of a person's name to be used in its first occurrence, with shorter forms used thereafter. This package adapts that principle to the classes of names below.
%
%  In each class there is a required ``surnames'' argument, \meta{SNN}. This can be a Western surname, an Eastern family name, or the personal name of an ancient, medieval, or royal person.\footnote{Some professional literature speaks of forenames and optional surnames. See Mulvany, \emph{Indexing Books}, pages 152--82, which I used as a guide along with the \emph{Chicago Manual of Style}. That approach does not work in \LaTeX, where we use optional forenames for the same effect.}
% Other naming systems can be adapted to these categories, \emph{e.g.}, Icelandic, Hungarian, etc.
%
%\begin{enumerate}[noitemsep]
%\item Western name:\\[1ex]
%\begin{tikzpicture}[line/.style={draw,thick}]\normalsize
%  \node [matrix] (macro) at (0,1)
%  {
%    \node(space){\qquad\qquad\qquad}; &
%    \node(arg1){\strut\textbf{Forename(s)}}; &
%    \node(arg2){\strut\textbf{Surname(s)}}; &
%    \node(arg3){\strut\textbf{Sobriquet, etc.}};\\
%  };
%  \node [matrix,column sep=1em] (tipsii) at (1,-2)
%  {
%    \node[align=left](a1)
%    {
%      Personal name(s):\\
%      \textit{baptismal name}\\
%      \textit{Christian name}\\
%      \textit{first and middle}\\\quad\textit{names}\\
%      \textit{praenomen}
%    }; &
%    \node[align=left](a2)
%    {
%      Family designator:\\
%      \textit{father's family}\\
%      \textit{mother's family}\\
%      \textit{ancestor}\\
%      \textit{occupation}\\
%      \textit{place of origin}\\
%      \textit{territory}\\
%      \textit{nomen/cognomen}\\
%      \textit{patronym}
%    }; &
%    \node[align=left](a3)
%    {
%      Sobriquet / title:\\
%      \textit{senior, junior, III\dots}\\
%      \textit{notable feature}\\
%      \textit{notable attribute}\\
%      \textit{place of origin}\\
%      \textit{territory}\\
%      \textit{agnomen}
%    }; \\
%  };
%  \begin{scope}[every path/.style=line]
%    \path (arg1) -- (a1);
%    \path (arg2) -- (a2);
%    \path (arg3) -- (a3);
%  \end{scope}
%\end{tikzpicture}
%\item Eastern name:\\[1ex]
%\begin{tikzpicture}[line/.style={draw,thick}]\normalsize
%  \node [matrix] (macro) at (0,1)
%  {
%    \node(spacei){\qquad\qquad\qquad}; &
%    \node(arg1){\strut\textbf{Family name}}; &
%    \node(spaceii){\qquad}; &
%    \node(arg2){\strut\textbf{Given name}};\\
%  };
%  \node [matrix,column sep=1cm] (tipsii) at (2,-1)
%  {
%    \node[align=left](a1)
%    {
%      Family\\ designator
%    }; &
%    \node[align=left](a2)
%    {
%      (Multiple names are rare, but multi-\\character names do exist.)
%    };\\
%  };
%  \begin{scope}[every path/.style=line]
%    \path (arg1) -- (a1);
%    \path (arg2) -- (a2);
%  \end{scope}
%\end{tikzpicture}
%\item Ancient name:\\[1ex]
%\begin{tikzpicture}[line/.style={draw,thick}]\normalsize
%  \node [matrix] (macro) at (0,1)
%  {
%    \node(spacei){\qquad\qquad\qquad}; &
%    \node(arg1){\strut\textbf{Given name}}; &
%    \node(spaceii){\qquad}; &
%    \node(arg2){\strut\textbf{Sobriquet, etc.}};\\
%  };
%  \node [matrix,column sep=2.2cm] (tipsii) at (1.5,-1.5)
%  {
%    \node[align=left](a1)
%    {
%      Personal\\ name
%    }; &
%    \node[align=left](a2)
%    {
%      Sobriquet / title:\\
%      \textit{senior, junior, III\dots}\\
%      \textit{notable feature}\\
%      \textit{notable attribute}\\
%      \textit{place of origin}\\
%      \textit{territory}
%    }; \\
%  };
%  \begin{scope}[every path/.style=line]
%    \path (arg1) -- (a1);
%    \path (arg2) -- (a2);
%  \end{scope}
%\end{tikzpicture}
%\end{enumerate}
%
% Another way to think about these classes of names is to pretend that you know \emph{nothing at all} about names. How would you make sense out of the following?
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{lll}\toprule
% Longer Name & Shorter Name & Indexed Name\\\midrule
% \Wash & \Wash\ForgetName[George]{Washington} & Washington, George\\
% \JRII & \JRII\ForgetName[John David]{Rockefeller, II} & Rockefeller, John David, II\\
% \Name*[Clive Staples]{Lewis} & \LLewis & Lewis, Clive Staples\\
% \Name*[Clive Staples]{Lewis} & \LJack\ForgetName[Clive Staples]{Lewis} & Lewis, Clive Staples\\
% \Yamt & \Yamt\ForgetName{Yamamoto, Isoroku} & Yamamoto Isoroku\\
% \Aris & \Aris\ForgetName{Aristotle} & Aristotle\\
% \Eliz & \Eliz\ForgetName{Elizabeth, I} & Elizabeth I\\
% \Attil & \Attil\ForgetName{Attila, the Hun} & Attila the Hun\\\bottomrule
% \end{tabular}
% \end{quote}
%
% The position of a name alone does not reveal whether it is a personal name or a family name. Nevertheless, if you notice a few consistent relationships, that will help you work out how the \textsf{nameauth} package encodes names:
% \begin{enumerate}\small
% \item The long form of a name corresponds with the reordered indexed form. That means the long forms of names must be the macro arguments.
% \item All Western index forms have surname(s) first, followed by a comma, then the forename(s), then a comma if needed, then the affix if it exists. That means Western names handle suffixes and name ordering differently than other names.
% \item All Western name forms have both forename(s) and surname(s). The forename(s) can change/drop in the text, but not in the index. That means the presence of an optional forename denotes a Western name instead of another name form.
% \item Eastern name forms \meta{Surname(s)} \meta{Forename(s)}, with royal and ancient name forms \meta{Name(s)} \meta{Affix}, should not have commas in their index entries. The forename(s) and affixes cannot change (in this package), but they can drop in the text, but not the index. All these name forms basically work the same, except that an ancient or medieval personal name has the same position that an Eastern family name has. Their arguments, therefore, have much the same syntax.
% \end{enumerate}
%
% All this being said, the publisher's way of handling things may trump the (arguably) canonical way. This package allows some ``borderline'' options and name forms to accommodate that.\footnote{Some publishers not only use commas with Eastern forms in the index, but sometimes the forms are just wrong. For example, one sees \Name{Sun, Yat-sen}\ForgetName{Sun, Yat-sen} indexed as ``Yat-sen, Sun'' (instead of either ``Sun, Yat-sen'' or ``Sun Yat-sen'') in Immanuel Geiss, \emph{Personen: Die biographische Dimension der Weltgeschichte}, Geschichte Griffbereit vol. 2 (Munich: Wissen Media Verlag, 2002), 720. The six-volume series is otherwise a helpful resource.}
% The most prominent example includes the ``non-native'' Eastern names discussed in Sections~\ref{sec:options} and~\ref{sec:Eastern}.
% \clearpage
% \section{Usage}
%
% \subsection{Package Options}
% \label{sec:options}
%
% |\usepackage[|\meta{$option_1$}|,|\meta{$option_2$}|,|\dots|]{nameauth}|\medskip
%
% \noindent From the user's perspective these options proceed from the most general to more specific details. Package options address the following:
% \begin{enumerate}[noitemsep]
% \item Enable or disable features (formatting, indexing, index sorting) 
% \item Affect the syntax of names (commas, capitalization, and reversing)
% \item Typographic display of names (formatted or not, and how)
% \end{enumerate}
%
% \noindent\begin{tabular}{p{0.97\textwidth}}\toprule\hfil\bfseries Default options are in boldface.\hfil\\\bottomrule\end{tabular}
%
% \begin{center}\Large\bfseries Choose Features\end{center}
%
% \noindent{\large\bfseries Choose Formatting}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{mainmatter} & \bfseries Start with ``main-matter names'' and formatting hooks (see page ~\pageref{page:PostProcess}).\\[1ex]
% \quad\texttt{frontmatter} & Start with ``front-matter names'' and hooks.\\[1ex]
% \quad\texttt{alwaysformat} & Use only respective ``first use'' formatting hooks.\\[1ex]
% \quad\texttt{formatAKA} & Format names declared by \cmd{\AKA} like other main- and front-matter names.\\[2ex]
% \end{tabular}\\
% The default |mainmatter| option and the |frontmatter| option enable two different systems of formatting and first/subsequent use. \cmd{\NamesActive} starts the main matter system when |frontmatter| is used. See Section~\ref{sec:FrontFormat}.
%
% The \texttt{alwaysformat} option disables ``subsequent use'' hooks globally. Using \texttt{formatAKA} lets \cmd{\AKA} use ``first-use'' hooks for one time and ``subsequent-use'' hooks thereafter, without needing \texttt{alwaysformat.}\bigskip
%
% \noindent{\large\bfseries Enable/Disable Indexing}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{index} & \bfseries Create index entries in place with names.\\[1ex]
% \quad\texttt{noindex} & Suppress indexing of names.\\[2ex]
% \end{tabular}\\
% The default |index| option enables name indexing right away. The |noindex| option disables the indexing of names until \cmd{\IndexActive} enables it. That can affect the use of index tags. This applies only to naming and indexing macros in the \textsf{nameauth} package. See Section~\ref{sec:SectionIndex}.\bigskip
%
% \noindent{\large\bfseries Enable/Disable Index Sorting}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{pretag} & \bfseries Create sort keys used with \texttt{makeindex}.\\[1ex]
% \quad\texttt{nopretag} & Do not create sort keys. \\[2ex]
% \end{tabular}\\
% The default allows \cmd{\PretagName} to create sort keys used in \texttt{makeindex} / \texttt{texindy}. Seldom would one change this option. See Section~\ref{sec:IndexSort}.\clearpage
%
% \begin{center}\Large\bfseries Affect the Syntax of Names\end{center}
%
%\noindent{\large\bfseries Show/Hide Affix Commas}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{nocomma} & \bfseries Suppress commas between surnames and affixes, following the \emph{Chicago Manual of Style} and other conventions.\\[1ex]
% \quad\texttt{comma} & Retain commas between surnames and affixes.\\[2ex]
% \end{tabular}\\
% This option is set at load time. If you use \emph{modern standards} or Eastern names, choose the default |nocomma| option to get, \emph{e.g.}, \Name[James Earl]{Carter, Jr.}.
%
% If you need to adopt \emph{older standards} that use commas between surnames and affixes, you have two choices:
% \begin{enumerate}
% \item The \texttt{comma} option produces, \emph{e.g.}, \ForgetName[James Earl]{Carter, Jr.}\ShowComma\Name[James Earl]{Carter, Jr.}. Yet it limits the use of macros like \cmd{\AKA} and \cmd{\PName} and it prevents the use of Eastern and ancient names with the new syntax.\footnote{Before version 0.9 the \textsf{nameauth} package assumed the \texttt{comma} option by default and used the old syntax to encode names. Newer versions are backward-compatible.}
% \item Section~\ref{sec:Affix} shows how one can use \cmd{\ShowComma} with the |nocomma| option to get similar results, but with more flexibility.
% \end{enumerate}\medskip
%
% \noindent{\large\bfseries Capitalize Entire Surnames}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{normalcaps} & \bfseries Do not perform any special capitalization.\\[1ex]
% \quad\texttt{allcaps} & Capitalize entire surnames, such as romanized Eastern names.\\[2ex]
% \end{tabular}\\
% This only affects names printed in the body text. One of the design principles of this package keeps it consistent with English typography and syntax. Thus no syntactic or typographic changes are propagated into the index by default.
%
% Still, you can use this package with different conventions that involve both syntax and formatting. You can type in capitalized family names directly to get that effect. See also Section~\ref{sec:formatting} on how to use macros to get caps (\cmd{\uppercase}) or small caps (\cmd{\textsc}) in both the body text and the index. This becomes easy with the simplified interface.
%
% Section~\ref{sec:Eastern} deals with capitalization on a section-level and per-name basis.\bigskip
%
% \noindent{\large\bfseries Reverse Name Order}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\bfseries\texttt{notreversed} & \bfseries Print names in the order specified by \cmd{\Name} and the other macros.\\[1ex]
% \quad\texttt{allreversed} & Print all name forms in ``smart'' reverse order.\\[1ex]
% \quad\texttt{allrevcomma} & Print all names in ``Surname, Forenames'' order, meant for Western names.\\[2ex]
% \end{tabular}\\
% See Section~\ref{sec:Eastern} for related macros to control name reversing by section or by name. This also affects how Eastern names will appear in the index.
%
% So-called ``last-comma-first'' lists of names via \texttt{allrevcomma} (Section~\ref{sec:LastFirst}) are \emph{not} the same as the \texttt{comma} option. They are designed for Western names.\clearpage
%
% \begin{center}\Large\bfseries Name Post-Processing\end{center}
% \label{page:PostProcess}
%
% Sections~\ref{sec:CustomHooks}, \ref{sec:formatting}, and~\ref{sec:Hooksa}ff. explain this topic in greater detail. Post-processing follows syntactic formatting and does not affect the index.\footnote{This package was designed with type hierarchies in mind, although it has become more flexible. See Robert Bringhurst, \emph{The Elements of Typographic Style}, version 3.2 (Point Roberts, Washington: Hartley \& Marks, 2008), 53--60.}
%
% As of version 2.4, ``typographic formatting'' has become a generalized concept of ``name post-processing'' via these hook macros:
% \begin{itemize}
% \item \cmd{\NamesFormat} formats first uses of main-matter names.
% \item \cmd{\MainNameHook} formats subsequent uses of main-matter names.
% \item \cmd{\FrontNamesFormat} formats first uses of front-matter names.
% \item \cmd{\FrontNameHook} formats subsequent uses of front-matter names.
% \end{itemize}
%
% Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. offer substantially more complex possibilities for such hooks.\footnote{I drew some inspiration from the typography in Bernhard Lohse, \emph{Luthers Theologie} (G\"ottingen: Vandenhoeck \& Ruprecht, 1995) and the five-volume series by Jaroslav J. Pelikan Jr., The Christian Tradition: A History of the Development of Doctrine (Chicago: Chicago UP, 1971--89). Each volume in the series has its own title.}
% By default, they do nothing.
%
% English typography has been the default design choice for this package. Still, one can use German, French, and similar standards, which I group as ``Continental.'' Sections~\ref{sec:formatting} and~\ref{sec:Hooksc} have more on the topic, as well as the use of sort tags in Section~\ref{sec:IndexSort}. Continental standards format surnames only, both in the text and in the index. This conflicts with some deliberately ambiguous name forms in \textsf{nameauth}.\footnote{Ancient, Eastern, and suffixed name forms have the same pattern.}
% To get formatting in the index one must add it in the macro arguments. The simplified interface aids this process. Continental users also may lose some capitalization features; see Section~\ref{sec:standards}.\bigskip
%
% \noindent{\large\bfseries Formatting Attributes}\\[2ex]
% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}}
% \quad\texttt{smallcaps} & Set the first use of an entire name in small caps.\\[1ex]
% \quad\texttt{italic} & Set the first use of an entire name in italic.\\[1ex]
% \quad\texttt{boldface} & Set the first use of an entire name in boldface.\\[1ex]
% \quad\bfseries\texttt{noformat} & \bfseries Do not define a default format.\\[2ex]
% \end{tabular}\\
% The options that assign a font change are intended for ``quick'' solutions based on English typography. They change only \cmd{\NamesFormat}, the macro that formats first instances of names in the main matter.\\
%
% \noindent\begin{tabular}{p{0.97\textwidth}}\toprule\hfil\bfseries Versions 2.5 and onward assign no default formatting to names.\hfil\\\bottomrule\end{tabular}\bigskip
%
% Many users will not be affected by these changes because many prefer the |noformat| option. If you did use the default option in the past, you can recover that behavior with the |smallcaps| option.
% \clearpage
%
% \subsection{Quick Start Guide}
% \label{sec:start}
%
%\subsubsection{Main Interface}
% See Section~\ref{sec:Naming} for a proper description of \cmd{\Name}. Here we see briefly how to work with the classes of names in Section~\ref{sec:NameTypes}. We abbreviate the macro arguments \meta{forename(s)} with \meta{FNN} and \meta{surname(s)} with \meta{SNN}. Use the |nocomma| option especially when using Eastern names and ancient names.\bigskip
%
% \noindent{\large\bfseries Western Names}
% \begin{quote}
% \begin{tikzpicture}[line/.style={draw,thick}]
%   \node [matrix,column sep=2.5cm] (tipsi) at (1.5,2.5)
%   {
%     \node(opt){\small Add to force full name.}; &
%     \node[text width=3.5cm,align=left](grp){\small Add only if text in brackets |[ ]| follows.}; \\
%   };
%   \node [matrix] (macro) at (1.1,1)
%   {
%     \node(cmd){\bfseries\cmd{\Name}}; &
%     \node(star){\bfseries\texttt{*}}; &
%     \node(arg1){\bfseries\bfseries\oarg{FNN}}; &
%     \node(arg2){\bfseries\bfseries\marg{SNN}}; &
%     \node(arg3){\bfseries\oarg{Alternate names}}; &
%     \node(braces){\bfseries|{}|}; \\
%   };
%   \node [matrix,column sep=1em] (tipsii) at (1,-1)
%   {
%     \node[align=center](a1)
%     {
%       Forename(s)\\used in index
%     }; & & &
%     \node[align=center](a2)
%     {
%       Surname(s)\\Surname(s)|,| affix\\``required name''
%     }; & &
%     \node[align=center](a3)
%     {
%       \meta{empty}\\Nickname(s)\\Full forenames, etc.
%     }; \\
%   };
%   \begin{scope}[every path/.style=line]
%     \path (opt) -- (star);
%     \path (grp) -- (braces);
%     \path (arg1) -- (a1);
%     \path (arg2) -- (a2);
%     \path (arg3) -- (a3);
%   \end{scope}
% \end{tikzpicture}\\
% Usual forms:\\[2ex]\small
% \cmd{\Name}\oarg{FNN}\marg{SNN}\hfill|\Name[George]{Washington}|\IndexName[George]{Washington}\\[1ex]
% \cmd{\Name}\oarg{FNN}\marg{SNN|,| affix}\hfill|\Name[John David]{Rockefeller, II}|\IndexName[John David]{Rockefeller, II}\\[2ex]
% You must include the \meta{FNN} field with alternate forenames. The \meta{Alternate names} are swapped with the \meta{FNN}, but only in the body text:\\[1ex]
% \cmd{\Name}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\\\hbox{}\hfill |\Name[Bob]{Hope}[Leslie Townes]|\IndexName[Bob]{Hope}\\\hbox{}\hfill |\Name[Clive Staples]{Lewis}[C.S.]|\IndexName[Clive Staples]{Lewis}\\[1ex]
% \cmd{\Name}\oarg{FNN}\marg{SNN|,| affix}\oarg{Alternate names}\\\hbox{}\hfill |\Name[John David]{Rockefeller, IV}[Jay]|\IndexName[John David]{Rockefeller, IV}\\[2ex]\normalsize
% The older syntax is \cmd{\Name}\marg{SNN}\oarg{affix}. See Section~\ref{sec:obsolete} for its usage and its shortcomings. It remains for backward compatibility.
% \end{quote}\medskip
%
% \noindent{\large\bfseries Eastern Names in the Text, Western-style Index}
% \begin{quote}
% \begin{tikzpicture}[line/.style={draw,thick}]
%   \node [matrix,column sep=1.5cm] (tipsi) at (0.5,2)
%   {
%     \node(opt){\small Add to force full name.}; &
%     \node[text width=3.5cm,align=left](grp){\small Add only if text in brackets |[ ]| follows.}; \\
%   };
%   \node [matrix] (macro) at (0,1)
%   {
%     \node(cmd){\bfseries\cmd{\Name}}; &
%     \node(star){\bfseries\texttt{*}}; &
%     \node(arg1){\bfseries\oarg{FNN}}; &
%     \node(arg2){\bfseries\marg{SNN}}; &
%     \node(braces){\bfseries|{}|}; \\
%   };
%   \node [matrix] (tipsii) at (0.5,0)
%   {
%     \node(a1)
%     {
%       \quad Given name
%     }; &
%     \node(a2)
%     {
%       \quad Family name
%     }; \\
%   };
%   \begin{scope}[every path/.style=line]
%     \path (opt) -- (star);
%     \path (grp) -- (braces);
%     \path (arg1) -- (a1);
%     \path (arg2) -- (a2);
%   \end{scope}
% \end{tikzpicture}\\
% Technically, these are Western name forms without affixes. The reversing macros (Section~\ref{sec:Eastern}) cause them to display in Eastern order in the body text only. The index entries are Western in fashion: \meta{SNN}, \meta{FNN}. This ``non-native'' form of Eastern names excludes both comma-delimited forms and the old syntax.
% \end{quote}
% \clearpage
%
% \noindent{\large\bfseries Eastern Names in the Text, Eastern-style Index}
% \begin{quote}
% \begin{tikzpicture}[line/.style={draw,thick}]
%   \node [matrix,column sep=1cm] (tipsi) at (0.5,2)
%   {
%     \node(opt){\small Add to force full name.}; &
%     \node[text width=3.5cm,align=left](grp){\small Add only if text in brackets |[ ]| follows.}; \\
%   };
%   \node [matrix] (macro) at (0,1)
%   {
%     \node(cmd){\bfseries\cmd{\Name}}; &
%     \node(star){\bfseries\texttt{*}}; &
%     \node(arg1){\bfseries\marg{SNN, FNN}}; &
%     \node(braces){\bfseries|{}|}; \\
%   };
%   \node [matrix,column sep=1em] (tipsii) at (0.5,0)
%   {
%     \node(a1)
%     {
%       \quad Family name
%     }; &
%     \node(a2)
%     {
%       \quad Given name
%     }; \\
%   };
%   \begin{scope}[every path/.style=line]
%     \path (opt) -- (star);
%     \path (grp) -- (braces);
%     \path (arg1) -- (a1);
%     \path (arg1) -- (a2);
%   \end{scope}
% \end{tikzpicture}\\
% Usual form:\\[2ex]\small
% \cmd{\Name}\marg{SNN, FNN}\hfill|\Name{Yamamoto, Isoroku}|\IndexName{Yamamoto, Isoroku}\\[2ex]
% These names truly are Eastern names. They take the form \meta{SNN FNN} in the index even if the reversing macros (Section~\ref{sec:Eastern}) put the names in Western order in the body text. We call this the ``native'' Eastern form.\\[2ex]\normalsize
% The old form of Eastern names is \cmd{\Name}\marg{SNN}\oarg{FNN}. Again, this is retained only for backward compatibility. Cf. Section~\ref{sec:obsolete}.
% \end{quote}\medskip
%
% \noindent{\large\bfseries Ancient Names}
% \begin{quote}
% \begin{tikzpicture}[line/.style={draw,thick}]
%   \node [matrix,column sep=1em] (tipsi) at (2,2)
%   {
%     \node(opt){\quad\small Add to force full name.}; &
%     \node[text width=2.6cm,align=left](a1){\small Mononym\hfil\break Mononym, affix}; &
%     \node[text width=3.3cm,align=left](grp){\small Add only if text in brackets |[ ]| follows.}; \\
%   };
%   \node [matrix] (macro) at (1,1)
%   {
%     \node(cmd){\bfseries\cmd{\Name}}; &
%     \node(star){\bfseries\texttt{*}}; &
%     \node(arg1){\bfseries\marg{SNN}};  &
%     \node(braces){\bfseries|{}|}; \\
%   };\\
%   \begin{scope}[every path/.style=line]
%     \path (opt) -- (star);
%     \path (grp) -- (braces);
%     \path (arg1) -- (a1);
%   \end{scope}
% \end{tikzpicture}
% Usual form:\\[2ex]\small
% \cmd{\Name}\marg{SNN}\hfill|\Name{Aristotle}|\IndexName{Aristotle}\\[1ex]
% \cmd{\Name}\marg{SNN, affix}\hfill|\Name{Elizabeth, I}|\IndexName{Elizabeth, I}\\
% \hbox{}\hfill|\Name{Attila, the Hun}|\IndexName{Attila, the Hun}\\[2ex]\normalsize
% These forms are used for royalty, ancient figures, and other monomyms with or without suffixes.\footnote{Technically, the native Eastern forms and the \meta{Mononym, affix} forms are identical, although used in different contexts. You would not wish to reverse a royal name, for example.}
% The older syntax takes the form \cmd{\Name}\marg{Mononym}\oarg{affix}. Cf. Section~\ref{sec:obsolete}.
% \end{quote}
%
% Many commands in the main interface are variants of a base pattern, where \meta{prefix macro} consist of one or more of \cmd{\CapThis,} \cmd{\CapName,} \cmd{\RevName,} \cmd{\RevComma,} \cmd{\ShowComma,} and \cmd{\KeepAffix:}
%
% \begin{center}\small\setstretch{1.1}
% \begin{tabular}{r@{\,}r@{}c@{\,}c@{ }l}\toprule
% \meta{prefix macro} & \cmd{\Name} & & \meta{arguments} \\
% \meta{prefix macro} & \cmd{\Name} & |*| & \meta{arguments} \\
% \meta{prefix macro} & \cmd{\FName} & & \meta{arguments} \\\midrule
% & \cmd{\IndexName} & & \meta{arguments} \\
% & \cmd{\ForgetName} & & \meta{arguments} \\
% & \cmd{\SubvertName} & & \meta{arguments} \\
% & \cmd{\PretagName} & & \meta{arguments} & \meta{sort key}\\
% & \cmd{\TagName} & & \meta{arguments} & \meta{tag}\\
% & \cmd{\UntagName} & & \meta{arguments} \\
% & \cmd{\ExcludeName} & & \meta{arguments} \\\bottomrule
% \end{tabular}
% \end{center}
% \clearpage
%
% \subsubsection{Simplefied Interface}
% \label{sec:simplestart}%
%
% \DescribeEnv{nameauth}
% The |nameauth| environment can replace \cmd{\Name,} \cmd{\Name*,} and \cmd{\FName} with shorthands. This aids consistency and brevity. Still, one must use all the other macros of the main interface. Both interfaces interoperate with each other.
%
% The simplified interface produces control sequences that are fully compatible with the main interface. Although not required, |nameauth| is best used in the document preamble to avoid undefined control sequences.\footnote{The |nameauth| environment uses \cmd{\ignorespaces} to mitigate the need for trailing \texttt{\%.}} The italicized comments at right are not part of the example proper, but are there for explanation. Macro fields have uniform widths only to help compare argument types.
%
% \begin{quote}\small\setstretch{1.2}
% |\begin{nameauth}|\\
% |  \<| \meta{cseq1} |&| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} |& >|\hfill\emph{Western}\footnote{This is also the form used with ``non-native'' Eastern names using reversing macros, but leaving them in Western form in the index.}\\
% |  \<| \meta{cseq2} |&| \meta{FNN} |&| \meta{SNN, affix} |& >|\hfill\emph{Western}\\
% |  \<| \meta{cseq3} |&| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} |&| \meta{Alt. names} |>|\hfill\emph{W. nickname}\footnote{When the \meta{Alt. names} is used, \meta{FNN} never appears in the body text, but only in the index. See Section \ref{sec:Fname} to avoid possible difficulties. You could use \cmd{\AKA} to create a \emph{see} reference for the \AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller} example on the next page; see Section~\ref{sec:AKA}.}\\
% |  \<| \meta{cseq4} |&| \meta{FNN} |&| \meta{SNN, affix} |&| \meta{Alt. names} |>|\hfill\emph{W. nickname}\\
% |  \<| \meta{cseq5} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} |& >|\hfill\emph{ancient/mono}\\
% |  \<| \meta{cseq6} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, affix} |& >|\hfill\emph{royal/ancient}\\
% |  \<| \meta{cseq7} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, FNN} |& >|\hfill\emph{Eastern}\footnote{``Native'' Eastern names can be reversed to use Western order in the body text, but they will always have an Eastern form in the index.}\\
% |  \<| \meta{cseq8} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} |&| \meta{FNN/affix} |>|\hfill\emph{old syntax}\footnote{This is the old syntax for Eastern and royal names.}\\
% |\end{nameauth}|
% \end{quote}
%
% Each \meta{cseq} creates three macros. In the document text, |\|\meta{cseq} itself works like \cmd{\Name}. |\L|\meta{cseq} (think ``Long'') works like \cmd{\Name*}. |\S|\meta{cseq} (think ``Short'') works like \cmd{\FName}. Please bear in mind the following guidelines:
%
% \begin{itemize}\small
% \item In this context, ``|\<|'' is an escape character and a control sequence. If you forget it or just use |<| without the backslash, you will get errors.
% \item There \emph{must} be four argument fields (three ampersands) per line. Leaving out an ampersand will cause an error. Think ``holy hand grenade of Antioch'' from \emph{Monty Python and the Holy Grail}.
% \item Leading and trailing spaces in each |&|-delimited field are stripped, as is also the case in the main interface.
% \item As in the main interface, medial spaces do not affect first-use control sequences, but they will affect name forms in the body text and index.
% \item In the document text, as with the main interface, include trailing braces |{|\,|}|, control spaces, or the like if text in brackets |[|\,|]| follows any of the shorthands, \emph{e.g.}, |\LWash{} [\emph{sic}].|
% \item The old syntax (Section~\ref{sec:obsolete}), triggered by an empty \meta{FNN} field, causes the \meta{Alt. names} field to be interpreted as either Eastern \meta{FNN} or an \meta{affix}. Due to its limitations and potential confusion, you are encouraged to avoid it unless you are using the \texttt{comma} option.
% \end{itemize}
% \clearpage
%
%  The example below illustrates a fairly complete set of names, apart from some special cases covered elsewhere in the manual:
%
% \begin{quote}\small\setstretch{1.1}
% |\begin{nameauth}|\\[0.2ex]
% |  \< Wash & George & Washington & >|\hfill\emph{Western}\\
% |  \< Soto & Hernando & de Soto & >|\hfill\emph{particle}\\
% |  \< JRII & John David & Rockefeller, II & >|\hfill\emph{affix}\\
% |  \< JRIV & John David & Rockefeller, IV & >|\hfill\emph{affix}\\
% |  \< JayR & John David & Rockefeller, IV & Jay >|\hfill\emph{nickname}\\
% |  \< Lewis & Clive Staples & Lewis & C.S. >|\hfill\emph{nickname}\\
% |  \< Jack & Clive Staples & Lewis & Jack >|\hfill\emph{nickname}\\
% |  \< Aris & & Aristotle & >|\hfill\emph{ancient}\\
% |  \< Eliz & & Elizabeth, I & >|\hfill\emph{royal}\\
% |  \< Attil & & Attila, the Hun & >|\hfill\emph{ancient}\\
% |  \< Konoe & Fumimaro & Konoe & >|\hfill\emph{Eastern/Western index}\\
% |  \< Yamt & & Yamamoto, Isoroku & >|\hfill\emph{Eastern/Eastern index}\\
% |\end{nameauth}|
% \end{quote}
%
% Now we see how this works in the body text, which you can compare with the index. A dagger (\dag) indicates an Eastern name with a Western index form.
%
% \begin{multicols}{2}\small\setstretch{1.1}
% \noindent\textbf{Basic Uses:}\\
% |\Wash|\hfill  \Wash \\
% |\LWash|\hfill \LWash \\
% |\Wash|\hfill \Wash \\
% |\SWash|\hfill \SWash \\[1ex]
% \textbf{Western Reversed with Comma:}\\
% |\RevComma\LWash|\hfill \RevComma\LWash \\[1ex]
% \textbf{Particles:}\\
% |\Soto|\hfill \Soto \\
% |\Soto|\hfill \Soto \\
% |\CapThis\Soto|\hfill \CapThis\Soto \\[1ex]
% \textbf{Affixes:}\\
% |\JRII|\hfill \JRII \\
% |\LJRII|\hfill \LJRII \\
% |\JRII|\hfill \JRII \\[1ex]
% \textbf{Nicknames:} (See Section~\ref{sec:Fname})\\
% |\JRIV|\hfill \JRIV \\
% |\LJRIV[Jay]|\hfill \LJRIV[Jay] \\
% |\SJRIV[Jay]|\hfill \SJRIV[Jay] \\
% |\SJRIV[Jay] \JRIV|\hfill \SJRIV[Jay] \JRIV\\
% |\LJayR|\hfill \LJayR \\
% |\SJayR|\hfill \SJayR \\
% |\SJayR\ \JayR|\hfill \SJayR\ \JayR\\
% |\Lewis|\hfill \Lewis\\
% |\Lewis|\hfill \Lewis\\
% |\LJack|\hfill \LJack\\
% |\SJack|\hfill \SJack\columnbreak\\
% \textbf{Ancient:}\\
% |\Aris|\hfill \Aris \\
% |\Aris|\hfill \Aris \\[3.2ex]
% \textbf{Medieval/Royal:}\\
% |\Eliz|\hfill \Eliz \\
% |\Eliz|\hfill \Eliz \\
% |\Atil|\hfill \Attil \\
% |\Atil|\hfill \Attil \\[3.3ex]
% \textbf{Western / Western Index:}\\
% |\Konoe|\hfill \Konoe \\
% |\LKonoe|\hfill \LKonoe \\
% |\Konoe|\hfill \Konoe \\[3.3ex]
% \textbf{Eastern / Western Index:}\\
% |\CapName\RevName\LKonoe|\\\hbox{}\hfill \indent\dag\CapName\RevName\LKonoe \\
% |\CapName\Konoe|\hfill \dag\CapName\Konoe \\[3.2ex]
% \textbf{Eastern / Eastern Index:}\\
% |\CapName\Yamt|\hfill \CapName\Yamt \\
% |\CapName\LYamt|\hfill \CapName\LYamt \\
% |\CapName\Yamt|\hfill \CapName\Yamt \\[3.3ex]
% \textbf{Western / Eastern Index:}\\
% |\RevName\LYamt|\hfill \RevName\LYamt \\
% |\Yamt|\hfill \Yamt
% \end{multicols}
%
% Sections~\ref{sec:standards}, \ref{sec:accents}, and~\ref{sec:IndexSort} deal with the pitfalls of accents and capitalization, as well as why you should use \cmd{\PretagName} for any name with control sequences or extended Unicode under NFSS. This becomes very important when authors and publishers use medieval names as Western names.
%
% When index tagging or pre-tagging names (Section~\ref{sec:IndexSort}), the \meta{Alternate names} field has no effect on index tags. \cmd{\JRIV} and \cmd{\JayR} need only one tag:\\[1ex] \hbox{}\qquad|\TagName[John David]{Rockefeller, IV}{|\meta{something}|}|\\[1ex] Likewise, \cmd{\Lewis} and \cmd{\Jack} need only one tag:\\[1ex]\hbox{}\qquad|\TagName[Clive Staples]{Lewis}{|\meta{something}|}|
%
% \subsubsection{Older Syntax}
% \label{sec:obsolete}
%
% An ``obsolete'' syntax remains for backward compatibility with early versions of \textsf{nameauth} and with the \texttt{comma} option. Please avoid mixing the older and newer forms to avoid possible confusion and error. For example, the older syntax causes the \meta{Alternate names} field in the index tagging functions to become as significant as \meta{FNN}, including the need to pretag such names.
%
% The \texttt{comma} option causes Western names with affixes to have a comma. Yet that also causes Eastern and ancient names, or any names using a pattern like \meta{SNN, affix} or \meta{SNN, FNN} to display a comma where it should not occur. The old form lacks some error checking and robustness contained in the new syntax and limits the use of several macros, including \cmd{\AKA.} Section~\ref{sec:error} offers some cautions about the old syntax, as do many places in this manual. The form is:
%
% \begin{quote}
% |\Name{Dagobert}[I]|\hfill\emph{royal name}\\
% |\Name{Yoshida}[Shigeru]|\hfill\emph{Eastern name}\\
% |\begin{nameauth}|\\[0.5ex]
% |  \< Dagb & & Dagobert & I >|\hfill\emph{royal name}\\
% |  \< Yosh & & Yoshida & Shigeru >|\hfill\emph{Eastern name}\\
% |\end{nameauth}|\\[2ex]
% Here the \meta{FNN} fields are empty. That changes the final field from \meta{Alternate names} to \meta{affix/Eastern FNN}.
%
% |\Dagb| gives \Dagb, then \Dagb. In similar fashion, we see |\LDagb| \LDagb, |\CapName\Yosh| \CapName\Yosh, and |\CapName\RevName\LYosh| \CapName\RevName\LYosh.
% \end{quote}
%
% In the old syntax, |\Name{Henry}[VIII]| prints ``\Name{Henry}[VIII]'' and ``\Name{Henry}[VIII].'' If you mix |\Name{Henry}[VIII]| with the newer |\Name{Henry, VIII}| they both print \Name{Henry, VIII} and \Name{Henry, VIII} in the body text. Yet they generate different control sequences for both first/subsequent uses and index tags.\footnote{Technically you can mix the two, as I do here. You must force first and subsequent uses with \cmd{\ForgetName} and \cmd{\SubvertName}. You must make common index tags, \emph{e.g.}: \cmd{\TagName}\texttt{\{Henry, VIII\}\{, king\}} and \cmd{\TagName}\texttt{\{Henry\}[VIII]\{, king\}}. That undermines the time-saving features offered by this package.}
%
% \IndexInactive%
% Avoid |\Name{Henry, VIII}[Tudor]| unless you want ``\Name*{Henry, VIII}[Tudor]'' and ``\Name{Henry, VIII}[Tudor]'' in the body text and ``Henry VIII Tudor'' in the index.
% \IndexActive%
% One solution adds ``Tudor'' as needed in the text after |\Name{Henry, VIII}| and uses a tag in the index: |\TagName{Henry, VIII}{ Tudor}| (see Section \ref{sec:TagName}).
%
% \clearpage
%
% \subsection{Naming Macros}
% \label{sec:Naming}
%
% \subsubsection{\texttt{\textbackslash Name} and \texttt{\textbackslash Name*}}
% 
% \DescribeMacro{\Name}
% \DescribeMacro{\Name*}
% This macro generates two forms of the name: a printed form in the text and a form of the name that occurs in the index.
% The general syntax is:
% \begin{quote}
% \cmd{\Name}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\\
% \cmd{\Name*}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
%
% \noindent Here we see how the syntax works:
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\
% |\Name*[Albert]{Einstein}| & \Name*[Albert]{Einstein}\\
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule
% |\Name{Confucius}| & \Name{Confucius}\\
% |\Name*{Confucius}| & \Name*{Confucius}\\
% |\Name{Confucius}| & \Name{Confucius}\\\midrule
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\
% |\Name*[M.T.]{Cicero}[Marcus Tullius]| & \Name*[M.T.]{Cicero}[Marcus Tullius]\\
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\
% |\Name*{Charles, the Bald}| & \Name*{Charles, the Bald}\\
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule
% \end{tabular}
% \end{quote}
%
% \cmd{\Name} displays and indexes names, as illustrated in Section~\ref{sec:PatRef}. It always prints the \meta{SNN} field. \cmd{\Name} prints the ``full name'' at the first occurrence, then the partial form thereafter. \cmd{\Name*} always prints the full name.
%
% The \meta{Alternate names} field replaces the \meta{FNN} field in the body text only. It does this if the \meta{FNN} field is not empty; see ``\Name[M.T.]{Cicero}[Marcus Tullius]'' above. Regarding their index entries, |\Name[M.T.]{Cicero}[Marcus Tullius]| and |\Name[M.T.]{Cicero}| are equivalent. This lets one use a nickname while keeping the indexed form constant. If the \meta{FNN} is empty, you get the old syntax for Eastern and royal names (Section~\ref{sec:obsolete}).
%
% \begin{quote}
%|\begin{nameauth}|\\
%|  \< Einstein & Albert & Einstein & >|\\
%|  \< Cicero & M.T. & Cicero & >|\\
%|  \< Confucius & & Confucius & >|\\
%|  \< CBald & & Charles, the Bald & >|\\
%|\end{nameauth}|
%\end{quote}
%
% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}%
% Here we have the equivalent with the simplified interface. |\Einstein,| |\LEinstein,| and |\Einstein| produce \Einstein, \LEinstein, and \Einstein. |\CBald| and |\CBald| give \CBald\ and \CBald. |\Confucius| yields \Confucius.
%
% |\Cicero| prints \Cicero\ and \Cicero, while |\LCicero[Marcus Tullius]| gives \LCicero[Marcus Tullius]. The next page explains why this form may be preferable in some cases for name variants when using the simplified interface.
% \clearpage
%
% \subsubsection{Forenames: \texttt{\textbackslash FName}}
% \label{sec:Fname}
%
% \DescribeMacro{\FName}
% \DescribeMacro{\FName*}
% \cmd{\FName} and its synonym \cmd{\FName*} print just forenames, but only in subsequent name uses.\footnote{The two macros are the same in case you edit \cmd{\Name*} by adding an |F| to get a first reference, just as you might edit \cmd{\Name} the same way to get the same result.}
% They are intended for Western-style names. The syntax is:
% \begin{quote}
% \cmd{\FName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
% This macro always prints a full name when a name is first used. That prevents a first-name reference before a person has been introduced.\footnote{One can force a short name by using \cmd{\SubvertName}\oarg{FNN}\marg{SNN} \cmd{\makeatletter} \cmd{\@nameauth@FirstFormattrue} \cmd{\makeatother} \cmd{\FName}\oarg{FNN}\marg{SNN}. Nevertheless, this seems to be overkill. It would be easier to type the name manually, then use \cmd{\IndexName.}}
% By design, \cmd{\FName} \emph{never} prints Eastern personal names, so that ancient names also work (cf. Section~\ref{sec:PatRef}). Examples of general use include: \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}%
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% |\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\
% |\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\\midrule
% |\FName{Confucius}| & \FName{Confucius}\\
% |\FName{Confucius}|& \FName{Confucius}\\\midrule
% |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\
% |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\\midrule
% |\FName{Charles, the Bald}| & \FName{Charles, the Bald}\\
% |\FName{Charles, the Bald}| & \FName{Charles, the Bald}\\\bottomrule
% \end{tabular}\\
% \end{quote}
%
% With the simplified interface example from the previous page, |\SEinstein,| |\SConfucius,| |\SCicero,| and |\SCBald| give us \SEinstein, \SConfucius, \SCicero, and \SCBald. |\SCicero[Marcus Tullius]| gives \SCicero[Marcus Tullius]. However, with the macro |\FName[Chesley B.]{Sullenberger, III}[Sully]| we have ``\FName[Chesley B.]{Sullenberger, III}[Sully]'' and ``\FName[Chesley B.]{Sullenberger, III}[Sully].'' Please use caution!
%
%\ForgetName[Clive Staples]{Lewis} This may not always be a ``bug.'' Remembering Section~\ref{sec:simplestart}, you can use \Lewis\ or ``\SJack.'' |\FName[Clive Staples]{Lewis}[C.S.]| or \cmd{\Lewis} gives the first form, while |\FName[Clive Staples]{Lewis}[Jack]| or \cmd{\Jack} gives the second.   |\SJayR| gave \ForgetName[John David]{Rockefeller, IV}\SJayR\ and \SJayR, but the index entry remains ``Rockefeller, John David, IV.''
%
% Using ``default nicknames'' in the simplified interface has some caveats:
%
% \begin{nameauth}%
% \< Ches & Chesley B. & Sullenberger, III & >%
% \< Sully & Chesley B. & Sullenberger, III & Sully >%
% \end{nameauth}%
% \begin{quote}
% |\begin{nameauth}|\\
% |  \< Ches & Chesley B. & Sullenberger, III & >|\\
% |  \< Sully & Chesley B. & Sullenberger, III & Sully >|\\
% |\end{nameauth}|
% \end{quote}
%
% \ForgetName[Chesley B.]{Sullenberger, III} The first use \cmd{\Ches} prints ``\Ches.'' Later, \cmd{\SChes} and \cmd{\SSully} print ``\SChes'' and ``\SSully.'' While |\SChes[Sully]| always gives ``\SChes[Sully],'' |\SSully[Chesley B.]| prints ``\SSully[Chesley B.].'' The \meta{Alternate names} field is always occupied when using \cmd{\Sully,} etc. Thus, the final |[Chesley B.]| is not a macro argument.
%\clearpage
%
%
% \subsection{Affixes and Eastern Names}
%
% \subsubsection{Affixes Need Commas}
% \label{sec:Affix}
%
% Comma-delimited affixes handle several different name types. \emph{Always include a comma as an affix delimiter}, even when the |nocomma| option does not print the comma. Extra spaces between the comma and affix are ignored. Extra commas have no effect. Other name types include royal, medieval, and Eastern names:
%
% \begin{quote}\small\ForgetName{Sun, Yat-sen}\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% |\Name[Oskar]{Hammerstein, II}| & \Name[Oskar]{Hammerstein, II}\\
% |\Name[Oskar]{Hammerstein, II}| & \Name[Oskar]{Hammerstein, II}\\\midrule
% |\Name{Louis, XIV}| & \Name{Louis, XIV}\\
% |\Name{Louis, XIV}| & \Name{Louis, XIV}\\\midrule
% |\Name{Sun, Yat-sen}| & \Name{Sun, Yat-sen}\\
% |\Name{Sun, Yat-sen}| & \Name{Sun, Yat-sen}\\\bottomrule
% \end{tabular}
% \end{quote}
%
% You cannot use the old syntax with the \Name[Oskar]{Hammerstein, II} example. One must use comma-delimited suffixes when cross-referencing affixed Western names, royal names, some medieval names, and Eastern names with \cmd{\AKA}; see Section~\ref{sec:AKA}.\medskip
%
% \DescribeMacro{\KeepAffix}
% Put \cmd{\KeepAffix} before \cmd{\Name} or \cmd{\AKA} if a line break or page break divides a \meta{SNN, affix} pair. This puts a non-breaking space between \meta{SNN} and \meta{affix} in the body text, but not in the index. Other options to fix bad breaks include using \cmd{\hbox}, kerning and spacing in the \textsf{microtype} package, etc.\medskip
%
% \DescribeMacro{\ShowComma}
% The \texttt{comma} option is restrictive and used to reproduce older texts. \cmd{\ShowComma} gets the same results on a per-name basis while using the default |nocomma| option. With |\ShowComma\Name[Louis]{Gossett, Jr.}| one gets \ShowComma\Name[Louis]{Gossett, Jr.}. One must use \cmd{\ShowComma} consistently or risk errors in the body text and index.\bigskip
%
% \noindent{\large\bfseries Compare Older Syntax}\\[2ex]
% Avoid using the older syntax, shown below, except with the \texttt{comma} option. The older syntax causes Eastern and ancient names that use the \meta{SNN, affix} pattern to have unwanted commas in them with the \texttt{comma} option or with \cmd{\ShowComma.} \cmd{\AKA} and \cmd{\PName} cannot create cross-references to these forms:
%
% \begin{quote}\small\ForgetName{Henry}[VIII]\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\
% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\\midrule
% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\
% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\\bottomrule
% \end{tabular}
% \end{quote}
% These older forms work because no \meta{FNN} are present. Otherwise you would get weird nicknames. Again, to avoid potential frustration, please avoid using the older syntax unless you need it.
% \clearpage
%
% \subsubsection{Eastern Names}
% \label{sec:Eastern}
%
% The \textsf{nameauth} package offers ``non-native'' and ``native'' ways to handle romanized Eastern names. \cmd{\RevName}\cmd{\Name}\oarg{Eastern FNN}\marg{Eastern SNN} will produce an Eastern name in the body text and the Western form \meta{SNN}, \meta{FNN} in the index, including the comma. We call this ``non-native'' mode.
%
% In contrast, both \cmd{\Name}\marg{Eastern SNN, Eastern FNN} and the older syntax \cmd{\Name}\marg{Eastern SNN}\oarg{Eastern FNN} produce an Eastern name form in the body text: \meta{SNN} \meta{FNN} as well as in the index. This form has no comma in the index. We call this ``native'' mode.\medskip
%
% \DescribeMacro{\ReverseActive}
% \DescribeMacro{\ReverseInactive}
% \DescribeMacro{\RevName}
% The ``smart'' reverse output mechanism converts between Western and Eastern forms in the text, but not the index. Pick non-native mode for Western-format index entries. Pick native mode for Eastern forms in the index. In addition to the class options described in Section~\ref{sec:options}, \cmd{\ReverseActive} and \cmd{\ReverseInactive} toggle reversing on a larger scale, while \cmd{\RevName} is used once per \cmd{\Name}.
%
% Please\marginpar{\small\raggedleft\cmd{\global}} note that \cmd{\ReverseActive} and \cmd{\ReverseInactive} can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect.
%
% This list of Japanese music artists shows \cmd{\RevName} in action. Names in Western order, then non-native Eastern order are marked with a dagger ({\dag}). All other names are in native Eastern, then Western order. Forms using the old syntax are in parentheses:
%
% 
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{lll}\toprule
%  & \emph{unchanged} & |\RevName|\\\midrule
% \dag|\Name*[Aiko]{Nakano}| & \dag\Name*[Aiko]{Nakano} & \dag\RevName\Name*[Aiko]{Nakano}\\
% |\Name*{Arai, Akino}| & \Name*{Arai, Akino} & \RevName\Name*{Arai, Akino}\\
% (|\Name*{Ishida}[Yoko]|) & (\Name*{Ishida}[Yoko]) & (\RevName\Name*{Ishida}[Yoko])\\
% |\Name*{Yohko}| & \Name*{Yohko} & \RevName\Name*{Yohko}\\\bottomrule
% \end{tabular}
% \end{quote}\smallskip
%
% \DescribeMacro{\AllCapsActive}
% \DescribeMacro{\AllCapsInactive}
% \DescribeMacro{\CapName}
% Use \cmd{\AllCapsActive}, \cmd{\AllCapsInactive}, and \cmd{\CapName} for fully-capitalized family names in the body text. These macros are analogous to the reversing macros above and may be used alone or with those and other state-toggling macros, \emph{e.g.} \cmd{\CapName}\cmd{\RevName}\cmd{\Name}\marg{SNN, Affix}.
%
% Both\marginpar{\small\raggedleft\cmd{\global}} \cmd{\AllCapsActive} and \cmd{\AllCapsInactive} have the same local restrictions as the other state-changing macros. Use \cmd{\global} to force a global effect.
%
% In the example below, names in Western order, then non-native Eastern order are marked with a dagger ({\dag}). All other names are in native Eastern, then Western order. Forms using the old syntax are in parentheses:
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{l@{ }l@{ }l}\toprule
%  & \emph{unchanged} & |\CapName\RevName|\\\midrule
% \dag|\Name*[Yoko]{Kanno}| & \dag\CapName\Name*[Yoko]{Kanno} & \dag\CapName\RevName\Name*[Yoko]{Kanno}\\
% |\Name*{Shikata, Akiko}| & \CapName\Name*{Shikata, Akiko} & \CapName\RevName\Name*{Shikata, Akiko}\\
% (|\Name*{Nogawa}[Sakura]|) & (\CapName\Name*{Nogawa}[Sakura]) & (\CapName\RevName\Name*{Nogawa}[Sakura])\\
% |\Name*{Yohko}| & \CapName\Name*{Yohko} & \CapName\RevName\Name*{Yohko}\\\bottomrule
% \end{tabular}
% \end{quote}\smallskip
%
% Capitalization and reversing precede post-processing. The reversing and capitalization macros also work with \cmd{\AKA}. They affect only the text, not the index. For caps in the text and index see Section~\ref{sec:formatting}.
%
% \subsection{Other Naming Topics}
% {\hfill\large\bfseries\emph{Language-Related Issues}\hfill}\vspace{-2ex}
%
% \subsubsection{Particles}
% \label{sec:standards}
%
% According to the \emph{Chicago Manual of Style}, English names with the particles \emph{de}, \emph{de\ la}, \emph{d'}, \emph{von}, \emph{van}, and \emph{ten} generally keep them with the last name, using varied capitalization. \emph{Le}, \emph{La}, and \emph{L'} always are capitalized unless preceded by \emph{de}.\medskip
%
% \DescribeMacro{\CapThis}
% In English, these particles go in the \meta{SNN} field of \cmd{\Name}, \emph{e.g.}, \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}. |\CapThis\Name[Walter]{de la Mare}| lets you capitalize \emph{de} when at the beginning of a sentence. \CapThis\Name[Walter]{de la Mare} will think it fair. \CapThis\Soto\ (using |\CapThis\Soto| from Section~\ref{sec:simplestart}) would agree.
%
% It is a good idea to put |~| or \cmd{\nobreakspace} between particles and surnames to avoid bad breaks. This also prevents \cmd{\CapThis} from eating the space between a one-character particle and the surname (Section \ref{sec:Unicode}).
%
% The Continental style of handling surnames (Section~\ref{sec:formatting}) does not work with the capitalization macros. In the case of names like \Name[Catherine]{\textsc{de'~Medici}} use |\Name[Catherine]{\textsc{de'~Medici}}| and, instead of the capping macros, |\textsc{De'~Medici}\IndexName[Catherine]{\textsc{de'~Medici}}.|\medskip
%
% \DescribeMacro{\AccentCapThis}
% With \texttt{pdflatex} and \textsf{inputenc}, use \cmd{\CapThis} when the first character of the particle is \texttt{A--z} (basic Latin). Use \cmd{\AccentCapThis} when the first character is extended Latin or other Unicode (see Section \ref{sec:Unicode}). Otherwise, with \texttt{pdflatex} \cmd{\CapThis} will fail if an extended Unicode character is the first letter of a particle.
%
% For example, \emph{L'} and \emph{d'} are two separate glyphs each, while \emph{Ľ} and \emph{ď} are one Unicode glyph each. Even with \texttt{xelatex} and \texttt{lualatex}, you would put a non-breaking space between the particle and the name because the particle is only one character. With \texttt{pdflatex} you also must use \cmd{\AccentCapThis.}
%
% Another example deals with particles and name forms:
% \begin{quote}\small
% |\PretagName{Thomas, à~Kempis}{Thomas a Kempis}|\hfill\emph{medieval}\\
% |\PretagName[Thomas]{à~Kempis}{Thomas a Kempis}|\hfill\emph{Western}\\
% |\begin{nameauth}|\\[0.2ex]
% |  \< KempMed & & Thomas, à~Kempis & >|\hfill\emph{medieval}\\
% |  \< KempW & Thomas & à~Kempis & >|\hfill\emph{Western}\\
% |\end{nameauth}|
% \end{quote}
% The medieval forms \KempMed\ and \KempMed\ use the particle as the first part of an affix. Please do not confuse the medieval forms with the Western forms. Otherwise you will get similar names with different index entries.\footnote{Properly speaking, ``à~Kempis'' and ``Aquinas'' are not surnames but suffixed place names. They create different index entries from Western names and look different in the text.}
%
% \IndexInactive
% Many people use medieval affixes as Western surnames: \SubvertName[Thomas]{à~Kempis}``\AccentCapThis\KempW.''\footnote{This treatment of medieval names, along with the handling of Eastern names, seems to be one of the most frequently ``abused'' issues in the academic literature that I know. In order to achieve simplicity in work flow or conformity, authors and publishers will take some fairly ethnocentric or heavy-handed approaches to names. The \textsf{nameauth} package will accommodate those approaches, even if I personally disagree with them.}
% To get that form, use |\AccentCapThis\KempW.|
% \clearpage
%
% Section~\ref{sec:Unicode} explains in detail why the following problems can occur:
% \begin{itemize}\small
% \item |\CapThis\KempW| halts execution with \texttt{Argument of \textbackslash UTFviii@two@ octets has an extra \}.} 
% \item |\AccentCapThis\Name[Thomas]{à Kempis}| gives ``\AccentCapThis\Name[Thomas]{à Kempis}'' (space removed). Instead, use |\AccentCapThis\Name[Thomas]{à~Kempis}.| 
% \item Under \texttt{pdflatex} \cmd{\AccentCapThis} fails with particles like |lé|\,---\, use \cmd{\CapThis} in that case to avoid breaking the \emph{second} character.
% \item |\AccentCapThis\Soto| gives \AccentCapThis\Soto. Only use it with accented first letters.
% \end{itemize}
% \IndexActive
%
% You\marginpar{\small\raggedleft Alternates} could use name forms with braces, like |\Name[Thomas]{{à}~Kempis}|, and control sequences, like |\Name[Thomas]{\`a~Kempis}|. Using those forms consistently, with \cmd{\PretagName,} would require you to use \cmd{\CapThis,} never \cmd{\AccentCapThis}. See Section~\ref{sec:Unicode} for more details.
%
% Non-English contexts do not necessarily bind particles to surnames. Using \cmd{\Name} and \cmd{\FName} with alternate forenames helps address this and may skirt the particle capitalization issue. See also Section~\ref{sec:Particles}.
%
% \subsubsection{Formatting Initials}
%
% Omit spaces between initials if possible; see also Bringhurst's \emph{Elements of Typographic Style}. If your publisher wants spaces between initials, try putting thin spaces |\,| between them. Use \cmd{\PretagName} to get the correct index sorting:
% \begin{quote}
% |\PretagName[E.\,B.]{White}{White, E. B.}|\\
% |\begin{nameauth}|\\
% |  \< White & E.\,B. & White & >|\\
% |\end{nameauth}|
% \begin{nameauth}
%   \< White & E.\,B. & White & >
% \end{nameauth}
% \end{quote}
% \begin{quote}
% \def\sep{\vrule width0.5pt\kern-0.5pt}%
% \begin{tabular}{ll}\hline
% & \hphantom{E.}\sep\,\sep\hphantom{B.}\sep\hphantom{\ }\sep\hphantom{White}\\
% \cmd{\White} and \cmd{\LWhite} & \White\\
% & \hphantom{E.}\sep\,\sep\hphantom{B.}\sep\hphantom{\ }\sep\hphantom{White}\\\hline
% & \hphantom{E.}\sep\ \sep\hphantom{B.}\sep\ \sep\hphantom{White}\\
% Normal text:\hfill & {E. B. White}\\
% & \hphantom{E.}\sep\ \sep\hphantom{B.}\sep\ \sep\hphantom{White}\\\hline
% \end{tabular}
% \end{quote}
%
% \subsubsection{Hyphenation}
%
% The simplified interface trivializes the insertion of optional hyphens in names, but such hyphens must be used consistently in all the naming macros:
%
% \begin{quote}
% |\begin{nameauth}|\\
% |  \< Bier & Johann & Bier\-mann & >|\\
% |\end{nameauth}|
% \end{quote}
% We get \Bier\ and \Bier. English hyphenation can break ie-pairs and maybe others. One also can fix bad breaks with the \textsf{babel} or \textsf{polyglossia} packages. This moves the solution from ``quick and dirty'' to elegant. \Name[John]{Strietelmeier} can break badly in English, as you see. Using \textsf{babel}, we get:
% \begin{quote}
% \newcommand{\de}[1]{\foreignlanguage{ngerman}{#1}}%
% |\newcommand{\de}[1]{\foreignlanguage{ngerman}{#1}}|\\
% |\de{\Name*[John]{Strietelmeier}}|\\
% \de{\Name*[John]{Strietelmeier}}
% \end{quote}
%
% \subsubsection{Listing by Surname}
% \label{sec:LastFirst}
%
%\DescribeMacro{\ReverseCommaActive}
%\DescribeMacro{\ReverseCommaInactive}
%\DescribeMacro{\RevComma}
% The reversing macros \cmd{\ReverseCommaActive}, \cmd{\ReverseCommaInactive}, and \cmd{\RevComma}\ allow the easy generation of name lists ordered as \meta{SNN}, \meta{FNN} or \meta{SNN}, \meta{Alt. names}. The first two are broad toggles, while the third works on a per-name basis.
% Both\marginpar{\small\raggedleft\cmd{\global}} \cmd{\ReverseCommaActive} and \cmd{\ReverseCommaInactive} have the same local restrictions as the other state-changing macros unless you use \cmd{\global.}
% Eastern, medieval, and royal names do not work with these macros:
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{lll}\toprule
% \Name*[J.S.]{Mill}[John Stuart] & \RevComma\Name*[J.S.]{Mill}[John Stuart] & OK\\
% \Name*[Oskar]{Hammerstein, II} & \RevComma\Name*[Oskar]{Hammerstein, II} & OK\\
% \Name*{John, Eriugena} & \RevComma\Name*{John, Eriugena} & incompatible\\
% \Name*{Mao}[Tse-tung] & \RevComma\Name*{Mao}[Tse-tung] & incompatible\\
% \Name*{Anaximander} & \RevComma\Name*{Anaximander} & OK\\\bottomrule
% \end{tabular}
% \end{quote}
%
% {\hfill\large\bfseries\emph{Technical-Related Issues}\hfill}\vspace{-2ex}
% \subsubsection{Fault Tolerance}
%
% The \textsf{nameauth} package protects against some typing errors and malformed input. Several macros ignore leading and trailing spaces, but not medial spaces as illustrated by the variations below that are automatically corrected:
%
% \begin{quote}\small\ForgetName[Martin Luther]{King, Jr.}\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% \textit{Macro Example} & \textit{Resulting Text}\\\midrule
% |\Name*[ Martin Luther]{King, Jr.}| & \Name*[ Martin Luther]{King, Jr.}\\
% |\Name*[Martin Luther ]{King, Jr.}| & \Name*[Martin Luther ]{King, Jr.}\\
% |\Name*[ Martin Luther ]{King, Jr.}| & \Name*[ Martin Luther ]{King, Jr.}\\
% |\Name*[Martin Luther]{ King, Jr.}| & \Name*[Martin Luther]{ King, Jr.}\\
% |\Name*[Martin Luther]{King, Jr. }| & \Name*[Martin Luther]{King, Jr. }\\
% |\Name*[Martin Luther]{ King, Jr. }| & \Name*[Martin Luther]{ King, Jr. }\\\bottomrule
% \end{tabular}
% \end{quote}
%
% \subsubsection{Detecting Punctuation}
%
% In Western names, affixes like ``Jr.'' (junior), ``Sr.'' (senior), ``d.\,J.'' (\textit{der J\"ungere}), and ``d.\,\"A.'' (\textit{der \"Altere}) can collide with the full stop in a sentence. \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA} detect this in a name and gobble the subsequent full stop as needed:
%
% \begin{quote}\footnotesize\ForgetName[Martin Luther]{King, Jr.}\setstretch{1.2}
% \begin{tabular}{r@{\hbox to 1em{\hfil}}c@{\hbox to 1em{\hfil}}l}\toprule
% \textit{Macro Example\hfill} & \textit{periods} & \textit{Resulting Text}\\\midrule
% |\Name[Martin Luther]{King, Jr.}.| & $2\rightarrow1$ & \Name[Martin Luther]{King, Jr.}.\\
% |\Name[Martin Luther]{King, Jr.}.| & $2\rightarrow1$ & \Name[Martin Luther]{King, Jr.}.\\
% |\Name[Martin Luther]{King, Jr.}|\texttt{\textvisiblespace} & $1\rightarrow0$ & \Name[Martin Luther]{King, Jr.}\\
% |\Name*[Martin Luther]{King, Jr.}.| & $2\rightarrow1$ & \Name*[Martin Luther]{King, Jr.}.\\
% |\Name*[Martin Luther]{King, Jr.}|\texttt{\textvisiblespace} & $1\rightarrow1$ & \Name*[Martin Luther]{King, Jr.}\\\bottomrule
% \end{tabular}
% \end{quote}   
% Grouping tokens can frustrate this: |{\Name*[Martin Luther]{King, Jr.}}.| produces ``{\Name*[Martin Luther]{King, Jr.}}.'' (two periods). Enclosing |{Jr.}| within braces or a macro will do the same. If you must format the affix, leave the period outside: |\Name[Martin Luther]{\textsc{King}, \textsc{Jr}.}| Cf. Section~\ref{sec:formatting}.
%
% \subsubsection{Accented Names}
% \label{sec:accents}
% 
% For names that contain accented characters, using \texttt{xelatex} or \texttt{lualatex} with \texttt{xindy} (\texttt{texindy}) is recommended. Section~\ref{sec:engines} shows how you can work with multiple engines.
%
% If the leading character of \meta{SNN} is accented and lowercase (usually only in a particle), then you must use \cmd{\AccentCapThis} if you are using \texttt{pdflatex.} Sections~\ref{sec:standards} and~\ref{sec:Unicode} give more details about \cmd{\CapThis} and \cmd{\AccentCapThis}.
%
% Accented characters act like control sequences. In \texttt{pdflatex} use \cmd{\PretagName} with all names with extended Unicode characters (Sections~\ref{sec:IndexSort} and~\ref{sec:Unicode}).\footnote{This is true especially in NFSS while using \texttt{makeindex}. With \texttt{xindy} one can make custom sorting alphabets that are more powerful than \cmd{\PretagName}.}
%
% Nevertheless, Unicode characters and ``regular'' control sequences are not interchangeable. The example below shows this difference because the names are all long (thus, different). The names are not long, then short (were they the same):
% \begin{quote}
% \IndexInactive%
% |\Name[Johann]{Andre\"a}|\hfill \Name[Johann]{Andre\"a}\\
% \IndexActive%
% |\Name[Johann]{Andreä}|\hfill \Name[Johann]{Andreä} instead of \Name[Johann]{Andreä}\\
% \IndexInactive%
% |\Name{\AE thelred, II}|\hfill \Name{\AE thelred, II}\\
% \IndexActive%
% |\Name{Æthelred, II}|\hfill \Name{Æthelred, II} instead of \Name{Æthelred, II}
% \end{quote}
%
% See Section~\ref{sec:Unicode} on how to add additional Unicode glyphs to the default set under NFSS, \textsf{inputenc}, and \textsf{fontenc}. One may use expandable control sequences in names (thanks \Name*[Robert]{Schlicht}). Also, you can use \cmd{\edef} and \cmd{\noexpand} in names (Section~\ref{sec:Hooksc}). Since \textsf{nameauth} version 2.0, helpful concerns of \Name[Patrick]{Cousot} have been addressed.
% 
% \subsubsection{Format: Hooks}
% \label{sec:CustomHooks}
%
% There are two kinds of formatting at work:
% \begin{enumerate}\small
% \item \textbf{Syntactic Formatting:} This includes reversing names, capitalizing the first letter in the \meta{SNN} field in the body text, and capitalizing the root when \meta{SNN} is a \meta{root, suffix} pair.
% \item \textbf{Name Post-Processing:} This happens in the hook macros after a name has been parsed into the final form it will take in the text.
% \end{enumerate}
%
% \DescribeMacro{\NamesFormat}
% \DescribeMacro{\FrontNamesFormat}
% \DescribeMacro{\MainNameHook}
% \DescribeMacro{\FrontNameHook}
% Starting with version 2.5, the ``main-matter'' and ``front-matter'' systems are fully qualified and independent systems of formatting and first/subsequent name use. The main-matter system uses \cmd{\NamesFormat} to post-process first occurrences of names and \cmd{\MainNameHook} to post-process subsequent uses. The front-matter system uses \cmd{\FrontNamesFormat} to post-process first occurrences of names and \cmd{\FrontNameHook} to post-process subsequent uses. The \texttt{alwaysformat} option causes every name to be formatted as a ``first-use.''
%
% Section~\ref{sec:FrontFormat} offers more about how to switch the systems and what that implies. For now, we focus on custom formatting at work:
% \begin{quote}\small
% |\renewcommand*{\NamesFormat}{\scshape}|\\
% |\renewcommand*{\FrontNamesFormat}{\bfseries}|
% \end{quote}
%
% We leave \cmd{\MainNameHook} and \cmd{\FrontNameHook} unchanged so that the resulting names are not formatted. Here we have text in the front matter. It has the \cmd{\bfseries} formatting.
% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}
% \begin{quote}\small\setstretch{1.2}
% \NamesInactive\renewcommand*{\NamesFormat}{\scshape}\renewcommand*{\FrontNamesFormat}{\bfseries}
% \begin{tabular}{ll}\toprule
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule
% |\Name{Confucius}| & \Name{Confucius}\\
% |\Name{Confucius}| & \Name{Confucius}\\\midrule
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule
% \end{tabular}
% \end{quote}
%
% Next we have text in the main matter. It has the \cmd{\scshape} formatting.
% \begin{quote}\small\setstretch{1.2}
% \renewcommand*{\NamesFormat}{\scshape}\renewcommand*{\FrontNamesFormat}{\bfseries}
% \begin{tabular}{ll}\toprule
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule
% |\Name{Confucius}| & \Name{Confucius}\\
% |\Name{Confucius}| & \Name{Confucius}\\\midrule
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule
% \end{tabular}
% \end{quote}
%
% Finally we simulate the \texttt{alwaysformat} option for text in both the main matter and the front matter:
% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}
% \begin{quote}\small\setstretch{1.2}
% \makeatletter\@nameauth@AlwaysFormattrue\makeatother
% \renewcommand*{\NamesFormat}{\scshape}\renewcommand*{\FrontNamesFormat}{\bfseries}
% \begin{tabular}{ll}\toprule
% \textit{Front Matter}\global\NamesInactive\\\midrule
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\
% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule
% |\Name{Confucius}| & \Name{Confucius}\\
% |\Name{Confucius}| & \Name{Confucius}\\\midrule
% \textit{Main Matter}\global\NamesActive\\\midrule
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\
% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\
% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule
% \end{tabular}
% \makeatletter\@nameauth@AlwaysFormatfalse\makeatother
% \end{quote}
%
% The process of modularizing this post-processing began in version 2.4. Sections~\ref{sec:Hooksb}ff. discuss more on how one can redefine the formatting hooks.
% \clearpage
%
% \subsubsection{Format: Continental}
% \label{sec:formatting}
%
% Name post-processing\marginpar{\small\raggedleft Continental\\ small caps} does not affect the index. Control sequences in the name arguments themselves do affect the index. Section~\ref{sec:IndexSort} describes how to use \cmd{\PretagName} to get proper index sorting with names containing control sequences and extended Unicode characters.
%
% In this example, you get something that corresponds with the Continental system. The surname is formatted in both the body text and the index. It is always formatted, everywhere:
% \begin{quote}
% \indent|\PretagName[Greta]{\textsc{Garbo}}{Garbo, Greta}|\\
% \indent|\Name[Greta]{\textsc{Garbo}}|
% \end{quote}
% You get \Name[Greta]{\textsc{Garbo}}, then \Name[Greta]{\textsc{Garbo}}\,---\,even in the front matter. Section~\ref{sec:Hooksc} shows a more advanced example that will suppress the small caps except for first uses, but will retain the small caps in the index.
%
% Of course, one could always create a manual reference if desired. For example, one can type |``Garbo''\IndexName\Name[Greta]{\textsc{Garbo}}| for a ``Garbo'' reference.
%
% Some interesting things can happen when you put control sequences in the naming macro arguments. |\Name[\normalfont{Greta}]{\textsc{Garbo}}| will produce a name in the text and in the index that looks exactly like name above. Regardless of its looks, however, it is a a different name with different first/subsequent uses and a different index entry.
% 
% A comma delimiter will split the macro argument, potentially causing unbalanced braces. Avoid this by formatting the name and suffix separately:
% \begin{quote}\small
% |\PretagName{\uppercase{Fukuyama},| |Takeshi}{Fukuyama,| |Takeshi}|\\
% |\PretagName[Thurston]{\textsc{Howell},\textsc{III}}%|\\
% |  {Howell, Thurston 3}|\\[1ex]
% |\begin{nameauth}|\\
% |  \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & >|\\
% |  \< Howell & Thurston & \textsc{Howell},\textsc{III} & >|\\
% |\end{nameauth}|
% \end{quote}
%
% \cmd{\Fukuyama} produces \Fukuyama\ and \Fukuyama. Of course, you could type all-capital surnames without control sequences. Likewise, \cmd{\Howell} generates \Howell\ and \Howell.\medskip
%
% \subsubsection{Format: Engine}
% \label{sec:NewEngine}
%
% Assuming that redefining hooks and adding control sequences is insufficient to your task, you could modify the core naming macros and hook those modifications back into the \textsf{nameauth} package without needing to continuously track and patch the style file itself. 
%
% \DescribeMacro{\NameauthName}
% \DescribeMacro{\NameauthLName}
% \DescribeMacro{\NameauthFName}
% These macros are set by default to \cmd{\@nameauth@Name}, the internal name parser. The main and simplified interfaces call them as respective synonyms for \cmd{\Name,} \cmd{\Name*,} and \cmd{\FName.} Should you desire to create your own naming macros, you can redefine them. Here is the minimal working example:
% \begin{quote}
% |\makeatletter|\\
% |\newcommandx*\MyName[3][1=\@empty, 3=\@empty]{|\meta{Name}|}%|\\
% |\newcommandx*\MyLName[3][1=\@empty, 3=\@empty]%|\\
% |  {|\meta{Long name}|\@nameauth@FullNamefalse}%|\\
% |\newcommandx*\MyFName[3][1=\@empty, 3=\@empty]%|\\
% |  {|\meta{Short name}|\@nameauth@FirstNamefalse}%|\\
% |\makeatother|
% \end{quote}
%
% The macros above do not really work together with the rest of \textsf{nameauth} package, so be careful! You can hook these macros into the user interface thus:
% \begin{quote}
% \makeatletter%
% \newcommandx*\MyName[3][1=\@empty, 3=\@empty]{\meta{Name}}%
% \newcommandx*\MyLName[3][1=\@empty, 3=\@empty]{\meta{Long name}\@nameauth@FullNamefalse}%
% \newcommandx*\MyFName[3][1=\@empty, 3=\@empty]{\meta{Short name}\@nameauth@FirstNamefalse}%
% \makeatother%
% |\renewcommand*{\NameauthName}{\MyName}|\\
% |\renewcommand*{\NameauthLName}{\MyLName}|\\
% |\renewcommand*{\NameauthFName}{\MyFName}|\\
% |\begin{nameauth}|\\
% |  \< Silly & No Particular & Name & >|\\
% |\end{nameauth}|\\
% |This is \Silly, \LSilly, and \SSilly.|\\
% \renewcommand*{\NameauthName}{\MyName}%
% \renewcommand*{\NameauthLName}{\MyLName}%
% \renewcommand*{\NameauthFName}{\MyFName}%
% \begin{nameauth}
%   \< Silly & No Particular & Name & >
% \end{nameauth}
% This is \Silly, \LSilly, and \SSilly.
% \end{quote}
% Like\marginpar{\small\raggedleft\cmd{\global}} \cmd{\NamesFormat}, the other hook macros, and many of the state-changing and triggering macros in this package, these naming macros can be redefined or used locally within a scope without making global changes to the document unless you specifically use \cmd{\global}.
%
% Here we show that the macros \cmd{\NameauthName,} \cmd{\NameauthLName,} and \cmd{\NameauthFName} have reverted back to their original forms. Now \cmd{\Silly} and |\Name[No Particular]{Name}| produce \IndexInactive\Silly\ and \Name[No Particular]{Name}\IndexActive.
%
% \subsubsection{Format: Systems}
% \label{sec:FrontFormat}
%
% \DescribeMacro{\NamesActive}
% \DescribeMacro{\NamesInactive}
% Using the \texttt{frontmatter} option or \cmd{\NamesInactive} causes the naming macros to use the front matter formatting hook until \cmd{\NamesActive} switches the macros to the independent main matter formatting hooks. Additionally, two independent systems of names are created: front-matter names and main-matter names.
% 
% Please\marginpar{\small\raggedleft\cmd{\global}} note that these two macros can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect.
%
% Similar to the formatting example above, we redefine the formatting hooks to illustrate that indeed, there are two formatting systems at work. Here we switch to the ``front matter'' mode:
% \begin{quote}\small\cmd{\NamesInactive}\NamesInactive\\[0.4ex]
% \NamesInactive\renewcommand*{\NamesFormat}{\scshape}\renewcommand*{\FrontNamesFormat}{\bfseries}
% \begin{tabular}{@{}ll}
% |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\
% |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\
% |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\
% |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\
% \end{tabular}
% \end{quote}
% Then we switch back to ``main matter'' mode:
% \begin{quote}\small\cmd{\NamesActive}\NamesActive\\[0.4ex]
% \renewcommand*{\NamesFormat}{\scshape}\renewcommand*{\FrontNamesFormat}{\bfseries}
% \begin{tabular}{@{}ll}
% |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\
% |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\
% |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\
% |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\
% \end{tabular}
% \end{quote}
% 
% We have two independent cases of ``first use'' above. Thus, we have two ``species'' of names: ``front-matter'' and ``main-matter.'' This is useful if you want to format names one way in the regular body text but another way somewhere else. You see above, however, that using these systems in the same document section can lead to a clash of names.
%
% How about we apply some of these formatting ideas to footnotes? Certainly we can redefine \cmd{\NamesFormat} to create custom effects like changing typographic formatting in footnotes:
% \begin{quote}\small
% |\makeatletter|\\
% |\let\@oldfntext\@makefntext|\\
% |\long\def\@makefntext#1{%|\\
% |  \renewcommand*\NamesFormat{\scshape}\@oldfntext{#1}}|\\
% |\let\@makefntext\@oldfntext% just in case|\\
% |\makeatother|
% \end{quote}
% \makeatletter\ignorespaces%
% \let\@oldfntext\@makefntext%
% \long\def\@makefntext#1{\renewcommand*\NamesFormat{\scshape}\@oldfntext{#1}}%
% \makeatother%
% Your footnote would produce names with different formatting than the body text.\footnote{This demonstrates a format change: \Name[John Maynard]{Keynes}.}
% We change footnotes back to normal with:
% \makeatletter\ignorespaces%
% \let\@makefntext\@oldfntext%
% \makeatother%
% \begin{quote}\small
% |\makeatletter%|\\
% |\let\@makefntext\@oldfntext%|\\
% |\makeatother|
% \end{quote}
%
% This example has something of a flaw in it. If you are in the main matter of the document, this solution can affect names in the main body text, \emph{e.g.}, ``\Name[John Maynard]{Keynes},'' because the first and subsequent references are global by design. Also, relying only on scoping to insulate any changes to \cmd{\NamesFormat} might create undesired side effects, depending on the sort of modification.
%
% By using the front-matter system, we can get around the limitations of the footnotes interfering with the main-matter text:
% \begin{quote}\small
% |\makeatletter|\\
% |\let\@oldfntext\@makefntext|\\
% |\long\def\@makefntext#1{%|\\
% |  \NamesInactive\@oldfntext{#1}\NamesActive%|\\
% |}\makeatother|
% \end{quote}
% \makeatletter\ignorespaces%
% \let\@oldfntext\@makefntext%
% \long\def\@makefntext#1{\NamesInactive\@oldfntext{#1}\NamesActive}%
% \makeatother%
% Your footnote would produce a front-matter name.\footnote{This demonstrates a front-matter name: \Name[John Maynard]{Keynes}.}
% Notice that the front-matter text has no formatting by default. Not only does front-matter formatting not affect the body text, but also the first/subsequent uses are independent. As above, we can change footnotes back to normal.\makeatletter\let\@makefntext\@oldfntext\makeatother
%
% \subsection{Name Decisions}
% \subsubsection{Testing Decisions}
% \label{sec:tests}
%
% The macros in this section permit conditional text that depends on the presence or absence of a name. The \cmd{\If} in this section's macro names is capitalized to be different from a regular |\if| expression. The branching of these macros is altered by using \cmd{\Name,} \cmd{\Name*,} \cmd{\FName,} \cmd{\PName,} \cmd{\AKA,} \cmd{\AKA*,} \cmd{\ForgetName,} \cmd{\SubvertName,} and \cmd{\ExcludeName.}
%
% Some examples of conditional text include a ``mini-biography,'' a footnote, or a callout. These macros could be integrated with the ``text tag'' features in Section~\ref{sec:tagtext}. Authors and editors could use these macros with the \textsf{comment}, \textsf{pdfcomment}, and similar packages to make comments based on whether a name has occurred or not. That aids name management and thought development.
%
% If one passes control sequences to these macros instead of typing the text directly, one can get false results (see \emph{The \TeX book}, 212--15) unless:
% \begin{itemize}
% \item The arguments are retrieved from token registers.
% \item Expansion is regulated via \cmd{\expandafter,} \cmd{\noexpand,} etc.
% \item Expansion of accented characters in \texttt{pdflatex}/NFSS is regulated.
% \item Conditional expansion within macro arguments (cf. Section~\ref{sec:Hooksc}) yields consistent results.
% \end{itemize}
%
% The formatting hooks do not employ these testing macros because two are called only for first uses anyway. By default, \cmd{\AKA} calls only the subsequent use hooks unless the \texttt{formatAKA} option is used.
%
% Using \cmd{\tracingmacros,} \cmd{\show,} or \cmd{\meaning} can help you ensure that everything is expanding properly to prevent false results.
%
% \DescribeMacro{\IfMainName}
% If you want to produce output or perform a task based on whether a ``main body'' name exists, use \cmd{\IfMainName}, whose syntax is:
% \begin{quote}
% \cmd{\IfMainName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{yes}\marg{no}
% \end{quote}
% This is a long macro via \cmd{\newcommandx}, so you can have paragraph breaks in the \meta{yes} and \meta{no} paths. A ``main body'' name is capable of being formatted by this package, \emph{i.e.}, one created by the naming macros when the \texttt{mainmatter} option is used or after \cmd{\NamesActive}. It is distinguished from those names that occur in the front matter and those that have been used as cross-references.
%
% For example, we get ``\IfMainName[Bob]{Hope}{I met Bob}{I have not met Bob}'' from the following example because we have yet to invoke |\Name[Bob]{Hope}|:
% \begin{quote}
% |\IfMainName[Bob]{Hope}{I met Bob}{I have not met Bob}|
% \end{quote}%
%
% Since we have encountered \Name*[Johann]{Andreä}, we get ``\IfMainName[Johann]{Andreä}{I met Johann}{I have not met Johann}'' with a similar example:
% \begin{quote}
% |\IfMainName[Johann]{Andreä}{I met Johann}%|\\|  {I have not met Johann}|
% \end{quote}
%
% \DescribeMacro{\IfFrontName}
% If you want to produce output or perform a task based on whether a ``front matter'' name exists, use \cmd{\IfFrontName}, whose syntax is:
% \begin{quote}
% \cmd{\IfFrontName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{yes}\marg{no}
% \end{quote}
% This macro works the same as \cmd{\IfMainName.} A ``front matter'' name is not capable of being formatted by this package, \emph{i.e.}, one created by the naming macros when the \texttt{frontmatter} option is used or after \cmd{\NamesInactive}. It is distinguished from those names that occur in the main matter and those that have been used as cross-references.
% \clearpage
%
% \label{page:Carnap}For example, based on Section~\ref{sec:FrontFormat}, we see that ``\ignorespaces
% \IfFrontName[Rudolph]{Carnap}%
% {\IfMainName[Rudolph]{Carnap}%
%   {\Name[Rudolph]{Carnap} is both}%
%   {\Name[Rudolph]{Carnap} is only non-formatted}}%
% {\IfMainName[Rudolph]{Carnap}%
%   {\Name[Rudolph]{Carnap} is only formatted}%
%   {\Name[Rudolph]{Carnap} is not mentioned}}'' a formatted and unformatted name with the following test:
% \begin{quote}
% |\IfFrontName[Rudolph]{Carnap}%|\\
% |{\IfMainName[Rudolph]{Carnap}%|\\
% |  {\Name[Rudolph]{Carnap} is both}%|\\
% |  {\Name[Rudolph]{Carnap} is only non-formatted}}%|\\
% |{\IfMainName[Rudolph]{Carnap}%|\\
% |  {\Name[Rudolph]{Carnap} is only formatted}%|\\
% |  {\Name[Rudolph]{Carnap} is not mentioned}}|
% \end{quote}%
% We will return to this topic of main matter and front matter names later in Sections~\ref{sec:Tweaks} and~\ref{sec:LocalNames}. There we see how \cmd{\ForgetName} and \cmd{\SubvertName} usually affect both main- and front-matter names simultaneously unless set otherwise.\medskip
%
% \DescribeMacro{\IfAKA}
% If you want to produce output or perform a task based on whether a ``\emph{see}-reference'' name exists, use \cmd{\IfAKA}, whose syntax is:
% \begin{quote}
% \cmd{\IfAKA}\oarg{FNN}\marg{SNN}\oarg{Alt. names}\marg{y}\marg{n}\marg{excluded}
% \end{quote}
% This macro works similarly to \cmd{\IfMainName,} although it has an additional \meta{excluded} branch in order to detect those names excluded from indexing by \cmd{\ExcludeName} (Section~\ref{sec:exclude}).
%
% A ``\emph{see}-reference'' name is printed in the body text but only exists as a cross-reference created by \cmd{\AKA} and \cmd{\AKA*}. First, in the text we see ``\AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller},'' |\AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller}|. Next, we have the following example:
% \begin{quote}
% |\IfAKA[Jay]{Rockefeller}%|\\
% |  {\LJRIV\ has an alias}%|\\
% |  {\LJRIV\ has no alias}%|\\
% |  {\LJRIV\ is excluded}|
% \end{quote}
% This gives us ``\IfAKA[Jay]{Rockefeller}{\LJRIV\ has an alias}{\LJRIV\ has no alias}{\LJRIV\ is excluded}.'' If you are confident that you will not be dealing with names generated by \cmd{\ExcludeName} then you can just leave the \meta{excluded} branch as |{}.|
%
%  A similar use of |\IfAKA{Confucius}| tells us that ``\IfAKA{Confucius}{\Name{Confucius} is an alias}{\Name{Confucius} is not an alias}{}.'' Yet we should test that completely:
% \begin{quote}
% |\IfAKA[|\meta{FNN}|]{|\meta{SNN}|}[|\meta{alt. names}|]%|\\
% |{|\meta{true; it is a pseudonym}|}%|\\
% |{%|\\
% |  \IfFrontName[|\meta{FNN}|]{|\meta{SNN}|}[|\meta{alt. names}|]%|\\
% |    {\IfMainName[|\meta{FNN}|]{|\meta{SNN}|}[|\meta{alt. names}|]%|\\
% |      {|\meta{both}|}%|\\
% |      {|\meta{front}|}%|\\
% |    }%|\\
% |    {\IfMainName[|\meta{FNN}|]{|\meta{SNN}|}[|\meta{alt. names}|]%|\\
% |      {|\meta{main}|}%|\\
% |      {|\meta{does not exist}|}%|\\
% |    }%|\\
% |}%|\\
% |{|\meta{excluded}|}|
% \end{quote}
%
% Here we test for a name used with \cmd{\ExcludeName} (Section~\ref{sec:exclude}) to get the result, ``\ExcludeName{Grinch}\IfAKA{Grinch}{\Name{Grinch} is an alias}{\Name{Grinch} is not an alias}{\Name{Grinch} is excluded}'':
% \begin{quote}
% |\ExcludeName{Grinch}%|\\
% |\IfAKA{Grinch}%|\\
% |  {\Name{Grinch} is an alias}%|\\
% |  {\Name{Grinch} is not an alias}%|\\
% |  {\Name{Grinch} is excluded}|
% \end{quote}
% 
% \subsubsection{Changing Decisions}
% \label{sec:Tweaks}
% 
% This section describes macros that change the status of whether a name has occurred. That also helps to avoid clashes between formatted and non-formatted names. They are meant for editing at or near the final draft stage. ``\emph{See}-reference'' names created by \cmd{\AKA} are not affected by these macros.\medskip
%
% \DescribeMacro{\ForgetName}
% This macro is a ``dirty trick'' of sorts that takes the same optional and mandatory arguments used by \cmd{\Name}. It handles its arguments in the same way, except that it ignores the final argument if \meta{FNN} are present. The syntax is:
% \begin{quote}
% \cmd{\ForgetName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
% This macro causes \cmd{\Name} and friends globally to ``forget'' prior uses of a name. The next use of that name will print as if it were a ``first use,'' even if it is not. Index entries and cross-references are \emph{never} forgotten.\medskip
% 
% \DescribeMacro{\SubvertName}
% This macro is the opposite of the one above. It takes the same arguments. It handles its arguments in the same manner. The syntax is:
% \begin{quote}
% \cmd{\SubvertName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
% This macro causes \cmd{\Name} and friends globally to think that a prior use of a name already has occurred. The next use of that name will print as if it were a ``subsequent use,'' even if it is not.
%
% The default \marginpar{\small\raggedleft Scope} behavior of these two macros changes whether a name is ``forgotten'' or ``subverted'' simultaneously for front matter and main matter names, Remember the example on page~\pageref{page:Carnap} above that gave us the answer, ``\IfFrontName[Rudolph]{Carnap}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is both}{\Name[Rudolph]{Carnap} is only non-formatted}}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is only formatted}{\Name[Rudolph]{Carnap} is not mentioned}}?'' Now watch closely: After we use \ForgetName[Rudolph]{Carnap}|\ForgetName[Rudolph]{Carnap}| we get the result,
% ``\IfFrontName[Rudolph]{Carnap}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is both}{\Name[Rudolph]{Carnap} is only non-formatted}}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is only formatted}{\Name[Rudolph]{Carnap} is not mentioned}}.'' Both the main matter name and the front matter name were forgotten!
%
% This default behavior helps synchronize formatted and unformatted types of names. For example, if you wanted to use unformatted names in the footnotes and formatted names in the text (Section~\ref{sec:FrontFormat}), you could use, \emph{e.g.} \cmd{\SubvertName} right after the first use of a name in the body text, ensuring that all references in the text and notes would be short unless otherwise modified.\footnote{This manual takes advantage of that behavior at times in order to synchronize first and subsequent uses of names between formatted and unformatted sections of the body text.}
%
% \DescribeMacro{\LocalNames}
% \DescribeMacro{\GlobalNames}
% If, however, this ``global'' behavior of \cmd{\ForgetName} and \cmd{\SubvertName} is not desired, you can use \cmd{\LocalNames} to change that behavior and \cmd{\GlobalNames} to restore the default behavior. Both of these macros  work globally.
%
% After \cmd{\LocalNames,} if you are in a ``front matter'' section via the \texttt{frontmatter} option or \cmd{\NamesInactive,} \cmd{\ForgetName} and \cmd{\SubvertName} will only affect unformatted names. If you are in a ``main matter'' section via the \texttt{mainmatter} option or \cmd{\NamesActive,} then \cmd{\ForgetName} and \cmd{\SubvertName} will only affect formatted names. Section~\ref{sec:LocalNames} offers a long example.
%
% \subsection{``Text Tags''}
% \label{sec:tagtext}
%
% Sections~\ref{sec:TagName} and~\ref{sec:UntagName} deal with similar tagging features in the index. ``Text tags'' differ from index tags because they are not printed automatically with every name managed by \textsf{nameauth}. Section~\ref{sec:Hooksb} offers additional solutions that use the macros in this section.
%
% Instead of ``text tags,'' perhaps one should think about ``name information database entries.'' The macros in this section are named accordingly. We retain the ``text tag'' language for simplicity. 
%
% \DescribeMacro{\NameAddInfo}
% Text tags are independent of any other name conditionals, similar to index tags. This \cmd{\long} macro's syntax is:
% \begin{quote}
% \cmd{\NameAddInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag}
% \end{quote}
%
% For example, |\NameAddInfo[George]{Washington}{ (1732--99)}|\NameAddInfo[George]{Washington}{ (1732--99)} will associate the text \texttt{\textvisiblespace(1732--99)} with the name \cmd{\LWash} \LWash. Note, however, that the tag did not print automatically with the name.
%
% \DescribeMacro{\NameQueryInfo}
% To retrieve the information in a text tag, one uses the name as a key to the corresponding information:
% \begin{quote}
% \cmd{\NameQueryInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
% Thus, |``\NameQueryInfo[George]{Washington}.''| expands to ``\NameQueryInfo[George]{Washington}.'' Notice the space at the beginning of the tag. This is intentional, as with index tags. Sections~\ref{sec:TagName}, \ref{sec:UntagName}, and~\ref{sec:Hooksa}ff. illustrate how this can permit tags like asterisks, daggers, and footnotes in addition to tags that do need a space or some separation between them and the name.
%
% By using these text tag macros with the conditional macros, one can display information associated with a name based on  whether or the name has occurred. As of version 2.4, this can be done either outside of \cmd{\NamesFormat} and the other general hooks or inside those macros.
%
% \DescribeMacro{\NameClearInfo}
% \cmd{\NameAddInfo} will replace one text tag with another text tag, but it does not delete a text tag. That is the role of \cmd{\NameClearInfo}. The syntax is:
% \begin{quote}
% \cmd{\NameClearInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
%
% For example, |\NameClearInfo[George]{Washington}|\NameClearInfo[George]{Washington} will cause the macro |``\NameQueryInfo[George]{Washington}''| to produce nothing.
% \clearpage
%
% \subsection{Name Variant Macros}
% \subsubsection{\texttt{\textbackslash AKA}}
% \label{sec:AKA}
%
% \DescribeMacro{\AKA}
% \DescribeMacro{\AKA*}
% \cmd{\AKA} (meaning \textit{also known as}) handles pseudonyms, stage names, \emph{noms de plume}, and so on in order to replace typing manual cross-references in the index. The syntax for \cmd{\AKA} is:
% \begin{quote}
% \cmd{\AKA}\oarg{FNN}\marg{SNN}\oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names}\\
% \cmd{\AKA*}\oarg{FNN}\marg{SNN}\oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names}
% \end{quote}
% Only the \meta{FNN} and \meta{SNN} arguments from \cmd{\Name} and friends may be cross-referenced. The new syntax allows \cmd{\AKA} to cross-reference all name types. Both macros create a cross-reference in the index from the \meta{Alt. FNN}, \meta{Alt. SNN}, and \meta{Alt. names} fields to a name defined by \meta{FNN} and \meta{SNN}, regardless of whether that name has been used. Please consult also Section~\ref{sec:AKAtips}, which covers a number of in-depth examples of \cmd{\AKA.} The syntactic aspects of name formatting (caps and reversing) work with \cmd{\AKA}.
%
% Both macros print only the \meta{Alt. FNN} and \meta{Alt. SNN} fields in the body text. If the \meta{Alt. names} field is present, \cmd{\AKA} swaps \meta{Alt. names} with \meta{Alt. FNN} in the body text, similar to the naming macros.
%
% \cmd{\AKA*} has two functions. For Western names, where \meta{Alt. FNN} is present, \cmd{\AKA*} prints either just the \meta{Alt. FNN} or just the \meta{Alt. names} when they also are present. However, if \meta{Alt. FNN} is absent, \cmd{\AKA*} prints just \meta{Alt. names} if present, otherwise \meta{Alt. SNN}. See also Section~\ref{sec:TagName}.
%
% In this simple example we redefine the the default system of formatting to illustrate what happens with formatting by default:
% \begin{quote}\small
% \renewcommand*{\NamesFormat}{\scshape}|\renewcommand*{\NamesFormat}{\scshape}|\\
% |\Name{Jean, sans Peur}| |(\AKA{Jean,| |sans| |Peur}{Jean| |the| |Fearless})|\\ {\ttfamily was Duke of Burgundy 1404|--|1419.}
%
% \Name{Jean, sans Peur} (\AKA{Jean, sans Peur}{Jean the Fearless}) was Duke of Burgundy 1404--1419.
% \end{quote}
%
% ``\AKA{Jean, sans Peur}{Jean the Fearless}''\marginpar{\small\raggedleft\texttt{formatAKA}} usually receives no formatting because it is post-processed by \cmd{\MainNamesHook} in the main matter text and \cmd{\FrontNamesHook} otherwise. The \texttt{alwaysformat} option causes the first-use hooks to be used all the time, while the \texttt{formatAKA} option causes the first-use hooks to be used only at the first use:
% \ForgetName{Elizabeth, I}
% \begin{quote}\small
% \renewcommand*{\FrontNamesFormat}{\itshape}|\renewcommand*{\FrontNamesFormat}{\itshape}|\\
% \renewcommand*{\NamesFormat}{\scshape}|\renewcommand*{\NamesFormat}{\scshape}|\\
% |\LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''|\\
% \makeatletter\@nameauth@AKAFormattrue\makeatother
%
% \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''
%
% But if you switch to front matter, you will not get what you expect:\NamesInactive
%
% \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''
% \end{quote}
% \cmd{\AKA} works with the main/front formatting systems, but its ``first use'' naming system allows only one first use per name, per document.\footnote{This is intentionally a part of the design for \cmd{\AKA}.}
% Using \texttt{formatAKA} allows that one first-use instance to call the respective first-use formatting hooks. Of course, the \texttt{alwaysformat} option simply uses brute force to make everything call the first-use hooks.
%
% The following complex example has lines of source text interleaved with a point-by-point enumerated list, showing the Continental style. The small caps are a syntactic element of the name parameters themselves:
% \begin{enumerate}
% \item I tag the names for proper sorting.\\[4pt]
% |\PretagName[Heinz]{\textsc{Rühmann}}{Ruehmann, Heinz}%|\\
% |\PretagName[Heinrich Wilhelm]{\textsc{Rühmann}}%|\\
% |  {Ruehmann, Heinrich Wilhelm}%|
% \item I want ``\Name*[Heinz]{\textsc{Rühmann}}'' to be the main name of reference, so \cmd{\AKA*} uses his legal name as the cross-reference. \cmd{\AKA*} prints only ``Heinrich Wilhelm'' in the body text. Nevertheless, the index cross-reference will be complete with the surname.\\[4pt]
% |\AKA*[Heinz]{\textsc{Rühmann}}%|\\
% |  [Heinrich Wilhelm]{\textsc{Rühmann}} %|
% \item \cmd{\SubvertName} causes  \cmd{\FName} to print the short version via the ``subsequent-use'' \cmd{\MainNameHook.}\\[4pt]
% |\SubvertName[Heinz]{\textsc{Rühmann}}%|
% \item \cmd{\FName} prints ``\FName[Heinz]{\textsc{Rühmann}}.''\\[4pt]
% |``\FName[Heinz]{\textsc{Rühmann}}'' %|
% \item \cmd{\Name} prints ``\Name[Heinz]{\textsc{Rühmann}}.'' The small caps are syntactic, not typographic, because they are part of the argument to \cmd{\Name} itself.\\[4pt]
% |\Name[Heinz]{\textsc{Rühmann}} %|
% \end{enumerate}
% The resulting text is:
% \begin{quote}
% \AKA*[Heinz]{\textsc{Rühmann}}[Heinrich Wilhelm]{\textsc{Rühmann}}
% \SubvertName[Heinz]{\textsc{Rühmann}}``\FName[Heinz]{\textsc{Rühmann}}'' 
% \Name[Heinz]{\textsc{Rühmann}} (7 March 1902--3 October 1994) was a German film actor who appeared in over 100 films between 1926 and 1993.
% \end{quote}
%
% Using \Name[Bob]{Hope}, \ForgetName{Louis, XIV}\Name{Louis, XIV}, \Name{Lao-tzu}, and \Name{Gregory, I} as examples, we see how \cmd{\AKA} and \cmd{\AKA*} work:
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{ll}\toprule
% |\AKA[Bob]{Hope}[Leslie Townes]{Hope}| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}\\
% |\AKA*[Bob]{Hope}[Leslie Townes]{Hope}| & \AKA*[Bob]{Hope}[Leslie Townes]{Hope}\\
% |\AKA[Bob]{Hope}%|\\|  [Leslie Townes]{Hope}[Lester T.]| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]\\
% |\AKA*[Bob]{Hope}%|\\|  [Leslie Townes]{Hope}[Lester T.]| & \AKA*[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]\\\midrule
% |\AKA{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\
% |\AKA*{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\
% |\AKA{Lao-tzu}{Li, Er}| & \AKA{Lao-tzu}{Li, Er}\\
% |\AKA*{Lao-tzu}{Li, Er}| & \AKA{Lao-tzu}{Li, Er}\\\midrule
% |\AKA{Gregory, I}{Gregory}[the Great]| & \AKA{Gregory, I}{Gregory}[the Great]\\
% |\AKA*{Gregory, I}{Gregory}[the Great]| & \AKA*{Gregory, I}{Gregory}[the Great]\\\bottomrule
% \end{tabular}
% \end{quote}
%
% The alternate form ``Lester T. Hope'' in the previous table does not appear in the index, but only in the body text. A possible use here could involve ``spurious'' information or opinions that one might want to mention in the text but not the index. One produces \Name*{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great],'' along with a \emph{see} reference from ``Gregory the Great'' to ``Gregory I,'' via:\\[1ex]
% \indent\quad|\Name*{Gregory,| |I}| |``\AKA*{Gregory,| |I}{Gregory}[the| |Great]''|\medskip
%
% \cmd{\AKA} will not create multiple cross-references. Handle the special case where one moniker applies to multiple people with a manual solution, \emph{e.g.}, ``Snellius'' for both \Name*[Willebrord]{Snel van Royen} and his son \Name*[Rudolph]{Snel van Royen}:
%\begin{quote}
% |\index{Snellius|\verb!|!{}|see{Snel|\,|van|\,|Royen,|\,|Rudolph;%|\\ |Snel|\,|van|\,|Royen,|\,|Willebrord}}|
% \index{Snellius|see{Snel van Royen, Rudolph;%
% Snel van Royen, Willebrord}}
%\end{quote}
%
% Cross-references generated by \cmd{\AKA} and \cmd{\AKA*} are meant only to be \emph{see} references, never page entries. See also Section~\ref{sec:error}. In certain cases, the alternate name might need to be indexed with page numbers and \emph{see also} references. Do not use \cmd{\AKA} in those cases, rather, consider the following:
%
% \label{manualxref}\label{Rambam}%
%\begin{itemize}\small
% \item Refer to the person intended, \emph{e.g.}, \Name{Maimonides} (\AKA{Maimonides}{Moses ben-Maimon}):\\ |\Name{Maimonides}| |(\AKA{Maimonides}{Moses| |ben-Maimon})|
% \item We now have a name and a \emph{see} reference. Now one must refer to the alternate name, \emph{e.g.}, \Name{Rambam}: |\Name{Rambam}|.
% \item The alternate name must occur before making a cross-reference to the main name, in this case, \Name{Maimonides}.
% \item Add \verb!\index{Rambam|seealso{Maimonides}}! at the end of the document to ensure that it is the last entry among the cross-references. Generally, \emph{see also} references follow \emph{see} references in an index entry.\footnote{Different standards exist for punctuating index entries and cross-references. Check with your publisher, style guide, docs for \textsf{xindy} and \textsf{makeindex}, and \textsf{http://tex.stackexchange.com}.}
%\end{itemize}
%
% Using \cmd{\PretagName} helps avoid the need for manual index entries. Instead of doing a lot of extra work for some names, consider the following example:
%
% \begin{quote}\small
% {\ttfamily%
% |\PretagName{\textit{Doctor| |Angelicus}}{Doctor| |Angelicus}|\\
% |Perhaps| |the| |greatest| |medieval| |theologian was %|\\
% |\Name{Thomas,| |Aquinas} %|\\
% |(\AKA{Thomas,| |Aquinas}{Thomas| |of| |Aquino}), also known as %|\\
% |\AKA{Thomas, Aquinas}{\textit{Doctor Angelicus}}|.}
%
% \PretagName{\textit{Doctor Angelicus}}{Doctor Angelicus}
% Perhaps the greatest medieval theologian was
% \Name{Thomas, Aquinas} %
% (\AKA{Thomas, Aquinas}{Thomas of Aquino}), also known as %
% \AKA{Thomas, Aquinas}{\textit{Doctor Angelicus}}.
% \end{quote}
% We use the medieval form: |\Name{Thomas, Aquinas}| because ``Aquinas'' is not a surname, even though many people, including scholars, falsely use it as such. Section~\ref{sec:standards} talks about those unfortunate situations where one must use the Western form |\Name[Thomas]{Aquinas}.|
% \clearpage
%
% \subsubsection{\texttt{\textbackslash PName}}
%
% \DescribeMacro{\PName}
% \cmd{\PName} is a ``convenience macro'' meant for Western names. It generates a main name followed by a cross-reference in parentheses with the following syntax:
% \begin{quote}\small
% \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{other FNN}\marg{other SNN}\oarg{other alt.}
% \end{quote}
%
% Although \cmd{\PName} creates an easy shortcut, its drawbacks are many. It only can use the \meta{FNN}\meta{SNN} form of \cmd{\AKA}. Neither \cmd{\AKA*}, nor \cmd{\CapName}, \cmd{\CapThis}, \cmd{\RevComma}, \cmd{\RevName}, and the related package options work with \cmd{\PName.}
%
% The main name comes first, followed by the name that is only a \emph{see} reference. \cmd{\PName} can generate the following examples:
%
% \begin{quote}\small\setstretch{1.1}
% |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\
% |\PName*[Mark]{Twain}[Samuel L.]{Clemens}|\\
% |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\[1ex]
% \hbox{}\hfill \PName[Mark]{Twain}[Samuel L.]{Clemens}\\
% \hbox{}\hfill \PName*[Mark]{Twain}[Samuel L.]{Clemens}\\
% \hbox{}\hfill \PName[Mark]{Twain}[Samuel L.]{Clemens}\\[1ex]
% |\PName{Voltaire}[François-Marie]{Arouet}|\\
% |\PName*{Voltaire}[François-Marie]{Arouet}|\\
% |\PName{Voltaire}[François-Marie]{Arouet}|\\[1ex]
% \hbox{}\hfill \PName{Voltaire}[François-Marie]{Arouet}\\
% \hbox{}\hfill \PName*{Voltaire}[François-Marie]{Arouet}\\
% \hbox{}\hfill \PName{Voltaire}[François-Marie]{Arouet}
% \end{quote}
%
% \cmd{\PName} can be a bit sketchy with medieval names. You get \PName{William, I}{William, the Conqueror} with |\PName{William,| |I}{William,| |the Conqueror}.| Stay away from |\PName{William, I}{William}[the Conqueror]| because that is the old syntax that can break both \cmd{\AKA} and \cmd{\PName} if used in the leading arguments instead of in the trailing arguments. The old syntax can get you confused and lead you to type |\PName{William, I}[William]{the Conqueror}.| You would get a name that looked right in the body text but wrong in the index.
%
% Something like |\PName{Lao-tzu}{Li, Er}| ``\PName{Lao-tzu}{Li, Er}'' works well enough, but |\PName{Gregory, I}{Gregory}[the Great]|\ForgetName{Gregory, I} ``\PName{Gregory, I}{Gregory}[the Great]'' starts moving close to the old syntax.
%
% \subsection{Indexing Macros}
%
% \subsubsection{Indexing Control}
% \label{sec:SectionIndex}
%
% \DescribeMacro{\IndexActive}
% \DescribeMacro{\IndexInactive}
% Using the \texttt{noindex} option deactivates the indexing function of this package until \cmd{\IndexActive} occurs. Another macro, \cmd{\IndexInactive}, will deactivate indexing again. These can be used throughout the document, independently of \cmd{\ExcludeName}. They are global in scope, as are the other toggle macros in this package, so one must be explicit in turning indexing on and off.
%
% Please\marginpar{\small\raggedleft\cmd{\global}} note that these two macros can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect.\medskip
%
% \noindent\begin{tabular}{p{0.97\textwidth}}\toprule\hfil\bfseries Index tags only work when indexing is active.\hfil\\\bottomrule\end{tabular}
%
% \subsubsection{Indexing and \textsf{babel}}
% \label{sec:babel}
% Using\marginpar{\small\raggedleft \textsf{texindy}} \textsf{babel} with Roman page numbers will put \cmd{\textlatin} in the index entries if one includes a language that does not use the Latin alphabet\,---\,even if the main language does. The \texttt{texindy} program will ignore such references. This issue can affect \textsf{nameauth.}
%
% One fairly effective workaround for \texttt{texindy} redefines \cmd{\textlatin} to produce the page number itself within a certain scope like:
% \begin{quote}
% |\newcommand{\fixindex}[1]{\def\textlatin##1{##1}#1}|\\\dots\\
% |\fixindex{%|\\
% \meta{paragraphs of running text}|%|\\
% |}|
% \end{quote}
% Of course, one can opt to check if \cmd{\textlatin} is defined, save its value, redefine it, then restore it, perhaps even in an environment.
%
% \subsubsection{\texttt{\textbackslash IndexName}}
% 
% \DescribeMacro{\IndexName}
% This macro creates an index entry like those created by \cmd{\Name} and friends. It prints nothing in the body text. The syntax is:
% \begin{quote}
% \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
%
% \cmd{\IndexName} complies with the new syntax, where a suffixed pair in \meta{SNN} is a name/affix pair that can be ancient or Eastern. If \meta{FNN} are present, it ignores \meta{Alternate names}. Otherwise, if \meta{FNN} are absent, \cmd{\IndexName} sees \meta{Alternate names} as an affix using the old syntax.
%
% After \cmd{\IndexInactive} this macro does nothing until \cmd{\IndexActive} appears. It will not create index entries for names used with \cmd{\AKA} as cross-references.
%
% The indexing mechanism in the \textsf{nameauth} package follows \emph{Chicago Manual of Style} standards regarding Western names and affixes. Thus the name \LChes\ becomes ``Sullenberger, Chesley B., III'' in the index. Otherwise, if \meta{FNN} is absent, the comma would trigger ancient, medieval, and Eastern name forms in the index.
%
% \subsubsection{Index Sorting}
% \label{sec:IndexSort}
%
% The general practice for sorting with \texttt{makeindex -s} involves creating your own |.ist| file (pages 659--65 in \emph{The Latex Companion}). Otherwise use the following form that works with both \texttt{makeindex} and \texttt{texindy}: |\index{|\meta{sortkey}|@|\meta{actual}|}|
%
%Before version 2.0 of \textsf{nameauth}, one had to sort and index names like \Name[Jan]{Łukasiewicz} and \Name*{Æthelred, II} by putting them between \cmd{\IndexInactive} and \cmd{\IndexActive} while creating manual index entries.\medskip
% 
% \DescribeMacro{\PretagName}
% Fortunately, the current versions of \textsf{nameauth} have adopted an easier solution. The syntax of \cmd{\PretagName} is like that of \cmd{\TagName}:
% \begin{quote}
% \cmd{\PretagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag}
% \end{quote}
%
% Although the \cmd{\PretagName} macro might look similar to the the other tagging macros, its use and scope is quite a bit different:
% \begin{itemize}\small
% \item You can ``pretag'' any name and any cross-reference.
% \item You can ``tag'' and ``untag'' only names, not cross-references.
% \item There is no command to undo a ``pretag.''
% \end{itemize}
% \cmd{\PretagName} creates a sort key terminated with the ``actual'' character, which is |@| by default. Do not include the ``actual'' character in the pretag.
% Here is an example of its use:
% \begin{quote}
% |\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan}|\\
% |\PretagName{Æthelred, II}{Aethelred 2}|
% \end{quote}
%
% One need only pretag names once in the preamble. Every time that one refers to \Name[Jan]{Łukasiewicz} or \Name{Æthelred, II}, the proper index entry will be created. If you create a cross-reference with \cmd{\AKA} and you want to pretag it, see Section~\ref{sec:AKA}.\medskip
%
% \DescribeMacro{\IndexActual}
% If you need to change the ``actual'' character, such as with \texttt{gind.ist}, put |\IndexActual{=}| in the preamble.
%
% \subsubsection{\texttt{\textbackslash TagName}}
% \label{sec:TagName}
%
% \DescribeMacro{\TagName}
% This macro creates an index tag that will be appended to all index entries for a corresponding \cmd{\Name} from when it is invoked until the end of the document or a corresponding \cmd{\UntagName}. Both \cmd{\TagName} and \cmd{\UntagName} handle their arguments like \cmd{\IndexName}. If global tags are desired, tag names in the preamble.
% \begin{quote}
% \cmd{\TagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag}
% \end{quote}
%
% Tags are not ``pretags.'' To help sort that out, we look at what gets affected by these commands:\medskip
%
% \begin{tabular}{r@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}l}
% & \cmd{\PretagName} & \\
% |\index{| & |Aethelred 2@| & |Æthelred II| & |, king}|\\
% & & & \cmd{\TagName} and \cmd{\UntagName}\\
% \end{tabular}\medskip
%
% All the tagging commands use the name arguments as a reference point. \cmd{\PretagName} generates the leading sort key while \cmd{\TagName} and \cmd{\UntagName} affect the trailing content of the index entry.
%
% Tags created by \cmd{\TagName} can be helpful in the indexes of history texts, as can other package features. Here \cmd{\TagName} causes the \textsf{nameauth} indexing macros to append ``\texttt{,\textvisiblespace pope}'' to the index entries for \Name*{Gregory, I} and \Name*{Leo, I}:
% \begin{quote}\small
% \begin{tabular}{p{0.5\textwidth}p{0.28\textwidth}}
% |\TagName{Leo, I}{, pope}| |\TagName{Gregory, I}{, pope}| & (in the preamble)\\
% \dots & \\
% |\Name*{Leo,| |I}| |\Name*{Gregory,| |I}| & (first references to \ForgetName{Leo, I}\Name*{Leo, I} and \ForgetName{Gregory, I}\Name*{Gregory, I})\\
% \dots & \\
% |\Name*{Leo, I} was known as| |\AKA{Leo, I}{Leo}[the Great].| & \Name*{Leo, I} was known as \AKA{Leo, I}{Leo}[the Great].\\
% \dots & \\
% |\Name{Gregory,| |I}| |``\AKA*{Gregory,| |I}%| |{Gregory}[the Great],''| |another| |major| |pope.| & \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great],'' another major pope.\\
% \end{tabular}
% \end{quote}
%
% Tags are literal text that can be daggers, asterisks, and even specials. For example, all fictional names in the index of this manual are tagged with an asterisk. One must add any desired spacing to the start of the tag. Tagging aids scholarly indexing and can include life/regnal dates and other information.
%
% \cmd{\TagName} works with all name types, not just medieval names. Back in Section~\ref{sec:start} we had the example of \AKA[James Earl]{Carter, Jr.}[Jimmy]{Carter} (cross-reference in the index). \cmd{\TagName} adds ``\texttt{,\textvisiblespace president}'' to his index entry\IndexName[James Earl]{Carter, Jr.}.
%
% You can use the \marg{tag} field of \cmd{\TagName} to add specials to index entries for names. Every name in this document is tagged with at least \verb!{|hyperpage}! to allow hyperlinks in the index using the \textsf{ltxdoc} class and \textsf{hypdoc} package.
%
% \subsubsection{\texttt{\textbackslash UntagName}}
% \label{sec:UntagName}
%
% \DescribeMacro{\UntagName}
% \cmd{\TagName} will replace one tag with another tag, but it does not remove a tag from a name. That is the role of \cmd{\UntagName}. The syntax is:
% \begin{quote}
% \cmd{\UntagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
%
%  By using \cmd{\TagName} and \cmd{\UntagName}, one can disambiguate different people with the same name. For example:
%
% \begin{quote}\small
% \ttfamily This refers to |\Name*[John]{Smith}|.\\
% Now another |\ForgetName[John]{Smith}%|\\
% |\TagName[John]{Smith}{ (other)}\Name[John]{Smith}|.\\
% Then a third |\ForgetName[John]{Smith}%|\\
% |\TagName[John]{Smith}{ (third)}\Name[John]{Smith}|.\\
% Then the first |\UntagName[John]{Smith}\Name*[John]{Smith}|.
%
% \normalfont This refers to \Name*[John]{Smith}.\hfill\emph{index}: Smith, John\\
% Now another \ForgetName[John]{Smith}\TagName[John]{Smith}{* (other)\string|hyperpage}\Name[John]{Smith}.\hfill\emph{index}: Smith, John (second)\\
% Then a third \ForgetName[John]{Smith}\TagName[John]{Smith}{* (third)\string|hyperpage}\Name[John]{Smith}.\hfill\emph{index}: Smith, John (third)\\
% Then the first \TagName[John]{Smith}{*\string|hyperpage}\Name*[John]{Smith}.\hfill\emph{index}: Smith, John
% \end{quote}
%
% The tweaking macros \cmd{\ForgetName} and \cmd{\SubvertName} make it seem like you are dealing with three people who have the same name. The index tags will group together those entries with the same tag.\footnote{Since this document, unlike the example above, puts an asterisk by all fictional names in the index, it puts an asterisk at the beginning of the tags above and does not \cmd{\UntagName} \Name*[John]{Smith}, but retags him with an asterisk again.}
%
% \subsubsection{Global Name Exclusion}
% 
% \DescribeMacro{\ExcludeName}
% \label{sec:exclude}
% This macro globally prevents the indexing of a particular name or cross-reference. If you do not use it at the beginning of the document, you may not exclude any name or cross-reference that has been used already. The syntax is:
% \begin{quote}
% \cmd{\ExcludeName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}
% \end{quote}
%
% Consider the following example, where you will see excluded names printed in the body text with all the formatting and other features:
% \begin{quote}
% |\ExcludeName[Kris]{Kringle}|\ExcludeName[Kris]{Kringle}\\
% |\Name[Kris]{Kringle}| and |\Name[Kris]{Kringle}|:\\
% \Name[Kris]{Kringle} and \Name[Kris]{Kringle}.
% \end{quote}
%
% Nevertheless, no matter how many times you use \Name[Kris]{Kringle} in the body text, the name will never appear in the index. Remember the \Name{Grinch} from Section~\ref{sec:tests}? He will not appear in the index either.
%
% \cmd{\ExcludeName} also prevents cross-references. You may see output in the body text, but no \emph{see}-reference will appear in the index:
% \begin{quote}
% |\ExcludeName[Santa]{Claus}|\ExcludeName[Santa]{Claus}\\
% |\AKA[Kris]{Kringle}[Santa]{Claus}|\\ \AKA[Kris]{Kringle}[Santa]{Claus}
% \end{quote}
%
% Instead of using \cmd{\ExcludeName}, which basically prevents the indexing mechanism of the naming macros from doing anything with a particular name, it is far likelier that you would use the index control macros (Section~\ref{sec:SectionIndex}).
% \clearpage
%
% \subsection{Longer Examples}
%
% \subsubsection{Tips for \texttt{\textbackslash AKA}}
% \label{sec:AKAtips}
%
% \begin{itemize}\small
% \item \oarg{FNN}\marg{SNN} is the main name. \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} is the cross-reference. Forgetting this may cause errors.
% \item The old syntax causes \cmd{\AKA} and \cmd{\AKA*} to fail: |\AKA{Louis}[XIV]{Sun King}| and |\AKA{Gregory}[I]{Gregory}[the Great]|.
% \item The \meta{Alt. SNN} field uses comma-delimited suffixes.
% \item The \meta{Alt. names} field does not use comma-delimited suffixes.
% \item Eastern names work as pseudonyms, with all that entails. One can refer to \Name[Lafcadio]{Hearn} as \CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}:\\\hbox{}\qquad|\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}|.
% \item Particles work: \CapThis\AKA[Charles]{du Fresne}{du Cange} is the alternate name for \Name[Charles]{du Fresne}, which is capitalized via \cmd{\CapThis}\cmd{\AKA}. See also Section~\ref{sec:Particles}.
% \item Reversing works, \emph{e.g.},\\\hbox{}\qquad \cmd{\RevComma}: \RevComma\AKA[Bob]{Hope}[Leslie Townes]{Hope}\\\hbox{}\qquad \cmd{\RevName}: \RevName\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}
% \item The name fields of \cmd{\PretagName} correspond with the \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} fields of \cmd{\AKA}:\\[1ex]\hbox{}\qquad |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş}| matches\\\hbox{}\qquad |\PretagName{Vlad,| |Ţepeş}{Vlad| |Tepes}|\\[1ex] This form does not match: |\PretagName{Vlad}[Ţepeş]{Vlad| |Tepes}|.
% \item With stage names like \Name[The Amazing]{Kreskin}, if you want them in the index, use |\Name[The Amazing]{Kreskin}| to get ``Kreskin, The Amazing.'' \IndexInactive Otherwise use something like |\Name[J.]{Kreskin}[The Amazing]| to get \Name[J.]{Kreskin}[The Amazing] in the text and ``Kreskin, J.'' in the index.\\[1ex] Using \cmd{\AKA} with such names looks like: |\AKA[The Amazing]{Kreskin}| |[Joseph]{Kresge}| and |\AKA[J.]{Kreskin}[Joseph]{Kresge}|.\IndexActive You get \Name*[The Amazing]{Kreskin}, a.k.a. \AKA[The Amazing]{Kreskin}[Joseph]{Kresge}.
% \item Special cases like ``Iron Mike'' Tyson as the nickname for \Name[Mike]{Tyson} may be handled in a number of ways.
% \begin{enumerate}\small
% \item Follow |``Iron Mike''| with |\IndexName[Mike]{Tyson}| and do whatever you want in the text. This may be the easiest solution.
% \item Use |``\AKA[Mike]{Tyson}{Iron Mike}''| to create ``\AKA[Mike]{Tyson}{Iron Mike}'' in the text and a \emph{see}-type cross-reference to ``Tyson, Mike'' in the index. Be sure to have an occurrence of |\Name[Mike]{Tyson}| in the text. See also Section~\ref{sec:AKA}. This is the best solution in terms of how \textsf{nameauth} is designed.
% \item Always get ``Iron Mike Tyson'' with something like:\\[1ex]
% |\newcommand*{\Iron}{\SubvertName[Mike]{Tyson}%|\\
% |\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}}|\\[1ex]
% \newcommand*{\Iron}{\SubvertName[Mike]{Tyson}\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}}
% |``\Iron''| gives you ``\Iron.''\footnote{In typesetting this manual I defined the macro \cmd{\Iron} and others like it on one continuous line because defining a macro over multiple lines with comment characters ending them in \textsf{ltxdoc} and a \texttt{.dtx} file caused extra spaces to be inserted.} You are responsible for typesetting the first use and creating a cross-reference. This solution runs somewhat contrary to the design principles of \textsf{nameauth}, but it may be helpful if you want the invariant name ``\Iron'' to recur and you want to save typing.
% \end{enumerate}
% \end{itemize}
%
% \subsubsection{Unicode and NFSS}
% \label{sec:Unicode}
%
% The following subset of extended Latin Unicode characters are available ``out of the box'' using NFSS, \textsf{inputenc}, and \textsf{fontenc}:
%
% \begin{quote}\small\setstretch{1.2}
% \begin{tabular}{llll}\toprule
% \scshape À Á Â Ã Ä Å Æ & \scshape Ç È É Ê Ë & \scshape Ì Í Î Ï Ð Ñ & \scshape small caps \\
% À Á Â Ã Ä Å Æ & Ç È É Ê Ë & Ì Í Î Ï Ð Ñ & normal \\[1ex]
% \scshape Ò Ó Ô Õ Ö Ø & \scshape Ù Ú Û Ü Ý & \scshape Þ ß & \scshape small caps \\
% Ò Ó Ô Õ Ö Ø & Ù Ú Û Ü Ý & Þ ß & normal \\[1ex]
% \scshape à á â ã ä å æ & \scshape ç è é ê ë & \scshape ì í î ï ð ñ & \scshape small caps \\
% à á â ã ä å æ & ç è é ê ë & ì í î ï ð ñ & normal \\[1ex]
% \scshape ò ó ô õ ö ø & \scshape ù ú û ü ý & \scshape þ ÿ & \scshape small caps \\
% ò ó ô õ ö ø & ù ú û ü ý & þ ÿ & normal \\[1ex]
% \scshape Ă ă Ą ą Ć ć Č č & \scshape Ď ď Đ đ Ę ę Ě ě & \scshape Ğ ğ İ ı & \scshape small caps \\
% Ă ă Ą ą Ć ć Č č & Ď ď Đ đ Ę ę Ě ě & Ğ ğ İ ı & normal \\[1ex]
% \scshape Ĳ ĳ Ľ ľ Ł ł & \scshape Ń ń Ň ň Œ œ & \scshape Ŕ ŕ Ř ř & \scshape small caps \\
% Ĳ ĳ Ľ ľ Ł ł & Ń ń Ň ň Œ œ & Ŕ ŕ Ř ř & normal \\[1ex]
% \scshape Ś Ş ş Š š Ţ ţ Ť ť & \scshape Ů ů Ű ű & \scshape Ź ź Ż ż Ž ž & \scshape small caps \\
% Ś Ş ş Š š Ţ ţ Ť ť & Ů ů Ű ű & Ź ź Ż ż Ž ž &  normal \\\bottomrule
% \end{tabular}
% \end{quote}
%
% Additional accents and glyphs can be used with Unicode input, NFSS, \textsf{inputenc}, and \textsf{fontenc} when using fonts with TS1 glyphs, \emph{e.g.}, |\usepackage{lmodern}| (per the table on pages 455--63 in \emph{The Latex Companion}). The following example lets you type, ``In Congreſs, July 4, 1776.''
% \begin{quote}
% |\usepackage{newunicodechar}|\\
% |\DeclareTextSymbolDefault{\textlongs}{TS1}|\\
% |\DeclareTextSymbol{\textlongs}{TS1}{115}|\\
% |\newunicodechar{ſ}{\textlongs}|
% \end{quote}
%
% Although |\newunicodechar{ā}{\=a}| allows |\Name{Ghazāli}| to generate \IndexInactive\Name{Ghaz\=ali}\IndexActive, one must be careful with control sequences like |\=a| fail when using \texttt{makeindex} and \texttt{gind.ist}. For example, the \textsf{ltxdoc} class, with \texttt{gind.ist}, turns the default ``actual'' character |@| into |=|. Using |\index{Gh{\=a}zali}| halts execution. Using |\index{Gh\=azali}| gives an ``azali'' entry sorted under ``Gh'' (thanks \Name[Dan]{Luecking}). This issue is not specific to \textsf{nameauth}.
%
% Such issues with \texttt{gind.ist} are not the only concerns one must have about NFSS, \textsf{inputenc}, and \textsf{fontenc} when using Unicode. Although the manner in which glyphs are handled is quite powerful, it also is fragile. Any \TeX\ macro that partitions its argument without using delimiters can break Unicode under NFSS.
%
% Consider the following examples with |\def\foo#1#2#3\relax{<#1#2><#3>}|:
% \begin{quote}\setstretch{1.2}
% \def\foo#1#2#3\relax{<#1#2><#3>}
% \begin{tabular}{lll}\toprule
% Argument & Macro & Result\\\midrule
% |abc| & |\foo abc\relax| & \foo abc\relax\\
% |{æ}bc| & |\foo {æ}bc\relax| & \foo {æ}bc\relax\\
% \cmd{\ae bc} & |\foo \ae bc\relax| & \foo \ae bc\relax\\\bottomrule
% \end{tabular}
% \end{quote}
%
% The arguments in the last example always put |c| in |#3|, with the first two glyphs in |#1#2.| Now here is where things get tricky:
% \begin{quote}\setstretch{1.2}
% \begin{tabular}{llll}\toprule
% Argument & Macro & Engine & Result\\\midrule
% |æbc| & |\foo æbc\relax| & \texttt{xelatex} & <æb><c>\\
% |æbc| & |\foo æbc\relax| & \texttt{lualatex} & <æb><c>\\
% |æbc| & |\foo æbc\relax| & \texttt{pdflatex} & <æ><bc>\\\bottomrule
% \end{tabular}
% \end{quote}
%
% In both \texttt{xelatex} and \texttt{lualatex} you get the same results as the previous table, where |c| is in |#3| and the first two glyphs are in |#1#2.| However, using \texttt{pdflatex} with \textsf{inputenc} and \textsf{fontenc} causes |æ| by itself to use |#1#2|.
%
% Without digging into the details of font encoding and NFSS, we can say in simple terms that |æ| is ``two arguments wide.'' Any macro where this |#1#2| pair gets split into |#1| and |#2| will produce either the error \texttt{Unicode char \dots not set up for LaTeX} or the error \texttt{Argument of \textbackslash UTFviii@two@ octets has an extra \}.} This is not just specific to \textsf{nameauth}.
%
% Using \cmd{\CapThis} can trigger this kind of error when the \emph{first} character of the \meta{SNN} field is an extended-Latin or similarly accented or extended Unicode character. Using \cmd{\AccentCapThis} can trigger this kind of error when the \emph{second} character of the \meta{SNN} field is a similarly accented or extended character.
%
% \LaTeX\ also removes spaces in a manner that one should remember:
% \begin{quote}\setstretch{1.2}
% \def\foo#1#2#3\relax{<#1#2><#3>}
% \begin{tabular}{lll}\toprule
% Argument & Macro & Result\\\midrule
% |a b c| & |\foo a b c\relax| & \foo a b c\relax\\
% |ab c| & |\foo ab c\relax| & \foo ab c\relax\\
% |a bc| & |\foo a bc\relax| & \foo a bc\relax\\
% |abc| & |\foo abc\relax| & \foo abc\relax\\\bottomrule
% \end{tabular}
% \end{quote}
% Notice that if a space exists between the first two arguments,the space gets gobbled between the first two arguments, but retained in the third. This pertains to the way that \LaTeX\ allows for spaces after control sequences and tries to fetch the undelimited |#1#2.| Since |#3| terminates the argument list, it gets ``everything else.'' Nor would using \cmd{\obeyspaces} and \cmd{\ignorespaces} always get the desired result without a certain degree of complexity.
%
% Here is why using explicit spacing macros with one-character particles when using \cmd{\CapThis} and \cmd{\AccentCapThis} helps fix the issue of gobbled spaces, and why non-breaking spaces are preferred:\footnote{Given that you would not want a bad break between a particle and a name.}
% \begin{quote}\small\setstretch{1.2}
% \def\foo#1#2#3\relax{<#1#2><#3>}
% \begin{tabular}{lll}\toprule
% Argument & Macro & Result\\\midrule
% |a~bc| & |\foo a~bc\relax| & \foo a~bc\relax\\
% |a\nobreakspace bc| & |\foo a\nobreakspace bc\relax| & \foo a\nobreakspace bc\relax\\
% |a\space bc| & |\foo a\space bc\relax| & \foo a\space bc\relax\\\bottomrule
% \end{tabular}
% \end{quote}
%
% Sections~\ref{sec:standards} and~\ref{sec:accents} have information related to these topics and the \textsf{nameauth} package.
% \clearpage
%
% \subsubsection{\LaTeX\ Engines}
% \label{sec:engines}
%
% The \textsf{nameauth} package tries to work with multiple languages and typesetting engines. The following preamble snippet from this manual illustrates how that can be done:
% \begin{quote}
% |\usepackage{ifxetex}|\\
% |\usepackage{ifluatex}|\\
% |\ifxetex|\hfill |% uses fontspec|\\
% \hbox{\quad}|\usepackage{fontspec}|\\
% \hbox{\quad}|\defaultfontfeatures{Mapping=tex-text}|\\
% \hbox{\quad}|\usepackage{xunicode}|\\
% \hbox{\quad}|\usepackage{xltxtra}|\\
% |\else|\\
% \hbox{\quad}|\ifluatex|\hfill |% also uses fontspec|\\
% \hbox{\quad}\hbox{\quad}|\usepackage{fontspec}|\\
% \hbox{\quad}\hbox{\quad}|\defaultfontfeatures{Ligatures=TeX}|\\
% \hbox{\quad}|\else|\hfill |% traditional NFSS|\\
% \hbox{\qquad}|\usepackage[utf8]{inputenc}|\\
% \hbox{\qquad}|\usepackage[TS1,T1]{fontenc}|\\
% \hbox{\quad}|\fi|\\
% |\fi|
% \end{quote}
%
% This arrangement worked best for this manual, which has been tested with all three engines. This example is not meant to be the only possible way to check which engine you are using and how to set things up.
%
% The following can be used in the text itself to allow for conditional processing that helps one to document work under multiple engines:
%
% \begin{quote}
% |\ifxetex| \meta{xelatex text}|%|\\
% |\else|\\
% \hbox{\quad}|\ifluatex|\\
% \hbox{\qquad}|\ifpdf |\meta{lualatex in pdf mode text}|%|\\
% \hbox{\qquad}|\else |\meta{lualatex in dvi mode text}|%|\\
% \hbox{\qquad}|\fi|\\
% \hbox{\quad}|\else|\\
% \hbox{\qquad}|\ifpdf |\meta{pdflatex text}|%|\\
% \hbox{\qquad}|\else |\meta{latex text}|%|\\
% \hbox{\qquad}|\fi|\\
% \hbox{\quad}|\fi|\\
% |\fi|
% \end{quote}
% \clearpage
%
% \subsubsection{\texttt{\textbackslash LocalNames}}
% \label{sec:LocalNames}
%
% As mentioned previously in Section~\ref{sec:Tweaks}, both \cmd{\ForgetName} and \cmd{\SubvertName} usually affect both main-matter and front-matter names. This default behavior can be quite helpful. Nevertheless, there are cases where it is undesirable. This section shows \cmd{\Localnames} and \cmd{\Globalnames} in action, limiting the behavior of the ``tweaking macros'' to either the main or front matter.
%
% We begin by defining a macro that will report to us whether a name exists in the main matter, front matter, both, or none:
% \def\CheckChuck{\IfFrontName[Charlie]{Chaplin}%
%   {\IfMainName[Charlie]{Chaplin}{both}{front}}%
%   {\IfMainName[Charlie]{Chaplin}{main}{none}}}%
% \begin{quote}
% |\def\CheckChuck{%\IfFrontName[Charlie]{Chaplin}%|\\
% |  {\IfMainName[Charlie]{Chaplin}{both}{front}}%|\\
% |  {\IfMainName[Charlie]{Chaplin}{main}{none}}}%|
% \end{quote}
% Next we create a formatted name in the main matter:
% \begin{quote}
% |\Name*[Charlie]{Chaplin}|\hfill\Name*[Charlie]{Chaplin}\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% Now we switch to an unformatted section and create a name there. Observe that \cmd{\global} precedes \cmd{\NamesInactive} because we want those effects to persist beyond the immediate scope of the \texttt{quote} environment:
% \begin{quote}
% |\global\NamesInactive|\global\NamesInactive\\
% |\Name*[Charlie]{Chaplin}|\hfill\Name*[Charlie]{Chaplin}\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% Now we are in a ``front matter section.'' We now have two names. They look and behave the same, but are two different ``species'' with independent first and subsequent uses. We use \cmd{\Localnames} to make \cmd{\ForgetName} and \cmd{\SubvertName} local in scope. We then forget the name in the unformatted section:
% \begin{quote}
% |\LocalNames|\LocalNames\\
% |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% Since the ``front-matter name'' was removed, only a ``main-matter name'' exists. We now ``subvert'' the front-matter name to bring its ``existence'' back again and switch to the main section. See that \cmd{\global} precedes \cmd{\NamesActive} because we used \cmd{\global} previously and want a similar effect:
% \begin{quote}
% |\SubvertName[Charlie]{Chaplin}|\SubvertName[Charlie]{Chaplin}\\
% |\global\NamesActive|\global\NamesActive\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% Now both names exist again, but \cmd{\ForgetName} and \cmd{\SubvertName} are still local in scope. We forget the main-matter name and additionally reset the default behavior so that \cmd{\ForgetName} and \cmd{\SubvertName} will be global:
% \begin{quote}
% |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}\\
% |\GlobalNames|\GlobalNames\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% Finally, we forget everything. Even though we are in a main-matter section, the front-matter control sequence goes away:
% \begin{quote}
% |\ForgetName[Charlie]{Chaplin}|\ForgetName[Charlie]{Chaplin}\\
% |\CheckChuck|\hfill\CheckChuck
% \end{quote}
% \clearpage
%
% \subsubsection{Hooks: Intro}
% \label{sec:Hooksa}
%
% Before\marginpar{\small\raggedleft Margin\break Paragraphs} we get to the use of text tags and name conditionals in name formatting, we begin with an intermediate example to illustrate that something more complex can occur in \cmd{\NamesFormat}. Here we put the first mention of a name in boldface, along with a marginal notation if possible:\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.}
% \begin{quote}
% |\let\OldFormat\NamesFormat%|\\
% |\renewcommand*\NamesFormat[1]%|\\
% |  {\textbf{#1}\ifinner\else|\\
% |  \marginpar{\raggedleft\scriptsize #1}\fi}|\\
% \dots\\
% |\let\NamesFormat\OldFormat%|
% \end{quote}
% Changes to \cmd{\NamesFormat} should not rely merely on scoping rules to keep them ``local'' but should be changed and reset explicitly, or else odd side effects can result, especially with more exotic changes to \cmd{\NamesFormat}. We now use the example above in a sample text:
% \begin{quote}
% \let\OldFormat\NamesFormat\ignorespaces%
% \renewcommand*\NamesFormat[1]%
%   {\textbf{#1}\ifinner\else
%   \marginpar{\raggedleft\scriptsize #1}\fi}%
% |\PretagName{Vlad, Ţepeş}{Vlad Tepes}% for accented names|\\[2ex]
% {\small |\Name{Vlad| |III,| |Dracula},| |known| |as| |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş},| |``\AKA*{Vlad| |III,| |Dracula}{Vlad}[the| |Impaler]''| |after| |his| |death,| |was| |the| |son| |of| |\Name{Vlad| |II,| |Dracul},| |a| |member| |of| |the| |Order| |of| |the| |Dragon.| |Later| |references| |to| |``\Name{Vlad| |III,| |Dracula}''| |appear| |thus.|}\\[2ex]
% \Name{Vlad III, Dracula}, known as \AKA{Vlad III, Dracula}{Vlad, Ţepeş}, ``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler]''  after his death, was the son of \Name{Vlad II, Dracul}, a member of the Order of the Dragon. Later references to ``\Name{Vlad III, Dracula}'' appear thus.
% \let\NamesFormat\OldFormat%
% \end{quote}
%
% Now again we have reverted to the original form of \cmd{\NamesFormat} and we get \ForgetName{Vlad III, Dracula}\Name{Vlad III, Dracula} and \Name{Vlad III, Dracula}. For references to ``Vlad'' instead of ``\Name{Vlad III, Dracula}'' one could use |\Name{Vlad, III Dracula}|. Do not mix these forms with each other or with the old syntax, lest errors bite! You would get multiple index entries, unwanted cross-references, and unexpected forms in the text. The simplified interface greatly helps one to avoid this.
%
% \let\OldMainHook\MainNameHook%
% You cannot re-enter \cmd{\Name} or \cmd{\AKA} by calling them from within \cmd{\Namesformat,} \cmd{\FrontNameHook,} or \cmd{\MainNameHook,} as the next example shows:
% \begin{quote}\small
% |\renewcommand*\MainNameHook[1]%|\\
% |{%|\\
% |  {#1}%|\\
% |  \IndexInactive%|\\
% |  \Name{foo}\AKA{bar}{baz}%|\\
% |  \IndexActive%|\\
% |}|
% \end{quote}
% \renewcommand*\MainNameHook[1]{{#1}\IndexInactive\Name{foo}\AKA{bar}{baz}\IndexActive}%
% Calling, \emph{e.g.}, |\Wash| produces \Wash, without foo, bar, or baz. \cmd{\Name} and \cmd{\AKA} expand to nothing. Version 2.4 of \textsf{nameauth} prevents stack-overflows both in this case and if you called the naming macros as their own arguments. |\Name{foo\Name{bar}}| would produce ``\textsc{foo}'' in the text and ``foo\textsc{bar}'' in the index. As you see, these cases are to be avoided.
% \let\MainNameHook\OldMainHook%
%
% \subsubsection{Hooks: Life Dates}
% \label{sec:Hooksb}
% We can use name conditionals (Section~\ref{sec:tests}) and text tags (Section~\ref{sec:tagtext}) to add life information to names when desired.
%
% \DescribeMacro{\if@nameauth@InName}
% \DescribeMacro{\if@nameauth@InAKA}
% The example \cmd{\NamesFormat} below adds a text tag to the first occurrences of main-matter names. It uses internal macros of \cmd{\@nameauth@Name.} To prevent errors, the Boolean values \cmd{\@nameauth@InName} and \cmd{\@nameauth@InAKA} are true only within the scope of \cmd{\@nameauth@Name} and \cmd{\AKA} respectively.
%
% \DescribeMacro{\@nameauth@toksa}
% \DescribeMacro{\@nameauth@toksb}
% \DescribeMacro{\@nameauth@toksc}
% This package makes three token registers available to facilitate using the name conditional macros as we do below. Using these registers allows accented names to be recognized properly. In \cmd{\AKA} the token registers are copies of the \emph{last} three arguments, corresponding to the pseudonym. Nevertheless, they have the same names as the registers in \cmd{\@nameauth@Name} because they work the same way and may be easier to use this way.
%
% We assume that we will not be using the \texttt{alwaysformat} option, meaning that we only call this hook once for a first use:\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.}
% \begin{quote}\small
% |\newif\ifNoTextTag%|\hfill|allows us to work around \ForgetName|\\
% |\let\OldFormat\NamesFormat%|\hfill|save the format|\\
% |\makeatletter%|\hfill|access internals|\\
% |\renewcommand*\NamesFormat[1]%|\\
% |{%|\\
% |  \let\ex\expandafter%|\hfill|reduce typing|\\
% |  \textbf{#1}%|\\
% |  \if@nameauth@InName%|\hfill|do only in \@nameauth@Name|\\
% |    \ifNoTextTag%|\hfill|true branch disables tags|\\
% |    \else%|\hfill|take false branch|\\
% |      \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo%|\\
% |      \ex\ex\ex\ex\ex\ex\ex[%|\\
% |      \ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]%|\\
% |      \ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}%|\\
% |      \ex[\the\@nameauth@toksc]%|\\
% |    \fi|\\
% |  \fi|\\
% |  \if@nameauth@InAKA%|\hfill|do only in \AKA|\\
% |    \ifNoTextTag\else|\\
% |      \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo%|\\
% |      \ex\ex\ex\ex\ex\ex\ex[%|\\
% |      \ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]%|\\
% |      \ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}%|\\
% |      \ex[\the\@nameauth@toksc]%|\\
% |    \fi|\\
% |  \fi|\\
% |  \global\NoTextTagfalse%|\hfill|reset tag suppression|\\
% |}|\\
% |\makeatother%|
% \end{quote}
%
% The example above prints tags by default in the false path of \cmd{\NoTextTag}, while suppressing them in the true path.
%
% Before we can refer to any text tags, we must create them. Please pardon the fact that I am going to ``avoid the truth'' about the tag used for ``Atatürk'' below in order to illustrate certain points regarding \cmd{\AKA.} I will tell the truth later when this group of examples is complete:
% \begin{quote}\small
% |\NameAddInfo[George]{Washington}{ (1732--99)}%|\\
% |\NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}%|\\
% |\NameAddInfo{Atatürk}{ (a special surname granted 1934)}%|
% \end{quote}
% \NameAddInfo[George]{Washington}{ (1732--99)}%
% \NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}%
% \NameAddInfo{Atatürk}{ (a special surname granted 1934)}%
% \NameAddInfo{\kern0pt Atatürk}{ (a special surname granted 1934)}%
% \NameAddInfo{Atatürk\kern0pt}{ (a special surname granted 1934)}%
% We begin using the modified \cmd{\NamesFormat} under normal conditions:
% \newif\ifNoTextTag%
% \let\OldFormat\NamesFormat%
% \let\OldFrontFormat\FrontNamesFormat%
% \makeatletter\renewcommand*\NamesFormat[1]{\let\ex\expandafter\textbf{#1}\if@nameauth@InName\ifNoTextTag\else\ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\fi\fi\if@nameauth@InAKA\ifNoTextTag\else\ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\fi\fi\global\NoTextTagfalse}\makeatother
% \ForgetName[George]{Washington}%
% \begin{quote}\small
% |\Wash| |held| |office| |1789--97.| |No| |tags| |appear| |in| |later| |uses| |of| |\Wash.| |We| |now| |suppress| |the| |dates| |and| |trigger| |a| |new| |first| |use:|\\
% |\NoTextTagtrue\ForgetName[George]{Washington}\Wash.|
%
% |\Name[Mustafa]{Kemal}| |was| |later| |given| |the| |name%|\\ |\AKA[Mustafa]{Kemal}{Atatürk}. We mention|\\
% |\AKA[Mustafa]{Kemal}{Atatürk} again.|
%
% \Wash\ held office 1789--97. No tags appear in later uses of \Wash. We now suppress the dates and trigger a new first use: \NoTextTagtrue\ForgetName[George]{Washington}\Wash.
%
% \Name[Mustafa]{Kemal} was later given the name \IndexInactive\AKA[Mustafa]{Kemal}{\kern0pt Atatürk}. We mention \AKA[Mustafa]{Kemal}{\kern0pt Atatürk} again\IndexActive.
% \end{quote}
%
% Notice that the text tag for Atatürk did not print. That is because \cmd{\AKA} usually only calls the ``subsequent use'' hooks. Therefore we simulate the \texttt{formatAKA} option and \cmd{\ForgetName} \Wash\ and \Name[Mustafa]{Kemal}:
% \begin{quote}\small
% \makeatletter\@nameauth@AKAFormattrue\makeatother
% \ForgetName[George]{Washington}%
% \ForgetName[Mustafa]{Kemal}%
% \Wash\ held office 1789--97. No tags appear in later uses of \Wash. We now suppress the dates and trigger a new first use: \NoTextTagtrue\ForgetName[George]{Washington}\Wash.
%
% \Name[Mustafa]{Kemal} was later given the name \IndexInactive\AKA[Mustafa]{Kemal}{Atatürk\kern0pt}. We mention \AKA[Mustafa]{Kemal}{Atatürk\kern0pt} again\IndexActive.
% \end{quote}
% Here we see that the tag is printed because \texttt{formatAKA} allows \cmd{\NamesFormat} to be called for the first use of Ataturk.
%
% Now we \cmd{\let} the first-use macro in the front matter be the same as that in the main matter and see what we get in the front matter via \cmd{\NamesInactive.} Again we simulate the \texttt{formatAKA} option and \cmd{\ForgetName} \Wash\ and \Name[Mustafa]{Kemal}:
% \begin{quote}\small
% \makeatletter\@nameauth@AKAFormattrue\makeatother\NamesInactive|\NamesInactive|\\
% |\let\OldFrontFormat\FrontNamesFormat|\\
% \let\FrontNamesFormat\NamesFormat|\let\FrontNamesFormat\NamesFormat|\\
% \ForgetName[George]{Washington}%
% \ForgetName[Mustafa]{Kemal}%
% \Wash\ held office 1789--97. No tags appear in later uses of \Wash. We now suppress the dates and trigger a new first use: \NoTextTagtrue\ForgetName[George]{Washington}\Wash.
%
% \Name[Mustafa]{Kemal} was later given the name \AKA[Mustafa]{Kemal}{Atatürk}. We mention \AKA[Mustafa]{Kemal}{Atatürk} again.
% \end{quote}
% Again we see that everything is formatted the way we want, even in the front matter. Nevertheless, I have not been quite honest. Since I wanted to simulate multiple first uses of \cmd{\AKA,} which can print a tag only once unless you use the \texttt{alwaysformat} option, I inserted kerns into the instances of |\AKA[Mustafa]{Kemal}{Atatürk}| in the example paragraphs above:
% \begin{quote}\footnotesize
% |\NameAddInfo{\kern0pt| |Atatürk}{| |(a| |special| |surname| |granted| |1934)}|\\
% |\NameAddInfo{Atatürk\kern0pt}{| |(a| |special| |surname| |granted| |1934)}|\\
% |\NameAddInfo{Atatürk}{| |(a| |special| |surname| |granted| |1934)}|\\
% \end{quote}
% Because the names were different in each paragraph even though they looked the same, I prevented the names with kerns from appearing in the index via \cmd{\IndexInactive} and \cmd{\IndexActive.}\medskip
%
% Please remember to reset the formatting, if needed:\medskip
%
% \noindent\let\NamesFormat\OldFormat|\let\NamesFormat\OldFormat|\\
% \let\FrontNamesFormat\OldFrontFormat|\let\FrontNamesFormat\OldFrontFormat|\medskip
%
% Here is a summary of what happens:
% \begin{enumerate}
% \item In \cmd{\@nameauth@name} and \cmd{\AKA}:
% \begin{enumerate}
%   \item Parse name arguments. Save an unexpanded copy of each relevant name argument in a token register.
%   \item Check for a control sequence based on them.
%   \item Enter a decision route based on the result. Yes means the name exists. No means it does not. The decision route engages the Boolean values governing formatting.
%   \item Generate the index and print forms of the name. Create the index entry from the former and pass the latter onward to the format switching macro. Based on the Boolean values governing formatting, that macro calls either the first-use or subsequent-use hooks respectively in the main matter or the front matter.
% \end{enumerate}
% \item In the post-processing hooks:
% \begin{enumerate}
%   \item Normally you do nothing and exit, or make a local font change and exit. You could do more complex tasks like  discarding the text output of the naming macros, then parsing and displaying the name parameters differently, based on the token registers.
%   \item You also can make more than one independent check for a control sequence based on the name arguments saved in the token registers. This permits some fairly complex actions based on both the Boolean values and the control sequences themselves.
%   \item Thus your decision route could turn into a tree or a set of relationships among a number of names.
%   \item Print the form of the name as it was passed, or possibly do something else altogether.
%   \item \textbf{If you invoke \cmd{\@nameauth@name} and \cmd{\AKA} from within the hooks, they will do nothing.}
% \end{enumerate}
% \item In \cmd{\@nameauth@name} and \cmd{\AKA}:
% \begin{enumerate}
%   \item Generate the control sequence that says the name exists.
%   \item clean up and exit.
% \end{enumerate}
% \end{enumerate}
% \clearpage
%
% \subsubsection{Hooks: Continental}
% \label{sec:Hooksc}
%
% For implementing Continental systems of name formatting, in addition to the basic methods already discussed, here we see how one can have the small caps consistently in the surnames for the first uses and the index, yet have a normal font for subsequent references in the body text.
%
% We begin by putting the following in the document preamble:
% \begin{quote}\small
% |\newif\ifSC|\\
% |\SCtrue%|\hfill |This turns on small caps by default|
%
% \noindent|\def\DoFormat#1{%|\\
% |  \ifSC|\\
% |    \textsc{#1}%|\hfill |Format small caps if true|\\
% |  \else|\\
% |    #1%|\hfill |Do nothing if false|\\
% |  \fi|\\
% |}|
%
% \cmd{\DoFormat} is the key to this whole approach. We want a control sequence that will expand differently under different circumstances.
%
% {\noindent\footnotesize|\begin{nameauth}|\\
% |  \< JQA & John Quincy & \noexpand\DoFormat{Adams} & >|\\
% |  \< Aeths & & \noexpand\DoFormat{Æþelstan} & >|\\
% |  \< Chas & & \noexpand\DoFormat{Charles}, I & >|\\
% |  \< Cao & & \noexpand\DoFormat{Cao}, Cao & >|\\
% |  \< JRIII & John David & \noexpand\DoFormat{Rockefeller}, III & >|\\
% |  \< SDJR & Sammy & \noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}. & >|\\
% |\end{nameauth}|}
%
% \cmd{\noexpand} is another vital piece of the solution. If one does not use this, all sorts of errors will arise. We also must sort these names properly:
%
% {\noindent\footnotesize|\PretagName[John Quincy]{\noexpand\DoFormat{Adams}}{Adams, John Quincy}|\\
% |\PretagName{\noexpand\DoFormat{Æþelstan}}{Aethelstan}|\\
% |\PretagName{\noexpand\DoFormat{Charles}, I}{Charles 1}|\\
% |\PretagName{\noexpand\DoFormat{Cao}, Cao}{Cao Cao}|\\
% |\PretagName[John David]{\noexpand\DoFormat{Rockefeller}, III}%|\\
% |  {Rockefeller, John David, III}|\\
% |\PretagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}%|\\
% |  {Davis, Sammy, Jr.}|}
% \end{quote}
%
% Above we have our control sequences set up for our names. Next we save the old ``subsequent use'' hook macros:
% \begin{quote}\small
% |\let\OldFrontHook\FrontNameHook%|\\
% |\let\OldMainHook\MainNameHook%|
% \end{quote}
%
% \let\OldFrontHook\FrontNameHook%
% \let\OldMainHook\MainNameHook%
% We do not need to redefine either \cmd{\NamesFormat} or \cmd{\FrontNamesFormat} because we want the first uses to display small caps in the text. We redefine \cmd{\MainNameHook} and \cmd{\FrontNameHook} in order to \emph{suppress} formatting in all subsequent uses of names. We also use the \texttt{formatAKA} option.
% \clearpage
%
% The new implementation of \cmd{\MainNameHook} follows. We incorporate those parts of \cmd{\AKA} and \cmd{\@nameauth@Name} that print name arguments in the text:\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.}
% \begin{quote}\small
% |\makeatletter%|\\
% |\renewcommand*\MainNameHook[1]%|\\
% |{%|\\
% |  \let\ex\expandafter%|\\
% |  \SCfalse%|
% 
% Above we set the small caps Boolean to false. Now we have to ``redo'' name parsing in order to get the different format. We get the unexpanded arguments from the naming macro that called us via the token registers. We must expand the register values for comparisons to work.
%
% {\noindent\footnotesize|  \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}%|\\
% |  \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}%|\\
% |  \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}%|\\
% |  \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}%|}
%
% \cmd{\Space} is defined by the parent macro. Here we print an appropriate version of the pseudonym in the text. We cannot use the text-only capitalization macros when we use this scheme. This is not much of a problem when using Continental contexts.
%
% |  \ifx\argb\testb|\\
% |    \protected@edef\Suff{\@empty}%|\\
% |    \let\Reversed\argb%|\\
% |    \let\SNN\argb%|\\
% |    \let\Short\argb%|\\
% |  \else|\\
% |    \protected@edef\Suff{\ex\@nameauth@Suffix\ex{%|\\
% |      \the\@nameauth@toksb}}%|\\
% |    \protected@edef\Reversed{\Suff\Space\testb}%|\\
% |    \protected@edef\SNN{\testb\Space\Suff}%|\\
% |     \if@nameauth@RevThis|\\
% |       \let\Short\Suff%|\\
% |     \else|\\
% |       \let\Short\testb%|\\
% |     \fi|\\
% |  \fi|
%
% Only the reversing macros will work with the macros that we generate above as well as in the rest of this hook. The capitalization macros are ignored.
% \clearpage
%
% Print an appropriate version of the pseudonym in the text.
%
% |  \if@nameauth@InAKA|\\
% |    \ifx\arga\@empty|\\
% |      \ifx\argc\@empty|\\
% |        \if@nameauth@RevThis|\\
% |          \Reversed%|\\
% |        \else|\\
% |          \SNN%|\\
% |        \fi|\\
% |      \else|\\
% |        \if@nameauth@AltAKA|\\
% |          \argc%|\\
% |        \else|\\
% |          \if@nameauth@RevThis|\\
% |            \ex\argc\ex\Space\SNN%|\\
% |          \else|\\
% |            \ex\SNN\ex\space\argc%|\\
% |          \fi|\\
% |        \fi|\\
% |      \fi|\\
% |    \else|\\
% |      \ifx\argc\@empty|\\
% |        \let\FNN\arga%|\\
% |      \else|\\
% |        \let\FNN\argc%|\\
% |      \fi|\\
% |      \if@nameauth@AltAKA|\\
% |        \FNN%|\\
% |      \else|\\
% |        \if@nameauth@RevThis|\\
% |          \ex\SNN\ex\Space\FNN%|\\
% |        \else|\\
% |          \ex\FNN\ex\space\SNN%|\\
% |        \fi|\\
% |      \fi|\\
% |    \fi|\\
% |  \else|
% \clearpage
% Print an appropriate version of the name in the text.
%
% |    \ifx\arga\@empty|\\
% |      \ifx\argc\@empty|\\
% |        \if@nameauth@FullName|\\
% |          \if@nameauth@RevThis|\\
% |            \Reversed%|\\
% |          \else|\\
% |            \SNN%|\\
% |          \fi|\\
% |        \else|\\
% |          \Short%|\\
% |        \fi|\\
% |      \else|\\
% |        \if@nameauth@FullName|\\
% |          \if@nameauth@RevThis|\\
% |            \ex\argc\ex\space\SNN%|\\
% |          \else|\\
% |            \ex\SNN\ex\space\argc%|\\
% |          \fi|\\
% |        \else|\\
% |          \if@nameauth@RevThis|\\
% |            \argc%|\\
% |          \else|\\
% |            \Short%|\\
% |          \fi|\\
% |        \fi|\\
% |      \fi|\\
% |    \else|\\
% |      \ifx\argc\@empty|\\
% |        \let\FNN\arga%|\\
% |      \else|\\
% |        \let\FNN\argc%|\\
% |      \fi|\\
% |      \let\Short\FNN%|\\
% |      \if@nameauth@FullName|\\
% |        \if@nameauth@RevThis|\\
% |          \ex\SNN\ex\Space\FNN%|\\
% |        \else|\\
% |          \ex\FNN\ex\space\SNN%|\\
% |        \fi|\\
% |      \else|\\
% |        \if@nameauth@FirstName|\\
% |          \Short%|\\
% |        \else|\\
% |          \testb%|\\
% |        \fi|\\
% |      \fi|\\
% |    \fi|\\
% |  \fi|\\
% |}|
% \end{quote}
%
% This is a really long example! It incorporates much of the parsing that is done in \cmd{\AKA} and \cmd{\@nameauth@Name} in order to implement as much of the standard look and feel as possible.
% \makeatletter%
% \renewcommand*\MainNameHook[1]{\ignorespaces%
%   \let\ex\expandafter\ignorespaces%
%   \SCfalse\ignorespaces%
%   \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}\ignorespaces%
%   \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}\ignorespaces%
%   \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}\ignorespaces%
%   \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}\ignorespaces%
%   \ifx\argb\testb
%     \protected@edef\Suff{\@empty}\ignorespaces%
%     \let\Reversed\argb\ignorespaces%
%     \let\SNN\argb\ignorespaces%
%     \let\Short\argb\ignorespaces%
%   \else
%     \protected@edef\Suff{\ex\@nameauth@Suffix\ex{\the\@nameauth@toksb}}\ignorespaces%
%     \protected@edef\Reversed{\Suff\Space\testb}\ignorespaces%
%     \protected@edef\SNN{\testb\Space\Suff}\ignorespaces%
%      \if@nameauth@RevThis
%        \let\Short\Suff%
%      \else
%        \let\Short\testb%
%      \fi
%   \fi
%   \if@nameauth@InAKA
%     \ifx\arga\@empty
%       \ifx\argc\@empty
%         \if@nameauth@RevThis
%           \Reversed%
%         \else
%           \SNN%
%         \fi
%       \else
%          \if@nameauth@AltAKA
%            \argc%
%          \else
%            \if@nameauth@RevThis
%              \ex\argc\ex\Space\SNN%
%            \else
%              \ex\SNN\ex\space\argc%
%            \fi
%          \fi
%        \fi
%      \else
%        \ifx\argc\@empty
%          \let\FNN\arga%
%        \else
%          \let\FNN\argc%
%        \fi
%        \if@nameauth@AltAKA
%          \FNN%
%        \else
%          \if@nameauth@RevThis
%            \ex\SNN\ex\Space\FNN%
%          \else
%            \ex\FNN\ex\space\SNN%
%          \fi
%        \fi
%      \fi
%   \else
%     \ifx\arga\@empty
%       \ifx\argc\@empty
%         \if@nameauth@FullName
%           \if@nameauth@RevThis
%             \Reversed%
%           \else
%             \SNN%
%           \fi
%         \else
%           \Short%
%         \fi
%       \else
%         \if@nameauth@FullName
%           \if@nameauth@RevThis
%             \ex\argc\ex\space\SNN%
%           \else
%             \ex\SNN\ex\space\argc%
%           \fi
%         \else
%           \if@nameauth@RevThis
%             \argc%
%           \else
%             \Short%
%           \fi
%         \fi
%       \fi
%     \else
%       \ifx\argc\@empty
%         \let\FNN\arga%
%       \else
%         \let\FNN\argc%
%       \fi
%       \let\Short\FNN%
%       \if@nameauth@FullName
%         \if@nameauth@RevThis
%           \ex\SNN\ex\Space\FNN%
%         \else
%           \ex\FNN\ex\space\SNN%
%         \fi
%       \else
%         \if@nameauth@FirstName
%           \Short%
%         \else
%           \testb%
%         \fi
%       \fi
%     \fi
%   \fi
% }
% \clearpage
%
% The final hook operates in the front matter. We simply let \cmd{\FrontNameHook} be the same as \cmd{\MainNameHook} in order to suppress all formatting. This is similar to the default behavior of \textsf{nameauth.}
% \begin{quote}\small
% |\let\FrontNameHok\MainNameHook|\\
% |\makeatother|
% \end{quote}
% \let\FrontNameHook\MainNameHook
% \makeatother
%
% \noindent{\large\bfseries Main Matter}\\
%
% {\footnotesize\noindent\begin{tabular}{llll}\toprule
% First & Next & Long & Short \\\midrule
% \JQA & \JQA & \LJQA & \SJQA\\
% \JRIII & \JRIII & \LJRIII & \SJRIII\\
% \Aeths & \Aeths & \LAeths & \SAeths\\
% \Chas & \Chas & \LChas & \SChas\\
% \Cao & \Cao & \LCao & \SCao\\\bottomrule
% \end{tabular}}\bigskip
%
% \noindent{\large\bfseries Front Matter}\\
%
% \NamesInactive
% {\footnotesize\noindent\begin{tabular}{llll}\toprule
% First & Next & Long & Short \\\midrule
% \JQA & \JQA & \LJQA & \SJQA\\
% \JRIII & \JRIII & \LJRIII & \SJRIII\\
% \Aeths & \Aeths & \LAeths & \SAeths\\
% \Chas & \Chas & \LChas & \SChas\\
% \Cao & \Cao & \LCao & \SCao\\\bottomrule
% \end{tabular}}\bigskip
% \NamesActive
%
% We can refer to \SDJR. See how the punctuation detection still works? The next reference is \SDJR.
% We also can use reversing, such as reversing with commas:\\
%
% \ReverseCommaActive
% {\footnotesize\noindent\begin{tabular}{lll}\toprule
% Long & Normal & Short \\\midrule
% \LJQA & \JQA &  \SJQA\\
% \LJRIII & \JRIII & \SJRIII\\
% \LSDJR & \SDJR & \SSDJR \\\bottomrule
% \end{tabular}}\bigskip
% \ReverseCommaInactive
%
% \makeatletter\@nameauth@AKAFormattrue\makeatother
% If we use the \texttt{formatAKA} option we can refer to \LCao\ as \AKA{\noexpand\DoFormat{Cao}, Cao}{\noexpand\DoFormat{Mengde}}, and again \AKA{\noexpand\DoFormat{Cao}, Cao}{\noexpand\DoFormat{Mengde}}. We get that with:
% \begin{quote}\small
% |\PretagName{\noexpand\DoFormat{Mengde}}{Mengde}|\\
% |\AKA{\noexpand\DoFormat{Cao}, Cao}{\noexpand\DoFormat{Mengde}}|
% \end{quote}
% \makeatletter\@nameauth@AKAFormatfalse\makeatother
% Otherwise \cmd{\AKA} will not format the alternate name.
%
% When we are done, if the scope is not document-wide, we restore the hooks to their old values:
% \begin{quote}\small
% |\let\FrontNameHook\OldFrontHook|\\
% |\let\MainNameHook\OldMainHook|
% \end{quote}
% \let\FrontNameHook\OldFrontHook
% \let\MainNameHook\OldMainHook
%
% I am the first to admit that this example is quite involved. I am painfully aware that this package has not crystallized from a great knowledge base or descended on high from any kind of superior design. It has been quite a journey of discovery about naming and \LaTeX, \emph{inter alia}.
% \clearpage
%
% \subsubsection{Variant Spellings}
%
% This section illustrates why this package is called ``nameauth.'' Here we get to an example where the macros work together to implement a name authority.
%
% Handling variant name spellings can be complicated. For example, let us assume that you are editing a collection of essays. You might settle on the form \Name[W.E.B.]{Du Bois} in your name authority. An essay in that collection might use the alternate spelling \IndexInactive\Name*[W.E.B.]{DuBois}\IndexActive. The author or publisher who owns that work might not grant you permission to alter the spelling. In that case, you could add an alternate spelling. Using the simplified interface, it would be:
% \begin{nameauth}
% \< DuBois & W.E.B. & Du Bois & >
% \< AltDuBois & W.E.B. & DuBois & >
% \end{nameauth}
% \begin{quote}
% |\begin{nameauth}|\\
% |  \< DuBois & W.E.B. & Du Bois & >|\\
% |  \< AltDuBois & W.E.B. & DuBois & >|\\
% |\end{nameauth}|
% \end{quote}
%
% If you wanted to index the alternate spelling with its own entry, the trivial use of \cmd{\AltDuBois} allows that easily. All you need do is make cross-references to each variant in the index so that the reader is aware of them.
%
% Nevertheless, \DuBois\ and \IndexInactive\AltDuBois\IndexActive\ differ only by spaces. For several good reasons, such as fault tolerance in typing, the first/subsequent use mechanism ignores spaces and sees them as \emph{the same name}. Use |\ForgetName[W.E.B.]{Du Bois}| to trigger the first use of \cmd{\AltDuBois} in that section.
%
% If you wanted to index the variants under only one name entry, it gets more complicated. You could do the following:
%
% \begin{enumerate}\small
% \item Use |\ForgetName[W.E.B.]{Du Bois}| at the start of the section.
% \item Wrap \cmd{\AltDuBois} between \cmd{\IndexInactive} and \cmd{\IndexActive}.
% \item Call \cmd{\IndexName} with the authoritative form right after \cmd{\IndexActive}.
% \item Create a cross-reference in the index.
% \end{enumerate}
% This can be automated at the start of the section with something like:
% \begin{quote}%
% \ForgetName[W.E.B.]{DuBois}%
% \gdef\OtherDuBois{\IndexInactive\AltDuBois\IndexActive\IndexName[W.E.B.]{Du Bois}}%
% \index{DuBois, W.E.B.|see{Du Bois, W.E.B.}}%
% |\ForgetName[W.E.B.]{DuBois}|\\
% |\gdef\OtherDuBois{\IndexInactive\AltDuBois\IndexActive%|\\|  \IndexName[W.E.B.]{Du Bois}}|\\
% \verb!\index{DuBois, W.E.B.|see{Du Bois, W.E.B.}}!
% \end{quote}
%
% The alternate section mentions \cmd{\OtherDuBois} starting with a first use: \OtherDuBois. Subsequent uses of  \cmd{\OtherDuBois} print \OtherDuBois. Of course, one could get more complex than the example above. The index will only hold the standard entry for \Name*[W.E.B.]{Du Bois}: ``Du Bois, W.E.B.'' and a cross-reference from the variant ``DuBois, W.E.B.'' to the standard entry.
%
% \clearpage
%
% \subsection{Naming Pattern Reference}
% \label{sec:PatRef}
%
% \subsubsection{Basic Naming}
% \noindent{\bfseries Western Names}\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.42\textwidth}@{}p{0.53\textwidth}}\toprule
% \textit{First reference in the text}:\newline\hbox to 1em{\hfil}\ForgetName[John]{Smith}\Name[John]{Smith} &
% |\Name*[John]{Smith}|\newline |\Name[John]{Smith}|\newline |\FName[John]{Smith}|\\[1ex]
% \textit{Subsequent full}: \Name*[John]{Smith} & |\Name*[John]{Smith}|\\[1ex]
% \textit{Subsequent surname}: \Name[John]{Smith} & |\Name[John]{Smith}|\\[1ex]
% \textit{Subsequent forename}: \FName[John]{Smith} & |\FName[John]{Smith}|\\\midrule
% \textit{Long first reference}: \ForgetName[J.Q.]{Public}\newline\hbox to 1em{\hfil}\Name[J.Q.]{Public}[Jane Q.] & |\Name*[J.Q.]{Public}[Jane Q.]|\newline |\Name[J.Q.]{Public}[Jane Q.]|\newline |\FName[J.Q.]{Public}[Jane Q.]|\\[1ex]
% \textit{Subsequent full}: \Name*[J.Q.]{Public} & |\Name*[J.Q.]{Public}|\\[1ex]
% \textit{Alternate}: \Name*[J.Q.]{Public}[Jane Qetsiyah] & |\Name*[J.Q.]{Public}[Jane Qetsiyah]|\\[1ex]
% \textit{Alternate}: \FName[J.Q.]{Public}[Janie] & |\FName[J.Q.]{Public}[Janie]|\\\bottomrule
% \end{tabular}}
% \vfil
% 
% \noindent{\bfseries Western Plus Affixes}\\[2ex]
% Always use a comma to delimit name/affix pairs.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.42\textwidth}@{}p{0.53\textwidth}}\toprule
% \textit{First reference}:\newline\hbox to 1em{\hfil}\ForgetName[George S.]{Patton, Jr.}\Name[George S.]{Patton, Jr.} & |\Name*[George S.]{Patton, Jr.}|\newline |\Name[George S.]{Patton, Jr.}|\newline |\FName[George S.]{Patton, Jr.}|\\[1ex]
% \textit{Subsequent}: \Name*[George S.]{Patton, Jr.} & |\Name*[George S.]{Patton, Jr.}|\\[1ex]
% \textit{Subsequent surname}: \Name[George S.]{Patton, Jr.} & |\Name[George S.]{Patton, Jr.}|\\[1ex]
% \textit{Subsequent forename}: \FName[George S.]{Patton, Jr.}[George] & |\FName[George S.]{Patton, Jr.}[George]|\\\bottomrule
% \end{tabular}}
% \vfil
%
%{\noindent |\begin{nameauth}|\\
%|  \< Smith & John & Smith & >|\\
%|  \< JQP & J.Q. & Public & >|\\
%|  \< Patton & George S. & Patton, Jr. & >|\\
%|\end{nameauth}|}
% \vfil
%
% {\setstretch{1.1}\ForgetName[John]{Smith}\ForgetName[J.Q.]{Public}\ForgetName[George S.]{Patton, Jr.}%
% \noindent |\Smith, \LSmith, \Smith, and \SSmith|:\\
% \indent \Smith, \LSmith, \Smith, and \SSmith\\
% |\JQP[Jane Q.],| |\LJQP[Jane Q.],| |and| |\JQP[Jane Q.]|:\\
% \indent \JQP[Jane Q.], \LJQP[Jane Q.], and \JQP[Jane Q.]\\
% |\LJQP[Jane| |Qetsiyah]\| |and| |\SJQP[Janie]|:\\
% \indent \LJQP[Jane Qetsiyah]\ and \SJQP[Janie]\\
% \noindent |\Patton,| |\LPatton,| |\Patton,| |and| |\SPatton|:\\
% \indent \Patton, \LPatton, \Patton, and \SPatton.\\
% |\SPatton[George]| prints \SPatton[George].}
% \clearpage
%
% \noindent{\bfseries New Syntax: Royal, Eastern, and Ancient}\\[2ex]
% Using |\Name{Demetrius, I Soter}| keeps the number with the affix. To keep the number with the name, use |\Name{Demetrius I, Soter}|. See also Section~\ref{sec:Affix}.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.53\textwidth}@{}p{0.42\textwidth}}\toprule
% \textit{First reference}: \ForgetName{Francis, I}\Name{Francis, I} & |\Name*{Francis, I}|\newline |\Name{Francis, I}|\newline |\FName{Francis, I}|\\[1ex]
% \textit{Subsequent full}: \Name*{Francis, I} & |\Name*{Francis, I}|\\[1ex]
% \textit{Subsequent name}: \Name{Francis, I} & |\Name{Francis, I}|\newline |\FName{Francis, I}|\\[1ex]
% \textit{First reference}: \newline\hbox to 1em{\hfil}\ForgetName{Demetrius, I Soter}\Name{Demetrius, I Soter} & |\Name*{Demetrius, I Soter}|\newline |\Name{Demetrius, I Soter}|\newline |\FName{Demetrius, I Soter}|\\[1ex]
% \textit{Subsequent full}: \Name*{Demetrius, I Soter} & |\Name*{Demetrius, I Soter}|\\[1ex]
% \textit{Subsequent name}: \Name{Demetrius, I Soter} & |\Name{Demetrius, I Soter}|\newline |\FName{Demetrius, I Soter}|\\\midrule
% \textit{First reference}: \ForgetName{Sun, Yat-sen}\Name{Sun, Yat-sen} & |\Name*{Sun, Yat-sen}|\newline |\Name{Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\[1ex]
% \textit{Subsequent full}: \Name*{Sun, Yat-sen} & |\Name*{Sun, Yat-sen}|\\[1ex]
% \textit{Subsequent name}: \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\\midrule
% \textit{First mononym reference}:\newline\hbox to 1em{\hfil}\ForgetName{Plato}\Name{Plato} &
% |\Name*{Plato}|\newline |\Name{Plato}|\newline |\FName{Plato}|\\[1ex]
% \textit{Subsequent}: \Name{Plato} & |\Name*{Plato}|\newline |\Name{Plato}|\newline |\FName{Plato}|\\\bottomrule
% \end{tabular}}
% \vfil
%
%\noindent |\begin{nameauth}|\\
%|  \< Francis & & Francis, I & >|\\
%|  \< Dem & & Demetrius, I Soter & >|\\
%|  \< Sun & & Sun, Yat-sen & >|\\
%|  \< Plato & & Plato & >|\\
%|\end{nameauth}|
% \vfil
%
% {\setstretch{1.1}\ForgetName{Francis, I}\ForgetName{Demetrius, I Soter}\ForgetName{Sun, Yat-sen}\ForgetName{Plato}%
% \noindent |\Francis,| |\LFrancis,| |\Francis,| |and| |\SFrancis|:\\
% \indent \Francis, \LFrancis, \Francis, and \SFrancis\\
% |\Dem,| |\LDem,| |\Dem,| |and \SDem|:\\
% \indent \Dem, \LDem, \Dem, and \SDem\\
% |\Sun,| |\LSun,| |\Sun,| |and \SSun|:\\
% \indent \Sun, \LSun, \Sun, and \SSun\\
% |\Plato,| |\LPlato,| |\Plato,| |and \SPlato|:\\
% \indent \Plato, \LPlato, \Plato, and \SPlato.}
% \vfil
% You also can ``stack'' \cmd{\CapThis}, \cmd{\CapName}, \cmd{\RevName}, \cmd{\KeepAffix}, and so on in front of these control sequences. |\CapName\LSun| generates \CapName\LSun.
% \clearpage
%
% \noindent{\bfseries Old Syntax: Royal and Eastern}\\[2ex]
% Avoid these forms except with the \texttt{comma} option. |\Name{Ptolemy}[I Soter]| keeps the number with the affix. Use |\Name{Ptolemy I}[Soter]| to keep the number with the name. See also Section~\ref{sec:Affix}.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.53\textwidth}@{}p{0.42\textwidth}}\toprule
% \textit{First reference}: \ForgetName{Henry}[VIII]\Name{Henry}[VIII] & |\Name*{Henry}[VIII]|\newline |\Name{Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\[1ex]
% \textit{Subsequent full}: \Name*{Henry}[VIII] & |\Name*{Henry}[VIII]|\\[1ex]
% \textit{Subsequent name}: \Name{Henry}[VIII] & |\Name{Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\[1ex]
% \textit{First reference}: \ForgetName{Ptolemy}[I Soter]\Name{Ptolemy}[I Soter] & |\Name*{Ptolemy}[I Soter]|\newline |\Name{Ptolemy}[I Soter]|\newline |\FName{Ptolemy}[I Soter]|\\[1ex]
% \textit{Subsequent full}: \Name*{Ptolemy}[I Soter] & |\Name*{Ptolemy}[I Soter]|\\[1ex]
% \textit{Subsequent name}: \Name{Ptolemy}[I Soter] & |\Name{Ptolemy}[I Soter]|\newline |\FName{Ptolemy}[I Soter]|\\\midrule
% \textit{First reference}:\newline \hbox to 1em{\hfil}\ForgetName{Mao}[Tse-tung]\Name{Mao}[Tse-tung] & |\Name*{Mao}[Tse-tung]|\newline |\Name{Mao}[Tse-tung]|\\[1ex]
% \textit{Subsequent full}: \Name*{Mao}[Tse-tung] & |\Name*{Mao}[Tse-tung]|\\[1ex]
% \textit{Subsequent name}: \Name{Mao}[Tse-tung] & |\Name{Mao}[Tse-tung]|\newline |\FName{Mao}[Tse-tung]|\\\bottomrule
% \end{tabular}}
% \vfil
%
%\noindent |\begin{nameauth}|\\
%|  \< Henry & & Henry & VIII >|\\
%|  \< Ptol & & Ptolemy & I Soter >|\\
%|  \< Mao & & Mao & Tse-tung >|\\
%|\end{nameauth}|
% \vfil
%
% {\setstretch{1.1}\ForgetName{Ptolemy}[I Soter]\ForgetName{Henry}[VIII]\ForgetName{Mao}[Tse-tung]%
% \noindent |\Henry, \LHenry, \Henry, and \SHenry|:\\
% \indent \Henry, \LHenry, \Henry, and \SHenry\\
% |\Ptol,| |\LPtol,| |\Ptol,| |and \SPtol|:\\
% \indent \Ptol, \LPtol, \Ptol, and \SPtol\\
% |\Mao, \LMao, \Mao, and \SMao|:\\
% \indent \Mao, \LMao, \Mao, and \SMao}
% \vfil
%
% Avoid mixing old and new syntax. |\Name{Antiochus,| |IV| |Epiphanes}| and |\Name{Antiochus}[IV| |Epiphanes]| look similar, but they are quite different. Even if you avoid the old syntax, keep the following in mind:
%
% \begin{itemize}\small
% \item \textbf{Okay:} Use |\Name{Antiochus, IV Epi\-phanes}| to get \IndexInactive\Name{Antiochus, IV Epi\-phanes} and \Name{Antiochus, IV Epi\-phanes} in the body text and ``Antiochus IV Epi\-phanes'' in the index.
%
% \item \textbf{Okay:} Use |\Name{Antiochus~IV, Epi\-phanes}| to get \Name{Antiochus~IV, Epi\-phanes} and \Name{Antiochus~IV, Epi\-phanes} in the body text and ``Antiochus IV Epi\-phanes'' in the index.\IndexActive
%
% \item \textbf{Best:} Use |\Name{Antiochus,| |IV}| to get \Name{Antiochus, IV} and \Name{Antiochus, IV} in the text. Add a tag like |\TagName{Antiochus,| |IV}{| |Epi\-phanes}| to get ``Antiochus IV Epi\-phanes'' in the index. Manually add ``Epi\-phanes'' in the body text when desired.
% \end{itemize}
% \clearpage
%
% \subsubsection{Particles}
% \label{sec:Particles}
% The following illustrate the American style of particulate names.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule
% \textit{First}: \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare} & |\Name*[Walter]{de la Mare}|\newline |\Name[Walter]{de la Mare}|\newline |\FName[Walter]{de la Mare}|\\[1ex]
% \textit{Subsequent}: \Name[Walter]{de la Mare} & |\Name[Walter]{de la Mare}|\\[1ex]
% \textit{Start of sentence}: \CapThis\Name[Walter]{de la Mare} & |\CapThis\Name[Walter]{de la Mare}|\\[1ex]
% \textit{Forename}: \FName[Walter]{de la Mare} & |\FName[Walter]{de la Mare}|\\\bottomrule
% \end{tabular}}\\[2ex]
%
% \noindent The Continental style differs slightly. These first three forms below put the particles in the index. Long macros are split for readability.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule
% \textit{The (admittedly long) first use}:\newline\small\Name[Johann Wolfgang von]{Goethe} & |\Name*[Johann Wolfgang von]{Goethe}|\newline |\Name[Johann Wolfgang von]{Goethe}|\newline |\FName[Johann Wolfgang von]{Goethe}|\\[1ex]
% \textit{Subsequent}: \Name[Johann Wolfgang von]{Goethe} & |\Name[Johann Wolfgang von]{Goethe}|\\[1ex]
% \textit{Forenames}: \FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang] & |\FName[Johann Wolfgang von]{Goethe}%|\newline|[Johann Wolfgang]|\\\bottomrule
% \end{tabular}}\\[2ex]
%
% \noindent These latter examples of the Continental style use the nickname feature to omit the particles from the index.\\[2ex]{\small\setstretch{1.1}
% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule
% \textit{First}: \Name[Adolf]{Harnack}[Adolf von] & |\Name*[Adolf]{Harnack}[Adolf von]|\newline |\Name[Adolf]{Harnack}[Adolf von]|\newline |\FName[Adolf]{Harnack}[Adolf von]|\\[1ex]
% \textit{Subsequent full}: \Name*[Adolf]{Harnack}[Adolf von] & |\Name*[Adolf]{Harnack}[Adolf von]|\newline\\
% \textit{Subsequent surname}: \Name[Adolf]{Harnack}[Adolf von] & |\Name[Adolf]{Harnack}[Adolf von]|\newline |\Name[Adolf]{Harnack}|\\[1ex]
% \textit{Subsequent forename}: \FName[Adolf]{Harnack} & |\FName[Adolf]{Harnack}|\\\bottomrule
% \end{tabular}}
% \vfil
%
%\noindent |\begin{nameauth}|\\
%|  \< DLM & Walter & de la Mare & >|\\
%|  \< JWG & Johann Wolfgang von & Goethe & >|\\
%|  \< Harnack & Adolf & Harnack & >|\\
%|\end{nameauth}|
%\vfil
%
% \ForgetName[Walter]{de la Mare}\ForgetName[Johann Wolfgang von]{Goethe}\ForgetName[Adolf]{Harnack}%
% \noindent |\DLM\| |and| |\CapThis\DLM|:\\
% \indent \DLM\ and \CapThis\DLM.\\[1ex]
% |\JWG\| |and| |\JWG|:\\
% \indent \JWG\ and \JWG.\\[1ex]
% |\Harnack[Adolf von]\| |and| |\Harnack|:\\
% \indent \Harnack[Adolf von]\ and \Harnack\\[1ex]
% You will not see \Harnack's ``von'' in the index because it was used only in the alternate forenames field.
% \index{Maimonides|seealso{Rambam}}
% \index{Rambam|seealso{Maimonides}}
% \clearpage
%
% \subsection{Errors and Warnings}
% \label{sec:error}
%
% Here are some ways to avoid common errors:
%
% \begin{itemize}\small
% \item Keep it simple! Avoid unneeded macros and use the simplified interface.
% \item Check braces and brackets with naming macros to avoid errors like ``Paragraph ended\dots'' and ``Missing \meta{grouping token} inserted.''
% \item Do not apply a formatting macro to an entire comma-delimited \meta{SNN, affix} pair.  |\Name[Oskar]{\textsc{Hammerstein, II}}| fails due to unbalanced braces because it gets split up. Format each part instead \emph{e.g.}, |\Name[Oskar]{\textsc{Hammerstein},\textsc{II}}.|\IndexName[Oskar]{Hammerstein, II}
% \item With \texttt{pdflatex} use \cmd{\CapThis} when the first letter of a surname particle is \texttt{a--z}, otherwise use \cmd{\AccentCapThis} if it is extended Unicode. Doing otherwise may cause unbalanced braces and related errors.
% \item Consider using \cmd{\PretagName} with all names containing control sequences or extended Unicode; see Section~\ref{sec:IndexSort}.
% \item One way to spot errors is to compare index entries with names in the body text. All macros that produce output also emit meaningful warnings. \cmd{\PName} produces warnings via \cmd{\Name} and \cmd{\AKA}.
% \item Please pay greater attention to the warnings produced by \cmd{\IndexName}, \cmd{\TagName}, \cmd{\UntagName}, and \cmd{\ExcludeName}. Many other warnings are FYI.
% \end{itemize}
% The older syntax presents its own group of potential errors:
% \begin{itemize}\small\IndexInactive
% \item Erroneously typing |\Name[Henry]{VIII}| prints ``\Name*[Henry]{VIII}'' and ``\Name[Henry]{VIII},'' as well as producing a malformed index entry.
% \item Avoid forms like |\Name[Henry]{VIII}[Tudor]| which gives ``\Name*[Henry]{VIII}[Tudor]'' and ``\Name[Henry]{VIII}[Tudor].'' This is a Western name form, not an ancient form. It may act as malformed input if you mix it with proper medieval name forms, but it will not affect them adversely.
% \item The older syntax will not work with some macros. From the film \emph{Men in Black III}, |\AKA{Boris}[the Animal]{Just Boris}| fails. \cmd{\PName} fails for the same reasons. See also Section~\ref{sec:AKA}
% \item This form does work:\\ |\Name{Boris,| |the| |Animal}| |\AKA{Boris,| |the| |Animal}{Just| |Boris}|.\\ You get \Name{Boris, the Animal} being ``\AKA{Boris, the Animal}{Just Boris}.''\IndexActive
% \end{itemize}
% Warnings result from the following:
% \begin{itemize}\small
% \item Using a cross-reference \oarg{Alternate names}\marg{Alternate SNN}\oarg{Alt. names} created by \cmd{\AKA} as a name reference in \cmd{\Name}, \cmd{\FName}, and \cmd{\PName}. They merely will print a name in the body text.
% \item Using a name reference \oarg{FNN}\marg{SNN}\oarg{Alternate names} created by \cmd{\Name}, \cmd{\FName}, and \cmd{\PName} as a cross-reference in \cmd{\AKA}. It merely will print a name in the body text.
% \item Using \cmd{\AKA} to create the same cross-reference multiple times or with a cross-reference created by \cmd{\ExcludeName}. It merely will print a name in the body text, but not the index.
% \item Using \cmd{\IndexName} to index a cross-reference made via \cmd{\AKA} or via the mechanism in \cmd{\ExcludeName} as a main entry. It will do nothing.
% \item Using \cmd{\TagName}, \cmd{\UntagName}, and \cmd{\PretagName} with cross-references. The first two will do nothing. However, \cmd{\PretagName} will ``pretag'' a cross-reference. This is the desired behavior.
% \item Using \cmd{\ExcludeName} with cross-references. It will do nothing.
% \item Using \cmd{\ExcludeName} to exclude a name that has already been used. Likewise, it will do nothing.
% \item Using \cmd{\Name}, \cmd{\FName}, \cmd{\PName}, and \cmd{\AKA} to refer to names and cross-references excluded by \cmd{\ExcludeName}. They merely will print a name in the body text.
% \item Using the |nameauth| environment to redefine shorthands, such as:\\[2ex]
% |\PretagName[E.\,B.]{White}{White, E. B.}|\dots\\[1ex]
% |\begin{nameauth}|\\\IndexName[E.\,B.]{White}
% |  \< White & E.\,B. & White & >|\\
% |  \< White & E. B. & White & >|\\
% |\end{nameauth}|\\[1ex]
% Such redefinitions could generate unwanted index entries.
% \end{itemize}
%
% \clearpage%\StopEventually{^^A
%  \clearpage\PrintChanges
%  \clearpage\PrintIndex
%}
%
% \section{Implementation}
%
% \iffalse
%<*package>
% \fi
% \small
% \subsection{Boolean Values}
%
% \noindent{\large\bfseries Affix Commas}\\[0.5ex]
% The \texttt{comma} and |nocomma| options toggle the first value below, while \cmd{\ShowComma} toggles the second. Each instance of \cmd{\Name} and \cmd{\AKA} reset |\@nameauth@ShowComma|.
%    \begin{macrocode}
\newif\if@nameauth@AlwaysComma
\newif\if@nameauth@ShowComma
%    \end{macrocode}\medskip
%
% \noindent{\large\bfseries Toggle Formatting}\\[0.5ex]
% \cmd{\NamesActive} and \cmd{\NamesInactive} or the |mainmatter| and |frontmatter| options make \cmd{\@nameauth@MainFormat} either true or false, which switches between the main and front matter hooks. \cmd{\@nameauth@AKAFormat} permits \cmd{\AKA} to call the first-use hooks. Otherwise it will call only the subsequent-use hooks.
%    \begin{macrocode}
\newif\if@nameauth@MainFormat
\newif\if@nameauth@AKAFormat
%    \end{macrocode}
% The next value works with \cmd{\LocalNames} and \cmd{\GlobalNames}.
%    \begin{macrocode}
\newif\if@nameauth@LocalNames
%    \end{macrocode}\medskip
%
% \noindent{\large\bfseries Indexing}\\[0.5ex]
% \cmd{\IndexActive} and \cmd{\IndexInctive} or the |index| and |noindex| options set this below:
%    \begin{macrocode}
\newif\if@nameauth@DoIndex
%    \end{macrocode}
% The |pretag| and |nopretag| options toggle the value below.
%    \begin{macrocode}
\newif\if@nameauth@Pretag
%    \end{macrocode}\medskip
%
% \noindent{\large\bfseries Syntactic Formatting}\\[0.5ex]
% \cmd{\@nameauth@FullName} is true in any case where a long name reference is desired. \cmd{\@nameauth@FirstName} disables full-name references and causes only Western forenames to be displayed. |\@nameauth@AltAKA| is toggled respectively by \cmd{\AKA} and \cmd{\AKA*} to print a longer or shorter name.
%    \begin{macrocode}
\newif\if@nameauth@FullName
\newif\if@nameauth@FirstName
\newif\if@nameauth@AltAKA
%    \end{macrocode}
% The next Boolean values govern full name capitalization, name reversing, and name reversing with commas.
%    \begin{macrocode}
\newif\if@nameauth@AllCaps
\newif\if@nameauth@AllThis
\newif\if@nameauth@RevAll
\newif\if@nameauth@RevThis
\newif\if@nameauth@RevAllComma
\newif\if@nameauth@RevThisComma
%    \end{macrocode}
% This Boolean value is triggered by \cmd{\CapThis} and reset by \cmd{\Name} and \cmd{\AKA}.
%    \begin{macrocode}
\newif\if@nameauth@DoCaps
%    \end{macrocode}
% This Boolean value is triggered by \cmd{\AccentCapThis} to handle special cases of extended Unicode particle caps. Each instance of \cmd{\Name} and \cmd{\AKA} reset it.
%    \begin{macrocode}
\newif\if@nameauth@Accent
%    \end{macrocode}
% \cmd{\KeepAffix} toggles the value below, which causes \cmd{\Name} and \cmd{\AKA} to use non-breaking spaces between a name and an affix, then reset the value.
%    \begin{macrocode}
\newif\if@nameauth@NBSP
%    \end{macrocode}
% This Boolean value is used for detection of double full stops at the end of a name.
%    \begin{macrocode}
\newif\if@nameauth@Punct
%    \end{macrocode}\medskip
%
% \noindent{\large\bfseries Hook Triggers}\\[0.5ex]
% |\@nameauth@FirstFormat| triggers the first-use hooks to be called; otherwise the second-use hooks are called. Additionally, |\@nameauth@AlwaysFormat| forces this true, except when \cmd{\@nameauth@AKAFormat} is false.
%    \begin{macrocode}
\newif\if@nameauth@FirstFormat
\newif\if@nameauth@AlwaysFormat
%    \end{macrocode}\medskip
%
% \noindent{\large\bfseries Who Called Me?}\\[0.5ex]
% These values are true within \cmd{\Name} and \cmd{\AKA}, respectively. Otherwise they are false. They are used when one modifies the hook macros. See Sections~\ref{sec:Hooksb}ff.
%    \begin{macrocode}
\newif\if@nameauth@InAKA
\newif\if@nameauth@InName
%    \end{macrocode}
% As a side note, \cmd{\AKA} will invoke \cmd{\NamesFormat} / \cmd{\FrontNamesFormat} if the \texttt{alwaysformat} option is set. Otherwise it will invoke \cmd{\MainNameHook} / \cmd{\FrontNameHook}.\medskip
%
% \noindent{\large\bfseries Stack Overflow Prevention}\\[0.5ex]
% Here is the locking mechanism that prevents a stack overflow via recursive calls to \cmd{\Name} and \cmd{\AKA}. See Sections~\ref{sec:Hooksb}ff.
%    \begin{macrocode}
\newif\if@nameauth@Lock
%    \end{macrocode}
% \subsection{Hooks}
% \begin{macro}{\NamesFormat}
% Post-process ``first'' instance of final complete name form in text. See Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. Called when both |\@nameauth@MainFormat| and |\@nameauth@FirstFormat| are true.
%    \begin{macrocode}
\newcommand*{\NamesFormat}{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\MainNameHook}
% \changes{v2.4}{2016/03/15}{Added}
% Post-process subsequent instance of final complete name form in main-matter text. See Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. Called when |\@nameauth@MainFormat| is true and |\@nameauth@FirstFormat| is false.
%    \begin{macrocode}
\newcommand*{\MainNameHook}{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\FrontNamesFormat}
% \changes{v2.5}{2016/04/06}{Added}
% Post-process ``first'' instance of final complete name form in front-matter text. Called when |\@nameauth@MainFormat| is false and |\@nameauth@FirstFormat| is true.
%    \begin{macrocode}
\newcommand*{\FrontNamesFormat}{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\FrontNameHook}
% \changes{v2.4}{2016/03/15}{Added}
% Post-process subsequent instance of final complete name form in front-matter text. Called when |\@nameauth@MainFormat| is false and |\@nameauth@FirstFormat| is false.
%    \begin{macrocode}
\newcommand*{\FrontNameHook}{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\NameauthName}
% \changes{v2.2}{2015/12/01}{Added}
% Hook to create custom naming macros. Usually the three macros below have the same control sequence, but they need not do so if you want something different. See Section~\ref{sec:NewEngine}. Use at your own risk! Changing these macros basically rewrites this package.
%    \begin{macrocode}
\newcommand*{\NameauthName}{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\NameauthLName}
% \changes{v2.3}{2016/01/05}{Added}
% Customization hook called after \cmd{\@nameauth@FullName} is set true. See Section~\ref{sec:NewEngine}.
%    \begin{macrocode}
\newcommand*{\NameauthLName}{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\NameauthFName}
% \changes{v2.2}{2015/12/01}{Added}
% Customization hook called after \cmd{\@nameauth@FirstName} is set true. See Section~\ref{sec:NewEngine}.
%    \begin{macrocode}
\newcommand*{\NameauthFName}{\@nameauth@Name}
%    \end{macrocode}
% \end{macro}
% \clearpage\noindent
% \noindent{\large\bfseries Name Argument Token Registers}\\[0.5ex]
% These three token registers contain the current values of the name arguments passed to \cmd{\Name}, its variants, and the cross-reference fields of \cmd{\AKA.}
%    \begin{macrocode}
\newtoks\@nameauth@toksa%
\newtoks\@nameauth@toksb%
\newtoks\@nameauth@toksc%
%    \end{macrocode}
% These three token registers contain the current values of the name arguments in each line of the \texttt{nameauth} environment.
%    \begin{macrocode}
\newtoks\@nameauth@etoksb%
\newtoks\@nameauth@etoksc%
\newtoks\@nameauth@etoksd%
%    \end{macrocode}
% \subsection{Package Options}
% The following package options interact with many of the prior Boolean values.
%    \begin{macrocode}
\DeclareOption{comma}{\@nameauth@AlwaysCommatrue}
\DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse}
\DeclareOption{mainmatter}{\@nameauth@MainFormattrue}
\DeclareOption{frontmatter}{\@nameauth@MainFormatfalse}
\DeclareOption{formatAKA}{\@nameauth@AKAFormattrue}
\DeclareOption{index}{\@nameauth@DoIndextrue}
\DeclareOption{noindex}{\@nameauth@DoIndexfalse}
\DeclareOption{pretag}{\@nameauth@Pretagtrue}
\DeclareOption{nopretag}{\@nameauth@Pretagfalse}
\DeclareOption{allcaps}{\@nameauth@AllCapstrue}
\DeclareOption{normalcaps}{\@nameauth@AllCapsfalse}
\DeclareOption{allreversed}%
  {\@nameauth@RevAlltrue\@nameauth@RevAllCommafalse}
\DeclareOption{allrevcomma}%
  {\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue}
\DeclareOption{notreversed}%
  {\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue}
\DeclareOption{smallcaps}{\renewcommand*{\NamesFormat}{\scshape}}
\DeclareOption{italic}{\renewcommand*{\NamesFormat}{\itshape}}
\DeclareOption{boldface}{\renewcommand*{\NamesFormat}{\bfseries}}
\DeclareOption{noformat}{\renewcommand*{\NamesFormat}{}}
\ExecuteOptions%
  {nocomma,%
   mainmatter,%
   index,%
   pretag,%
   normalcaps,%
   notreversed,%
   noformat}
\ProcessOptions\relax
%    \end{macrocode}
% Now we load the required packages. They facilitate the first/subsequent name uses, the parsing of arguments, and the implementation of starred forms.
%    \begin{macrocode}
\RequirePackage{etoolbox}
\RequirePackage{ifluatex}
\RequirePackage{ifxetex}
\RequirePackage{trimspaces}
\RequirePackage{suffix}
\RequirePackage{xargs}
%    \end{macrocode}
%
% The \textsf{etoolbox} package is essential for bringing the modern functionality of $\epsilon$-\TeX\ in parsing and passing the name parameters, etc. Using \textsf{xargs} allows for the optional arguments to work in a fairly wide set of environments.\footnote{Early versions of this package used \LaTeX3 functionality that was powerful. Yet the naming macros broke in some cases, like in \cmd{\marginpar} and some other environments.}
% Using \textsf{suffix} facilitated macros like \cmd{\Name*}, although one might argue whether or not a ``starred form'' is the best approach, especially when \textsf{suffix} and \textsf{xargs} have some compatibility issues. Finally, \textsf{trimspaces} helps the fault tolerance of name arguments and \textsf{ifluatex/ifxetex} allow accented names to work on different \LaTeX\ engines.
%
% \subsection{Internal Macros}
%
% \noindent{\large\bfseries Name Control Sequence: Who Am I?}
% \begin{macro}{\@nameauth@Clean}
% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string, even using accented characters, based on the arguments of \cmd{\Name} and friends. With this we can construct a control sequence name and test for it to determine the existence of pseudonyms and the first or subsequent occurrences of a name.
%    \begin{macrocode}
\newcommand*{\@nameauth@Clean}[1]%
  {\expandafter\zap@space\detokenize{#1} \@empty}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Core Name Parsing Operations}
% \begin{macro}{\@nameauth@Root}
% \changes{v1.4}{2012/07/24}{Made more robust}
% The following two macros parse \meta{SNN} into a radix and a comma-delimited suffix, returning only the radix. They (and their arguments) are expandable in order to facilitate proper indexing functionality. They form the kernel of the suffix removal and comma suppression features.
%    \begin{macrocode}
\newcommand*{\@nameauth@Root}[1]%
  {\@nameauth@TrimRoot#1,\@empty\relax}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@TrimRoot}
% \changes{v0.9}{2012/02/10}{Suffix handling expandable}
% \changes{v2.0}{2015/11/11}{trim spaces}
% Throw out the comma and suffix, return the radix.
%    \begin{macrocode}
\def\@nameauth@TrimRoot#1,#2\relax{\trim@spaces{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CapRoot}
% \changes{v0.95}{2012/02/17}{Added}
% \changes{v2.1}{2015/11/24}{Handle Unicode better}
% The next two macros implement the particulate name capitalization mechanism by returning a radix where the first letter is capitalized. In \texttt{xelatex} and \texttt{lualatex} this is trivial and causes no problems. In \texttt{pdflatex} we have to account for ``double-wide'' accented Unicode characters.
%    \begin{macrocode}
\newcommand*{\@nameauth@CapRoot}[1]%
{%
  \ifxetex
    \@nameauth@CRii#1\relax%
  \else
    \ifluatex
      \@nameauth@CRii#1\relax%
    \else
      \if@nameauth@Accent
        \@nameauth@CRiii#1\relax%
      \else
        \@nameauth@CRii#1\relax%
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CRii}
% \changes{v0.95}{2012/02/17}{Added}
% \changes{v1.26}{2012/04/24}{Fixed}
% Grab the first letter as one argument, and everything before \cmd{\relax} as the second. Capitalize the first and return it with the second.
%    \begin{macrocode}
\def\@nameauth@CRii#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CRiii}
% \changes{v2.1}{2015/11/24}{added}
% This is called in \texttt{pdflatex} under \textsf{inputenc} where an accented Unicode character takes the first two arguments. Grab the first ``letter'' as two arguments and cap it, then everything before \cmd{\relax} as the third. Capitalize the first and return it with the second.
%    \begin{macrocode}
\def\@nameauth@CRiii#1#2#3\relax{\uppercase{#1#2}\@nameauth@Root{#3}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@AllCapRoot}
% \changes{v1.5}{2013/02/22}{Added}
% This macro returns a fully-capitalized radix. It is used for generating capitalized Eastern family names in the body text.
%    \begin{macrocode}
\newcommand*{\@nameauth@AllCapRoot}[1]%
  {\uppercase{\@nameauth@Root{#1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Suffix}
% \changes{v0.9}{2012/02/10}{Added}
% The following two macros parse \meta{SNN} into a radix and a comma-delimited suffix, returning only the suffix. Anything before a comma is stripped off by |\@nameauth@Suffix|, but a comma must be present in the argument. Leading spaces are removed to allow consistent formatting.
%    \begin{macrocode}
\newcommand*{\@nameauth@Suffix}[1]%
  {\@nameauth@TrimSuffix#1\relax}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@TrimSuffix}
% \changes{v0.9}{2012/02/10}{Added}
% \changes{v1.5}{2013/02/22}{Trim spaces}
% Throw out the radix, comma, and \cmd{\relax}; return the suffix with no leading spaces.
%    \begin{macrocode}
\def\@nameauth@TrimSuffix#1,#2\relax{\trim@spaces{#2}}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Punctuation Detection}
% \begin{macro}{\@nameauth@TestDot}
% This macro, based on a snippet by \Name*[Uwe]{Lueck}, checks for a period at the end of its argument. It determines whether we need to call \cmd{\@nameauth@CheckDot} below.
%    \begin{macrocode}
\newcommand*{\@nameauth@TestDot}[1]%
{%
  \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}%
  \def\TestPunct##1%
    {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}%
  \@nameauth@Punctfalse%
  \TestDot#1\TestEnd.\TestEnd\TestStop%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@CheckDot}
% We assume that \cmd{\expandafter} precedes the invocation of \cmd{\@nameauth@CheckDot}, which only is called if the terminal character of the input is a period. We evaluate the lookahead \cmd{\@token} while keeping it on the list of input tokens.
%    \begin{macrocode}
\newcommand*{\@nameauth@CheckDot}%
  {\futurelet\@token\@nameauth@EvalDot}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@EvalDot}
%  If \cmd{\@token} is a full stop, we gobble the token.
%    \begin{macrocode}
\newcommand*{\@nameauth@EvalDot}%
  {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi}
%    \end{macrocode}
% \end{macro}
% \clearpage
%
% \noindent{\large\bfseries Name Hook Dispatcher}
% \begin{macro}{\@nameauth@FmtName}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% \changes{v0.94}{2012/02/15}{Add particle caps}
% \changes{v0.95}{2012/02/17}{Works with \textsf{microtype}}
% \changes{v2.0}{2015/11/11}{One macro instead of two}
% \changes{v2.4}{2016/03/15}{Add hooks for non-formatted names}
% \changes{v2.5}{2016/04/06}{Add final formatting hooks and logic}
% The dispatcher invokes the appropriate formatting hooks, depending on the Boolean values for first use, subsequent use, and name type. The first set of tests enables or disables formatting within \cmd{\AKA}. The second set of tests handle all the other naming macros in the name and front matter. The hooks have a local scope.
%    \begin{macrocode}
\newcommand*{\@nameauth@FmtName}[1]%
{%
  \if@nameauth@InAKA
    \if@nameauth@AlwaysFormat
      \@nameauth@FirstFormattrue%
    \else
      \if@nameauth@AKAFormat\else\@nameauth@FirstFormatfalse\fi
    \fi
    \@nameauth@TestDot{#1}%
    \if@nameauth@MainFormat
      \if@nameauth@FirstFormat
        \bgroup\NamesFormat{#1}\egroup%
      \else
        \bgroup\MainNameHook{#1}\egroup%
      \fi
    \else
      \if@nameauth@FirstFormat
        \bgroup\FrontNamesFormat{#1}\egroup%
      \else
        \bgroup\FrontNameHook{#1}\egroup%
      \fi
    \fi
  \else
    \if@nameauth@AlwaysFormat\@nameauth@FirstFormattrue\fi
    \@nameauth@TestDot{#1}%
    \if@nameauth@MainFormat
      \if@nameauth@FirstFormat
        \bgroup\NamesFormat{#1}\egroup%
      \else
        \bgroup\MainNameHook{#1}\egroup%
      \fi
    \else
      \if@nameauth@FirstFormat
        \bgroup\FrontNamesFormat{#1}\egroup%
      \else
        \bgroup\FrontNameHook{#1}\egroup%
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \clearpage
%
% \noindent{\large\bfseries Core Indexing Operations}
% \begin{macro}{\@nameauth@Actual}
% This sets the ``actual'' character used by \textsf{nameauth} for index sorting.
%    \begin{macrocode}
\newcommand*\@nameauth@Actual{@}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@nameauth@Index}
% \changes{v0.94}{2012/02/15}{Added}
% \changes{v2.0}{2015/11/11}{Redesigned tagging}
% If the indexing flag is true, create an index entry, otherwise do nothing.
%    \begin{macrocode}
\newcommand*{\@nameauth@Index}[2]%
{%
  \def\cseq{#1}%
  \ifcsname\cseq!TAG\endcsname
    \ifcsname\cseq!PRE\endcsname
      \if@nameauth@DoIndex
        \index{\csname\cseq!PRE\endcsname#2\csname\cseq!TAG\endcsname}%
      \fi
    \else
      \if@nameauth@DoIndex\index{#2\csname\cseq!TAG\endcsname}\fi
    \fi
  \else
    \ifcsname\cseq!PRE\endcsname
      \if@nameauth@DoIndex\index{\csname\cseq!PRE\endcsname#2}\fi
    \else
      \if@nameauth@DoIndex\index{#2}\fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Core Name Management Engine}
% \begin{macro}{\@nameauth@Name}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% \changes{v0.96}{2012/02/19}{Works w/ \textsf{microtype}, \textsf{memoir}}
% \changes{v1.5}{2013/02/22}{Add reversing and caps}
% \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging}
% \changes{v2.1}{2015/11/24}{Isolate Unicode issues}
% \changes{v2.3}{2016/01/05}{Rename as internal macro}
% \changes{v2.4}{2016/03/15}{Define name CS after formatting; add token regs for hooks}
% \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}}
% \changes{v2.5}{2016/04/06}{Enable hooks better to query internal values}
% Here is the heart of the package. \Name*[Marc van]{Dongen} provided the basic structure. Parsing, indexing, and formatting are in discrete elements.
%    \begin{macrocode}
\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty]%
{%
%    \end{macrocode}
% Prevent entering \cmd{\@nameauth@Name} via itself or \cmd{\AKA}. Both \cmd{\@nameauth@Name} and \cmd{\AKA} engage the lock. Calling these macros in their own parameters will create malformed output but should not halt program execution or overflow the stack. Calling these macros within the hook macros will simply cause them to exit.
%    \begin{macrocode}
  \if@nameauth@Lock\else
  \@nameauth@Locktrue%
  \@nameauth@InNametrue%
  \let\ex\expandafter%
%    \end{macrocode}
% \clearpage\noindent
% Names occur in horizontal mode; we ensure that. Next we make copies of the arguments to test them and make parsing decisions. We also make token register copies of the current name args to be available for the hook macros.
%    \begin{macrocode}
  \leavevmode\hbox{}%
  \protected@edef\testa{#1}%
  \protected@edef\arga{\trim@spaces{#1}}%
  \protected@edef\testb{\trim@spaces{#2}}%
  \protected@edef\testbr{\@nameauth@Root{#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@toksa\expandafter{#1}%
  \@nameauth@toksb\expandafter{#2}%
  \@nameauth@toksc\expandafter{#3}%
%    \end{macrocode}
% Test for malformed input.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \Name: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \Name: Essential name malformed}%
    \fi
  \fi
%    \end{macrocode}
% If global caps. reversing, and commas are true, set the local flags true.
%    \begin{macrocode}
  \if@nameauth@AllCaps\@nameauth@AllThistrue\fi
  \if@nameauth@RevAll\@nameauth@RevThistrue\fi
  \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi
%    \end{macrocode}
% The code below handles non-breaking and regular spaces, as well as commas, in the text and the index by setting up which kind we want to use. These will be inserted as appropriate as the output is formatted.
%    \begin{macrocode}
  \protected@edef\ISpace{\space}%
  \protected@edef\Space{\space}%
  \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi
  \if@nameauth@AlwaysComma
    \protected@edef\ISpace{,\space}%
    \protected@edef\Space{,\space}%
    \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
  \fi
  \if@nameauth@ShowComma
    \protected@edef\ISpace{,\space}%
    \protected@edef\Space{,\space}%
    \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
  \fi
%    \end{macrocode}
% \clearpage\noindent
% The section below parses any ``surnames'' into name/suffix pairs and figures out how to capitalize and reverse them as needed, storing the results for the main parser. 
%    \begin{macrocode}
  \protected@edef\RawShort{\@nameauth@Root{#2}}%
  \if@nameauth@DoCaps
    \protected@edef\CapShort{\@nameauth@CapRoot{#2}}%
  \else
    \let\CapShort\RawShort%
  \fi
  \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#2}}%
  \let\IndexShort\RawShort%
  \ifx\testb\testbr
    \protected@edef\Suff{\@empty}%
    \let\IndexSNN\RawShort%
    \let\Reversed\RawShort%
    \let\SNN\RawShort%
    \let\PrintShort\RawShort%
    \if@nameauth@DoCaps
      \let\Reversed\CapShort%
      \let\SNN\CapShort%
      \let\PrintShort\CapShort%
    \fi
    \if@nameauth@AllThis
      \let\Reversed\AllCapShort%
      \let\SNN\AllCapShort%
      \let\PrintShort\AllCapShort%
    \fi
  \else
    \protected@edef\Suff{\@nameauth@Suffix{#2}}%
    \protected@edef\IndexSNN{\RawShort\ISpace\Suff}%
    \protected@edef\Reversed{\Suff\Space\RawShort}%
    \protected@edef\SNN{\RawShort\Space\Suff}%
    \if@nameauth@RevThis
      \let\PrintShort\Suff%
    \else
      \let\PrintShort\RawShort%
    \fi
    \if@nameauth@DoCaps
      \protected@edef\Reversed{\Suff\Space\CapShort}%
      \protected@edef\SNN{\CapShort\Space\Suff}%
      \if@nameauth@RevThis
        \let\PrintShort\Suff%
      \else
        \let\PrintShort\CapShort%
      \fi
    \fi
    \if@nameauth@AllThis
      \protected@edef\Reversed{\Suff\Space\AllCapShort}%
      \protected@edef\SNN{\AllCapShort\Space\Suff}%
      \if@nameauth@RevThis
        \let\PrintShort\Suff%
      \else
        \let\PrintShort\AllCapShort%
      \fi
    \fi
  \fi
%    \end{macrocode}
% Here we parse names. 
%    \begin{macrocode}
  \ifx\testa\@empty
    \ifx\testc\@empty
%    \end{macrocode}
% This is the section for momonyms, royal name/suffix pairs, and native Eastern names where comma-delimited suffixes are used. The first conditional below checks if we are trying to use an alternate name cross-reference as a main name (code !PN for pseudonym). If we are using a legitimate name, we generate an index entry.
%    \begin{macrocode}
      \ifcsname\csb!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \Name: Xref: #2 cannot be a page reference}%
      \else
        \@nameauth@Index{\csb}{\IndexSNN}%
      \fi
%    \end{macrocode}
% If formatting is active, we handle first and subsequent formatting of names in the main matter (code !MN for main matter name). First we handle subsequent uses. We need \cmd{\expandafter} to enable the punctuation detection.
%    \begin{macrocode}
      \if@nameauth@MainFormat
        \ifcsname\csb!MN\endcsname
          \if@nameauth@FirstName
            \@nameauth@FullNamefalse%
          \fi
          \if@nameauth@FullName
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\Reversed}%
            \else
              \ex\@nameauth@FmtName\ex{\SNN}%
            \fi
          \else
            \ex\@nameauth@FmtName\ex{\PrintShort}%
          \fi
          \@nameauth@FullNamefalse%
          \@nameauth@FirstNamefalse%
        \else
%    \end{macrocode}
% Handle first uses.
%    \begin{macrocode}
          \@nameauth@FirstFormattrue%
          \@nameauth@FullNametrue%
          \@nameauth@FirstNamefalse%
          \if@nameauth@RevThis
            \ex\@nameauth@FmtName\ex{\Reversed}%
          \else
            \ex\@nameauth@FmtName\ex{\SNN}%
          \fi
          \csgdef{\csb!MN}{}%
          \@nameauth@FullNamefalse%
        \fi
      \else
%    \end{macrocode}
% \clearpage\noindent
% Take care of names in the front matter (code !NF for non-formatted). First handle subsequent uses.
%    \begin{macrocode}
        \ifcsname\csb!NF\endcsname
          \if@nameauth@FirstName
            \@nameauth@FullNamefalse%
          \fi
          \if@nameauth@FullName
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\Reversed}%
            \else
              \ex\@nameauth@FmtName\ex{\SNN}%
            \fi
          \else
            \ex\@nameauth@FmtName\ex{\PrintShort}%
          \fi
          \@nameauth@FullNamefalse%
          \@nameauth@FirstNamefalse%
        \else
%    \end{macrocode}
% Handle first uses.
%    \begin{macrocode}
          \@nameauth@FirstFormattrue%
          \@nameauth@FullNametrue%
          \@nameauth@FirstNamefalse%
          \if@nameauth@RevThis
            \ex\@nameauth@FmtName\ex{\Reversed}%
          \else
            \ex\@nameauth@FmtName\ex{\SNN}%
          \fi
          \csgdef{\csb!NF}{}%
          \@nameauth@FullNamefalse%
        \fi
      \fi
    \else
%    \end{macrocode}
% This is the section that handles the old syntax for royal names and native Eastern names. The first conditional below checks if we are trying to use an alternate name cross-reference as a main name (code !PN for pseudonym). If we are using a legitimate name, we generate an index entry.
%    \begin{macrocode}
      \ifcsname\csbc!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \Name: Xref: #2 #3 cannot be a page reference}%
      \else
        \@nameauth@Index{\csbc}{\IndexSNN\ISpace\argc}%
      \fi
%    \end{macrocode}
% \clearpage\noindent
% If formatting is active, we handle first and subsequent formatting of names in the main matter (code !MN for main matter name). First we handle subsequent uses.
%    \begin{macrocode}
      \if@nameauth@MainFormat
        \ifcsname\csbc!MN\endcsname
          \if@nameauth@FirstName
            \@nameauth@FullNamefalse%
          \fi
          \if@nameauth@FullName
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\ex\argc\ex\space\SNN}%
            \else
              \ex\@nameauth@FmtName\ex{\ex\SNN\ex\space\argc}%
            \fi
          \else
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\argc}%
            \else
              \ex\@nameauth@FmtName\ex{\PrintShort}%
            \fi
          \fi
          \@nameauth@FullNamefalse%
          \@nameauth@FirstNamefalse%
        \else
%    \end{macrocode}
% Handle first uses.
%    \begin{macrocode}
          \@nameauth@FirstFormattrue%
          \@nameauth@FullNametrue%
          \@nameauth@FirstNamefalse%
          \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}{}%
          \@nameauth@FullNamefalse%
        \fi
      \else
%    \end{macrocode}
% \clearpage\noindent
% Take care of names in the front matter (code !NF for non-formatted). First  handle subsequent uses.
%    \begin{macrocode}
        \ifcsname\csbc!NF\endcsname
          \if@nameauth@FirstName
            \@nameauth@FullNamefalse%
          \fi
          \if@nameauth@FullName
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\ex\argc\ex\space\SNN}%
            \else
              \ex\@nameauth@FmtName\ex{\ex\SNN\ex\space\argc}%
            \fi
          \else
            \if@nameauth@RevThis
              \ex\@nameauth@FmtName\ex{\argc}%
            \else
              \ex\@nameauth@FmtName\ex{\PrintShort}%
            \fi
          \fi
          \@nameauth@FullNamefalse%
          \@nameauth@FirstNamefalse%
        \else
%    \end{macrocode}
% Handle first uses.
%    \begin{macrocode}
          \@nameauth@FirstFormattrue%
          \@nameauth@FullNametrue%
          \@nameauth@FirstNamefalse%
          \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}{}%
          \@nameauth@FullNamefalse%
        \fi
      \fi
    \fi
  \else
%    \end{macrocode}
% \clearpage\noindent
% This is the section that handles Western names and non-native Eastern names. The first pair of conditionals handle the \texttt{comma} option, \cmd{\RevThisComma}, and alternate forenames. The next conditional below checks if we are trying to use an alternate name cross-reference as a main name (code !PN for pseudonym). If we are using a legitimate name, we generate an index entry.
%    \begin{macrocode}
    \if@nameauth@RevThisComma
      \protected@edef\ISpace{,\space}%
      \protected@edef\Space{,\space}%
      \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
    \fi
    \ifx\testc\@empty
      \let\FNN\arga%
    \else
      \let\FNN\argc%
    \fi
    \ifcsname\csab!PN\endcsname
      \PackageWarning{nameauth}%
      {macro \Name: Xref: #1 #2 cannot be a page reference}%
    \else
      \ifx\Suff\@empty
        \@nameauth@Index{\csab}{\IndexShort,\space\arga}%
      \else
        \@nameauth@Index{\csab}{\IndexShort,\space\arga,\space\Suff}%
      \fi
    \fi
%    \end{macrocode}
% If formatting is active, we handle first and subsequent formatting of names in the main matter (code !MN for main matter name). First we handle subsequent uses.
%    \begin{macrocode}
    \if@nameauth@MainFormat
      \ifcsname\csab!MN\endcsname
        \if@nameauth@FirstName
          \@nameauth@FullNamefalse%
          \let\PrintShort\FNN%
        \fi
        \if@nameauth@FullName
          \if@nameauth@RevThis
            \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}%
          \else
            \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}%
          \fi
        \else
          \ex\@nameauth@FmtName\ex{\PrintShort}%
        \fi
        \@nameauth@FullNamefalse%
        \@nameauth@FirstNamefalse%
      \else
%    \end{macrocode}
% \clearpage\noindent
% Handle first uses.
%    \begin{macrocode}
        \@nameauth@FirstFormattrue%
        \@nameauth@FullNametrue%
        \@nameauth@FirstNamefalse%
        \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}{}%
        \@nameauth@FullNamefalse%
      \fi
    \else
%    \end{macrocode}
% Take care of names in the front matter (code !NF for non-formatted). First  handle subsequent uses.
%    \begin{macrocode}
      \ifcsname\csab!NF\endcsname
        \if@nameauth@FirstName
          \@nameauth@FullNamefalse%
          \let\PrintShort\FNN%
        \fi
        \if@nameauth@FullName
          \if@nameauth@RevThis
            \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}%
          \else
            \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}%
          \fi
        \else
          \ex\@nameauth@FmtName\ex{\PrintShort}%
        \fi
        \@nameauth@FullNamefalse%
        \@nameauth@FirstNamefalse%
      \else
%    \end{macrocode}
% Handle first uses.
%    \begin{macrocode}
        \@nameauth@FirstFormattrue%
        \@nameauth@FullNametrue%
        \@nameauth@FirstNamefalse%
        \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}{}%
        \@nameauth@FullNamefalse%
      \fi
    \fi
  \fi
%    \end{macrocode}
% \clearpage\noindent
% Reset all the ``per name'' Boolean values.
%    \begin{macrocode}
  \@nameauth@Lockfalse%
  \@nameauth@InNamefalse%
  \@nameauth@FirstFormatfalse%
  \@nameauth@NBSPfalse%
  \@nameauth@DoCapsfalse%
  \@nameauth@Accentfalse%
  \@nameauth@AllThisfalse%
  \@nameauth@ShowCommafalse%
  \@nameauth@RevThisfalse%
  \@nameauth@RevThisCommafalse%
%    \end{macrocode}
% Close the ``locked'' branch.
%    \begin{macrocode}
  \fi
%    \end{macrocode}
% Call the full stop detection.
%    \begin{macrocode}
  \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{User Interface Macros}
%
% \noindent{\large\bfseries Syntactic Formatting\,---\,Capitalization}
% \begin{macro}{\CapThis}
% \changes{v0.94}{2012/02/15}{Added}
% Tells the root capping macro to cap an unaccented first character.
%    \begin{macrocode}
\newcommand*{\CapThis}{\@nameauth@DoCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AccentCapThis}
% \changes{v2.1}{2015/11/24}{Added}
% Tells the root capping macro to cap an accented first Unicode character.
%    \begin{macrocode}
\newcommand*{\AccentCapThis}{\@nameauth@Accenttrue\@nameauth@DoCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CapName}
% \changes{v1.5}{2013/02/22}{Added}
% Capitalize entire name.
%    \begin{macrocode}
\newcommand*{\CapName}{\@nameauth@AllThistrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AllCapsInactive}
% Turn off global surname capitalization.
% \changes{v1.5}{2013/02/22}{Added}
%    \begin{macrocode}
\newcommand*{\AllCapsInactive}{\@nameauth@AllCapsfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AllCapsActive}
% \changes{v1.5}{2013/02/22}{Added}
% Turn on global surname capitalization.
%    \begin{macrocode}
\newcommand*{\AllCapsActive}{\@nameauth@AllCapstrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Syntactic Formatting\,---\,Reversing}
% \begin{macro}{\RevName}
% \changes{v1.5}{2013/02/22}{Added}
% Reverse name order.
%    \begin{macrocode}
\newcommand*{\RevName}{\@nameauth@RevThistrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseInactive}
% Turn off global name reversing.
% \changes{v1.5}{2013/02/22}{Added}
%    \begin{macrocode}
\newcommand*{\ReverseInactive}{\@nameauth@RevAllfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseActive}
% Turn on global name reversing.
% \changes{v1.5}{2013/02/22}{Added}
%    \begin{macrocode}
\newcommand*{\ReverseActive}{\@nameauth@RevAlltrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Syntactic Formatting\,---\,Reversing with Commas}
% \begin{macro}{\RevComma}
% \changes{v1.5}{2013/02/22}{Added}
% Last name, comma, first name.
%    \begin{macrocode}
\newcommand*{\RevComma}%
  {\@nameauth@RevThistrue\@nameauth@RevThisCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseCommaInactive}
% Turn off global ``last-name-comma-first.''
% \changes{v1.5}{2013/02/22}{Added}
%    \begin{macrocode}
\newcommand*{\ReverseCommaInactive}%
  {\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ReverseCommaActive}
% Turn on global ``last-name-comma-first.''
% \changes{v1.5}{2013/02/22}{Added}
%    \begin{macrocode}
\newcommand*{\ReverseCommaActive}%
  {\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Syntactic Formatting\,---\,Affixes}
% \begin{macro}{\ShowComma}
% \changes{v1.4}{2012/07/24}{Added}
% Put comma between name and suffix one time.
%    \begin{macrocode}
\newcommand*{\ShowComma}{\@nameauth@ShowCommatrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Typographic Formatting\,---\,Affixes}
% \begin{macro}{\KeepAffix}
% \changes{v1.9}{2015/07/09}{Added}
% Trigger a name-suffix pair to be separated by a non-breaking space.
%    \begin{macrocode}
\newcommand*{\KeepAffix}{\@nameauth@NBSPtrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Typographic Formatting\,---\,Main Versus Front Matter}
% \begin{macro}{\NamesInactive}
% Switch to the ``non-formatted'' species of names.
%    \begin{macrocode}
\newcommand*{\NamesInactive}{\@nameauth@MainFormatfalse}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NamesActive}
% Switch to the ``formatted'' species of names.
%    \begin{macrocode}
\newcommand*{\NamesActive}{\@nameauth@MainFormattrue}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Name Occurrence Tweaks}
% \begin{macro}{\LocalNames}
% \changes{v2.3}{2016/01/05}{Added}
% \changes{v2.4}{2016/03/15}{Ensured to be global}
% \cmd{\LocalNames} sets |@nameauth@LocalNames| true so \cmd{\ForgetName} and \cmd{\SubvertName} do not affect both formatted and unformatted names.
%    \begin{macrocode}
\newcommand*\LocalNames{\global\@nameauth@LocalNamestrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\GlobalNames}
% \changes{v2.3}{2016/01/05}{Added}
% \changes{v2.4}{2016/03/15}{Ensured to be global}
% \cmd{\GlobalNames} sets |@nameauth@LocalNames| false, restoring the default behavior of \cmd{\ForgetName} and \cmd{\SubvertName}.
%    \begin{macrocode}
\newcommand*\GlobalNames{\global\@nameauth@LocalNamesfalse}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Index Operations}
% \begin{macro}{\IndexInactive}
% \changes{v0.94}{2012/02/15}{Added}
% turn off global indexing of names.
%    \begin{macrocode}
\newcommand*{\IndexInactive}{\@nameauth@DoIndexfalse}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\IndexActive}
% \changes{v0.94}{2012/02/15}{Added}
% turn on global indexing of names.
%    \begin{macrocode}
\newcommand*{\IndexActive}{\@nameauth@DoIndextrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IndexActual}
% \changes{v2.0}{2015/11/11}{Added}
% Change the ``actual'' character from the default.
%    \begin{macrocode}
\newcommand*{\IndexActual}[1]%
  {\global\renewcommand*\@nameauth@Actual{#1}}
%    \end{macrocode}
% \end{macro}
%
% \clearpage
% \noindent{\large\bfseries Main Naming Interface}
% \begin{macro}{\Name}
% \changes{v2.3}{2016/01/05}{Change to interface macro}
% \cmd{\Name} calls \cmd{\NameauthName,} the interface hook.
%    \begin{macrocode}
\def\Name{\NameauthName}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Name*}
% \changes{v1.4}{2012/07/24}{Refactored}
% \cmd{\Name*} sets up a long name reference and calls \cmd{\NameauthLName,} the interface hook.
%    \begin{macrocode}
\WithSuffix\def\Name*{\@nameauth@FullNametrue\NameauthLName}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FName}
% \changes{v0.9}{2012/02/10}{Added}
% \changes{v1.4}{2012/07/24}{Refactored}
% \cmd{\FName} sets up a short name reference and calls \cmd{\NameauthFName,} the interface hook.
%    \begin{macrocode}
\def\FName{\@nameauth@FirstNametrue\NameauthFName}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FName*}
% \changes{v1.4}{2012/07/24}{Refactored}
% \cmd{\FName} and \cmd{\FName*} are identical.
%    \begin{macrocode}
\WithSuffix\def\FName*{\@nameauth@FirstNametrue\NameauthFName}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Alternate Names}
% \begin{macro}{\AKA}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% \changes{v0.9}{2012/02/10}{Add starred mode; redesigned}
% \changes{v1.26}{2012/04/24}{Fix sorting of name suffixes}
% \changes{v1.5}{2013/02/22}{Add reversing and caps}
% \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging}
% \changes{v2.1}{2015/11/24}{Isolate Unicode issues}
% \changes{v2.3}{2016/01/05}{Expand starred mode}
% \changes{v2.4}{2016/03/15}{Define name CS after formatting; add token regs for hooks}
% \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}}
% \cmd{\AKA} prints an alternate name and creates index cross-references. It prevents multiple generation of cross-references and suppresses double periods.
%    \begin{macrocode}
\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]%
{%
%    \end{macrocode}
% Prevent entering \cmd{\AKA} via itself or \cmd{\@nameauth@Name}.
%    \begin{macrocode}
  \if@nameauth@Lock\else
  \@nameauth@Locktrue%
  \@nameauth@InAKAtrue%
  \let\ex\expandafter%
%    \end{macrocode}
% Names occur in horizontal mode; we ensure that. Next we make copies of the arguments to test them and make parsing decisions. We also make token register copies of the current name args to be available for use within the hook macros.
%    \begin{macrocode}
  \leavevmode\hbox{}%
  \protected@edef\testa{#1}%
  \protected@edef\arga{\trim@spaces{#1}}%
  \protected@edef\testb{\trim@spaces{#2}}%
  \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}%
  \protected@edef\arge{\trim@spaces{#5}}%
  \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}%
%    \end{macrocode}
% \clearpage\noindent
% Test for malformed input.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \AKA: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \AKA: Essential name malformed}%
    \fi
  \fi
  \ifx\testd\@empty
    \PackageError{nameauth}%
    {macro \AKA: Essential name missing}%
  \else
    \ifx\csd\@empty
      \PackageError{nameauth}%
      {macro \AKA: Essential name malformed}%
    \fi
  \fi
%    \end{macrocode}
% If global caps. reversing, and commas are true, set the local flags true.
%    \begin{macrocode}
  \if@nameauth@AllCaps\@nameauth@AllThistrue\fi
  \if@nameauth@RevAll\@nameauth@RevThistrue\fi
  \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi
%    \end{macrocode}
% The code below handles non-breaking and regular spaces, as well as commas, in the text and the index by setting up which kind we want to use. These will be inserted as appropriate as the output is formatted.
%    \begin{macrocode}
  \protected@edef\ISpace{\space}%
  \protected@edef\Space{\space}%
  \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi
  \if@nameauth@AlwaysComma
    \protected@edef\ISpace{,\space}%
    \protected@edef\Space{,\space}%
    \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
  \fi
  \if@nameauth@ShowComma
    \protected@edef\ISpace{,\space}%
    \protected@edef\Space{,\space}%
    \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
  \fi
%    \end{macrocode}
%
% \clearpage\noindent
% The section below parses any ``surnames'' into name/suffix pairs and figures out how to capitalize and reverse them as needed, storing the results for the main parser. We have to handle several more combinations here than with \cmd{\Name} above.
%    \begin{macrocode}
  \protected@edef\Shortb{\@nameauth@Root{#2}}%
  \protected@edef\Shortd{\@nameauth@Root{#4}}%
  \if@nameauth@DoCaps
    \protected@edef\CapShort{\@nameauth@CapRoot{#4}}%
  \else
    \let\CapShort\Shortd
  \fi
  \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#4}}%
  \ifx\testb\testbr
    \let\SNNb\Shortb%
    \protected@edef\Suffb{\@empty}%
  \else
    \protected@edef\Suffb{\@nameauth@Suffix{#2}}%
    \protected@edef\SNNb{\Shortb\ISpace\Suffb}%
  \fi
  \ifx\testd\testdr
    \protected@edef\Suffd{\@empty}%
    \let\ISNNd\Shortd%
    \let\Reversed\Shortd%
    \let\SNNd\Shortd%
    \if@nameauth@DoCaps
      \let\SNNd\CapShort%
      \let\Reversed\CapShort%
    \fi
    \if@nameauth@AllThis
      \let\SNNd\AllCapShort%
      \let\Reversed\AllCapShort%
    \fi
  \else
    \protected@edef\Suffd{\@nameauth@Suffix{#4}}%
    \protected@edef\ISNNd{\Shortd\ISpace\Suffd}%
    \protected@edef\Reversed{\Suffd\Space\Shortd}%
    \protected@edef\SNNd{\Shortd\Space\Suffd}%
    \if@nameauth@DoCaps
      \protected@edef\Reversed{\Suffd\Space\CapShort}%
      \protected@edef\SNNd{\CapShort\Space\Suffd}%
    \fi
    \if@nameauth@AllThis
      \protected@edef\Reversed{\Suffd\Space\AllCapShort}%
      \protected@edef\SNNd{\AllCapShort\Space\Suffd}%
    \fi
  \fi
%    \end{macrocode}
% \clearpage\noindent
% Here we parse names. 
%    \begin{macrocode}
  \ifx\testc\@empty
    \ifx\teste\@empty
%    \end{macrocode}
% For mononyms and name/suffix pairs: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index.
%    \begin{macrocode}
      \ifcsname\csd!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \AKA: XRef: #4 exists}%
      \else
        \ifcsname\csd!MN\endcsname
          \PackageWarning{nameauth}%
          {macro \AKA: Name reference: #4 exists; no xref}%
        \else
          \ifcsname\csd!NF\endcsname
            \PackageWarning{nameauth}%
            {macro \AKA: Name reference: #4 exists; no xref}%
          \else
            \ifx\testa\@empty
              \@nameauth@Index{\csd}%
                {\ISNNd|see{\SNNb}}%
            \else
              \ifx\Suffb\@empty
                \@nameauth@Index{\csd}%
                  {\ISNNd|see{\SNNb,\space\arga}}%
              \else
                \@nameauth@Index{\csd}%
                  {\ISNNd|see{\Shortb,\space\arga,\space\Suffb}}%
              \fi
            \fi
          \fi
        \fi
      \fi
%    \end{macrocode}
% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index. Again, \cmd{\expandafter} is used for the punctuation detection.
%    \begin{macrocode}
      \if@nameauth@RevThisComma
        \protected@edef\ISpace{,\space}%
        \protected@edef\Space{,\space}%
        \if@nameauth@NBSP
          \protected@edef\Space{,\nobreakspace}%
        \fi
      \fi
      \ifcsname\csd!PN\endcsname\else\@nameauth@FirstFormattrue\fi
      \if@nameauth@RevThis
        \ex\@nameauth@FmtName\ex{\Reversed}%
      \else
        \ex\@nameauth@FmtName\ex{\SNNd}%
      \fi
      \ifcsname\csd!PN\endcsname\else\csgdef{\csd!PN}{}\fi
    \else
%    \end{macrocode}
% \clearpage\noindent
% For name/affix using the old syntax: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index.
%    \begin{macrocode}
      \ifcsname\csde!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \AKA: XRef: #4 #5 exists}%
      \else
        \ifcsname\csde!MN\endcsname
          \PackageWarning{nameauth}%
          {macro \AKA: Name reference: #4 #5 exists; no xref}%
        \else
          \ifcsname\csde!NF\endcsname
            \PackageWarning{nameauth}%
            {macro \AKA: Name reference: #4 #5 exists; no xref}%
          \else
            \ifx\testa\@empty
              \@nameauth@Index{\csde}%
                {\ISNNd\ISpace\arge|see{\SNNb}}%
            \else
              \ifx\Suffb\@empty
                \@nameauth@Index{\csde}%
                  {\ISNNd\ISpace\arge|see{\SNNb,\space\arga}}%
              \else
                \@nameauth@Index{\csde}%
                {\ISNNd\ISpace\arge|see{\Shortb,\space\arga,\space\Suffb}}%
              \fi
            \fi
          \fi
        \fi
      \fi
%    \end{macrocode}
% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index.
%    \begin{macrocode}
      \if@nameauth@RevThisComma
        \protected@edef\ISpace{,\space}%
        \protected@edef\Space{,\space}%
        \if@nameauth@NBSP
          \protected@edef\Space{,\nobreakspace}%
        \fi
      \fi
      \ifcsname\csde!PN\endcsname\else\@nameauth@FirstFormattrue\fi
      \if@nameauth@AltAKA
        \ex\@nameauth@FmtName\ex{\arge}%
      \else
        \if@nameauth@RevThis
          \ex\@nameauth@FmtName\ex{\ex\arge\ex\Space\SNNd}%
        \else
          \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\space\arge}%
        \fi
      \fi
      \ifcsname\csde!PN\endcsname\else\csgdef{\csde!PN}{}\fi
    \fi
  \else
%    \end{macrocode}
% \clearpage\noindent
% For Western names and affixes: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index.
%    \begin{macrocode}
    \ifcsname\cscd!PN\endcsname
      \PackageWarning{nameauth}%
      {macro \AKA: XRef: #3 #4 exists}%
    \else
      \ifcsname\cscd!MN\endcsname
        \PackageWarning{nameauth}%
        {macro \AKA: Name reference: #3 #4 exists; no xref}%
      \else
        \ifcsname\cscd!NF\endcsname
          \PackageWarning{nameauth}%
          {macro \AKA: Name reference: #3 #4 exists; no xref}%
        \else
          \ifx\testa\@empty
            \ifx\Suffd\@empty
              \@nameauth@Index{\cscd}%
                {\ISNNd,\space\argc|see{\SNNb}}%
            \else
              \@nameauth@Index{\cscd}%
                {\Shortd,\space\argc,\space\Suffd|see{\SNNb}}%
            \fi
          \else
            \ifx\Suffb\@empty
              \ifx\Suffd\@empty
                \@nameauth@Index{\cscd}%
                  {\ISNNd,\space\argc|see{\SNNb,\space\arga}}%
              \else
                \@nameauth@Index{\cscd}%
                {\Shortd,\space\argc,\space\Suffd|see{\SNNb,\space\arga}}%
              \fi
            \else
              \ifx\Suffd\@empty
                \@nameauth@Index{\cscd}%
                {\ISNNd,\space\argc|see{\Shortb,\space\arga,\space\Suffb}}%
              \else
                \@nameauth@Index{\cscd}%
  {\Shortd,\space\argc,\space\Suffd|see{\Shortb,\space\arga,\space\Suffb}}%
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
%    \end{macrocode}
% \clearpage\noindent
% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index.
%    \begin{macrocode}
    \if@nameauth@RevThisComma
      \protected@edef\ISpace{,\space}%
      \protected@edef\Space{,\space}%
      \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
    \fi
    \ifx\teste\@empty
      \let\FNN\argc%
    \else
      \let\FNN\arge%
    \fi
    \ifcsname\cscd!PN\endcsname\else\@nameauth@FirstFormattrue\fi
    \if@nameauth@AltAKA
      \ex\@nameauth@FmtName\ex{\FNN}%
    \else
      \if@nameauth@RevThis
        \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\Space\FNN}%
      \else
        \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNNd}%
      \fi
    \fi
    \ifcsname\cscd!PN\endcsname\else\csgdef{\cscd!PN}{}\fi
  \fi
%    \end{macrocode}
% Reset all the ``per name'' Boolean values.
%    \begin{macrocode}
  \@nameauth@Lockfalse%
  \@nameauth@InAKAfalse%
  \@nameauth@FirstFormatfalse%
  \@nameauth@NBSPfalse%
  \@nameauth@AltAKAfalse%
  \@nameauth@DoCapsfalse%
  \@nameauth@Accentfalse%
  \@nameauth@AllThisfalse%
  \@nameauth@ShowCommafalse%
  \@nameauth@RevThisfalse%
  \@nameauth@RevThisCommafalse%
%    \end{macrocode}
% Close the ``locked'' branch.
%    \begin{macrocode}
  \fi
%    \end{macrocode}
% Call the full stop detection.
%    \begin{macrocode}
  \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AKA*}
% \changes{v0.9}{2012/02/10}{Added}
% This starred form sets a Boolean to print only the alternate name argument, if that exists, and calls \cmd{\AKA}.
%    \begin{macrocode}
\WithSuffix\def\AKA*{\@nameauth@AltAKAtrue\AKA}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PName}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% \changes{v2.3}{2016/01/05}{Work directly with hooks}
% \cmd{\PName} is a convenience macro that calls \cmd{\NameauthName}, then \cmd{\AKA}.
%    \begin{macrocode}
\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty]%
{%
  \NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PName*}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% This sets up a long name reference and calls \cmd{\PName}.
%    \begin{macrocode}
\WithSuffix\def\PName*{\@nameauth@FullNametrue\PName}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Name Info Database: ``Text Tags''}
% \begin{macro}{\NameAddInfo}
% \changes{v2.4}{2016/03/15}{Added}
% This creates a control sequence and information associated with a given name, similar to an index tag, but usable in the body text.
%    \begin{macrocode}
\newcommandx\NameAddInfo[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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \NameInfo: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \NameInfo: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \csgdef{\csb!DB}{#4}%
    \else
      \csgdef{\csbc!DB}{#4}%
    \fi
  \else
    \csgdef{\csab!DB}{#4}%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameQueryInfo}
% \changes{v2.4}{2016/03/15}{Added}
% This prints the information created by \cmd{\NameAddInfo} if it exists.
%    \begin{macrocode}
\newcommandx\NameQueryInfo[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}}%
%    \end{macrocode}
% \clearpage\noindent
% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \NameInfo: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \NameInfo: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi
    \else
      \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi
    \fi
  \else
    \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NameClearInfo}
% \changes{v2.4}{2016/03/15}{Added}
% This deletes a text tag. It has the same structure as \cmd{\UntagName.}
%    \begin{macrocode}
\newcommandx*\NameClearInfo[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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and then we parse the arguments, undefining the tag control sequences.
%    \begin{macrocode}
  \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!DB}%
    \else
      \global\csundef{\csbc!DB}%
    \fi
  \else
    \global\csundef{\csab!DB}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \clearpage\noindent
%
% \noindent{\large\bfseries Index Operations}
% \begin{macro}{\IndexName}
% \changes{v0.75}{2012/01/19}{Use current arguments}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
% \changes{v1.26}{2012/04/24}{Fix name suffix sorting}
% \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging}
% This creates an index entry that is not already a pseudonym. It prints nothing. It does ensure consistent formatting.
%    \begin{macrocode}
\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\testbr{\@nameauth@Root{#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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and make parsing decisions. Below we handle the types of spaces or commas that will be inserted into the index entries.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \IndexName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \IndexName: Essential name malformed}%
    \fi
  \fi
  \protected@edef\Space{\space}%
  \if@nameauth@AlwaysComma
    \protected@edef\Space{,\space}%
  \fi
  \if@nameauth@ShowComma
    \protected@edef\Space{,\space}%
  \fi
%    \end{macrocode}
% Now we deal with suffixes, and whether to handle them for Western or Eastern names.
%    \begin{macrocode}
  \let\Short\testbr%
  \ifx\testb\testbr
    \let\SNN\Short%
    \protected@edef\Suff{\@empty}%
  \else
    \protected@edef\Suff{\@nameauth@Suffix{#2}}%
    \protected@edef\SNN{\Short\Space\Suff}%
  \fi
%    \end{macrocode}
% \clearpage\noindent
% We create the appropriate index entries with tags, letting the internal indexing macro sort that out. We do not create an index entry in the case that a name has been used as a pseudonym by \cmd{\AKA} or \cmd{\ExcludeName}.
%    \begin{macrocode}
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \IndexName: XRef: #2 exists}%
      \else
        \@nameauth@Index{\csb}{\SNN}%
      \fi
    \else
      \ifcsname\csbc!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \IndexName: XRef: #2 #3 exists}%
      \else
        \@nameauth@Index{\csbc}{\SNN\Space\argc}%
      \fi
    \fi
  \else
    \ifcsname\csab!PN\endcsname
      \PackageWarning{nameauth}%
      {macro \IndexName: XRef: #1 #2 exists}%
    \else
      \ifx\Suff\@empty
        \@nameauth@Index{\csab}{\Short,\space\arga}%
      \else
        \@nameauth@Index{\csab}{\Short,\space\arga,\space\Suff}%
      \fi
    \fi
  \fi
  \@nameauth@ShowCommafalse%
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \begin{macro}{\TagName}
% \changes{v1.2}{2012/02/25}{Added}
% \changes{v1.9}{2015/07/09}{Fix cs collisions}
% \changes{v2.0}{2015/11/11}{Isolate malformed input; redesign tagging}
% This creates an index entry tag that is applied to a name that is not already used as a cross reference via \cmd{\AKA}.
%    \begin{macrocode}
\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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences.
%    \begin{macrocode}
  \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
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \begin{macro}{\UntagName}
% \changes{v1.2}{2012/02/25}{Added}
% \changes{v1.9}{2015/07/09}{Ensure global undef, fix cs collisions}
% \changes{v2.0}{2015/11/11}{Isolate malformed input; redesign tagging}
% This deletes an index tag.
%    \begin{macrocode}
\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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and then we parse the arguments, undefining the tag control sequences.
%    \begin{macrocode}
  \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
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \begin{macro}{\PretagName}
% \changes{v2.0}{2015/11/11}{Added}
% This creates an index entry tag that is applied before a name.
%    \begin{macrocode}
\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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences.
%    \begin{macrocode}
  \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
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ExcludeName}
% \changes{v0.94}{2012/02/15}{Added}
% \changes{v2.0}{2015/11/11}{Isolate malformed input}
% \changes{v2.3}{2016/01/05}{Distinguish excluded names from regular aliases}
% This macro prevents a name from being formatted or indexed, making \cmd{\Name} and friends print their arguments, emit a warning, and continue.
%    \begin{macrocode}
\newcommandx*\ExcludeName[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}}%
%    \end{macrocode}
% \clearpage\noindent
% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \ExcludeName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \ExcludeName: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \ExcludeName: Xref: #2 already exists}%
      \else
        \ifcsname\csb!MN\endcsname
          \PackageWarning{nameauth}%
          {macro \ExcludeName: Reference: #2 exists; no exclusion}%
        \else
          \ifcsname\csb!NF\endcsname
            \PackageWarning{nameauth}%
            {macro \ExcludeName: Reference: #2 exists; no exclusion}%
          \else
            \csgdef{\csb!PN}{!}%
          \fi
        \fi
      \fi
    \else
      \ifcsname\csbc!PN\endcsname
        \PackageWarning{nameauth}%
        {macro \ExcludeName: Xref: #2 #3 already exists}%
      \else
        \ifcsname\csbc!MN\endcsname
          \PackageWarning{nameauth}%
          {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}%
        \else
          \ifcsname\csbc!NF\endcsname
            \PackageWarning{nameauth}%
            {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}%
          \else
            \csgdef{\csbc!PN}{!}%
          \fi
        \fi
      \fi
    \fi
%    \end{macrocode}
% \clearpage\noindent
%    \begin{macrocode}
  \else
    \ifcsname\csab!PN\endcsname
      \PackageWarning{nameauth}%
      {macro \ExcludeName: XRef: #1 #2 already exists}%
    \else
      \ifcsname\csab!MN\endcsname
        \PackageWarning{nameauth}%
        {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}%
      \else
        \ifcsname\csab!NF\endcsname
          \PackageWarning{nameauth}%
          {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}%
        \else
          \csgdef{\csab!PN}{!}%
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Name Decisions}
% \begin{macro}{\IfFrontName}
% \changes{v2.3}{2016/01/05}{Added}
% This macro expands one path if a front matter name exists, or else the other if it does not exist.
%    \begin{macrocode}
\newcommandx\IfFrontName[5][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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \IfFrontName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \IfFrontName: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi
    \else
      \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi
    \fi
  \else
    \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \begin{macro}{\IfMainName}
% \changes{v2.3}{2016/01/05}{Added}
% This macro expands one path if a main matter name exists, or else the other if it does not exist.
%    \begin{macrocode}
\newcommandx\IfMainName[5][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}}%
%    \end{macrocode}
% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \IfMainName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \IfMainName: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi
    \else
      \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi
    \fi
  \else
    \ifcsname\csab!MN\endcsname{#4}\else{#5}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \begin{macro}{\IfAKA}
% \changes{v2.3}{2016/01/05}{Added}
% \changes{v2.4}{2016/03/15}{Redesign exclusion test}
% This macro expands one path if a see-reference name exists, another if it does not exist, and a third if it is excluded.
%    \begin{macrocode}
\newcommandx\IfAKA[6][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}}%
  \def\test{!}%
%    \end{macrocode}
% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \IfAKA: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \IfAKA: Essential name malformed}%
    \fi
  \fi
  \ifx\testa\@empty
    \ifx\testc\@empty
      \ifcsname\csb!PN\endcsname
        \edef\testa{\csname\csb!PN\endcsname}%
        \ifx\testa\test{#6}\else{#4}\fi
      \else{#5}\fi
    \else
      \ifcsname\csbc!PN\endcsname
        \edef\testa{\csname\csbc!PN\endcsname}%
        \ifx\testa\test{#6}\else{#4}\fi
      \else{#5}\fi
    \fi
  \else
    \ifcsname\csab!PN\endcsname
      \edef\testa{\csname\csab!PN\endcsname}%
      \ifx\testa\test{#6}\else{#4}\fi
    \else{#5}\fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \clearpage\noindent
% \noindent{\large\bfseries Changing Name Decisions}
% \begin{macro}{\ForgetName}
% \changes{v0.75}{2012/01/19}{New argument added}
% \changes{v1.9}{2015/07/09}{Ensure global undef}
% \changes{v2.0}{2015/11/11}{Isolate malformed input}
% \changes{v2.3}{2016/01/05}{Changed to allow global or local behavior}
% This undefines a control sequence to force the ``first use'' option of \cmd{\Name}.
%    \begin{macrocode}
\newcommandx*\ForgetName[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}}%
%    \end{macrocode}
% We make copies of the arguments to test them.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \ForgetName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \ForgetName: Essential name malformed}%
    \fi
  \fi
%    \end{macrocode}
% Now we parse the arguments, undefining the control sequences either locally by section type or globally. |@nameauth@LocalNames| toggles the local or global behavior, while |@nameauth@MainFormat| selects the type of name.
%    \begin{macrocode}
  \ifx\testa\@empty
    \ifx\testc\@empty
      \if@nameauth@LocalNames
        \if@nameauth@MainFormat
          \global\csundef{\csb!MN}%
        \else
          \global\csundef{\csb!NF}%
        \fi
      \else
        \global\csundef{\csb!MN}%
        \global\csundef{\csb!NF}%
      \fi
    \else
      \if@nameauth@LocalNames
        \if@nameauth@MainFormat
          \global\csundef{\csbc!MN}%
        \else
          \global\csundef{\csbc!NF}%
        \fi
      \else
        \global\csundef{\csbc!MN}%
        \global\csundef{\csbc!NF}%
      \fi
    \fi
  \else
    \if@nameauth@LocalNames
      \if@nameauth@MainFormat
        \global\csundef{\csab!MN}%
      \else
        \global\csundef{\csab!NF}%
      \fi
%    \end{macrocode}
% \clearpage\noindent
%    \begin{macrocode}
    \else
      \global\csundef{\csab!MN}%
      \global\csundef{\csab!NF}%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\SubvertName}
% \changes{v0.9}{2012/02/10}{Added}
% \changes{v2.0}{2015/11/11}{Isolate malformed input}
% \changes{v2.3}{2016/01/05}{Changed to allow global or local behavior}
% This defines a control sequence to suppress the ``first use'' of \cmd{\Name}.
%    \begin{macrocode}
\newcommandx*\SubvertName[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}}%
%    \end{macrocode}
% We make copies of the arguments to test them.
%    \begin{macrocode}
  \ifx\testb\@empty
    \PackageError{nameauth}%
    {macro \SubvertName: Essential name missing}%
  \else
    \ifx\csb\@empty
      \PackageError{nameauth}%
      {macro \SubvertName: Essential name malformed}%
    \fi
  \fi
%    \end{macrocode}
% Now we parse the arguments, defining the control sequences either locally by section type or globally. |@nameauth@LocalNames| toggles the local or global behavior, while |@nameauth@MainFormat| selects the type of name.
%    \begin{macrocode}
  \ifx\testa\@empty
    \ifx\testc\@empty
      \if@nameauth@LocalNames
        \if@nameauth@MainFormat
          \csgdef{\csb!MN}{}%
        \else
          \csgdef{\csb!NF}{}%
        \fi
      \else
        \csgdef{\csb!MN}{}%
        \csgdef{\csb!NF}{}%
      \fi
    \else
      \if@nameauth@LocalNames
        \if@nameauth@MainFormat
          \csgdef{\csbc!MN}{}%
        \else
          \csgdef{\csbc!NF}{}%
        \fi
      \else
        \csgdef{\csbc!MN}{}%
        \csgdef{\csbc!NF}{}%
      \fi
    \fi
%    \end{macrocode}
% \clearpage\noindent
%    \begin{macrocode}
  \else
    \if@nameauth@LocalNames
      \if@nameauth@MainFormat
        \csgdef{\csab!MN}{}%
      \else
        \csgdef{\csab!NF}{}%
      \fi
    \else
      \csgdef{\csab!MN}{}%
      \csgdef{\csab!NF}{}%
    \fi
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \noindent{\large\bfseries Simplified Interface}
% \begin{environment}{nameauth}
% \changes{v1.6}{2013/03/10}{Added}
% \changes{v2.0}{2015/11/11}{Redesigned argument handling}
% \changes{v2.11}{2015/11/29}{Bugfix}
% \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}}
% The |nameauth| environment provides a means to implement shorthand references to names in a document.
%    \begin{macrocode}
\newenvironment{nameauth}{%
  \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}}%
    \@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
        \PackageError{nameauth}%
        {environment nameauth: Essential name missing}%
      \else
        \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\@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}}%
%    \end{macrocode}
% \clearpage\noindent
%    \begin{macrocode}
          \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\@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\@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\@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\@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\@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\@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{\ex\ex\ex\ex\ex\ex\ex\NameauthName%
              \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}\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\@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}\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\@nameauth@etoksb\ex\ex\ex]%
              \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[%
              \the\@nameauth@etoksd]}%
          \fi
        \fi
      \fi
    \fi
    \ignorespaces%
  }\ignorespaces%
}{\endgroup\ignorespaces}
%    \end{macrocode}
% \end{environment}
%\Finale
\endinput
%</package>
