%%
%% This is file `examples.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nameauth.dtx  (with options: `examples')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2023 by Charles P. Schaum <charles[dot]schaum@comcast.net>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    https://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 

\documentclass[oneside]{article}

\input{compat.tex} % Included with nameauth; needed only if
% compiling on multiple TeX distros or LaTeX engines.

\usepackage[textwidth=137mm,textheight=237mm,
            right=40mm,marginparwidth=40mm]{geometry}
\usepackage{index}
\usepackage{nameauth}[2023/02/03]
\usepackage[inline]{enumitem}
\usepackage{fancyvrb}

% Define fancyvrb defaults.
\fvset{gobble=2,numbers=left,fontsize=\small}

\usepackage{xcolor}
\usepackage[colorlinks=true]{hyperref}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up indexing and put margin paragraphs on the left.
%
\makeindex
\newindex{per}{rdx}{rnd}{Index of Persons}
\renewcommand\NameauthIndex{\index[per]}
\reversemarginpar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Global definitions of conditionals for examples and
% Global definitions of macros for examples could occur
% here, but we put those instead in the sections where
% they appear.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create name shorthands. Note the use of \noexpand
% in the macro arguments below.
%
\begin{nameauth}
  \< Doug   & Frederick & Douglass &        >
  \< Bailey & Betsey    & Bailey   &        >
\end{nameauth}

\begin{nameauth}
  \< Wash & George & Washington & >
  \< Aris & & Aristotle & >
  \< Plato & & Plato & >
  \< Aeth & & Æthelred, II & >
  \< Sun & & Sun, Yat-sen & >
  \< Linc & Abraham & Lincoln & >
  \< MLK & Martin Luther & King, Jr. & >
  \< Soto & Hernando & de Soto & >
  \< Goethe & J.W. von & Goethe & >
  \< Patton & George S. & Patton, Jr. & >
  \< Ike & Dwight D. & Eisenhower & >
\end{nameauth}

\begin{nameauth}
  \< Luth & Martin & \noexpand\textSC{Luther} & >
  \< Cath & Catherine \noexpand\AltCaps{d}e'
          & \noexpand\textSC{Medici} & >
\end{nameauth}

\begin{nameauth}
  \< Jeff & Thomas &
     \noexpand\textSC{Jefferson}\noexpand\GEN{} & >
\end{nameauth}

\begin{nameauth}
  \< Scipio & \noexpand\SCIPi & \noexpand\SCIPii & >
  \< TGrac & \noexpand\TSemp & Gracchus & >
\end{nameauth}

\begin{nameauth}
  \< OScipio & Lucius & \noexpand\CSB & > % O for Oxford
\end{nameauth}

\begin{nameauth}
  \< Shak & \noexpand\WM & \noexpand\SHK & >
\end{nameauth}

\begin{nameauth}
  \< deSmet & Pierre-Jean &
     \noexpand\Fbox{\noexpand\AltCaps{d}e~Smet} & >
\end{nameauth}

%
% We could add name info database tags (text tags) either
% in the preamble or in the document environment. We will do
% the latter in this example file.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Below we establish sort tags for names.
%
%  Sort these names under: US Presidents.
\PretagName[George]{Washington}{US Presidents!Washington, George}
\PretagName[Abraham]{Lincoln}{US Presidents!Lincoln, Abraham}

%  Sort these names under: Philosophers.
\PretagName{Aristotle}{Philosophers!Aristotle}
\PretagName{Plato}{Philosophers!Plato}

%  Sort these names under: Black Americans, famous.
\PretagName[Frederick]{Douglass}
  {Black Americans, famous!Douglass, Frederick}
\PretagName[Betsey]{Bailey}
  {Black Americans, famous!Bailey, Betsey}
\PretagName[Martin Luther]{King, Jr.}
  {Black Americans, famous!King, Martin Luther, Jr.}

%  Sort these names under: Europeans, historical.
\PretagName{Æthelred, II}{Europeans, historical!Aethelred 2}
\PretagName[Hernando]{de Soto}
  {Europeans, historical!de Soto, Hernando}

\PretagName{Vlad, Ţepeş}{Vlad Tepes} % for accented names

\PretagName[Konrad]{\noexpand\textSC{Zuse}}{Zuse, Konrad}
\PretagName[Ada]{\noexpand\textIT{Lovelace}}{Lovelace, Ada}
\PretagName[Charles]{\noexpand\textBF{Babbage}}
  {Babbage, Charles}
\PretagName{\noexpand\textUC{Kanade}, Takeo}{Kanade Takeo}

\PretagName[Martin]{\noexpand\textSC{Luther}}{Luther, Martin}
\PretagName[Catherine \noexpand\AltCaps{d}e']
           {\noexpand\textSC{Medici}}{Medici, Catherine de}

\PretagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {Jefferson, Thomas}

\PretagName[Greta]{\noexpand\textSC{Garbo}}{Garbo, Greta}
\PretagName{\noexpand\textSC{Misora}, Hibari}{Misora Hibari}
\PretagName[Heinz]{\noexpand\textSC{R\"uhmann}}{Ruehmann, Heinz}
\PretagName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
  {Ruehmann, Heinrich Wilhelm}

\PretagName[\noexpand\SCIPi]{\noexpand\SCIPii}
  {Scipio Africanus}
\PretagName[\noexpand\TSemp]{Gracchus}
  {Gracchus, Tiberius Sempronius}

\PretagName[Lucius]{\noexpand\CSB}{Cornelius Scipio Barbatus}

\PretagName[\noexpand\WM]{\noexpand\SHK}
  {Shakespeare, William}
\PretagName[Robert]{\textSC{Burns}}{Burns, Robert}

\PretagName[Pierre-Jean]%
  {\noexpand\Fbox{\noexpand\AltCaps{d}e~Smet}}%
  {de~Smet, Pierre-Jean}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Below we establish some index tags for names.
%
\TagName[George S.]{Patton, Jr.}{, general}
\TagName{Vlad, II}{ Dracul}
\TagName{Vlad, III}{ Dracula}
\IndexRef{Dracula}{Vlad III}
\TagName[Thomas]{\noexpand\textSC{Jefferson}\noexpand\GEN{}}
  {, pres.}
\TagName[\noexpand\TSemp]{Gracchus}{, consul}
\TagName[Lucius]{\noexpand\CSB}{, consul}

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

\title{\bfseries Collected Examples}
\author{Charles P. Schaum}
\date{2023/02/03}

\begin{document}
\maketitle

\phantomsection
\pdfbookmark[1]{\contentsname}{toc}
\tableofcontents
\newpage

\section{Minimal Example}

\begin{enumerate*}
  \item[\textbf{1.}] \Doug\ rose to eminence by sheer force
    of character and talents that neither slavery nor caste
    proscription could crush.
  \item[\textbf{2.}] \Doug's early life is perhaps the most
    complete indictment of the slave system ever presented at
    the bar of public opinion.
  \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
    earliest memories centered around the cabin of his
    grandmother, \Bailey.\\
\end{enumerate*}
\index{example, minimal}

\ForgetName[Frederick]{Douglass}
\ForgetName[Betsey]{Bailey}
\noindent
\begin{enumerate*}
  \item[\textbf{2.}] \Doug's early life is perhaps the most
    complete indictment of the slave system ever presented at
    the bar of public opinion.
  \item[\textbf{3.}] \Doug\ was born in February, l8l7. His
    earliest memories centered around the cabin of his
    grandmother, \Bailey.
  \item[\textbf{1.}] \Doug\ rose to eminence by sheer force
    of character and talents that neither slavery nor caste
    proscription could crush.
\end{enumerate*}

\section{Multiple Indexes}

The Electric Boogaloo\index{Boogaloo, Electric}\\ %  main index
was created by \Name{Ollie~\& Jerry}.             %  name index
\index{indexes, multiple}

\section{Index Categories}

\subsection{Famous Black Americans}

\ForgetThis\Name[Frederick]{Douglass} rose to eminence by sheer
force of character and talents that neither slavery nor caste
proscription could crush. Circumstances made
\Name[Frederick]{Douglass} a slave, but they could not prevent
him from becoming a freeman and a leader among mankind.\\

We also celebrate \MLK, then \MLK.

\subsection{Patres Patriae}

We mention President \Wash; again, \Wash.
Family and close friends called him \SWash.\\

\TagName[George]{Washington}{!as general}
We can reminisce about \LWash[General].
\UntagName[George]{Washington}

When speaking of \Linc, we can refer to \LLinc[Abe].

\subsection{Philosophers}

Among philosophers we consider \Plato\ and \Aris.

\subsection{Historical Figures}

We ponder about \Aeth, then \Aeth.
We speak of \Sun, then \Sun.
We note \Soto, then just \Soto.
\CapThis\Soto{} starts a sentence.

\subsection{Further Discussion}

\TagName[George]{Washington}{!as general}
\TagName[Dwight D.]{Eisenhower}{!as general}
\LWash, \LPatton, and \LIke\ were high-ranking generals.\\

\TagName[Dwight D.]{Eisenhower}{!as president}
\UntagName[George]{Washington}
\Wash\ and \Ike\ also were US presidents.

\small
% Instead of pre-tagging Ike we do the following:
\index[per]{US Presidents!other|see{Eisenhower, Dwight D., president}}

\section{More Complex Hooks}

% First save main- and front-matter hooks. Then change
% first-use hooks for both main matter and front matter.
\let\OldFormat\NamesFormat
\let\OldFrontNames\FrontNamesFormat

\renewcommand*\NamesFormat[1]{\textbf{#1}\unless\ifinner
   \marginpar{\raggedleft\scriptsize #1}\fi}
\renewcommand*\FrontNamesFormat[1]{\textit{#1}\unless\ifinner
   \marginpar{\raggedleft\scriptsize #1}\fi}
\index{complex hooks, intro}

The new format (front matter):\NamesInactive

\Name{Vlad, III}[III Dracula], known as
\IndexRef{Vlad, Ţepeş}{Vlad III}\SubvertThis\Name*{Vlad, Ţepeş}
(\Name*{Vlad, Ţepeş}[the Impaler])
after his death, was the son of \Name{Vlad, II}[II Dracul],
a member of the Order of the Dragon. Later references to
``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.

The new format (main matter):\NamesActive

\Name{Vlad, III}[III Dracula], known as
\IndexRef{Vlad, Ţepeş}{Vlad III}\SubvertThis\Name*{Vlad, Ţepeş}
(\Name*{Vlad, Ţepeş}[the Impaler])
after his death, was the son of \Name{Vlad, II}[II Dracul],
a member of the Order of the Dragon. Later references to
``\Name*{Vlad, III}'' and ``\Name{Vlad, III}'' appear thus.

\let\NamesFormat\OldFormat
\let\FrontNamesFormat\OldFrontNames

We are back in the old format.

in the front matter we see: \NamesInactive
\ForgetThis\Name{Vlad, III}[III Dracula],
\Name*{Vlad, III}, and  \Name{Vlad, III}.

in the main matter we see: \NamesActive
\ForgetThis\Name{Vlad, III}[III Dracula],
\Name*{Vlad, III}, and  \Name{Vlad, III}.

\section{Life Dates in Hooks}

% Add data tags to names.
\NameAddInfo[George]{Washington}{ (1732--99)}
\NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}
\NameAddInfo{Atat\"urk}{ (in 1934, a special surname)}

% Ensure that Atat\"urk is a cross-reference that
% has no page entries in the index.
\IndexRef{Atat\"urk}{Kemal, Mustafa}

% Manually suppress data tag in ``first'' reference
\newif\ifNoTag

% Redesign formatting hook to usually print a tag
% only in ``first'' reference. On exit, It resets
% the flag that suppresses tags, making that flag
% work only once per name use.

\renewcommand*\NamesFormat[1]
{%
  #1%
  \ifcsname\NameauthPattern!DB\endcsname
    \unless\ifNoTag
      \expandafter\csname\NameauthPattern!DB\endcsname%
    \fi
    \global\NoTagfalse%
  \fi
}

\ForgetThis\Name[George]{Washington} held office as the first US
president from 1789 to 1797. \Name[George]{Washington} was the only
president whose term in office was completely in the eighteenth
century. If we need to trigger the first use hook at some point,
we can suppress dates and get an automatic long reference via:
\NoTagtrue\ForgetThis\Name[George]{Washington}. Or we can trigger
the first-use hook in a subsequent name use and still have dates:
\ForceName\Name[George]{Washington}.
\index{life dates}

We can add name info tags to names used only as cross-
references. For example, \Name[Mustafa]{Kemal} was granted
the name \Name{Atat\"urk}. We mention \Name[Mustafa]{Kemal}
and \Name{Atat\"urk} again. Likewise, we can trigger a
first use, but with no data tag tag:
\NoTagtrue\ForgetThis\Name{Atat\"urk}.

\section{Alternate Formatting}

\AltFormatActive
\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{\AltOff}

\noindent
\ForgetThis\Name[Konrad]{\noexpand\textSC{Zuse}};
\Name[Konrad]{\noexpand\textSC{Zuse}}\\
\ForgetThis\Name[Ada]{\noexpand\textIT{Lovelace}};
\Name[Ada]{\noexpand\textIT{Lovelace}}\\
\ForgetThis\Name[Charles]{\noexpand\textBF{Babbage}};
\Name[Charles]{\noexpand\textBF{Babbage}}\\
\ForgetThis\Name{\noexpand\textUC{Kanade}, Takeo};
\Name{\noexpand\textUC{Kanade}, Takeo}
\index{formatting, alternate}

\renewcommand*\MainNameHook{\sffamily\AltOff}

\ForgetThis\Luth\ was a leading figure in the Protestant
Reformation. \Luth\ believed that one is declared
righteous in a forensic sense by divine grace through faith
created by the Holy Spirit via the Gospel and the Sacraments.

\ForgetThis\Cath\ was not only Queen of France in her own right,
but she also guided the reigns of her three sons.
\CapThis\LCath[\noexpand\AltCaps{d}e']
was blamed for the St.\ Bartholomew's Day massacre that saw the
murder of thousands of Huguenots.
\index{formatting, alternate}

\section{Grammatical Inflections in Names}

\newif\ifGenitive
\newif\ifDoGenitive

\newcommand*\GEN{\ifDoGenitive\textSC{'s}\fi}

\renewcommand*\NamesFormat[1]
  {\ifGenitive\DoGenitivetrue\fi#1\global\Genitivefalse}
\renewcommand*\MainNameHook[1]
  {\ifGenitive\DoGenitivetrue\fi\AltOff#1\global\Genitivefalse}

Consider \Genitivetrue\Jeff\ legacy as the author of the
colonies' Declaration of Independence and his impact as third
president of the United States. \Jeff\ was a complex historical
figure whose actions defy a consistent moral compass both in
public policy and in personal affairs.
\index{inflections, grammatical}

\section{Sample Reference Work I}

% Make a cross-reference from a variant name form to the
% form of the head-words

\IndexRef[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}}
  {\noexpand\textSC{R\"uhmann}, Heinz}

% Define the formatting hooks. Since we use the `altformat'
% option, alternate formatting is turned off in later
% name uses.

\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{\AltOff}

% Typeset head-words with a slanted font.

\newcommand{\RefArticle}[3]
{%
  \def\check{#2}%
  \ifx\check\empty
    \noindent\ForgetThis\textsl{#1}\ #3
  \else
    \noindent\ForgetThis\textsl{#1}\ #2\ #3
  \fi\medskip
}

\index{reference work}
\RefArticle
  {\RevComma\Name[Greta]{\noexpand\textSC{Garbo}}}
  {}
  {(18 September 1905\,--\,15 April 1990) was a Swedish
   film actress during the 1920s and 1930s.
   \Name[Greta]{\noexpand\textSC{Garbo}}\dots}

\RefArticle
  {\Name{\noexpand\textSC{Misora}, Hibari}}
  {(W:\,``\RevName\Name*{\noexpand\textSC{Misora}, Hibari}'';}
  {29 May 1937\,--\,24 June 1989) was a Japanese singer
   and actress noted for her positive message.
   \Name{\noexpand\textSC{Misora}, Hibari}\dots}

\RefArticle
  {\RevComma\Name[Heinz]{\noexpand\textSC{R\"uhmann}}}
  {(\SubvertThis\ForceName
    \FName[Heinrich Wilhelm]{\noexpand\textSC{R\"uhmann}};}
  {7 March 1902\,--\,3 October 1994) was a German actor
   in over 100 films.
   \Name[Heinz]{\noexpand\textSC{R\"uhmann}}\dots}

\section{Roman Names: Student Reference}

% Global Boolean flags need to be defined only once.
\newif\ifNoPraenomen
\newif\ifNoCognomen
\newif\ifNoGens
\newif\ifNoAgnomen

% Local Boolean flags need to be defined only once.
\newif\ifXPrae
\newif\ifXCogn
\newif\ifXGens
\newif\ifXAgno

% Name variant macros need to be defined uniquely for each
% name. First is Scipio. Second is Gracchus.

\newcommand*\SCIPi
{%
  \ifXGens Publius\else
    \ifXPrae Cornelius\else
      Publius Cornelius%
    \fi
  \fi
}

\newcommand*\SCIPii
{%
  \ifXAgno Scipio\else
    Scipio Africanus%
  \fi
}

\newcommand*\TSemp
{%
  \ifXGens Tiberius\else
    \ifXPrae Sempronius\else
      Tiberius Sempronius%
    \fi
  \fi
}

% We add the name data tag.
\NameAddInfo[\noexpand\TSemp]{Gracchus}
  { (consul, 177 \textsc{bc})}

% Although it is helpful to set everything up
% In the preamble, it is not absolutely necessary.
% Here we define the simpler set of formatting hooks
% for Scipio, although the complex hooks will work
% for both equally as well.

\renewcommand*\NamesFormat[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\renewcommand*\MainNameHook[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\index{Roman names, student}
\Scipio\ was born around 236 \textsc{bc} into the
Scipiones branch of the Cornelii clan.
\NoAgnomentrue\Scipio\ rose to military fame during the
Second Punic War. Thereafter he was known as \Scipio.
He flourished during the Egyptian reigns of
\Name{Ptolemy, IV}[IV Philopator] and
\Name{Ptolemy, V}[V Epiphanes], and the Syrian
reigns of \Name{Seleucus, III}[III Ceraunus] and
\Name{Antiochus, III}[III the Great].

% We make no change to \MainNameHook, but we do
% change \NamesFormat to display any extant
% name data tags.

\renewcommand*\NamesFormat[1]
{%
  \ifNoPraenomen\XPraetrue\fi%
  \ifNoGens\XGenstrue\fi%
  \ifNoCognomen\XCogntrue\fi%
  \ifNoAgnomen\XAgnotrue\fi%
  #1%
  \ifcsname\NameauthPattern!DB\endcsname
    \expandafter\csname\NameauthPattern!DB\endcsname%
  \fi
  \global\NoPraenomenfalse%
  \global\NoGensfalse%
  \global\NoCognomenfalse%
  \global\NoAgnomenfalse%
}

\TGrac\ served as tribune of the plebs in 184 \textsc{bc}.
\NoGenstrue\STGrac\ was elected praetor for 180 \textsc{bc},
after which he was appointed governor of Hispania Citerior.
serving with the rank of proconsul. In 177 \textsc{bc},
he was elected consul, again in 163 \textsc{bc}.

\section{Roman Names: Scholarly Work}

% Name variant macros need to be defined
% uniquely for each name.

\newcommand*\CSB
{%
  \ifXGens
    \ifXAgno Scipio\else
      Scipio Barbatus\fi
  \else
    \ifXCogn Cornelius\else
      \ifXAgno Cornelius Scipio\else
        Cornelius Scipio Barbatus%
      \fi
    \fi
  \fi
}

\index{Roman names, scholar}
\OScipio\ was born around 337 \textsc{bc} into the
Scipiones branch of the Cornelii clan, one of the large
patrician clans. \NoGenstrue\NoAgnomentrue\OScipio\ was
one of the two elected consuls in 298 \textsc{bc}
and served during the Third Samnite War.

\section{Reference Work II}

% Boolean flags; the first sets up headwords and the second
% indicates that a non-Western form should not be reversed.
\newif\ifHeadword
\newif\ifAncientName

% Sorting and tagging the names:

% Adding name information:
\NameAddInfo{Aristotle}{ (384--322 \textsc{bc})}
\NameAddInfo[Charles]{\noexpand\textBF{Babbage}}{ (1791--1871)}
\NameAddInfo{\noexpand\textUC{Kanade}, Takeo}{ (1945-- )}
\NameAddInfo[Ada]{\noexpand\textIT{Lovelace}}
 { (Augusta Ada King, Countess of Lovelace
   [née Byron]; 1815--52)}

% Redefining the formatting hooks:
\makeatletter
\renewcommand\NamesFormat[1]
{%
  \ifHeadword
    \ifNameauthWestern
      \@nameauth@RevThisCommatrue%
      \bfseries \NameParser%
      \normalfont%
      \ifcsname\NameauthPattern!DB\endcsname
        \expandafter\csname\NameauthPattern!DB\endcsname%
      \fi
    \else
      \bgroup%
        \bfseries \NameParser%
        \unless\ifAncientName
          \normalfont; W:\AltOff\space
          \@nameauth@RevThistrue \NameParser%
        \fi
        \normalfont%
        \ifcsname\NameauthPattern!DB\endcsname
          \expandafter\csname\NameauthPattern!DB\endcsname%
        \fi
      \egroup%
    \fi
  \else
    \NameParser%
  \fi
  \global\Headwordfalse%
  \global\AncientNamefalse%
}
\makeatother
\renewcommand\MainNameHook{\AltOff}

% Define related macros:
\newcommand\Headword{\Headwordtrue\ForgetThis}
\renewcommand{\RefArticle}[2]
{%
  \noindent\Headword #1 #2%
  \medskip
}
\index{reference work}

\RefArticle{\AncientNametrue\Name{Aristotle}}{was the first to offer
a system of logic, most notably syllogistic logic, that would
become the basis for discrete states and circuitry of
digital computers. \Name{Aristotle}\dots}

\RefArticle{\Name[Charles]{\noexpand\textBF{Babbage}}}{designed and
built the Difference Engine and began work on the Analytical
Engine. \Name[Charles]{\noexpand\textBF{Babbage}}\dots}

\RefArticle{\Name{\noexpand\textUC{Kanade}, Takeo}}{is one of the
foremost pioneers in the field of computer vision.
\Name{\noexpand\textUC{Kanade}, Takeo}\dots}

\RefArticle{\Name[Ada]{\noexpand\textIT{Lovelace}}}{collaborated with
\Name*[Charles]{\noexpand\textBF{Babbage}}* and wrote what some
consider to be the first computer program for the Analytical
Engine. \Name[Ada]{\noexpand\textIT{Lovelace}}\dots}
\index{reference work}

\section{Marginalia}

% Global Boolean flags need to be defined only once.
\newif\ifSpecialFN
\newif\ifSpecialSN
\newif\ifRevertSN

% Name variant macros need to be defined
% uniquely for each name.

% For a long name, we want to use ``William'' in the text
% and ``Wm.'' in the margin.

\newcommand*\WM
{%
  \ifSpecialFN Wm.\else
  William\fi
}

% The first surname use will be ``Shakespeare'', but ``the
% Bard'' thereafter. We allow for alternate caps.
% We can get ``Shakespeare'' thereafter by toggling a flag.

\newcommand*\SHK
{%
  \ifRevertSN
    \textSC{Shakespeare}\else
    \ifSpecialSN
      \noexpand\AltCaps{t}he Bard\else
      \textSC{Shakespeare}%
    \fi
  \fi
}

% Here is how we toggle that flag.

\newcommand*\Revert{\RevertSNtrue}

% The ``first-use'' hook prints a name, then tries
% to insert a margin note using a different name form
% and the user-accessible parser. Finally it resets
% the reversion flag, which is only effective in the
% ``subsequent-use'' hook. Note how macros in the
% name arguments take the role of what the internal
% Boolean flags might otherwise handle.

\makeatletter
\renewcommand*\NamesFormat[1]
{%
  \RevertSNfalse\SpecialFNfalse\SpecialSNfalse%
  #1%
  \unless\ifinner
    \marginpar
    {%
      \footnotesize\raggedleft%
      \SpecialFNtrue\SpecialSNfalse%
      \NameParser%
    }%
  \fi
  \global\RevertSNfalse%
}

\renewcommand*\MainNameHook[1]
{%
  \AltOff\SpecialFNfalse\SpecialSNtrue%
  #1%
  \unless\ifinner
    \unless\ifRevertSN
      \marginpar
      {%
        \footnotesize\raggedleft%
        \SpecialFNfalse\SpecialSNfalse%
        \NameParser%
      }%
    \fi
  \fi
  \global\RevertSNfalse%
}
\makeatother

\index{special uses}
\ForgetThis\Shak\ is the national poet of England
in much the same way that \Name[Robert]{\textSC{Burns}}
is that of Scotland. With the latter's rise of influence
in the 1800s, \Revert\Shak\ became known as ``\Shak''.

\section{Customization, Easy}

\makeatletter
\newcommand*\Fbox[1]{%
  \if@nameauth@DoAlt\protect\fbox{#1}\else#1\fi
}
\makeatother

\renewcommand*\NamesFormat{}
\renewcommand*\FrontNamesFormat{}
\renewcommand*\MainNameHook{\AltOff}
\renewcommand*\FrontNameHook{\AltOff}

\index{customization, easy}
\deSmet\ was a Jesuit missionary who arrived in North
America in 1821 at the age of twenty, after a year of seminary
education. \CapThis\deSmet\ was ordained in 1827 and worked
among American Indian nations after 1837. We can show the forms
\LdeSmet\ and \SdeSmet.

\section{Customization, Complicated}

\newif\ifFbox      % Replaces \if@nameauth@DoAlt
\newif\ifFirstCap  % Replaces \if@nameauth@DoCaps
\newif\ifInHook    % Replaces \if@nameauth@InHook
\Fboxtrue          % Replaces \AltFormatActive

% Alternate formatting macro definition
\renewcommand*\Fbox[1]{%
  \ifFbox\protect\fbox{#1}\else#1\fi
}

% Redefinition of \AltCaps and \CapThis
\renewcommand*\AltCaps[1]{%
  \ifInHook
    \ifFirstCap\MakeUppercase{#1}\else#1\fi
  \else
    #1%
  \fi
}
\renewcommand*\CapThis{\FirstCaptrue}

\renewcommand*\NamesFormat[1]
  {\InHooktrue\NameParser\global\FirstCapfalse}

\renewcommand*\MainNameHook[1]
  {\Fboxfalse\InHooktrue\NameParser\global\FirstCapfalse}

\let\FrontNamesFormat\Namesformat
\let\FrontNameHook\MainNameHook

\index{customization, complicated}
\ForgetThis\deSmet\ was a Jesuit missionary who arrived in North
America in 1821 at the age of twenty, after a year of seminary
education. \CapThis\deSmet\ was ordained in 1827 and worked
among American Indian nations after 1837. We can show the forms
\LdeSmet\ and \SdeSmet.

\newif\ifCaps      % Replaces \if@nameauth@DoAlt
\Capstrue          % Replaces \AltFormatActive

% Alternate formatting macro definition
\renewcommand*\textSC[1]{\ifCaps\textsc{#1}\else#1\fi}

% Redefinition of \AltCaps and \CapThis
\renewcommand*\AltCaps[1]{%
  \ifInHook
    \ifFirstCap\MakeUppercase{#1}\else#1\fi
  \else
    #1%
  \fi
}
\renewcommand*\CapThis{\FirstCaptrue}

\renewcommand*\NamesFormat[1]
  {\InHooktrue#1\global\FirstCapfalse}

\renewcommand*\MainNameHook[1]
  {\Capsfalse\InHooktrue#1\global\FirstCapfalse}

\let\FrontNamesFormat\Namesformat
\let\FrontNameHook\MainNameHook

\ForgetThis\Luth\ was a leading figure in the Protestant
Reformation. \Luth\ believed that one is declared
righteous in a forensic sense by divine grace through faith
created by the Holy Spirit via the Gospel and the Sacraments.

\ForgetThis\Cath\ was not only Queen of France in her own right,
but she also guided the reigns of her three sons.
\CapThis\LCath[\noexpand\AltCaps{d}e']
was blamed for the St.\ Bartholomew's Day massacre that saw the
murder of thousands of Huguenots.

\renewcommand*\NamesFormat{}
\newcommand*\FrontNamesFormat{}
\renewcommand*\MainNameHook{}
\renewcommand*\FrontNameHook{}

\section{Customization, Complete}

\makeatletter

% Change the general-case name macro to show
% a name in a framed, colored box.

\newcommandx*\MyName[3][1=\@empty, 3=\@empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{gray!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro for when names are forced long.
\newcommandx*\MyLName[3][1=\@empty, 3=\@empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{green!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}

% Likewise change the macro when personal names are desired.
\newcommandx*\MyFName[3][1=\@empty, 3=\@empty]{%
  \global\@nameauth@toksa\expandafter{#1}%
  \global\@nameauth@toksb\expandafter{#2}%
  \global\@nameauth@toksc\expandafter{#3}%
  \fcolorbox{black}{yellow!25!white}{\@nameauth@Name[#1]{#2}[#3]}%
}
\makeatother

% Change the formatting hooks, but do not use alternate.
% formatting, which is separate from that above.
\renewcommand*\NamesFormat[1]{\scshape#1}
\renewcommand*\MainNameHook[1]{#1}

% Change the naming macro hooks.
\renewcommand*\NameauthName{\MyName}
\renewcommand*\NameauthLName{\MyLName}
\renewcommand*\NameauthFName{\MyFName}

\index{customization, insane}
\ForgetThis\Name[Adolf]{Harnack} was a theologian who stressed
the Fatherhood of God and the brotherhood of man.
\Name[Adolf]{Harnack} flourished in the early twentieth
century. We also produce \Name*[Adolf]{Harnack} and
\FName[Adolf]{Harnack}.
\AltFormatInactive

\makeatletter
\renewcommand*\NameauthName{\@nameauth@Name}
\renewcommand*\NameauthLName{\@nameauth@Name}
\renewcommand*\NameauthFName{\@nameauth@Name}
\makeatother

\renewcommand*\NamesFormat{}
\renewcommand*\MainNameHook{}

\section{\protect\LaTeX\ Engines}

We use \texttt{american} for the language; one should use one's own.
We use Latin Modern. We could load \textsf{tikz} using
\texttt{\textbackslash ifDoTikZ} to avoid crashing some \texttt{dvi}
viewers in a \texttt{dvi}-only workflow.
\index{\protect\LaTeX\ engines}

\begin{quote}\small
\begin{Verbatim}
  \IfFileExists{iftex.sty}{\usepackage{iftex}}{}
  \unless\ifdefined\RequireTUTeX
    \usepackage{ifxetex}
    \usepackage{ifluatex}
    \usepackage{ifpdf}
  \fi

  \newif\ifDoTikZ                        % Is loading TikZ okay?

  \ifxetex
    \usepackage{fontspec}
    \usepackage{polyglossia}
    \setdefaultlanguage{american}        % Use own language
    \usepackage{tikz}
    \DoTikZtrue                          % PDF: yes TikZ okay.
  \else
    \ifluatex
      \ifpdf
        \usepackage{fontspec}
        \usepackage{polyglossia}
        \setdefaultlanguage{american}    % Use own language
        \usepackage{tikz}
        \DoTikZtrue                      % PDF: yes TikZ okay.
      \else
        \IfFileExists{utf8-2018.def}{}
          {\usepackage[utf8]{inputenc}}
        \usepackage[TS1,T1]{fontenc}
        \usepackage[american]{babel}     % Use own language
        \usepackage{lmodern}
        % Perhaps add \usepackage{tikz} with caveats.
      \fi
    \else
      \IfFileExists{utf8-2018.def}{}
        {\usepackage[utf8]{inputenc}}
      \usepackage[TS1,T1]{fontenc}
      \usepackage[american]{babel}       % Use own language
      \usepackage{lmodern}
      \ifpdf
        \usepackage{tikz}
        \DoTikZtrue                      % PDF: yes TikZ okay.
      \fi
    \fi
  \fi
\end{Verbatim}
\end{quote}

\newpage

In the body text we can use something like the test below for:\quad
\fbox{\ifxetex doing \texttt{pdf} things\else
  \ifpdf doing \texttt{pdf} things\else
    doing \texttt{dvi} things\fi
  \fi}

\begin{quote}\small
\begin{Verbatim}
  \ifxetex
    doing \texttt{pdf} things
  \else
    \ifpdf
      doing \texttt{pdf} things
    \else
      doing \texttt{dvi} things
    \fi
  \fi
\end{Verbatim}
\end{quote}

The following equivalent conditional statements can help a macro
or just the body text to work under multiple engines:
\begin{quote}\small
\begin{Verbatim}
  \ifxetex xelatex%
  \else
    \ifluatex
      \ifpdf lualatex (pdf)%
      \else lualatex (dvi)%
      \fi
    \else
      \ifpdf pdflatex%
      \else latex (dvi)%
      \fi
    \fi
  \fi
\end{Verbatim}

\begin{Verbatim}
  \unless\ifxetex
    \unless\ifluatex
      \ifpdf pdflatex%
      \else latex (dvi)%
      \fi
    \else
      \ifpdf lualatex (pdf)%
      \else lualatex (dvi)%
      \fi
    \fi
  \else xelatex%
  \fi
\end{Verbatim}
\end{quote}

\section{Miscellaneous Tests: Spaces}

Here we test to see if any unwanted spaces exist in macros that take name arguments.
If everything is OK, two vertical bars should either immediately precede and follow
the arguments, or have no space between them. This section also tests if all possible
argument combinations work in most macros that take name arguments.
We disable indexing here.\\
\IndexInactive

\hbox to 0.7\textwidth{\Verb+\Name[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\Name[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\Name*[FNN]{SNN,Affix}+\dotfill
  |\Name*[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\DropAffix\Name*[FNN]{SNN,Affix}+\dotfill
  |\DropAffix\Name*[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\Name[FNN]{SNN,Affix}+\dotfill
  |\Name[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\FName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\FName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\FName[FNN]{SNN,Affix}+\dotfill
  |\FName[FNN]{SNN,Affix}|}\medskip

\hbox to 0.7\textwidth{\Verb+\Name{SNN,Affix}[Alternate]+\dotfill
  |\Name{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\Name*{SNN,Affix}+\dotfill
  |\Name*{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\Name{SNN,Affix}+\dotfill
  |\Name{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\FName{SNN,Affix}+\dotfill
  |\FName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\ForceFN\FName{SNN,Affix}[Alternate]+\dotfill
  |\ForceFN\FName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ForceFN\FName{SNN,Affix}+\dotfill
  |\ForceFN\FName{SNN,Affix}|}\medskip

\newpage

\hbox to 0.7\textwidth{\Verb+\ForgetThis\Name{SNN}[Alternate]+\dotfill
  |\ForgetThis\Name{SNN}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\Name*{SNN}[Alternate]+\dotfill
  |\Name*{SNN}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\Name{SNN}[Alternate]+\dotfill
  |\Name{SNN}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\FName{SNN}[Alternate]+\dotfill
  |\FName{SNN}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ForceFN\FName{SNN}[Alternate]+\dotfill
  |\ForceFN\FName{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\IndexName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\IndexName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IndexName[FNN]{SNN,Affix}+\dotfill
  |\IndexName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexName{SNN,Affix}[Alternate]+\dotfill
  |\IndexName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IndexName{SNN,Affix}+\dotfill
  |\IndexName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexName{SNN}[Alternate]+\dotfill
  |\IndexName{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\IndexRef[FNN]{SNN,Affix}[Alternate]{Target}+\dotfill
  |\IndexRef[FNN]{SNN,Affix}[Alternate]{Target}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexRef[FNN]{SNN,Affix}{Target}+\dotfill
  |\IndexRef[FNN]{SNN,Affix}{Target}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexRef{SNN,Affix}[Alternate]{Target}+\dotfill
  |\IndexRef{SNN,Affix}[Alternate]{Target}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexRef{SNN,Affix}{Target}+\dotfill
  |\IndexRef{SNN,Affix}{Target}|}\par
\hbox to 0.7\textwidth{\Verb+\IndexRef{SNN}[Alternate]{Target}+\dotfill
  |\IndexRef{SNN}[Alternate]{Target}|}\medskip

\hbox to 0.7\textwidth{\Verb+\ExcludeName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\ExcludeName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ExcludeName[FNN]{SNN,Affix}+\dotfill
  |\ExcludeName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\ExcludeName{SNN,Affix}[Alternate]+\dotfill
  |\ExcludeName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ExcludeName{SNN,Affix}+\dotfill
  |\ExcludeName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\ExcludeName{SNN}[Alternate]+\dotfill
  |\ExcludeName{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\IncludeName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\IncludeName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName[FNN]{SNN,Affix}+\dotfill
  |\IncludeName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName{SNN,Affix}[Alternate]+\dotfill
  |\IncludeName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName{SNN,Affix}+\dotfill
  |\IncludeName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName{SNN}[Alternate]+\dotfill
  |\IncludeName{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\IncludeName*[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\IncludeName*[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName*[FNN]{SNN,Affix}+\dotfill
  |\IncludeName*[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName*{SNN,Affix}[Alternate]+\dotfill
  |\IncludeName*{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName*{SNN,Affix}+\dotfill
  |\IncludeName*{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IncludeName*{SNN}[Alternate]+\dotfill
  |\IncludeName*{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\PretagName[FNN]{SNN,Affix}[Alternate]{Sort}+\dotfill
  |\PretagName[FNN]{SNN,Affix}[Alternate]{Sort}|}\par
\hbox to 0.7\textwidth{\Verb+\PretagName[FNN]{SNN,Affix}{Sort}+\dotfill
  |\PretagName[FNN]{SNN,Affix}{Sort}|}\par
\hbox to 0.7\textwidth{\Verb+\PretagName{SNN,Affix}[Alternate]{Sort}+\dotfill
  |\PretagName{SNN,Affix}[Alternate]{Sort}|}\par
\hbox to 0.7\textwidth{\Verb+\PretagName{SNN,Affix}{Sort}+\dotfill
  |\PretagName{SNN,Affix}{Sort}|}\par
\hbox to 0.7\textwidth{\Verb+\PretagName{SNN}[Alternate]{Sort}+\dotfill
  |\PretagName{SNN}[Alternate]{Sort}|}\medskip

\hbox to 0.7\textwidth{\Verb+\TagName[FNN]{SNN,Affix}[Alternate]{Tag}+\dotfill
  |\TagName[FNN]{SNN,Affix}[Alternate]{Tag}|}\par
\hbox to 0.7\textwidth{\Verb+\TagName[FNN]{SNN,Affix}{Tag}+\dotfill
  |\TagName[FNN]{SNN,Affix}{Tag}|}\par
\hbox to 0.7\textwidth{\Verb+\TagName{SNN,Affix}[Alternate]{Tag}+\dotfill
  |\TagName{SNN,Affix}[Alternate]{Tag}|}\par
\hbox to 0.7\textwidth{\Verb+\TagName{SNN,Affix}{Tag}+\dotfill
  |\TagName{SNN,Affix}{Tag}|}\par
\hbox to 0.7\textwidth{\Verb+\TagName{SNN}[Alternate]{Tag}+\dotfill
  |\TagName{SNN}[Alternate]{Tag}|}\medskip

\hbox to 0.7\textwidth{\Verb+\UntagName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\UntagName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\UntagName[FNN]{SNN,Affix}+\dotfill
  |\UntagName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\UntagName{SNN,Affix}[Alternate]+\dotfill
  |\UntagName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\UntagName{SNN,Affix}+\dotfill
  |\UntagName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\UntagName{SNN}[Alternate]+\dotfill
  |\UntagName{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\NameAddInfo[FNN]{SNN,Affix}[Alternate]{Info}+\dotfill
  |\NameAddInfo[FNN]{SNN,Affix}[Alternate]{Info}|}\par
\hbox to 0.7\textwidth{\Verb+\NameAddInfo[FNN]{SNN,Affix}{Info}+\dotfill
  |\NameAddInfo[FNN]{SNN,Affix}{Info}|}\par
\hbox to 0.7\textwidth{\Verb+\NameAddInfo{SNN,Affix}[Alternate]{Info}+\dotfill
  |\NameAddInfo{SNN,Affix}[Alternate]{Info}|}\par
\hbox to 0.7\textwidth{\Verb+\NameAddInfo{SNN,Affix}{Info}+\dotfill
  |\NameAddInfo{SNN,Affix}{Info}|}\par
\hbox to 0.7\textwidth{\Verb+\NameAddInfo{SNN}[Alternate]{Info}+\dotfill
  |\NameAddInfo{SNN}[Alternate]{Info}|}\medskip

\hbox to 0.7\textwidth{\Verb+\NameQueryInfo[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\NameQueryInfo[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\NameQueryInfo[FNN]{SNN,Affix}+\dotfill
  |\NameQueryInfo[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\NameQueryInfo{SNN,Affix}[Alternate]+\dotfill
  |\NameQueryInfo{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\NameQueryInfo{SNN,Affix}+\dotfill
  |\NameQueryInfo{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\NameQueryInfo{SNN}[Alternate]+\dotfill
  |\NameQueryInfo{SNN}[Alternate]|}\medskip

\newpage

\hbox to 0.7\textwidth{\Verb+\NameClearInfo[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\NameClearInfo[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\NameClearInfo[FNN]{SNN,Affix}+\dotfill
  |\NameClearInfo[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\NameClearInfo{SNN,Affix}[Alternate]+\dotfill
  |\NameClearInfo{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\NameClearInfo{SNN,Affix}+\dotfill
  |\NameClearInfo{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\NameClearInfo{SNN}[Alternate]+\dotfill
  |\NameClearInfo{SNN}[Alternate]|}\medskip

\hbox to 0.7\textwidth{\Verb+\ForgetName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\ForgetName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ForgetName[FNN]{SNN,Affix}+\dotfill
  |\ForgetName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\ForgetName{SNN,Affix}[Alternate]+\dotfill
  |\ForgetName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\ForgetName{SNN,Affix}+\dotfill
  |\ForgetName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\ForgetName{SNN}[Alternate]+\dotfill
  |\ForgetName{SNN}[Alternate]|}\medskip

\Verb+\LocalNames+\LocalNames\par
\hbox to 0.7\textwidth{\Verb+\SubvertName[FNN]{SNN,Affix}[Alternate]+\dotfill
  |\SubvertName[FNN]{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\SubvertName[FNN]{SNN,Affix}+\dotfill
  |\SubvertName[FNN]{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\SubvertName{SNN,Affix}[Alternate]+\dotfill
  |\SubvertName{SNN,Affix}[Alternate]|}\par
\hbox to 0.7\textwidth{\Verb+\SubvertName{SNN,Affix}+\dotfill
  |\SubvertName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\SubvertName{SNN}[Alternate]+\dotfill
  |\SubvertName{SNN}[Alternate]|}\par
\Verb+\GlobalNames+\GlobalNames\medskip

\hbox to 0.7\textwidth{\Verb+\IfMainName[FNN]{SNN,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfMainName[FNN]{SNN,Affix}[Alternate]{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfMainName[FNN]{SNN,Affix}{Y}{N}+\dotfill
  |\IfMainName[FNN]{SNN,Affix}{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfMainName{SNN,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfMainName{SNN,Affix}[Alternate]{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfMainName{SNN,Affix}{Y}{N}+\dotfill
  |\IfMainName{SNN,Affix}{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfMainName{SNN}[Alternate]{Y}{N}+\dotfill
  |\IfMainName{SNN}[Alternate]{Y}{N}|}\medskip

\hbox to 0.7\textwidth{\Verb+\IfFrontName[FNN]{SNN,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName[FNN]{SNN,Affix}[Alternate]{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfFrontName[FNN]{SNN,Affix}{Y}{N}+\dotfill
  |\IfFrontName[FNN]{SNN,Affix}{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfFrontName{SNN,Affix}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName{SNN,Affix}[Alternate]{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfFrontName{SNN,Affix}{Y}{N}+\dotfill
  |\IfFrontName{SNN,Affix}{Y}{N}|}\par
\hbox to 0.7\textwidth{\Verb+\IfFrontName{SNN}[Alternate]{Y}{N}+\dotfill
  |\IfFrontName{SNN}[Alternate]{Y}{N}|}\medskip

\hbox to 0.7\textwidth{\Verb+\SeeAlso\IndexRef[FNN]{SNN,Affix}{Target}+\dotfill
  |\SeeAlso\IndexRef[FNN]{SNN,Affix}{Target}|}\par
\hbox to 0.7\textwidth{\Verb+\ExcludeName{SNN,Affix}+\dotfill
  |\ExcludeName{SNN,Affix}|}\par
\hbox to 0.7\textwidth{\Verb+\IfAKA[FNN]{SNN,Affix}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA[FNN]{SNN,Affix}[Alternate]{Y}{N}{X}|}\par
\hbox to 0.7\textwidth{\Verb+\IfAKA[FNN]{SNN,Affix}{Y}{N}{X}+\dotfill
  |\IfAKA[FNN]{SNN,Affix}{Y}{N}{X}|}\par
\hbox to 0.7\textwidth{\Verb+\IfAKA{SNN,Affix}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA{SNN,Affix}[Alternate]{Y}{N}{X}|}\par
\hbox to 0.7\textwidth{\Verb+\IfAKA{SNN,Affix}{Y}{N}{X}+\dotfill
  |\IfAKA{SNN,Affix}{Y}{N}{X}|}\par
\hbox to 0.7\textwidth{\Verb+\IfAKA{SNN}[Alternate]{Y}{N}{X}+\dotfill
  |\IfAKA{SNN}[Alternate]{Y}{N}{X}|}\medskip

\hbox to \textwidth{\Verb+\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]|}\par
\hbox to \textwidth{\Verb+\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|}\par
\hbox to \textwidth{\Verb+\DropAffix\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}+\dotfill
  |\DropAffix\AKA[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|}\par
\hbox to \textwidth{\Verb+\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}[Alternate2]|}\par
\hbox to \textwidth{\Verb+\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}[FNN2]{SNN2,Affix2}|}\medskip

\hbox to \textwidth{\Verb+\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]|}\par
\hbox to \textwidth{\Verb+\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN3,Affix3}|}\par
\hbox to \textwidth{\Verb+\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}|}\par
\hbox to \textwidth{\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}[Alternate3]|}\par
\hbox to \textwidth{\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN3,Affix3}|}\medskip

\hbox to \textwidth{\Verb+\AKA[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\AKA[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|}\par
\hbox to \textwidth{\Verb+\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|}\par
\hbox to \textwidth{\Verb+\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]+\dotfill
  |\ForceFN\AKA*[FNN1]{SNN1,Affix1}{SNN4}[Alternate4]|}\medskip

\phantomsection
\addcontentsline{toc}{section}{Index of Persons}
\printindex[per]

\renewcommand\indexname{Index of Subjects}
\phantomsection
\addcontentsline{toc}{section}{Index of Subjects}
\printindex

\end{document}

