summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/nameauth
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-11 00:49:56 +0000
committerKarl Berry <karl@freefriends.org>2012-02-11 00:49:56 +0000
commit31705256b876f83730b07d6ba8dbb46889ffc05c (patch)
tree0307a6f0c5f52ee1414bb906863d498ba5865d63 /Master/texmf-dist/source/latex/nameauth
parent48ea98193ab70b9d4d1e5fb2acddd70a1ff3d5ae (diff)
nameauth (10feb12)
git-svn-id: svn://tug.org/texlive/trunk@25353 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/nameauth')
-rw-r--r--Master/texmf-dist/source/latex/nameauth/nameauth.dtx893
1 files changed, 551 insertions, 342 deletions
diff --git a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
index 07caea8592a..a9dd72a3696 100644
--- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
+++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
@@ -26,7 +26,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{nameauth}
%<*package>
- [2012/02/06 v0.86 name authority macros to aid consistent display and indexing of names]
+ [2012/02/10 v0.9 name authority macros to aid consistent display and indexing of names]
%</package>
%
%<*driver>
@@ -37,7 +37,7 @@
\usepackage{lmodern}
\usepackage{makeidx}
\usepackage{newunicodechar}
-\usepackage{nameauth}[2012/02/06]
+\usepackage{nameauth}[2012/02/10]
\begingroup\lccode`!=`\\\lowercase{\endgroup\def\bsc{!}}
\makeindex
\frenchspacing
@@ -57,7 +57,7 @@
%</driver>
% \fi
%
-% \CheckSum{520}
+% \CheckSum{0}
%
% \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
@@ -81,8 +81,9 @@
% \changes{v0.8}{2012/01/29}{Refactoring to improve functionality and compatibility; documentation expanded}
% \changes{v0.85}{2012/02/05}{Added comma suppression and additional functionality; revised documentation}
% \changes{v0.86}{2012/02/06}{Fixed some regressions}
+% \changes{v0.9}{2012/02/10}{Added first name formatting, comma and suffix handling now expandable, edited documentation}
%
-% \DoNotIndex{\newcommand, \newenvironment, \@empty, \@gobble, \bfseries, \bgroup, \def, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \fi, \if, \ifx, \IfBooleanTF, \IfValueTF, \itshape, \let, \newif, \relax, \renewcommand, \RequirePackage, \scshape, \space, \DeclareDocumentCommand, \DeclareOption, \ProcessOptions, \@ifclassloaded, \@token, \@period, \csgdef, \csundef, \detokenize, \expandafter, \Forenames, \futurelet, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@dtx, \if@nameauth@Punct, \ifcsname, \index, \PackageWarning, \Surnames, \Surnamesi, \Surnamesii, \TestDot, \TestEnd, \TestPunct, \TestStop, \zap@space, \edef}
+% \DoNotIndex{\newcommand, \newenvironment, \@empty, \@gobble, \bfseries, \bgroup, \def, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \fi, \if, \ifx, \IfBooleanTF, \IfValueTF, \itshape, \let, \newif, \relax, \renewcommand, \RequirePackage, \scshape, \space, \DeclareDocumentCommand, \DeclareOption, \ProcessOptions, \@token, \@period, \csgdef, \csundef, \detokenize, \expandafter, \Forenames, \futurelet, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@Punct, \ifcsname, \index, \PackageWarning, \Surnames, \Surnamesi, \Surnamesii, \TestDot, \TestEnd, \TestPunct, \TestStop, \zap@space, \edef, \if@nameauth@DoIndex, \if@nameauth@Comma, \Test}
%
% \providecommand*{\url}{\texttt}
% \GetFileInfo{nameauth.dtx}
@@ -92,68 +93,85 @@
% \maketitle
%
% \begin{abstract}
-% \noindent These macros help an author to encode the (optional) forenames and (mandatory) surnames of people in order to normalize occurrences in the text and entries in the index. This package is intended for Western-style naming conventions.
+% \noindent Using the \textsf{nameauth} package, an author can encode names according to a name authority. Index entries will be consistent if the input parameters are consistent. An author can move blocks of text arbitrarily and the names will be reformatted automatically, making it easier to transition from drafts to a final manuscript. This package mainly supports Western naming conventions, with some basic features for ancient, royal, and Eastern names.
% \end{abstract}
%
% \section{Introduction}
%
-% Suppose you were working on a collection of essays. Depending on the permissions governing the essays, you might need to allow variance in the spelling of people's names. You would use either a house reference, a research library, or an encyclopedic source to decide on authoritative name forms. Your index might use abbreviated versions of those forms. Either a substantive or copy editor would keep track of the main name form, the variants, and their relationship to the index. For optimal quality, that would require a proofreading pass with queries to the editor. That adds time and cost to the job. If the author or editor can handle these details in advance, the result trims overhead cost. That could make a prospective author or freelance editor more likely to be selected for publication.
+% Suppose you were working on a collection of essays. Depending on the permissions governing the essays, you might need to allow variance in the form of people's names. You would use a name authority to index and keep track of name forms. Your index might use abbreviated forms. Either a substantive or copy editor would keep track of the main form, the variants, and their relationship to the index. That might require a proofreading pass with queries to the editor. That adds time and cost to the job. If the author or editor can handle these details in advance, the result trims overhead cost, making that person more desirable for publication.
%
% \subsection{Design Decisions}
%
-% This package assumes that an author or editor wants to minimize keystrokes. The default behavior sets the first occurrence of a person's name in small caps and prints out that full name. Subsequent occurrences set the last name only in the running text font. Considerable variation from the defaults is possible.
+% This package assumes that an author or editor wants to minimize keystrokes. The default behavior consists of the most likely settings. Considerable variation from the defaults is possible. The \texttt{.dtx} file is an invaluable source of information on how many variations of the macros can be used.
%
% \subsection{Thanks}
%
-% Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, and \Name[Uwe]{Lueck} for their invaluable assistance. Marc showed me the basic structure using the \textsf{xparse} package. Enrico and Philipp helped with generating control sequences and sanitizing. Heiko gave a space-removing solution that could be passed as an argument in a macro. Code adapted from Uwe's work on the texhax list enabled the routines to function with the \textsf{microtype} package.
+% Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, and \Name[Uwe]{Lueck} for their invaluable assistance. \FName[Marc van]{Dongen}[Marc] showed me the basic structure using the \textsf{xparse} package. \FName[Enrico]{Gregorio} and \FName[Philipp]{Stephani} helped with generating control sequences and sanitizing. \FName[Heiko]{Oberdiek} gave a space-removing solution that could be passed as an argument in a macro. Code adapted from \FName[Uwe]{Lueck}'s work on the texhax list enabled the routines to function with the \textsf{microtype} package.
%
% \section{Usage}
%
% \subsection{Package Options}
-% If the default behavior is not desired, the following options easily alter it. They are, as follows:
+% If the default behavior is not desired, the following options easily alter it. The class options are listed with defaults first in each category:
% \changes{v0.85}{2012/02/05}{Added new class options}
%
-% \begin{quote}
+% \begin{quote}\small
% \begin{tabular}{lp{3in}}
% \texttt{mainmatter} & The default behavior triggers special typesetting of the first occurrence of a name, starting at the beginning of a document.\\[1ex]
-% \texttt{frontmatter} & This option suppresses the special typesetting of the first occurrence of a name before the invocation of \cmd{\NamesActive}. This option fits well with front matter from a contributor who may not intend the same formatting and emphasis found in the main matter. The indexing and aliasing features of the package remain operative. \emph{Note}: One can switch at will between formatted and non-formatted sections; see Section \ref{sec:SectionFormat}.\\[2ex]
-% \texttt{smallcaps} & The default behavior when a name is first encountered is to print it in small caps.\\[1ex]
+% \texttt{frontmatter} & This option suppresses the special typesetting of the first occurrence of a name before the invocation of \cmd{\NamesActive}. This option fits well with front matter from a contributor who may not intend the same formatting and emphasis found in the main matter. The indexing and aliasing features of the package remain operative. \emph{Note}: One can switch at will between formatted and non-formatted sections; see Section \ref{sec:SectionFormat}{\large\strut}.\\\hline
+% {\large\strut}\texttt{smallcaps} & The default behavior when a name is first encountered is to print it in small caps.\\[1ex]
% \texttt{italic} & This option causes the first occurrence of the name to be italicized.\\[1ex]
% \texttt{boldface} & This option causes the first occurrence of the name to be set in boldface.\\[1ex]
-% \texttt{noformat} & This option suppresses document formatting after the invocation of \cmd{\NamesActive}. If an author wants the indexing and aliasing functions without any special typesetting, this option accomplishes that easily. \emph{Note}: One can override the name typesetting options manually; see Subsection \ref{sec:FontAttributes}. This option is \emph{not} equivalent to \texttt{frontmatter}. The latter functions independently and never produces any formatting. This approach allows one to toggle formatting on and off without retyping the document. With \cmd{\NamesFormat} It anticipates variation among publishers' house styles.\\[1ex]
-% \texttt{nocomma} & The default behavior suppresses printing of commas between surnames and suffixes, following modern styles like \emph{Chicago Manual of Style}. See Subsection \ref{sec:suffix} for implications of this behavior.\\[1ex]
-% \texttt{comma} &Print commas between surnames and suffixes, following older styles. See Subsection \ref{sec:suffix}.\\[1ex]
+% \texttt{noformat} & This option suppresses document formatting after the invocation of \cmd{\NamesActive}. If an author wants the indexing and aliasing functions without any special typesetting, this option accomplishes that easily. \emph{Note}: One can override the name typesetting options manually; see Section \ref{sec:FontAttributes}. This option is \emph{not} equivalent to \texttt{frontmatter}. The latter functions independently and never produces any formatting. This approach allows one to toggle formatting on and off without retyping the document. With \cmd{\NamesFormat} It anticipates variation among publishers' house styles.{\large\strut}\\\hline
+% {\large\strut}\texttt{nocomma} & The default behavior suppresses printing of commas between surnames and suffixes, following modern styles like \emph{Chicago Manual of Style}. See Section \ref{sec:suffix} for implications of this behavior.\\[1ex]
+% \texttt{comma} & Print commas between surnames and suffixes, following older styles. See also Section \ref{sec:suffix}.\\
% \end{tabular}
% \end{quote}
% \clearpage
%
+% \subsection{Example Text}
+%
+% We begin with a sample text that attempts to cover the basic features, and even a couple of advanced ones. It is in the genre of a merry wedding reception toast, proving that a serious package can be used lightheartedly.\\
+%
+% \noindent DISCLAIMER: I use a number of names associated with historical figures throughout this document. This is because I expect that the users of this package will refer to real-world figures. At no time in this document am I intending either to promote, disparage, align with, align against, or make any assertions about any persons living or dead. As far as I am concerned, all names mentioned herein deserve respect for the impact and legacy of their bearers.\\
+%
+% \noindent\textbf{Example Text:}
+% \label{sec:example}
+%
+% {\ttfamily This is a toast to |\Name[John]{Smith}| and his childhood sweetheart,\break |\Name[J.Q.]{Public}[Jane Q.]|. |\FName[John]{Smith}| and\break |``\FName[J.Q.]{Public}[Janie]''| have finally made it official today!\break They first met in college, where they had to learn about\break |\Name{Aristotle}| and all the stuff that I couldn't keep in my head.\break [laughs] Nevertheless, by the time they got to\break |\Name{John}[Duns Scotus]| they were definitely a number. They studied medieval history-makers like |\Name{Gregory, I}|\break |``\AKA*{Gregory, I}{Gregory}[the Great]''| and by the Renaissance they were engaged. After spending time in separate grad schools, these\break promising medievalists got faculty positions at adjoining colleges and here we are. As the brother of |\FName[J.Q.]{Public}[Jane]|\break |``\AKA*[J.Q.]{Public}{Jane}[the Great]''| I am happy to welcome\break |\FName[John]{Smith}[Sir John]| to our raucous family.}\\
+%
+% This is a toast to \Name[John]{Smith} and his childhood sweetheart, \Name[J.Q.]{Public}[Jane Q.]. \FName[John]{Smith} and ``\FName[J.Q.]{Public}[Janie]'' have finally made it official today! They first met in college, where they had to learn about \Name{Aristotle} and all the stuff that I couldn't keep in my head. [laughs] Nevertheless, by the time they got to \Name{John}[Duns Scotus] they were definitely a number. They studied medieval history-makers like \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great]'' and by the Renaissance they were engaged. After spending time in separate grad schools, these promising medievalists got faculty positions at adjoining colleges and here we are. As the brother of \FName[J.Q.]{Public}[Jane] ``\AKA*[J.Q.]{Public}{Jane}[the Great]'' I am happy to welcome \FName[John]{Smith}[Sir John] to our raucous family.\\
+%
+% Here you will notice that one can make a reference to Pope |\Name{Gregory, I}| followed by ``the Great'' via |``\AKA*{Gregory, I}{Gregory}[the Great]''|. That is achieved by the ambiguous behavior of the default \texttt{nocomma} option plus the ``sobriquet only'' feature of \cmd{\AKA*}. It is easy to use these features, but can be tricky to debug. Sections \ref{sec:suffix} and \ref{sec:pennames} have more details.
+%
% \subsection{Quick Start Guide}
% \changes{v0.8}{2012/01/29}{Added quick start guide for the impatient}
% \changes{v0.85}{2012/02/05}{Updated quick start guide}
%
-% This page and the next comprise a ``cheat sheet'' for the impatient. None of the examples in this subsection generate index entries. These examples simply help you get used to the package:
+% This page and the next comprise a ``cheat sheet'' for the impatient. None of the examples in this subsection generate index entries. These examples help you get used to the package, but they do not show all possibilities.
%
% \begin{enumerate}\setlength\itemsep{0pt}\small
% \item The indexed forms of the names always remain the same.
% \item Always use the same form of reference, e.g., |\Name[John]{Smith}| or\newline |\Name{Louis}[XIV]|, otherwise point 1 will become false.
-% \item Trade work for consistency. For example, |\Name[J.Q.]{Public}[Jane Q.]| can be moved around anywhere when you rearrange text and the first reference will always be the longer, optional form. |\Name[J.Q.]{Public}| might not do that.
-% \item Checking against the index will help you debug your \cmd{\Name} references, \emph{inter alia}.
+% \item Trade work for consistency.
+% \item Checking index references will help you find mistakes.
% \item Start using the macros you \emph{need}, then work from there.
% \end{enumerate}
%
% \bgroup\small
% \begin{tabular}{p{1.8in}p{2.3in}}
% \normalsize\strut\textbf{I want to\dots} & \normalsize\textbf{I need to use} (for example)\dots \\\hline
-% Print a full Western name (first reference) & |\Name*[John]{Smith}| or\newline |\Name[John]{Smith}|\\\hline
+% Print a full Western name (first reference in the text) & |\Name*[John]{Smith}| or\newline |\Name[John]{Smith}| or\newline |\FName[John]{Smith}|\\\hline
% Full Western name & |\Name*[John]{Smith}|\\\hline
-% Short Western name (subsequent reference) & |\Name[John]{Smith}|\\\hline
-% Print a Western name that has a longer form in the text than in the index (first reference) & |\Name*[J.Q.]{Public}[Jane Q.]| or\newline |\Name[J.Q.]{Public}[Jane Q.]|\\\hline
+% Short surname only (later) & |\Name[John]{Smith}|\\\hline
+% First name only (later) & |\FName[John]{Smith}|\\\hline
+% Print name with alternate forenames/nicknames in the text, not in the index (first reference) & |\Name*[J.Q.]{Public}[Jane Q.]| or\newline |\Name[J.Q.]{Public}[Jane Q.]| or\newline |\FName[J.Q.]{Public}[Jane Q.]|\\\hline
+% Nickname only (later) & |\FName[J.Q.]{Public}[Jane Q.]|\\\hline
% Full name without longer form & |\Name*[J.Q.]{Public}|\\\hline
% Same person, last name only (subsequent reference) & |\Name[J.Q.]{Public}[Jane Q.]| or\newline \dag|\Name[J.Q.]{Public}|\\\hline
% Print an ancient name & |\Name{Plato}| or |\Name*{Plato}|\\\hline
% Print a full Eastern name (first reference) & |\Name*{Mao}[Tse-tung]| or\newline |\Name{Mao}[Tse-tung]|\\\hline
% Full Eastern name & |\Name*{Mao}[Tse-tung]|\\\hline
-% Short Eastern name (subsequent reference) & |\Name{Mao}[Tse-tung]|\\\hline
+% Short name (later reference) & |\Name{Mao}[Tse-tung]|\\\hline
% Print a full ``royal'' name (first reference) & |\Name*{Louis}[XIV]| or\newline |\Name{Louis}[XIV]|\\\hline
% Full ``royal'' name & |\Name*{Louis}[XIV]|\\\hline
% Shorter subsequent reference & |\Name{Louis}[XIV]|\\\hline
@@ -164,7 +182,7 @@
% \smallskip\dag{} This form is OK, but can cause unwanted results if you rearrange text.\medskip
% \egroup
%
-% \noindent I strongly suggest Subsection \ref{sec:suffix} for more on the interaction between suffixes and sobriquets. Especially these features create useful, yet ambiguous forms that may be hard to debug. Also, mind leading spaces in the macro arguments.
+% \noindent I strongly suggest reading Section \ref{sec:suffix} before using comma-delimited suffixes.
% \clearpage
%
% \bgroup\small
@@ -185,25 +203,28 @@
% \bgroup\small
% \begin{tabular}{p{1.5in}p{2.6in}}
% \normalsize\strut\textbf{I want to\dots} & \normalsize\textbf{I need to use} (for example)\dots \\\hline
-% Print a full Western name followed by a lesser-known name in parentheses (first reference) & |\PName*[Bob]{Hope}[Leslie Townes]{Hope}|\newline |\PName[Bob]{Hope}[Leslie Townes]{Hope}|\\\hline
-% Full name, lesser-known name in parentheses & |\PName*[Bob]{Hope}[Leslie Townes]{Hope}|\\\hline
-% Surname only, followed by a full lesser-known name (subsequent reference) & |\PName[Bob]{Hope}[Leslie Townes]{Hope}|\\\hline
-% Mononym followed by a lesser-known name & |\PName*{Prince}[Prince Rogers]{Nelson}|\newline |\PName{Prince}[Prince Rogers]{Nelson}|\\\hline
-% Flexibly associate a name with a lesser-known name & \dots a tribute to |\Name{Ari Up}|, born \newline |\AKA{Ari Up}[Arianne]{Forster}|\dots One would not index \emph{Ari Up} as ``Up, Ari''.\\\hline
+% Print a name that is only a \emph{see} reference to another. & |\AKA[Bob]{Hope}[Leslie Townes]{Hope}|\\\hline
+% Print both names, the latter in parens & |\PName[Bob]{Hope}[Leslie Townes]{Hope}|\\\hline
+% Print an ancient name, number, and sobriquet & \S |\AKA*{Gregory, I}{Gregory}[the Great]|\\\hline
+% Mononym followed by a lesser-known name & |\PName{Prince}[Prince Rogers]{Nelson}|\\\hline
+% Flexibly associate a name with a lesser-known name & \P \dots a tribute to |\Name{Ari Up}|, born \newline |\AKA{Ari Up}[Arianne]{Forster}|\dots \\\hline
% \end{tabular}
-% \egroup
+%
+% \smallskip \S{} This depends on the default \texttt{nocomma} option.\\
+% \indent \P{} |{Ari Up}| is one unit; one would not index the stage name as ``Up, Ari''.
+% \egroup
%
% \bigskip
% \noindent Avoiding the following pitfalls will save time and frustration:
% \begin{enumerate}\setlength\itemsep{0pt}\small
-% \item Mixing sobriquets with modern forms fails due to the ``longer name'' feature, e.g., |\Name[First]{Ancient}[Sobriquet]| and |\Name[King]{Number}[Sobriquet]|.
-% \item Using \cmd{\AKA} and \cmd{\PName} with ``ancient,'' ``royal,'' and ``Eastern'' forms will fail, but see Subsection \ref{sec:suffix} for a workaround:\newline |\Name{Ancient}[Sobriquet] \AKA{Ancient Sobriquet}[First]{Last}|\newline |\Name{Queen}[Number] \AKA{Queen Number}[First]{Last}|\newline |\Name{EastFamily}[EastFirst] \AKA{EastFamily EastFirst}[First]{Last}|
+% \item Mixing sobriquets with modern forms fails due to the ``alternate name'' feature, e.g., |\Name[First]{Ancient}[Sobriquet]| and |\Name[King]{Number}[Sobriquet]|.
+% \item Using \cmd{\AKA} and \cmd{\PName} with ``ancient,'' ``royal,'' and ``Eastern'' forms will fail, but see Section \ref{sec:suffix} for a workaround:\newline |\Name{Ancient}[Sobriquet] \AKA{Ancient Sobriquet}[First]{Last}|\newline |\Name{Queen}[Number] \AKA{Queen Number}[First]{Last}|\newline |\Name{EastFamily}[EastFirst] \AKA{EastFamily EastFirst}[First]{Last}|
% \item Using a forename or first initials can prevent failure in some cases:\newline OK: |\Name[J.]{Kreskin}[The Amazing] (\AKA[J.]{Kreskin}[Joseph]{Kresge})|\newline FAIL: |\Name[]{Kreskin}[The Amazing] (\AKA{Kreskin}[Joseph]{Kresge})|\newline FAIL: |\Name{Kreskin}[The Amazing] (\AKA{Kreskin}[Joseph]{Kresge})|
% \item Keep track of how name references are disambiguated in the text. Since one must put the full indexed name in a \cmd{\Name} reference it is easy to forget that the reference will be shortened if it is subsequent. \cmd{\Name*} comes to the rescue here.
-% \item Mistyping the pairs of \texttt{\{} braces \texttt{\}} and \texttt{[} brackets \texttt{]} creates contextually-dependent errors that can be difficult to track. Leading spaces may be hard to spot in the text, but will be apparent in the index with incorrectly sorted names.
+% \item Mistyping the pairs of \texttt{\{} braces \texttt{\}} and \texttt{[} brackets \texttt{]} creates contextually-dependent errors that can be difficult to track. Leading spaces in macro arguments will create incorrectly sorted index entries. Take care to avoid them.
% \end{enumerate}
%
-% \subsection{Basic Macros}
+% \subsection{Basic Macros: \bsc Name and \bsc FName}
%
% \subsubsection{\texttt{\bsc Name} and \texttt{\bsc Name*}}
%
@@ -228,13 +249,11 @@
% \end{tabular}
% \end{quote}
%
-% \noindent Basically, \cmd{\Name} connects the \emph{FNN} to the \emph{SNN} to create both a printed form and an indexed form, usually \textbf{\emph{FNN}\,\emph{SNN}} and \textbf{\emph{SNN},\,\emph{FNN}}. This takes care of most modern Western names. For those with one name, such as ancient figures or those with stage names, one can drop the \emph{FNN} so that \cmd{\Name} produces the result \textbf{\emph{SNN}} for both text and index.
-%
-% A newer feature added to \cmd{\Name} avoids a complicated workaround. Sometimes you might want to have the option of using either an alternate set of forenames or a sobriquet that functions as a surname for ancient figures. These two alternatives are handled by the final, optional field of \cmd{\Name}. If ``regular'' \emph{FNN} are present, then the alternate names conditionally will replace the \emph{FNN} in the printed form, but not in the indexed form. If no regular \emph{FNN} are present, then the alternate names will be appended to the \emph{SNN} in the printed form \emph{and} in the indexed form. You must use the sobriquet form of a name consistently or risk confusion.
+% \noindent Basically, \cmd{\Name} connects the \emph{FNN} to the \emph{SNN} to create respective printed and indexed forms, usually \emph{FNN}\,\emph{SNN} and \emph{SNN},\,\emph{FNN}. This takes care of most Western names. For those with one name, such as ancient figures or stage names, one can drop the \emph{FNN} so that \cmd{\Name} produces the result \emph{SNN} for both text and index.\cmd{\Name} always prints the surname or ``base name.''
%
-% I mentioned conditional use. The unstarred form prints the ``full name'' at the first occurrence, then only the partial form thereafter. The starred form always prints the full name. Both macros usually apply a different ``font attribute'' to the name when it first appears in the running text.
+% Sometimes you might want to have the option of using either an alternate set of forenames, like a nickname, or a sobriquet that functions as a surname for ancient figures. These two alternatives are handled by the final, optional field of \cmd{\Name}. If ``regular'' \emph{FNN} are present, then the alternate names conditionally will replace the \emph{FNN} in the printed form, but not in the indexed form. If no regular \emph{FNN} are present, then the alternate names will be appended to the \emph{SNN} in the printed form \emph{and} in the indexed form. You may choose to include or exclude nicknames and such, but you must always use the sobriquet form of a name consistently.
%
-% Here are some more examples of use:
+% I mentioned conditional use. The unstarred form prints the ``full name'' at the first occurrence, then only the partial form thereafter. The starred form always prints the full name. Both macros usually apply a different ``font attribute'' to the name when it first appears in the running text. Here are more examples:
%
% \begin{quote}\small
% |\Name*[Johann Wolfgang von]{Goethe}|\\
@@ -247,6 +266,7 @@
% |\Name{Boethius}| and |\Name*{Boethius}|
% Print \Name{Boethius} the first time it appears. Later, print \Name{Boethius}.
% \end{quote}
+%\clearpage
%
% \begin{quote}\small
% |\Name*{Antiochus IV}[Epiphanes]|\\
@@ -256,7 +276,7 @@
% Print \Name{Antiochus IV}[Epiphanes] the first time it appears. Later, print just the name \Name{Antiochus IV}[Epiphanes].
% \end{quote}
%
-% \noindent\emph{Note}: Here I am playing a ``dirty trick'' by making each line begin as if the name had not yet occurred. See Section \ref{sec:Tweaks} for more.
+% \noindent\emph{Note}: I am playing a ``dirty trick'' by making each line begin as if the name had not yet occurred. This trick can be used, for example, to force the formatting of the first name in a chapter or section. See Section \ref{sec:Tweaks} for more.
%
% \subsubsection{Tabular Summary of \texttt{\bsc Name}}
%
@@ -272,39 +292,100 @@
% \end{tabular}
% \end{quote}
%
-% \noindent Another option employs the sobriquet feature for royal names. The forms that work include:
-%
+% \noindent Here are examples that show variation among alternate names. As long as the ``main'' \emph{FNN} are constant, so will the index entries be constant:
+%
% \begin{quote}\small
+% In all cases, the index entries contain ``De Wette, Wilhelm M.L.''\\[1ex]
+% \texttt{\bsc Name[Wilhelm M.L.]\{De Wette\}[Wilhelm Martin Leberecht]}\\
+% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, first occurrence)\\
+% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, second occurrence)\\[1ex]
+% \ForgetName[Wilhelm M.L.]{De Wette}%
+% \texttt{\bsc Name*[Wilhelm M.L.]\{De Wette\}}\\
+% \Name*[Wilhelm M.L.]{De Wette} (text, first occurrence)\\
+% \Name*[Wilhelm M.L.]{De Wette} (text, second occurrence)
+% \end{quote}
+%
+% \noindent Alternate forenames \emph{override} the \emph{FNN} in the text. Sobriquets are \emph{appended} to \emph{SNN}. The presence or absence of \emph{FNN} triggers this difference. Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*}. The surname argument is \emph{always} printed.\medskip
+%
+% \noindent Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \texttt{\bsc AKA} and \texttt{\bsc PName} cannot refer to these forms, although they can use these forms in the \emph{second} name argument to construct a cross-reference. A workaround is discussed in Section \ref{sec:suffix}. The following method is the only one that works with the \texttt{comma} option. Valid ``sobriquet'' forms are:\\
+%
+% \bgroup\footnotesize
% \begin{tabular}{llp{1.2cm}ll}\hline
-% \emph{FNN} & \emph{SNN} & Alternate Names & Result & Function\\\hline
+% {\normalsize\strut}\emph{FNN} & \emph{SNN} & Alternate Names & Result & Function\\\hline
% (none) & \texttt{Henry} & \texttt{VIII} & \Name*{Henry}[VIII] & |\Name*{Henry}[VIII]|\\
% (none) & \texttt{Henry} & \texttt{VIII} & \Name{Henry}[VIII] & |\Name{Henry}[VIII]|\\\hline
+% (none) & \texttt{Chiang} & \texttt{Kai-shek} & \Name{Chiang}[Kai-shek] & |\Name{Chiang}[Kai-shek]|\\
+% (none) & \texttt{Chiang} & \texttt{Kai-shek} & \Name{Chiang}[Kai-shek] & |\Name{Chiang}[Kai-shek]|\\\hline
% \end{tabular}
-% \end{quote}
+% \egroup
%
-% \noindent Other options are possible and are discussed in Subsection \ref{sec:suffix}. They are ambiguous and may not work in all circumstances, but they do afford compatibility with \texttt{\bsc AKA} and \texttt{\bsc PName}.
+% \subsubsection{\texttt{\bsc FName}}
%
-% Rudimentary references to Eastern names (I plead ignorance on this point) can be achieved via the sobriquet feature:
+% \DescribeMacro{\FName}
+% This casual friend of \cmd{\Name} prints only ``first'' names except if a first use occurs, whereupon it prints a full, formatted name as set by the class options or the formatting macros. The syntax is basically the same:
+% \begin{quote}
+% \cmd{\FName}\oarg{forename(s)}\marg{surname(s)}\oarg{alternate names}
+% \end{quote}
+% Remember that \cmd{\FName} \emph{has no starred form}. Next we see what it does:
%
% \begin{quote}\small
-% \begin{tabular}{p{0.7cm}p{0.8cm}p{1.1cm}p{2.7cm}p{3.7cm}}\hline
-% \emph{FNN} & \emph{SNN} & Alternate Names & Result & Function\\\hline
-% (none) & \texttt{Chiang} & \texttt{Kai-shek} & \Name{Chiang}[Kai-shek] & |\Name{Chiang}[Kai-shek]|\\
-% (none) & \texttt{Chiang} & \texttt{Kai-shek} & \Name{Chiang}[Kai-shek] & |\Name{Chiang}[Kai-shek]|\\\hline
+% \begin{tabular}{llll}\hline
+% {\large\strut}\emph{FNN} & \emph{SNN} & Alternate Names & Result\\\hline
+% \texttt{Albert} & \texttt {Einstein} & (none) & \FName[Albert]{Einstein}\\
+% (none) & \texttt{Confucius} & (none) & \FName{Confucius}\\
+% \texttt{M.T.} & \texttt{Cicero} & \texttt{Marcus Tullius} & \FName[M.T.]{Cicero}[Marcus Tullius]\\
+% (none) & \texttt{Charles} & \texttt{the Bald} & \FName{Charles}[the Bald]\\\hline
% \end{tabular}
% \end{quote}
%
+% \noindent If one accidentally referred to |\FName[Max]{Planck}| as a first reference, that would appear as \FName[Max]{Planck}. otherwise it would just be \FName[Max]{Planck}. Using the ``alternate names'' option prints them instead. For example, aviation hero \Name[Chesley B.]{Sullenberger, III} can be noted as:
+%
+% \begin{quote}|``\FName[Chesley B.]{Sullenberger, III}[Sully]''|\quad``\FName[Chesley B.]{Sullenberger, III}[Sully]''\end{quote}
+%
+%\noindent A good way to cut keystrokes would be to assign the above macro to the control sequence \cmd{\Sully}. With comma-delimited suffixes we note special cases governed by the \texttt{nocomma} class option (see Section \ref{sec:suffix}). These include names like like \FName[J.D.]{Rock, III} and \FName{Charles, V}:
+% \begin{quote}|\FName[J.D.]{Rock, III}|, ``\FName[J.D.]{Rock, III},'' |\FName{Charles, V}|, ``\FName{Charles, V}''\end{quote}
+% \noindent \FName{Mao}[Tse-tung], ``\FName{Mao}[Tse-tung],'' does not work with \cmd{\FName} because it is an Eastern name. \cmd{\FName} works best with Western names and mononyms.\\
+%
+% \noindent \cmd{\FName} understands that an extra period could result from typing:
+% \begin{quote}
+% |My boss is \Name*[J.D.]{Rock, III}.|\\ |We all call him \FName[J.D.]{Rock, III}.|
+% \end{quote}
+%\cmd{\FName} solves this by scanning for and eliminating that extra period:
+% \begin{quote}
+% My boss is \Name*[J.D.]{Rock, III}.\\ We all call him \FName[J.D.]{Rock, III}.
+% \end{quote}
+%
% \subsection{Advanced Topics}
%
+% \subsubsection{Hyphenation}
+%
+% I find it helpful to use the \textsf{babel} or \textsf{polyglossia} packages to help with name hyphenation. If one is using English as the main language, the default hyphenation patterns may not suffice. For example, the name \Name[John]{Strietelmeier} may break thus: ``Stri-etelmeier.'' That is fixed by creating a \cmd{\de} macro equivalent to |\newcommand{\de}[1]{\foreignlanguage{ngerman}{#1}}| (using \textsf{babel}) and writing |\de{\Name[John]{Strietelmeier}}|.
+%
+% One can insert optional hyphens in the arguments of \cmd{\Name} and friends but that must be done \emph{consistently} to avoid variants being treated as different names.
+%
+% \subsubsection{\texttt{\bsc IndexName}}
+%
+% \DescribeMacro{\IndexName}
+% This macro allows one to create an index entry with the same format as \cmd{\Name} and friends. It prints no text in the body and can be used like \cmd{\index}, but without any special formatting. The syntax is similar to \cmd{\Name}:
+% \begin{quote}
+% \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{alternate names}
+% \end{quote}
+% \cmd{\IndexName} does not index the alternate names unless no \emph{FNN} are present, at which time is acts like \cmd{\Name} using the sobriquet feature.
+%
+% \subsubsection{Manual Index Entries}
+% \label{sec:manual}
+%
+% Starting with version 0.9, \cmd{\Name} and friends produce index entries that are compatible with manual index entries. The comma and suffix handling are now entirely expandable. A great way to see how these index entries are formed is to run \textsf{latex} and friends using \textsf{makeindex}---I have not tested this package with \texttt{xindy}---and examine the \texttt{.ind} file.
+%
% \subsubsection{Suffix Removal}
% \label{sec:suffix}
% \changes{v0.85}{2012/02/05}{New suffix removal features}
%
-% \texttt{\bsc Name} and \texttt{\bsc Name*} have an additional difference. \texttt{\bsc Name} will truncate the suffixes from subsequent occurrences of last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. \emph{The typed form always uses a comma}, e.g., \texttt{\bsc Name[Oskar]\{Hammerstein, II\}}. Moreover, the space after the comma is literal, but not manipulated by the package in case one wants to use a thin space instead. That is left to the author.
+% \texttt{\bsc Name} and \texttt{\bsc Name*} have an additional difference. \texttt{\bsc Name} will truncate the suffixes from subsequent occurrences of last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. \emph{The input form always uses a comma}, e.g., \texttt{\bsc Name[Oskar]\{Hammerstein, II\}}. Moreover, the space after the comma is literal, but not manipulated by the package in case one wants to use a thin space instead. That is left to the author.
%
-% Again, \textbf{the comma is not optional with suffixes}. It is how this feature works. More than one comma in the arguments of \cmd{\Name} and all similar user interface macros will cause unwanted results.
+% Again, \textbf{the comma is not optional with suffixes}. It is how this feature works. More than one comma in the \emph{SNN} argument of \cmd{\Name} and friends will cause unwanted results. Fortunately, that is unlikely.
%
-% \cmd{\Name} and friends keep track of whether the name ends with the period of an abbreviation like ``Jr.'' and ``Sr.'' That should also work with abbreviations like ``d.~\"{A}.'' (\textit{der \"{A}ltere}). Two periods are not printed when the full name is printed at the end of a sentence. The following example shows the possible combinations:
+% These macros keep track of whether the name ends with the period of an abbreviation like ``Jr.'' and ``Sr.'' That should also work with abbreviations like ``d.~\"{A}.'' (\textit{der \"{A}ltere}). Two periods are not printed when the full name is printed at the end of a sentence. The following example shows the possible combinations:
%
% \ForgetName[Martin Luther]{King, Jr.}%
% \begin{quote}\small
@@ -321,7 +402,7 @@
%
% \begin{quote}\small
% \begin{tabular}{llp{1.2cm}ll}\hline
-% \emph{FNN} & \emph{SNN} & Alternate Names & Result & Function\\\hline
+% {\large\strut}\emph{FNN} & \emph{SNN} & Alternate Names & Result & Function\\\hline
% (none) & \texttt{Louis, XIV} & (none) & \Name{Louis, XIV} & |\Name{Louis, XIV}|\\
% (none) & \texttt{Louis, XIV} & (none) & \Name{Louis, XIV} & |\Name{Louis, XIV}|\\
% (none) & \texttt{Sun, Yat-sen} & (none) & \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\\
@@ -329,86 +410,14 @@
% \end{tabular}
% \end{quote}
%
-% \noindent The benefit to using this form is that one can type |\Name*{Louis, XIV}, the| |``\AKA{Louis, XIV}{Sun King}''| and get \Name*{Louis, XIV}, the ``\AKA{Louis, XIV}{Sun King}'' in the text with an appropriate reference from ``Sun King'' to ``Louis XIV'' in the index (see below). The sobriquet feature would otherwise prevent such usage.
+% \noindent The benefit to using this form is that one can type |\Name*{Louis, XIV}, the| |``\AKA{Louis, XIV}{Sun King}''| and get \Name*{Louis, XIV}, the ``\AKA{Louis, XIV}{Sun King}'' in the text with an appropriate reference from ``Sun King'' to ``Louis XIV'' in the index. The sobriquet feature would otherwise prevent such usage.
%
-% Using this feature comes with a price. Even though suffix and sobriquet features produce the same \emph{output} with the default options, they are internally \emph{different} with respect to the first/subsequent use mechanism. Use each approach consistently. This workaround takes advantage of the ambiguous default behavior; the \texttt{comma} option will break its functionality. Again, \emph{caveat auctor}.
-%
-% \subsubsection{Alternate forenames in the Text}
-%
-% I showed above the cases of \Name[M.T.]{Cicero}[Marcus Tullius] and \Name*[John Q.]{Adams}[John Quincy] where one can have a longer name in the text than in the index. Here are fuller examples:
-%
-% \begin{quote}\small
-% \texttt{\bsc Name[Wilhelm M.L.]\{De Wette\}[Wilhelm Martin Leberecht]}\\
-% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, first occurrence)\\
-% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, second occurrence)\\
-% The abbreviated name ``De Wette, Wilhelm M.L.'' is in the index.\\[1ex]
-% \ForgetName[Wilhelm M.L.]{De Wette}%
-% \texttt{\bsc Name*[Wilhelm M.L.]\{De Wette\}}\\
-% \Name*[Wilhelm M.L.]{De Wette} (text, first occurrence)\\
-% \Name*[Wilhelm M.L.]{De Wette} (text, second occurrence)\\
-% The abbreviated name ``De Wette, Wilhelm M.L.'' is in the index.\\[1ex]
-% \ForgetName[Wilhelm M.L.]{De Wette}%
-% \texttt{\bsc Name*[Wilhelm M.L.]\{De Wette\}[W.M.L.]}\\
-% \Name*[Wilhelm M.L.]{De Wette}[W.M.L.] (text, first occurrence)\\
-% \Name*[Wilhelm M.L.]{De Wette}[W.M.L.] (text, second occurrence)\\
-% The abbreviated name “De Wette, Wilhelm M.L.” is in the index.
-% \end{quote}
-%
-% \noindent Alternate forenames \emph{override} the \emph{FNN} in the text. Sobriquets are \emph{appended} to \emph{SNN}. The presence or absence of \emph{FNN} triggers this difference. Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*}. The surname argument is \emph{always} printed. The next macro allows one to bypass this restriction.
-%
-% \subsubsection{\texttt{\bsc IndexName}}
-%
-% \DescribeMacro{\IndexName}
-% This macro prints no text in the body. It only creates an index entry that conforms with the rest of the package. Its syntax is:
-% \begin{quote}
-% \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{alternate names}
-% \end{quote}
-%
-% \noindent \cmd{\IndexName} \emph{does not work} with the pen name mechanism described below. This example shows \cmd{\Name} and \cmd{\IndexName} working together.
-%
-% \begin{quote}
-% \bgroup\ttfamily
-% \bsc Name[C.F.W.]\{Walther\}[Carl Ferdinand Wilhelm] was a major\break figure in American Lutheran history. \bsc Name[C.F.W.]\{Walther\}\break used his full name when signing documents. To family,\break however, he was just Ferdinand\bsc IndexName[C.F.W.]\{Walther\}.
-% \egroup
-%
-% \Name[C.F.W.]{Walther}[Carl Ferdinand Wilhelm] was a major figure in American Lutheran history. \Name[C.F.W.]{Walther} used his full name when signing documents. To family, however, he was just Ferdinand\IndexName[C.F.W.]{Walther}.
-% \end{quote}
-%
-% \noindent One can use this macro for special cases, like referring to works by joint or multiple authors or simply indexing names consistently with this package:
-%
-% \begin{quote}
-% \bgroup\ttfamily
-% \bsc newcommand\{\bsc SJB\}\%\break
-% \{\bsc IndexName[Stan]\{Berenstain\}\bsc IndexName[Jan]\{Berenstain\}\}\break
-% \bsc textit\{The Berenstain Bears\} is a popular series of\break children's books with over 300 titles. One can index the\break Berenstains\bsc SJB\{\} in this manner.
-% \egroup
-%
-% \newcommand{\SJB}%
-% {\IndexName[Stan]{Berenstain}\IndexName[Jan]{Berenstain}}
-% \textit{The Berenstain Bears} is a popular series of children's books with over 300 titles. One can index the Berenstains\SJB{} in this manner.
-% \end{quote}
-%
-% \ForgetName{Antiochus IV}[Epiphanes]%
-% \begin{quote}
-% \bgroup\ttfamily
-% First Maccabees recounts the suppression of Jewish customs\break under the Seleucid king \bsc Name\{Antiochus IV\}[Epiphanes]. His behavior was so egregious that he became an early model for the later profile of Antichrist.\break \bsc IndexName\{Antiochus IV\}[Epiphanes]
-% \egroup
-%
-% First Maccabees recounts the suppression of Jewish customs under the Seleucid king \Name{Antiochus IV}[Epiphanes]. His behavior was so egregious that he became an early model for the later profile of Antichrist.\IndexName{Antiochus IV}[Epiphanes]
-% \end{quote}
+% Even though suffix and sobriquet features look like they produce the same \emph{output} in the body text using the \texttt{nocomma} option, they are internally \emph{different}. They will not respect each other regarding ``first use,'' although they will (tentatively) cooperate in the index. Use each approach consistently. An example of ``dangerous'' use of these features occurs in Section \ref{sec:formatting}. The \texttt{comma} option will cause these forms above to have commas and behave differently. Again, \emph{caveat auctor}.
%
% \subsubsection{Pen Names: An Introduction}
+% \label{sec:pennames}
%
-% \cmd{\IndexName} lacks some safeguards for handling pen names that the macros \cmd{\PName} and \cmd{\AKA} introduce. These macros are incompatible with the alternate name and sobriquet features of \cmd{\Name} for the following reasons:
-%
-% \begin{enumerate}
-% \item It makes sense to have the better-known name come first.
-% \item That order produces an ambiguous argument list. Making the list unambiguous requires a mandatory argument, thus, extra keystrokes.
-% \item The more details in any given macro, the more confusing it is to use.
-% \item Many ancient pseudonyms require manual typesetting and indexing.
-% \end{enumerate}
-%
-% \noindent We already saw the strengths and weaknesses of the suffix feature above as a workaround for sobriquets and Eastern names when using \cmd{\PName} and \cmd{\AKA}. A more general workaround for such names follows:
+% The macro \cmd{\AKA} deals with pseudonyms, stage names, \emph{noms de plume}, etc. We already saw the strengths and weaknesses of the suffix feature above as a workaround for sobriquets and Eastern names when using \cmd{\AKA}. Before we examine its function in detail, we touch on the only solution for some name forms, especially if one chooses the \texttt{comma} option:
%
% \begin{quote}
% \bgroup\ttfamily
@@ -420,53 +429,54 @@
% \Name{Jean}[sans Peur] (Jean the Fearless) was Duke of Burgundy from 1404 to 1419.
% \end{quote}
%
-% \noindent A more complicated example is:
+% \noindent The suffix workaround also can work with this example, but not with something like |\Name{Vlad, III}[Dracula]|. In order to make that form work, you would have to use |\Name{Vlad, III Dracula}|. The latter two forms both shorten to Vlad and look the same using the \texttt{nocomma} option. If you use both forms (see Section \ref{sec:formatting}) errors may bite. A more complicated example is:
% \begin{quote}
-% \bgroup\ttfamily\small
-% \verb!\index{Doctor Angelicus@\textit{Doctor Angelicus}|see{Thomas Aquinas}}%!\\
-% \verb!\index{Thomas of Aquino|see{Thomas Aquinas}}%!\\
-% Perhaps the greatest medieval theologian was |\Name{Thomas}[Aquinas]| (Thomas of Aquino), also known as |\textit{Doctor Angelicus}|. His name ``Aquinas'' is not a surname, so many modern scholars simply refer to him as |\Name{Thomas}[Aquinas]|.
+% \bgroup\ttfamily\footnotesize
+% \verb!\index{Doctor Angelicus@\textit{Doctor Angelicus}|see{@{Thomas}{} Aquinas}}%!\\
+% \verb!\index{Thomas of Aquino|see{@{Thomas}{} Aquinas}}%!\\
+% Perhaps the greatest medieval theologian was |\Name{Thomas}[Aquinas]| (Thomas of Aquino), also known as |\textit{Doctor Angelicus}|. His name ``Aquinas'' is not a surname, so many modern scholars simply refer to him as \break |\Name{Thomas}[Aquinas]|.
% \egroup
%
-% \index{Doctor Angelicus=\textit{Doctor Angelicus}|see{Thomas Aquinas}}%
-% \index{Thomas of Aquino|see{Thomas Aquinas}}%
+% \index{Doctor Angelicus=\textit{Doctor Angelicus}|see{={Thomas}{} Aquinas}}%
+% \index{Thomas of Aquino|see{={Thomas}{} Aquinas}}%
% Perhaps the greatest medieval theologian was \Name{Thomas}[Aquinas] (Thomas of Aquino), also known as \textit{Doctor Angelicus}. His name ``Aquinas'' is not a surname, so many modern scholars simply refer to him as \Name{Thomas}[Aquinas].
% \end{quote}
%
-% \subsubsection{\texttt{\bsc PName}}
+% \subsubsection{\texttt{\bsc AKA}}
%
-% \DescribeMacro{\PName}
-% Pseudonyms, stage names, \emph{noms de plume}, epithets, and monikers can be handled with two macros: \cmd{\PName} and \cmd{\AKA}. The macro \cmd{\PName} usually takes a well-known name, followed by a lesser-known name. Like \cmd{\Name}, \cmd{\PName} has starred and unstarred forms, but those forms only operate on the first name, not on the second name. \cmd{\PName} also handles double-periods. The syntax is:
+% \DescribeMacro{\AKA}
+% \DescribeMacro{\AKA*}
+% The primary macro that handles aliases is \cmd{\AKA}. Its syntax is:
% \begin{quote}
-% \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{lesser-known FNN}\marg{lesser-known SNN}
+% \cmd{\AKA}\oarg{FNN}\marg{SNN}\oarg{alternate FNN}\marg{alternate SNN}\oarg{alt. names}\\
+% \cmd{\AKA*}\oarg{FNN}\marg{SNN}\oarg{alternate FNN}\marg{alternate SNN}\oarg{alt. names}
% \end{quote}
%
-% \noindent The following examples demonstrate uses of \cmd{\PName}. The macros are agnostic of the ``pen name'' itself. The author determines the name that is indexed (the first name) and the subsequent name that only occurs as a \emph{see} reference.
-%
-% \begin{quote}
-% |\PName*[Mark]{Twain}[Samuel L.]{Clemens}|\\
-% Print \PName*[Mark]{Twain}[Samuel L.]{Clemens} the first time it appears. Later, print \PName*[Mark]{Twain}[Samuel L.]{Clemens}.\\[1ex]
-% \ForgetName[Mark]{Twain}%
-% |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\
-% Print \PName[Mark]{Twain}[Samuel L.]{Clemens} the first time it appears. Later, print \PName[Mark]{Twain}[Samuel L.]{Clemens}.\\[1ex]
-% |\PName*[Willebrord]{Snel van Royen}{Snellius}|\\
-% Print \PName*[Willebrord]{Snel van Royen}{Snellius} the first time it appears. Later, print \PName*[Willebrord]{Snel van Royen}{Snellius}.\\[1ex]
-% \ForgetName[Willebrord]{Snel van Royen}%
-% |\PName[Willebrord]{Snel van Royen}{Snellius}|\\
-% Print \PName[Willebrord]{Snel van Royen}{Snellius} the first time it appears. Later, print \PName[Willebrord]{Snel van Royen}{Snellius}.\\[1ex]
-% |\PName{Voltaire}[François-Marie]{Arouet}|\\
-% Print \PName{Voltaire}[François-Marie]{Arouet} the first time it appears. Later, print \PName{Voltaire}[François-Marie]{Arouet}. The starred version also produces \PName*{Voltaire}[François-Marie]{Arouet}
+% \noindent Notice that the \emph{FNN} and \emph{SNN} arguments \emph{do not accept} the third argument field of \cmd{\Name}. This means that one cannot use \cmd{\AKA} to create a \emph{see} reference to a name with a sobriquet or to an Eastern name unless one uses the suffix feature mentioned previously. Here is a quick review of what works and what fails:
+%
+% \begin{quote}\footnotesize
+% \begin{tabular}{llllll}\hline
+% {\normalsize\strut}\emph{FNN} & \emph{SNN} & Alt. \emph{FNN} & Alt. \emph{SNN} & Alt. names & Result \\\hline
+% {\small\strut}\texttt{Bob} & \texttt{Hope} & \texttt{Leslie Townes} & \texttt{Hope} & (none) & success\\
+% {\small\strut}\dag\texttt{Bob} & \texttt{Hope} & \texttt{Leslie Townes} & \texttt{Hope} & \texttt{Lester T.} & success\\\hline
+% {\small\strut}(none) & \texttt{Louis} & \texttt{XIV} & \texttt{Sun King} & (none) & FAIL\\
+% {\small\strut}\ddag(none) & \texttt{Louis, XIV} & (none) & \texttt{Sun King} & (none) & success\\\hline
+% {\small\strut}(none) & \texttt{Gregory} & \texttt{I} & \texttt{Gregory} & \texttt{the Great} & FAIL\\
+% {\small\strut}\S (none) & \texttt{Gregory, I} & (none) & \texttt{Gregory} & \texttt{the Great} & success\\\hline
+% \end{tabular}
+%
+% \smallskip\dag{} This succeeds, but replaces ``Leslie Townes'' with ``Lester T.''\\
+% \ddag{} This form uses the \texttt{nocomma} feature.\\
+% \S{} This produces different output, depending on whether \cmd{\AKA} or \cmd{\AKA*} is used.
% \end{quote}
%
-% \subsubsection{\texttt{\bsc AKA}}
+% \noindent Since \cmd{\AKA} is designed to handle a number of otherwise incompatible needs, its use may be the most complex of all macros in this package. \cmd{\AKA} creates a cross reference. The target of this cross-reference is either \emph{SNN}, \emph{FNN} or just \emph{SNN}. The main entry in which the cross-reference occurs is constructed exactly like \cmd{\Name} handles its arguments. The \emph{alternate FNN} are replaced by the \emph{alternate names} if both exist. The \emph{alternate names} follow the \emph{alternate SNN} otherwise.
%
-% \DescribeMacro{\AKA}
-% The second macro that handles aliases is \cmd{\AKA}. It is the same alias mechanism used in \cmd{\PName}, but separated for more flexibility. Its syntax is similar to \cmd{\PName}:
-% \begin{quote}
-% \cmd{\AKA}\oarg{FNN}\marg{SNN}\oarg{lesser-known FNN}\marg{lesser-known SNN}
-% \end{quote}
+% The twist is the starred form \cmd{\AKA*}. If the starred form is used with the template (none)\marg{alternate SNN}\oarg{alt. names}, it only prints the \oarg{alt. names}. This allows it to be used in the manner of the example text in Section \ref{sec:example}. \cmd{\AKA} prints \marg{alternate SNN} followed by \oarg{alt. names}. A difference between the behavior of \cmd{\AKA*} and \cmd{\Name} using sobriquets is that \cmd{\AKA*} creates a cross-reference and allows the sobriquet to be printed separately from the main name within some manner of punctuation.
%
-% \noindent\cmd{\AKA} only prints the pseudonym, \emph{not} the indexed name. The macro also prevents double periods. An example of use follows:
+% \cmd{\AKA} only prints the alternate name. It assumes that a \cmd{\Name} macro occurs somewhere to create the page-indexed target of a cross-reference. No error checking otherwise occurs for this. The macro also prevents double periods.
+%
+%A brief example follows:
%
% \begin{quote}
% \bgroup\ttfamily
@@ -476,37 +486,45 @@
% Today we consider \AKA[George]{Eliot}[Mary Anne]{Evans} and her literary contributions as \Name[George]{Eliot}.
% \end{quote}
%
-% \noindent\cmd{\AKA} creates an index entry that cross-references to the ``main'' name given. It is assumed that a \cmd{\Name} macro occurs somewhere in reference to the indexed name. No error checking otherwise occurs for this.
-%
-% Pseudonyms only work as cross-references. \cmd{\Name} will only print a pen name and emit a warning. To index a pseudonym with page numbers, use \cmd{\Name} for both the main name and the pseudonym, then manually cross-reference them, e.g.:\medskip
+% \noindent The alternate name references generated by \cmd{\AKA} and \cmd{\AKA*} only work as cross-references. If you include these alternate names in the parameters of \cmd{\Name}, it will print the alternate names in the text and emit a warning. It will not index the alternate names at that point.
%
-% \bgroup\small\index{Rambam|seealso{Maimonides}}
+% In some cases, that is enough. In other cases, one might wish to index an alternate name with page numbers. In that case, do not use \cmd{\AKA}. Use \cmd{\Name} for both the main name and the alternate name. You will have to create manual cross-references with \cmd{\index}. For example:\medskip
+%
+% \bgroup\footnotesize\index{Rambam|seealso{Maimonides}}
% \begin{tabular}{p{0.7in}ll}\hline
% Authoritative Name & Alternate Name & Example of Use\\\hline
-% \Name{Maimonides} & \AKA{Maimonides}{Moses ben-Maimon} & \texttt{\bsc AKA\{Maimonides\}\{Moses ben-Maimon\}}\\
-% \Name{Maimonides} & \Name{Rambam} & \verb!\Name{Rambam}!\\& & \verb!\index{Rambam|seealso{Maimonides}!\\\hline
+% \Name{Maimonides} & \AKA{Maimonides}{Moses ben-Maimon} & |\AKA{Maimonides}{Moses ben-Maimon}|\\
+% \Name{Maimonides} & \Name{Rambam} & |\Name{Rambam}%|\\& & \verb!\index{Rambam|seealso{Maimonides}}!\\\hline
% \end{tabular}
% \egroup
%
-% \noindent\cmd{\AKA} will not create multiple instances of a cross-reference. This prevents bogus multiple cross-references in the index, but it also excludes the special case where one moniker applies to multiple people, e.g.: \PName*[Willebrord]{Snel van Royen}{Snellius} and his son \PName*[Rudolph]{Snel van Royen}{Snellius}.
+% \medskip\noindent\cmd{\AKA} will not create multiple instances of a cross-reference. This prevents possible errors in the index, but it also excludes the special case where one moniker applies to multiple people, e.g.: \PName*[Willebrord]{Snel van Royen}{Snellius} and his son \PName*[Rudolph]{Snel van Royen}{Snellius}. One must add a manual index entry:
% \index{Snellius|see{Snel van Royen, Rudolph}}%
-% Do not use \cmd{\IndexName} in this case. One must add a manual index entry as a workaround:
% \begin{quote}
% \verb!\index{Snellius|see{Snel van Royen, Rudolph}}!
% \end{quote}
%
-% \noindent Be careful with name collisions, especially with more than one person having the same last name. The following examples illustrate this:
+% \subsubsection{\texttt{\bsc PName}}
+%
+% \DescribeMacro{\PName}
+% \cmd{\PName} is a ``convenience macro'' that sacrifices some of the flexibility of \cmd{\AKA} for simplicity. It does not implement \cmd{\AKA*} and it works best with Western-style names. Like \cmd{\Name}, \cmd{\PName} prints a Western-style ``main'' name using either starred or unstarred forms that affect only that name. Like \cmd{\AKA}, it follows with an alternate name, but prints the full alternate name in parentheses. \cmd{\PName} also handles double-periods. The syntax is:
% \begin{quote}
-% \texttt{\bsc PName[Willebrord]\{Snel van Royen\}\{Snellius\}}\\
-% \PName[Willebrord]{Snel van Royen}{Snellius}\\[1ex]
-% \texttt{\bsc PName[Rudolph]\{Snel van Royen\}\{Snellius\}}\\
-% \PName[Rudolph]{Snel van Royen}{Snellius}\\[1ex]
-% \texttt{\bsc Name[Willebrord]\{Snel van Royen\}}\\
-% \Name[Willebrord]{Snel van Royen}\\[1ex]
-% \texttt{\bsc Name[Rudolph]\{Snel van Royen\}}\\
-% \Name[Rudolph]{Snel van Royen}
+% \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{lesser-known FNN}\marg{lesser-known SNN}
% \end{quote}
+%
+% \noindent The following examples demonstrate uses of \cmd{\PName}. The macros are agnostic of the ``pen name'' itself. The author determines the name that is indexed (the first name) and the subsequent name that only occurs as a \emph{see} reference.
%
+% \begin{quote}
+% |\PName*[Mark]{Twain}[Samuel L.]{Clemens}|\\
+% |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\
+% Print \PName*[Mark]{Twain}[Samuel L.]{Clemens} the first time it appears. Later, print \PName*[Mark]{Twain}[Samuel L.]{Clemens}. The form \cmd{\PName} later just prints \PName[Mark]{Twain}[Samuel L.]{Clemens}.\\[1ex]
+% |\PName*{Voltaire}[François-Marie]{Arouet}|\\
+% |\PName{Voltaire}[François-Marie]{Arouet}|\\
+% Print \PName{Voltaire}[François-Marie]{Arouet} the first time it appears. Later, print \PName{Voltaire}[François-Marie]{Arouet}. Both forms do the same thing in this case.
+% \end{quote}
+%
+% If you use the unstarred forms \cmd{\PName} and \cmd{\Name}, you must remember that, just because you include a full name as a parameter does not mean that the full name will print. You could end up with ambiguous references to the same last name, e.g., ``Snel van Royen.'' You are responsible for checking this.
+%
% \subsection{Accented Names}
% \label{sec:Accents}
%
@@ -542,8 +560,10 @@
% \end{quote}
%
% \noindent Please remember that the appropriate font packages, such as \textsf{lmodern} or the \TeX\ Gyre fonts, are needed to obtain some TS1 glyphs. Also there may be points where \textsf{pdflatex} will accept the input (e.g., Gh{\=a}zali), but \textsf{makeindex} will have problems with that. In ``normal'' operation (I have used \textsf{article} and \textsf{memoir}) these control sequences appear to work fine. Special requirements like those in the \textsf{ltxdoc} class disrupt this functionality, requiring manual index entries in some cases.
-%
+% \clearpage
+%
% \subsection{Name Formatting}
+% \label{sec:formatting}
%
% \subsubsection{Font Attributes}
% \label{sec:FontAttributes}
@@ -562,16 +582,24 @@
% \renewcommand{\NamesFormat}[1]{\textbf{#1}\ifinner\else\marginpar{\scriptsize #1}\fi}
%
%\begin{quote}
-% \bgroup\ttfamily \bsc Name\{Vlad III\}[Dracula] became known as Vlad Ţepeş, ``The\break Impaler,'' after his death. He was the son of\break \bsc Name\{Vlad II\}[Dracul]. Later references to\break \bsc Name\{Vlad III\}[Dracula] appear thus.\egroup \bigskip
+% \bgroup\ttfamily |\Name{Vlad III}[Dracula]| became known as Vlad Ţepeş, ``The\break Impaler,'' after his death. He was the son of\break |\Name{Vlad II}[Dracul]|, a member of the Order of the Dragon. Later references to |\Name{Vlad III}[Dracula]| appear thus.\egroup
%
-% \Name{Vlad III}[Dracula] became known as Vlad Ţepeş, ``The Impaler,'' after his death. He was the son of \Name{Vlad II}[Dracul]. Later references to \Name{Vlad III}[Dracula] appear thus.
+% \Name{Vlad III}[Dracula] became known as Vlad Ţepeş, ``The Impaler,'' after his death. He 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.
% \end{quote}
%
% \let\NamesFormat\oldformat
%
-% After using \cmd{\let} to revert \cmd{\NamesFormat}, a first occurrence again takes the form: \ForgetName{Vlad III}[Dracula]\Name{Vlad III}[Dracula].\\
+% \noindent After using \cmd{\let} to revert \cmd{\NamesFormat}, a first occurrence again takes the form: \ForgetName{Vlad III}[Dracula]\Name{Vlad III}[Dracula], while subsequent references are to \Name{Vlad III}[Dracula].\\
%
-% Let me again stress that ``royal'' names used in this manner do not work with \cmd{\PName} and \cmd{\AKA}. Consistently use either the suffix mechanism (Subsection \ref{sec:suffix}) or use as a guide the examples above for \Name*{Jean}[sans Peur] and \Name*{Thomas}[Aquinas].
+% Let me again stress that ``royal'' names used in this manner do not work with \cmd{\PName} and \cmd{\AKA}. Consistently use either the suffix mechanism (Section \ref{sec:suffix}) or use as a guide the examples above for \Name*{Jean}[sans Peur] and \Name*{Thomas}[Aquinas]. If you use the suffix mechanism, you would use the forms:
+%
+%\begin{quote}\ForgetName{Vlad III}[Dracula]\ForgetName{Vlad II}[Dracul]
+% \bgroup\ttfamily |\Name{Vlad III, Dracula}| became known as \break |\AKA{Vlad III, Dracula}{Vlad}[Ţepeş]|,\break |``\AKA{Vlad III, Dracula}{Vlad}[the Impaler],''| after his death. He 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.\egroup
+%
+% \Name{Vlad III, Dracula} became known as \AKA{Vlad III, Dracula}{Vlad}[Ţepeş], ``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler],'' after his death. He 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.
+% \end{quote}
+%
+% \noindent NOTE: The ``Dracula'' example is complex and the usual ``first use'' feature has been manipulated extensively to produce these results. If you mix casually the sobriquet and suffix forms, errors may ``bite.'' \Name{Vlad III}[Dracula] was a complex historical figure, as was his father, living in the no-man's land between the Ottoman Empire and the Holy Roman Empire. The story of the Jagiellon monarchy of Hungary, later to come under Hapsburg control, is also complex, as was that of \Name{Ivan, IV} ``\AKA*{Ivan, IV}{Ivan}[the Terrible]'' in fifteenth-century Muscovy. I am not trying to saddle a historical figure with the fiction of \Name[Bram]{Stoker}, although the latter is probably responsible for much tourism regarding \Name{Vlad III}[Dracula].
%
% \subsection{Formatting Certain Sections}
% \label{sec:SectionFormat}
@@ -602,17 +630,28 @@
% \end{tabular}
% \end{quote}
%
-% \subsection{Tweaks:\texttt{\bsc ForgetName}}
+% \subsection{Tweaks: \texttt{\bsc ForgetName} and \texttt{\bsc SubvertName}}
% \label{sec:Tweaks}
%
+% Using these two macros may hinder the arbitrary rearrangement of text. I suggest that one wait until the final draft before implementing them. They either force or suppress the active formatting of names.
+%
% \DescribeMacro{\ForgetName}
-% This macro is a ``dirty trick'' of sorts that takes the same optional and mandatory parameters used by \cmd{\Name}. It handles its arguments in the same manner as \cmd{\Name}, except that it ignores the final parameter if \emph{FNN} are present. The syntax is:
+% This macro is a ``dirty trick'' of sorts that takes the same optional and mandatory parameters used by \cmd{\Name}. It handles its arguments in the same way, except that it ignores the final parameter if \emph{FNN} are present. The syntax is:
% \begin{quote}
% \cmd{\ForgetName}\oarg{FNN}\marg{SNN}\oarg{alternate names}
% \end{quote}
%
-% \noindent This macro causes \cmd{\Name} and friends to “forget” prior uses of a name with respect to typesetting. The next use will print as if it were a ``first use.'' Index entries and pseudonyms (see above) are \emph{never} forgotten.
+% \noindent This macro causes \cmd{\Name} and friends to ``forget'' prior uses of a name with respect to typesetting. The next use will print as if it were a ``first use.'' Index entries and pseudonyms (see above) are \emph{never} forgotten.
%
+% \DescribeMacro{\SubvertName}
+% This macro is the opposite of the one above. It takes the same parameters. It handles its arguments in the same manner as \cmd{\Name}, except that it ignores the final parameter if \emph{FNN} are present. The syntax is:
+% \begin{quote}
+% \cmd{\SubvertName}\oarg{FNN}\marg{SNN}\oarg{alternate names}
+% \end{quote}
+%
+% \noindent This macro causes \cmd{\Name} and friends to think that prior uses of a name have already occurred. The next use will print as if it were a ``subsequent use.''
+% \clearpage
+%
% \StopEventually{\PrintChanges\clearpage\PrintIndex}
%
% \section{Implementation}
@@ -621,17 +660,18 @@
%<*package>
% \fi
% \subsection{Class Options and Required Packages}
+%
% \begin{macrocode}
\newif\if@nameauth@DoFormat
\newif\if@nameauth@DoComma
-\newif\if@nameauth@Punct
% \end{macrocode}
-% These Boolean values control or are controlled by formatting of first entries, suppression of commas, and whether or not a name ends with a period.\\
+% These Boolean values are used to control formatting and comma suppression. Both may be set with class options, but only |@nameauth@DoFormat| can be toggled with use interface macros \cmd{\NamesActive} and \cmd{\NamesInactive}.\\
%
% \begin{macrocode}
-\newif\if@nameauth@dtx
+\newif\if@nameauth@Comma
+\newif\if@nameauth@Punct
% \end{macrocode}
-% This Boolean value handles proper generation of dtx files. It is set by |\@ifclassloaded|.\\
+% These Boolean values are used internally for detection of suffixes and final periods.\\
%
% \changes{v0.85}{2012/02/05}{Added nocomma, comma options}
% \begin{macrocode}
@@ -647,11 +687,8 @@
\ProcessOptions\relax
\RequirePackage{etoolbox}
\RequirePackage{xparse}
-\@ifclassloaded{ltxdoc}
- {\@nameauth@dtxtrue}
- {\@nameauth@dtxfalse}%
% \end{macrocode}
-% The options above interact with the prior Boolean values. Suppressing and showing commas is set at load time and should not be changed in the document or else significant errors will result. |\@ifclassloaded| sets the Boolean value that governs the ``literal'' character used in the index. The other options can be changed without problem and several user interface macros provide that functionality.\\
+% The options above interact with the prior Boolean values. Suppressing and showing commas is set at load time and should not be changed in the document or else significant errors will result. The other options can be changed without problem and several user interface macros provide that functionality.\\
%
% \subsection{Internal Macros}
% \begin{macro}{\@nameauth@CleanName}
@@ -660,51 +697,81 @@
\newcommand*{\@nameauth@CleanName}[1]{\expandafter\zap@space\detokenize{#1} \@empty}
% \end{macrocode}
% \end{macro}
-% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string based on the forename/surname parameters of \cmd{\Name} and friends. With this we can construct a control sequence name. Testing for the presence of that control sequence determines the existence of pseudonyms and the first occurrence of a name.\\
-%
-% \noindent The following macros pertain to both the suffix mechanism mentioned above and the removal of suffixes with subsequent references of \cmd{\Name}.
+% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string based on the forename/surname parameters of \cmd{\Name} and friends. With this we can construct a control sequence name. Testing for the presence of that control sequence determines the existence of pseudonyms and the first occurrence of a name.\bigskip\hrule\bigskip
+% The following macros parse a ``base'' name into a radix and a suffix. They are designed so that their function occurs completely at the time of macro expansion, not execution. This expandability is key to the proper function of this package. They form the kernel of the suffix removal and comma suppression features.
%
% \begin{macro}{\@nameauth@Root}
+% \changes{v0.85}{2012/02/05}{Revise extant suffix handling}
+% \changes{v0.9}{2012/02/10}{renamed macro; suffix handling is expandable}
+% \begin{macrocode}
+\newcommand*{\@nameauth@Root}[1]{%
+ \@nameauth@TrimRoot#1\relax%
+}
+% \end{macrocode}
+% \end{macro}
+% Anything starting with a comma and ending with the end of the name is stripped off. That includes ``Sr.,'' ``Jr.,'' ``III,'' and so on. An extra comma is included at the end of the parameter when |\@nameauth@Root| is called directly from \cmd{\Name} and friends so that the delimiter list will always be correct. By using the comma-checking routines below, however, one can call this macro only when the parameter takes the form <a,b> and properly select the root and suffix (see below).
+%
+% \begin{macro}{\@nameauth@TrimRoot}
% \changes{v0.85}{2012/02/05}{Divide suffix handling into functional parts}
+% \changes{v0.9}{2012/02/10}{Renamed macro; suffix handling is expandable}
% \begin{macrocode}
-\def\@nameauth@Root#1,#2*{#1}%
+\def\@nameauth@TrimRoot#1,#2\relax{#1}
% \end{macrocode}
% \end{macro}
-% Strips off the second parameter delimited by a comma and an asterisk.
-%
+% This delimited-parameter macro strips off the first parameter.
+%
% \begin{macro}{\@nameauth@Suffix}
-% \changes{v0.85}{2012/02/05}{Add suffix handling functionality}
-% \begin{macro}{\@nameauth@Truncate}
-% \changes{v0.85}{2012/02/05}{Add suffix handling functionality}
+% \changes{v0.85}{2012/02/05}{Revise extant suffix handling}
+% \changes{v0.9}{2012/02/10}{added macro}
% \begin{macrocode}
-\def\@nameauth@Suffix#1,#2*{\ifx#2\@empty\else\@nameauth@Truncate#2\fi}
-\def\@nameauth@Truncate#1,{#1}
+\newcommand*{\@nameauth@Suffix}[1]{%
+ \@nameauth@TrimSuffix#1\relax%
+}
% \end{macrocode}
% \end{macro}
+% Anything before a comma is stripped off by |\@nameauth@Suffix|, but it should be called only in a conditional governed by |@nameauth@Comma|. This macro calls its auxiliary macro below.
+%
+% \begin{macro}{\@nameauth@TrimSuffix}
+% \changes{v0.9}{2012/02/10}{added macro}
+% \begin{macrocode}
+\def\@nameauth@TrimSuffix#1,#2\relax{#2}
+% \end{macrocode}
% \end{macro}
-% Strips off the first parameter and cleans up any extra commas.
-%
-% \begin{macro}{\@nameauth@NoComma}
-% \changes{v0.85}{2012/02/05}{Add comma handling routine}
+% This delimited-parameter macro strips off the second parameter.
+%
+% \begin{macro}{\@nameauth@CheckComma}
+% \changes{v0.85}{2012/02/05}{Add suffix handling functionality}
+% \changes{v0.9}{2012/02/10}{Fix comma checking, now expandable}
% \begin{macrocode}
-\newcommand{\@nameauth@NoComma}[1]{%
- {\@nameauth@Root#1,*\@nameauth@Suffix#1,*}%
+\newcommand*{\@nameauth@CheckComma}[1]{%
+ \@nameauth@CheckSuffix#1,\relax%
}
% \end{macrocode}
% \end{macro}
-% This is the heart of the comma suppression feature. Since the presence of commas are necessary for the suffix mechanism to work, commas are stripped as close as possible to generating output either for the body text or for the index.
+% This macro checks for a comma-delimited suffix. It calls its auxiliary macro below.
%
-% \begin{macro}{\@nameauth@Zapsuffix}
-% \changes{v0.85}{2012/02/05}{Revise extant suffix handling}
+% \begin{macro}{\@nameauth@CheckSuffix}
+% \changes{v0.9}{2012/02/10}{Added macro; comma checking expandable}
% \begin{macrocode}
-\newcommand*{\@nameauth@Zapsuffix}[1]{%
- {\@nameauth@Root#1,*}%
+\def\@nameauth@CheckSuffix#1,#2\relax{%
+ \def\Test{#2}%
+ \ifx\Test\@empty\@nameauth@Commafalse\else\@nameauth@Commatrue\fi%
}
% \end{macrocode}
% \end{macro}
-% Anything starting with a comma and ending with the end of the name is stripped off. That includes ``Sr.,'' ``Jr.,'' ``III,'' and so on.\\
+% This macro checks for a comma-delimited suffix and sets the Boolean |@nameauth@Comma| accordingly.
%
-% \noindent The following macros implement the mechanism to prevent the double-printing of a period after ``Sr.,'' ``Jr.,'' and so on.
+% \begin{macro}{\@nameauth@NoComma}
+% \changes{v0.85}{2012/02/05}{Revise extant suffix handling}
+% \changes{v0.9}{2012/02/10}{Redesigned macro}
+% \begin{macrocode}
+\newcommand*{\@nameauth@NoComma}[1]{%
+ \@nameauth@Root{#1}\@nameauth@Suffix{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% This macro removes a comma from a name by breaking a <root, suffix> pair into a <root><suffix> pair. It preserves the leading space or lack thereof in the suffix.\bigskip\hrule\bigskip
+% The following macros implement the mechanism to prevent the double-printing of a period after ``Sr.,'' ``Jr.,'' and so on.
%
% \begin{macro}{\@nameauth@CheckDot}
% \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility}
@@ -720,7 +787,7 @@
\def\@nameauth@EvalDot{\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi}
% \end{macrocode}
% \end{macro}
-% \cmd{\@nameauth@EvalDot} checks of \cmd{\@token} is a period. If so it gobbles it by using \cmd{\expandafter} to get past the grouping. Another \cmd{\expandafter} occurs immediately before the invocation of \cmd{\@nameauth@CheckDot} in \cmd{\Name} and \cmd{\AKA}.
+% \cmd{\@nameauth@EvalDot} checks if \cmd{\@token} is a period. If so it gobbles it by using \cmd{\expandafter} to get past the grouping. Another \cmd{\expandafter} occurs immediately before the invocation of \cmd{\@nameauth@CheckDot} in \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA}.
%
% \begin{macro}{\@nameauth@TestDot}
% \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility}
@@ -733,149 +800,147 @@
}
% \end{macrocode}
% \end{macro}
-% While \cmd{\@nameauth@CheckDot} looks \emph{ahead} for a period, \cmd{\@nameauth@TestDot}---based on a snippet by \Name*[Uwe]{Lueck}---checks for a terminal period in the name passed to it, ignoring medial periods. It always resets the Boolean value before making its test, making it unnecessary to reset elsewhere.
-%
+% While \cmd{\@nameauth@CheckDot} looks \emph{ahead} for a period, \cmd{\@nameauth@TestDot}---based on a snippet by \Name*[Uwe]{Lueck}---checks for a terminal period in the name passed to it, ignoring medial periods. It always resets the Boolean value before making its test, making it unnecessary to reset elsewhere.\bigskip\hrule\bigskip
% \begin{macro}{\@nameauth@FmtName}
% \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility}
% \changes{v0.85}{2012/02/05}{Add comma suppression}
+% \changes{v0.9}{2012/02/10}{Redesigned macro}
% \begin{macrocode}
\DeclareDocumentCommand\@nameauth@FmtName{s m}%
{%
\@nameauth@TestDot{#2}%
- \if@nameauth@DoComma%
- \IfBooleanTF{#1}{#2}{\bgroup\NamesFormat{#2}\egroup}%
- \else
- \IfBooleanTF{#1}%
- {\@nameauth@NoComma{#2}}%
- {\bgroup\NamesFormat{\@nameauth@NoComma{#2}}\egroup}%
- \fi
+ \IfBooleanTF{#1}%
+ {#2}%
+ {\bgroup\NamesFormat{#2}\egroup}%
}
% \end{macrocode}
% \end{macro}
-% \cmd{\@nameauth@FmtName} is where the first occurrences of a name are formatted. Notice how \cmd{\NamesFormat} sits between a \cmd{\bgroup} and an \cmd{\egroup} to localize the font change. The \cmd{\NamesFormat} hook has been discussed above. Comma suppression occurs here in order for the period-checking routines to work. That means comma suppression operates on the whole name here, but only on the \emph{SNN} field for the index entries. This should not present a noticeable difference, since commas seldom if ever occur in forenames.
+% \cmd{\@nameauth@FmtName} is where the first occurrences of a name are formatted. Notice how \cmd{\NamesFormat} sits between a \cmd{\bgroup} and an \cmd{\egroup} to localize the font change. The \cmd{\NamesFormat} hook has been discussed above. The main reason for making this a separate macro was to offer a means of adding features in modular fashion.
%
% \subsection{User Interface Macros}
% \begin{macro}{\Name}
% \changes{v0.75}{2012/01/19}{Added ``sobriquet'' feature}
% \changes{v0.8}{2012/01/29}{Merged all major functionality here}
% \changes{v0.85}{2012/02/05}{Add comma suppression to indexing, ltxdoc compatibility}
-% \changes{v0.86}{2012/02/06}{Slight tweak using \cmd{\edef}}
+% \changes{v0.86}{2012/02/06}{Slight tweak}
+% \changes{v0.9}{2012/02/10}{Redesigned macro}
% \begin{macrocode}
\DeclareDocumentCommand\Name{s o m o}%
{%
- \if@nameauth@DoComma\edef\Surnames{#3}%
- \else\edef\Surnames{\@nameauth@NoComma{#3}}\fi%
+ \def\Surnames{#3}%
+ \if@nameauth@DoComma\else%
+ \@nameauth@CheckComma{#3}%
+ \if@nameauth@Comma%
+ \edef\Surnames{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}%
+ \fi%
+ \fi%
\IfValueTF{#2}%
{\IfValueTF{#4}{\edef\Forenames{#4}}{\edef\Forenames{#2}}%
\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname%
- \@nameauth@FmtName*{#2 #3}%
+ \expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
\PackageWarning{nameauth}%
- {You cannot create a page reference from the pen name: #2 #3.}%
+ {You cannot create a page reference from the xref: #2 #3.}%
\else%
\if@nameauth@DoFormat%
\ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{\Forenames{} #3}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #2}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames, #2}}%
\else%
\csgdef{\@nameauth@CleanName{#2#3!MN!}}{}%
- \@nameauth@FmtName{\Forenames{} #3}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi%
+ \expandafter\@nameauth@FmtName\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #2}%
\fi%
\else%
\ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{\Forenames{} #3}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #2}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames, #2}}%
\else%
\csgdef{\@nameauth@CleanName{#2#3!NF!}}{}%
- \@nameauth@FmtName*{\Forenames{} #3}%
- \if@nameauth@dtx\index{#3=\Surnames, #2}%
- \else\index{#3@\Surnames, #2}\fi%
+ \expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #2}%
\fi%
\fi%
\fi}%
{\IfValueTF{#4}
{\ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname%
- \@nameauth@FmtName*{#3 #4}%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#4}%
\PackageWarning{nameauth}%
- {You cannot create a page reference from the pen name: #3 #4.}%
+ {You cannot create a page reference from the xref: #3 #4.}%
\else%
\if@nameauth@DoFormat%
\ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{#3 #4}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#4}%
+ \index{\Surnames\space#4}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames\space#4}}%
\else%
\csgdef{\@nameauth@CleanName{#3#4!MN!}}{}%
- \@nameauth@FmtName{#3 #4}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi%
+ \expandafter\@nameauth@FmtName\expandafter{%
+ \Surnames\space#4}%
+ \index{\Surnames\space#4}%
\fi%
\else%
\ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{#3 #4}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#4}%
+ \index{\Surnames\space#4}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames\space#4}}%
\else%
\csgdef{\@nameauth@CleanName{#3#4!NF!}}{}%
- \@nameauth@FmtName*{#3 #4}%
- \if@nameauth@dtx\index{#3=\Surnames{} #4}%
- \else\index{#3@\Surnames{} #4}\fi%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#4}%
+ \index{\Surnames\space#4}%
\fi%
\fi%
\fi}%
{\ifcsname\@nameauth@CleanName{#3!PN!}\endcsname%
- \@nameauth@FmtName*{#3}%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
\PackageWarning{nameauth}%
- {You cannot create a page reference from the pen name: #3.}%
+ {You cannot create a page reference from the xref: #3.}%
\else%
\if@nameauth@DoFormat%
\ifcsname\@nameauth@CleanName{#3!MN!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{#3}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
+ \index{\Surnames}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames}}%
\else%
\csgdef{\@nameauth@CleanName{#3!MN!}}{}%
- \@nameauth@FmtName{#3}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi%
+ \expandafter\@nameauth@FmtName\expandafter{\Surnames}%
+ \index{\Surnames}%
\fi%
\else%
\ifcsname\@nameauth@CleanName{#3!NF!}\endcsname%
\IfBooleanTF{#1}%
- {\@nameauth@FmtName*{#3}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi}%
- {\@nameauth@FmtName*{\@nameauth@Zapsuffix{#3}}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
+ \index{\Surnames}}%
+ {\@nameauth@FmtName*{\@nameauth@Root{#3,}}%
+ \index{\Surnames}}%
\else%
\csgdef{\@nameauth@CleanName{#3!NF!}}{}%
- \@nameauth@FmtName*{#3}%
- \if@nameauth@dtx\index{#3=\Surnames}%
- \else\index{#3@\Surnames}\fi%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
+ \index{\Surnames}%
\fi%
\fi%
\fi}%
@@ -886,13 +951,11 @@
% \end{macro}
% \cmd{\Name} is the heart of this package. \Name*[Marc van]{Dongen} provided the basic structure.
%
-%The reason why one sees six bifurcate outcomes repeated three times for eighteen ``normal'' and eighteen ``special'' variations is because one must make different decisions based on the dynamic interaction of many factors beyond mere input. First, at every instance where output is generated via \cmd{\index} there is a check to determine if the ``normal'' character for index entry literals will be used or the ``special'' version will be used with the \textsf{ltxdoc} class.
-%
-% Regarding the many branches, one cannot assume that the name will terminate with a suffix like ``Jr.'' until a check has been run to determine if the suffix should be truncated. The main dynamic factors include: the Boolean and value parameters (there are eight valid patterns of input among them), the first or subsequent use, the front or main matter use, possible operations on suffixes, the formatting or non-formatting of output, and whether a pen name has been passed to the routine.
+%The reason why one sees seven outcomes repeated three times for twenty-one variations is because one must make different decisions based on the dynamic interaction of many factors beyond mere input. Three choices occur when one tries to use an ``alternate name'' defined by \cmd{\AKA} as an argument to \cmd{\Name}. The latter prints the arguments with comma suppression if appropriate, emits a warning, and exits. One cannot use \cmd{\ForgetName} to expunge a pen name. This is a deliberate decision to avoid corruption of the index cross-references.
%
-% Here is how these many factors interrelate:
+% Regarding the remaining eighteen branches, one cannot assume that the name will terminate with a suffix like ``Jr.'' until a check has been run to determine if the suffix should be truncated. The Boolean and value parameters offer eight valid patterns of input. The first or subsequent use are two more, as are front or main matter use. Operations on suffixes are governed by the first or subsequent use. The formatting or non-formatting of output is governed both by a formatting Boolean and by first/subsequent use. A final choice deals with handling alternate names in the \cmd{\Forenames} macro.
%
-% \cmd{\Name} first checks for comma suppression. if so it stores a comma-suppressed version of the third parameter in \cmd{\Surnames}. Otherwise it stores an unchanged version in \cmd{\Surnames}. This will be passed to \cmd{\index} as a literal.
+% Here is how these many factors interrelate: \cmd{\Name} first checks for comma suppression. if so it stores a comma-suppressed version of the third parameter in \cmd{\Surnames}. Otherwise it stores an unchanged version in \cmd{\Surnames}. This will be passed to \cmd{\index} and |\@nameauth@FmtName|.\\
%
%\noindent \cmd{\Name} then checks for the forenames argument. Two outcomes are possible.
% \begin{enumerate}
@@ -908,90 +971,214 @@
% \end{enumerate}
% \end{enumerate}
%
-% A check occurs for a control sequence based on the names given and the suffix \texttt{!PN!} (for pen name). This is how \cmd{\AKA} protects cross-references. If the control sequence exists, then \cmd{\Name} only prints the name given (but with comma suppression) and emits a warning. One cannot use \cmd{\ForgetName} to expunge a pen name. This is a deliberate decision to avoid corruption of the index cross-references.
-%
% The next branch involves the Boolean value \texttt{@nameauth@DoFormat}, which is controlled by \cmd{\NamesActive} and \cmd{\NamesInactive}. If formatting is active, choose the unstarred form of \cmd{\@nameauth@FmtName}, which applies the formatting hook. Otherwise use the starred form that applies no formatting.
%
% The state of \texttt{@nameauth@DoFormat} also controls the suffix used in the control sequences: \texttt{!MN!} for main name or \texttt{!NF!} for no format. This is the heart of the \texttt{frontmatter} / \texttt{mainmatter} mechanism.
%
-% Where longer and shorter versions of names are printed, there the star parameter controls those outcomes. Comma suppression is used or not, as apppropriate, in the index entries, requiring the use of the ``literal'' character @ in most cases to get the alphabetizing and the output to work properly. Note again that one must always use commas with suffixes in the input, even if commas are suppressed in the output. That is how the mechanism works.
+% Where longer and shorter versions of names are printed, there the star parameter controls those outcomes. Comma suppression is used or not, as appropriate, in the index entries. Note again that one must always use commas with suffixes in the input, even if commas are suppressed in the output.
%
% The use of \cmd{\expandafter} before \cmd{\@nameauth@CheckDot} works with the other use of \cmd{\expandafter} mentioned with \cmd{\@nameauth@EvalDot} above to move past the closing brace and fetch the period as lookahead. That is only done when the check for a terminal period in the name succeeds.
%
-% \begin{macro}{\PName}
-% \changes{v0.85}{2012/02/05}{Add comma suppression}
+% \begin{macro}{\FName}
+% \changes{v0.9}{2012/02/10}{Added macro}
% \begin{macrocode}
-\DeclareDocumentCommand\PName{s o m o m}%
+\DeclareDocumentCommand\FName{o m o}%
{%
- \IfBooleanTF{#1}{\Name*[#2]{#3}}{\Name[#2]{#3}}%
- {\space}(\AKA[#2]{#3}[#4]{#5})%
+ \def\Surnames{#2}%
+ \if@nameauth@DoComma\else%
+ \@nameauth@CheckComma{#2}%
+ \if@nameauth@Comma%
+ \edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}%
+ \fi%
+ \fi%
+ \IfValueTF{#1}%
+ {\IfValueTF{#3}{\edef\Forenames{#3}}{\edef\Forenames{#1}}%
+ \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Forenames}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the xref: #1 #2.}%
+ \else%
+ \if@nameauth@DoFormat%
+ \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Forenames}%
+ \index{\Surnames, #1}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #1}%
+ \fi%
+ \else%
+ \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Forenames}%
+ \index{\Surnames, #1}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \Forenames\expandafter\space\Surnames}%
+ \index{\Surnames, #1}%
+ \fi%
+ \fi%
+ \fi}%
+ {\IfValueTF{#3}
+ {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#3}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the xref: #2 #3.}%
+ \else%
+ \if@nameauth@DoFormat%
+ \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname%
+ \@nameauth@FmtName*{\@nameauth@Root{#2,}}%
+ \index{\Surnames\space#3}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter{\Surnames\space#3}%
+ \index{\Surnames\space#3}%
+ \fi%
+ \else%
+ \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname%
+ \@nameauth@FmtName*{\@nameauth@Root{#2,}}%
+ \index{\Surnames\space#3}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames\space#3}%
+ \index{\Surnames\space#3}%
+ \fi%
+ \fi%
+ \fi}%
+ {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the xref: #2.}%
+ \else%
+ \if@nameauth@DoFormat%
+ \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname%
+ \@nameauth@FmtName*{\@nameauth@Root{#2,}}%
+ \index{\Surnames}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#2!MN!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter{\Surnames}%
+ \index{\Surnames}%
+ \fi%
+ \else%
+ \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname%
+ \@nameauth@FmtName*{\@nameauth@Root{#2,}}%
+ \index{\Surnames}%
+ \else%
+ \csgdef{\@nameauth@CleanName{#2!NF!}}{}%
+ \expandafter\@nameauth@FmtName\expandafter*%
+ \expandafter{\Surnames}%
+ \index{\Surnames}%
+ \fi%
+ \fi%
+ \fi}%
+ }%
+ \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi%
}
% \end{macrocode}
% \end{macro}
-% \cmd{\PName} is a convenience macro whose starred and unstarred forms call the respective versions of \cmd{\Name}, then \cmd{\AKA}. It prevents both the ``sobriquet'' feature and the alternate forenames feature, as mentioned above. It is only compatible with similar usage via \cmd{\Name} relying on the ambiguous default behavior of suffixes, the suffix suppression routines, and comma suppression.
+% \cmd{\FName} is entirely derived from \cmd{\Name}, but scaled back to print forename(s) in a subsequent use. It obeys the \texttt{nocomma} behavior and eliminates double periods.
%
% \begin{macro}{\AKA}
% \changes{v0.85}{2012/02/05}{Add comma suppression, ltxdoc compatibility}
% \changes{v0.86}{2012/02/06}{Fixed some regressions}
+% \changes{v0.9}{2012/02/10}{Added starred mode; redesigned}
% \begin{macrocode}
-\DeclareDocumentCommand\AKA{o m o m}%
+\DeclareDocumentCommand\AKA{s o m o m o}%
{%
- \if@nameauth@DoComma%
- \edef\Surnamesi{#2}\edef\Surnamesii{#4}%
- \else\edef\Surnamesi{\@nameauth@NoComma{#2}}%
- \edef\Surnamesii{\@nameauth@NoComma{#4}}%
+ \def\Surnamesi{#3}%
+ \def\Surnamesii{#5}%
+ \if@nameauth@DoComma\else%
+ \@nameauth@CheckComma{#3}%
+ \if@nameauth@Comma%
+ \edef\Surnamesi{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}%
+ \fi%
+ \@nameauth@CheckComma{#5}%
+ \if@nameauth@Comma%
+ \edef\Surnamesii{\@nameauth@Root{#5}\@nameauth@Suffix{#5}}%
+ \fi%
\fi%
- \IfValueTF{#3}%
- {\@nameauth@FmtName*{#3 #4}%
- \ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname\relax\else%
- \csgdef{\@nameauth@CleanName{#3#4!PN!}}{}%
- \IfValueTF{#1}%
- {\if@nameauth@dtx\index{#4=\Surnamesii, #3|see{\Surnamesi, #1}}%
- \else\index{#4@\Surnamesii, #3|see{\Surnamesi, #1}}\fi}%
- {\if@nameauth@dtx\index{#4=\Surnamesii, #3|see{\Surnamesi}}%
- \else\index{#4@\Surnamesii, #3|see{\Surnamesi}}\fi}%
+ \IfValueTF{#4}%
+ {\IfValueTF{#6}{\edef\Forenames{#6}}{\edef\Forenames{#4}}%
+ \expandafter\@nameauth@FmtName\expandafter*\expandafter{%
+ \expandafter\Forenames\expandafter\space\Surnamesii}%
+ \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname\relax\else%
+ \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}%
+ \IfValueTF{#2}%
+ {\index{\Surnamesii, #4|see{\Surnamesi, #2}}}%
+ {\index{\Surnamesii, #4|see{\Surnamesi}}}%
\fi}%
- {\@nameauth@FmtName*{#4}%
- \ifcsname\@nameauth@CleanName{#4!PN!}\endcsname\relax\else%
- \csgdef{\@nameauth@CleanName{#4!PN!}}{}%
- \IfValueTF{#1}%
- {\if@nameauth@dtx\index{#4=\Surnamesii|see{\Surnamesi, #1}}%
- \else\index{#4@\Surnamesii|see{\Surnamesi, #1}}\fi}%
- {\if@nameauth@dtx\index{#4=\Surnamesii|see{\Surnamesi}}%
- \else\index{#4@\Surnamesii|see{\Surnamesi}}\fi}%
+ {\IfValueTF{#6}%
+ {\IfBooleanTF{#1}%
+ {\@nameauth@FmtName*{#6}}%
+ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii #6}}%
+ \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname\relax\else%
+ \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}%
+ \IfValueTF{#2}%
+ {\index{\Surnamesii\space#6|see{\Surnamesi, #2}}}%
+ {\index{\Surnamesii\space#6|see{\Surnamesi}}}%
\fi}%
+ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}%
+ \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname\relax\else%
+ \csgdef{\@nameauth@CleanName{#5!PN!}}{}%
+ \IfValueTF{#2}%
+ {\index{\Surnamesii|see{\Surnamesi, #2}}}%
+ {\index{\Surnamesii|see{\Surnamesi}}}%
+ \fi}%
+ }%
\if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi%
}
% \end{macrocode}
% \end{macro}
-% \cmd{\AKA} prints a pseudonym and creates index cross-references. It also checks to see of cross-references already have been generated, and if so, it does not do it again. Like \cmd{\Name} it checks for a terminal period, but only for the alternate name.
+% \cmd{\AKA} prints a pseudonym and creates index cross-references. Its starred form suppresses the ``main'' pseudonym if a sobriquet is passed in the alternate name parameter. It prevents multiple generation of cross-references. Like \cmd{\Name} it suppresses double periods. Its choices reflect the different choices of index references, based on the arguments it receives..
+%
+% \begin{macro}{\PName}
+% \changes{v0.85}{2012/02/05}{Add comma suppression}
+% \begin{macrocode}
+\DeclareDocumentCommand\PName{s o m o m o}%
+{%
+ \IfBooleanTF{#1}{\Name*[#2]{#3}}{\Name[#2]{#3}}%
+ {\space}(\AKA[#2]{#3}[#4]{#5}[#6])%
+}
+% \end{macrocode}
+% \end{macro}
+% \cmd{\PName} is a convenience macro whose starred and unstarred forms call the respective versions of \cmd{\Name}, followed only by \cmd{\AKA}.
%
% \begin{macro}{\IndexName}
% \changes{v0.75}{2012/01/19}{Optional parameter added; mandatory parameter deleted}
% \changes{v0.85}{2012/02/05}{Add comma suppression, ltxdoc compatibility}
% \changes{v0.86}{2012/02/06}{Slight tweak using \cmd{\edef}}
+% \changes{v0.9}{2012/02/10}{redesigned macro}
% \begin{macrocode}
\DeclareDocumentCommand\IndexName{o m o}%
{%
- \if@nameauth@DoComma\edef\Surnames{#2}%
- \else\edef\Surnames{\@nameauth@NoComma{#2}}\fi%
+ \def\Surnames{#2}%
+ \if@nameauth@DoComma\else%
+ \@nameauth@CheckComma{#2}%
+ \if@nameauth@Comma%
+ \edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}%
+ \fi%
+ \fi%
\IfValueTF{#1}%
{\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname%
\else%
- \if@nameauth@dtx\index{#2=\Surnames, #1}%
- \else\index{#2@\Surnames, #1}\fi%
- \fi}%
+ \index{\Surnames, #1}%
+ \fi}%
{\IfValueTF{#3}
{\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname%
\else%
- \if@nameauth@dtx\index{#2=\Surnames{} #3}%
- \else\index{#2@\Surnames{} #3}\fi%
- \fi}%
+ \index{\Surnames\space#3}%
+ \fi}%
{\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname%
\else%
- \if@nameauth@dtx\index{#2=\Surnames}%
- \else\index{#2@\Surnames}\fi%
- \fi}
+ \index{\Surnames}%
+ \fi}%
}%
}
% \end{macrocode}
@@ -1015,7 +1202,26 @@
}
% \end{macrocode}
% \end{macro}
-% \cmd{\ForgetName} undefines control sequences to trigger the ``first use'' option of \cmd{\Name}.
+% \cmd{\ForgetName} undefines control sequences to force the ``first use'' option of \cmd{\Name}.
+%
+% \begin{macro}{\SubvertName}
+% \changes{v0.9}{2012/02/10}{Added macro}
+% \begin{macrocode}
+\DeclareDocumentCommand\SubvertName{o m o}%
+{%
+ \IfValueTF{#1}%
+ {\csgdef{\@nameauth@CleanName{#1#2!MN!}}%
+ \csgdef{\@nameauth@CleanName{#1#2!NF!}}}%
+ {\IfValueTF{#3}%
+ {\csgdef{\@nameauth@CleanName{#2#3!MN!}}%
+ \csgdef{\@nameauth@CleanName{#2#3!NF!}}}%
+ {\csgdef{\@nameauth@CleanName{#2!MN!}}%
+ \csgdef{\@nameauth@CleanName{#2!NF!}}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \cmd{\SubvertName} defines control sequences to suppress the ``first use'' of \cmd{\Name}.
%
% \begin{macro}{\NamesInactive}
% \begin{macrocode}
@@ -1023,11 +1229,14 @@
% \end{macrocode}
% \end{macro}
% This macro deactivates formatting, even as its counterpart below activates it.
+%
% \begin{macro}{\NamesActive}
% \begin{macrocode}
\newcommand{\NamesActive}{\@nameauth@DoFormattrue}
% \end{macrocode}
% \end{macro}
+% This macro is called automatically with the \texttt{mainmatter} option.
+%
% \clearpage
% \Finale
\endinput