diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-27 22:51:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-27 22:51:54 +0000 |
commit | 68c07ff546c308bdb369d4bffb5c65837041d613 (patch) | |
tree | de7a2d172eb2622d654f37a8f786e6d798902de2 /Master | |
parent | 1f9093ef56c8de2c74750cff37bd292e2cbacff3 (diff) |
nameauth (27jul12)
git-svn-id: svn://tug.org/texlive/trunk@27203 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/Makefile | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/README | 32 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/nameauth.pdf | bin | 635738 -> 636770 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/nameauth/nameauth.dtx | 1770 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 898 |
5 files changed, 1436 insertions, 1291 deletions
diff --git a/Master/texmf-dist/doc/latex/nameauth/Makefile b/Master/texmf-dist/doc/latex/nameauth/Makefile index 71694f7a7d3..f5c6c35da7e 100644 --- a/Master/texmf-dist/doc/latex/nameauth/Makefile +++ b/Master/texmf-dist/doc/latex/nameauth/Makefile @@ -1,15 +1,11 @@ engine ?= pdflatex # Override on the command line # with engine=latex - # or with engine=lualatex - # or with engine=xelatex. + # or with engine=xelatex + # or with engine=lualatex. + # If with lualatex, then use the fullpdf target. -# The pdf target is the normal one. It omits the code listing. -pdf : sty - $(engine) -draftmode "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" - makeindex -s gglo.ist -o nameauth.gls nameauth.glo - makeindex -s gind.ist -o nameauth.ind nameauth.idx - $(engine) "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" - $(engine) "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" +# The default builds the distribution uploaded to CTAN. +dist: pdf clean # Making this target includes the code listing fullpdf : sty @@ -19,9 +15,19 @@ fullpdf : sty $(engine) nameauth.dtx $(engine) nameauth.dtx +# This target omits the code listing. +pdf : sty + $(engine) -draftmode "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" + makeindex -s gglo.ist -o nameauth.gls nameauth.glo + makeindex -s gind.ist -o nameauth.ind nameauth.idx + $(engine) "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" + $(engine) "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" + +# Build the package. sty : nameauth.dtx nameauth.ins $(engine) nameauth.ins +# Instead of using the shell to see if files exist, take advantage of rm. clean : rm -f nameauth.aux rm -f nameauth.glo @@ -34,12 +40,13 @@ clean : rm -f nameauth.toc rm -f nameauth.hd rm -f nameauth.top + rm -f texput.* +# Remove all but the barest source files. clobber : clean rm -f nameauth.dvi rm -f nameauth.pdf rm -f nameauth.sty touch nameauth.* -dist: pdf clean diff --git a/Master/texmf-dist/doc/latex/nameauth/README b/Master/texmf-dist/doc/latex/nameauth/README index 2ccdbb59aec..444b3c0f9c7 100644 --- a/Master/texmf-dist/doc/latex/nameauth/README +++ b/Master/texmf-dist/doc/latex/nameauth/README @@ -1,15 +1,15 @@ The nameauth package Charles P. Schaum charles dot schaum at att dot net -v1.26 from 2012/04/24 +v1.4 from 2012/07/24 Abstract -Using the nameauth package, an author can encode names according to a -name authority. Index entries are consistent with input parameters. In-text -formatting of names is predictable and automated, making it easier to go -from drafts to a final manuscript. This package mainly supports Western -names, with basic features for ancient, royal, and Eastern names. +The nameauth package automates the formatting and indexing of names, +facilitating the implementation of a name authority. This allows one to +move blocks of text without retyping names, making it easier to go from +drafts to a final manuscript. This package mainly supports Western names, +with basic features for ancient, royal, and Eastern names. Files Target distribution @@ -39,24 +39,32 @@ Source distribution notes: One can use the following commands to generate the target distribution: -Generate the style file with: +Generate the style file with any form of LaTeX: $ pdflatex nameauth.ins -Generate the documentation with: +Generate the documentation (optimal with pdflatex): $ pdflatex nameauth.dtx -draftmode "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" $ makeindex -s gglo.ist -o nameauth.gls nameauth.glo $ makeindex -s gind.ist -o nameauth.ind nameauth.idx $ pdflatex nameauth.dtx "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" $ pdflatex nameauth.dtx "\AtBeginDocument{\OnlyDescription} \input nameauth.dtx" -I used GNU make to automate the process: - $ make dist +I used GNU make to automate the process, As of v.1.4, the following apply: + + Create the distribution. Works with latex, pdflatex, and xelatex: + + $ make + + Create the full pdf. Works with all of the above plus lualatex. + (Lualatex handles -draftmode in an incompatible manner.) + + $ make fullpdf Testing notes: -This packages works with the commands latex, lualatex, pdflatex, and xelatex. It has created inxexes successfully with makeindex and texindy. +This packages works with the commands latex, lualatex, pdflatex, and xelatex. It can be used with makeindex and texindy (but I have not done so for building the package itself). -For testing purposes, I modified the make file so that one can change the typesetting engine on the command line. The way that the make file is designed, the pdf target really depends on just they .sty file being made, so it can generate .dvi files just as easily. The default behavior (shown above) builds with pdflatex. That is the preferred method for creating the package. +For testing purposes, the make file permits one to change the typesetting engine on the command line. The default is to build the package with pdflatex. See Makefile for more details. License diff --git a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf Binary files differindex 4797757d820..7d69bda5105 100644 --- a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf +++ b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf diff --git a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx index 3a4063e441a..0e0c371abcc 100644 --- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx +++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx @@ -1,12 +1,11 @@ % \iffalse meta-comment % -% Copyright (C) 2011 by Charles P. Schaum <charles dot schaum at att dot net> -% --------------------------------------------------------------------------- +% Copyright (C) 2011 by Charles P. Schaum <charles dot schaum at att dot net> --------------------------------------------------------------------------- % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in -% http://www.latex-project.org/lppl.txt +% http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % @@ -26,7 +25,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] %<package>\ProvidesPackage{nameauth} %<*package> - [2012/04/24 v1.26 name authority macros to aid consistent display and indexing of names] + [2012/07/24 v1.4 name authority macros to aid consistent display and indexing of names] %</package> % %<*driver> @@ -58,7 +57,7 @@ \usepackage{makeidx} \usepackage{multicol} \usepackage[toc]{multitoc} -\usepackage{nameauth}[2012/04/24] +\usepackage{nameauth}[2012/07/24] \usepackage{hypdoc} \makeindex \frenchspacing @@ -73,7 +72,7 @@ %</driver> % \fi % -% \CheckSum{1180} +% \CheckSum{1206} % % \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 @@ -108,10 +107,20 @@ % \changes{v1.22}{2012/04/20}{Attempted first-use particle caps} % \changes{v1.24}{2012/04/21}{Reverted functionality and suggested \cmd{\CapThis} workaround} % \changes{v1.26}{2012/04/24}{Fixed sorting of name suffixes in index} +% \changes{v1.4}{2012/07/24}{Fixed issues moving argument problems, added several features} % -% \DoNotIndex{\@empty, \@gobble, \@period, \@token, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@Punct, \if@nameauth@DoIndex, \if@nameauth@Comma, \if@nameauth@DoCaps, \protected@edef, \zap@space, \bfseries, \bgroup, \csgdef, \csundef, \DeclareDocumentCommand, \DeclareOption, \def, \detokenize, \edef, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \expandafter, \fi, \Forenames, \futurelet \if, \IfBooleanTF, \ifcsname,\IfValueTF, \ifx, \index, \itshape, \let, \newcommand, \newenvironment, \newif, \PackageWarning, \ProcessOptions, \relax, \renewcommand, \RequirePackage, \scshape, \space, \Shortnames, \Surnames, \Surnamesi, \Surnamesii, \Test, \TestDot, \TestEnd, \TestPunct, \TestStop, \uppercase} +% \DoNotIndex{\@empty, \@gobble, \@period, \@token, \protected@edef, \zap@space, \bfseries, \bgroup, \csgdef, \csname, \csundef, \DeclareOption, \def, \detokenize, \edef, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \expandafter, \fi, \Forenames, \futurelet, \hbox, \if, \ifcsname, \ifx, \ignorespaces, \index, \itshape, \leavevmode, \let, \newcommand, \newcommandx, \newenvironment, \newif, \PackageWarning, \ProcessOptions, \relax, \renewcommand, \RequirePackage, \scshape, \space, \textbackslash, \uppercase, \WithSuffix} % -% \TagName{Louis}[the Pious]{, emperor}\TagName{Ptolemy I}[Soter]{, king}\TagName{Henry}[VIII]{, English king}\TagName{Charles}[the Bald]{, emperor}\TagName{Francis, I}{, French king}\TagName{Demetrius, I Soter}{, king}\TagName{Charles, V}{, emperor}\TagName{Louis, XIV}{, French king}% +% \TagName{Louis}[the Pious]{, emperor}% +% \TagName{Ptolemy I}[Soter]{, king}% +% \TagName{Henry}[VIII]{, English king}% +% \TagName{Charles}[the Bald]{, emperor}% +% \TagName{Francis, I}{, French king}% +% \TagName{Demetrius, I Soter}{, king}% +% \TagName{Charles, V}{, emperor}% +% \TagName{Louis, XIV}{, French king}% +% \TagName{Leo, I}{, pope} +% \TagName{Gregory, I}{, pope} % % \GetFileInfo{nameauth.dtx} % \title{The \textsf{nameauth} package} @@ -120,7 +129,7 @@ % \maketitle % % \begin{abstract} -% \noindent Using the \textsf{nameauth} package, an author can encode names according to a name authority. Index entries are consistent with input parameters. In-text formatting of names is predictable and automated, making it easier to go from drafts to a final manuscript. This package mainly supports Western names, with basic features for ancient, royal, and Eastern names. +% \noindent The \textsf{nameauth} package automates the formatting and indexing of names, facilitating the implementation of a \textbf{name authority}. This allows one to move blocks of text without retyping names, making it easier to go from drafts to a final manuscript. This package mainly supports Western names, with basic features for ancient, royal, and Eastern names. % \end{abstract} % % \tableofcontents @@ -128,208 +137,134 @@ % % \section{Introduction} % -% Suppose you were working on a collection of essays. Different publishers' permissions may force you to accept variance in the spelling of people's names. You would track and index those names using a name authority. Your index might use abbreviated name forms. This package allows the author to encode names so that the time and cost of an editor and proofreader can be minimized. This could make an author more desirable for publication. Features include: +% Book-length studies can engage more than 500 different names. Editors and proofreaders cost money when checking those names. This package provides basic tools for consistently and automatically formatting names for the body text and the index. The goal is to reduce error, streamline work, and become a more cost-effective author. Features include: % \begin{multicols}{2} % \begin{itemize}\setlength\itemsep{0pt}\small -% \item Simultaneous printing and indexing of names with fuller, typographically distinct first references. -% \item Printing alternate forenames, yet indexing a canonical form. -% \item Basic handling of variant names. -% \item Basic formatting and indexing tasks. -% \item Automatic addition of tags to names in indexes. +% \item Format, print, and index names all at once. +% \item Automatically print a full name the first time it appears, with full or shorter forms thereafter. +% \item Automatically apply typesetting to names, recalling German \emph{Sperr\-druck}. +% \item Rearrange text without retyping. +% \item Allow predictable name variants in the text, yet index consistent name forms. +% \item ``Tag'' and ``untag'' names in the index in order to index different people with the same name. +% \item Macros can be used in the body text, in a \cmd{\marginpar}, in tabular material, and in list environments like \texttt{enumerate}, among others. % \end{itemize} % \end{multicols} % -% \subsection{Typesetting, Indexing, and Design} +% \subsection{Design Notes and Thanks} % -% This package depends on \textsf{etoolbox} and \textsf{xparse.} It has been tested with \textsf{latex}, \textsf{lualatex}, \textsf{pdflatex} and \textsf{xelatex}, as well as \textsf{makeindex} and \textsf{texindy}. This file was typeset with \ifxetex\textsf{xelatex}\else\ifluatex\ifpdf\textsf{lualatex} in \texttt{pdf} mode\else\textsf{lualatex} in \texttt{dvi} mode\fi\else\ifpdf\textsf{pdflatex}\else\textsf{latex}\fi\fi\fi{} and \textsf{makeindex}. The default options and design of this package try to minimize keystrokes or trade extra work for benefits in formatting and consistency. The \texttt{.dtx} file is also a good source of information. +% This package depends on \textsf{etoolbox}, \textsf{suffix}, and \textsf{xargs}. As of version 1.4 it has been refactored extensively with robustness and modularity in mind. It has been tested with \textsf{latex}, \textsf{lualatex}, \textsf{pdflatex} and \textsf{xelatex}. It will work with \textsf{makeindex} and \textsf{texindy}. This document was typeset with \ifxetex\textsf{xelatex}\else\ifluatex\ifpdf\textsf{lualatex} in \texttt{pdf} mode\else\textsf{lualatex} in \texttt{dvi} mode\fi\else\ifpdf\textsf{pdflatex}\else\textsf{latex}\fi\fi\fi{} and \textsf{makeindex}. % -% \subsection{Thanks} -% -% Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, \Name[Uwe]{Lueck}, and \Name[Robert]{Schlicht} for their 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 and the sagacious advice of \FName[Robert]{Schlicht} 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}, \Name[Uwe]{Lueck}, and \Name[Robert]{Schlicht} for their assistance. The light of their knowledge banished the umbra of my ignorance. % % \subsection{Disclaimer} -% This documentation uses names of historical figures. Users will refer to real-world figures in their projects. At no time in this document am I intending either to promote, disparage, or make any assertions about any persons living or dead. All names mentioned herein deserve respect for the impact and legacy of their bearers. +% This documentation uses names of historical figures because users refer to real people in their projects. At no time in this document am I intending either to promote, disparage, or make any assertions about any persons living or dead. All names mentioned herein deserve respect for the impact and legacy of their bearers. +% \subsection{Caveat} +% Throughout this manual I play a ``dirty trick'' that makes a name print as if it had not yet occurred. In some cases I make a first occurrence print as if the name already had 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. % \clearpage % % \section{Usage} % % \subsection{Package Options} -% The defaults are \texttt{mainmatter}, \texttt{smallcaps}, \texttt{nocomma}, and \texttt{index}. With these options, the package begins immediately to format the first occurrences of names with small caps using a longer version of the name if one exists. It suppresses commas between surnames and suffixes and it indexes all names in place. The following class options alter this behavior.\\ -% -% \begin{quote}\small -% \begin{tabular}{lp{3in}} -% \texttt{mainmatter} & Use special typesetting for the first occurrence of a name, starting at the beginning of a document.\\[1ex] -% \texttt{frontmatter} & Suppress the special typesetting \emph{before} the invocation of \cmd{\NamesActive}. This option fits well, e.g., with front matter from a contributor who may not intend the same formatting and emphasis found in the main matter. The ``first use'' mechanism used with this option works independently of the ``first use'' mechanism after the invocation of \cmd{\NamesActive}. Indexing and aliasing features remain consistent. See also Section \ref{sec:SectionFormat}.\\[0.25ex]\hline -% {\large\strut}\texttt{smallcaps} & Set the first use of a name in small caps.\\[1ex] +% The defaults are \texttt{mainmatter}, \texttt{smallcaps}, \texttt{nocomma}, and \texttt{index}. The package begins immediately to format the first occurrences of names with small caps, suppressing commas between surnames and suffixes, and indexing all names in place. The following package options alter this behavior.\\ +% +% \begin{tabular}{lp{3.25in}} +% & {\large\bfseries Enable/Disable Formatting}\\[0.5ex] +% \texttt{mainmatter} & Enable formatting attributes (see below), starting at the beginning of a document.\\[1ex] +% \texttt{frontmatter} & Disable formatting \emph{before} the invocation of \cmd{\NamesActive} while retaining automatic full and short forms. This option fits well, e.g., with a foreword from a contributor. See Section \ref{sec:SectionFormat}.\\[1ex] +% & {\large\bfseries Show/Hide Suffix Commas}\\[0.5ex] +% \texttt{nocomma} & Suppress commas between surnames and suffixes, following modern styles like \emph{Chicago Manual of Style}. Commas can be forced on a per-use basis with \cmd{\ShowComma}. See Section \ref{sec:suffix}.\\[1ex] +% \texttt{comma} & Retain commas between all surnames and suffixes. This imposes limits on the use of certain macros.\\[1ex] +% & {\large\bfseries Enable/Disable Indexing}\\[0.5ex] +% \texttt{index} & Create index entries in place with the names.\\[1ex] +% \texttt{noindex} & Prevent indexing before the invocation of the macro \cmd{\IndexActive}. See Section \ref{sec:SectionIndex}.\\[1ex] +% & {\large\bfseries Formatting Attributes}\\[0.5ex] +% \texttt{alwaysformat} & Disabled by default, this option can be used together with the options below. With the \texttt{mainmatter} option or after \cmd{\NamesActive}, always apply one of the predefined formatting options below or custom formatting (Section \ref{sec:formatting}). This is quite similar to using \emph{Sperr\-druck} in German to call out names.\\[1ex] +% \texttt{smallcaps} & Set the first use of a name in small caps.\\[1ex] % \texttt{italic} & Italicize the first occurrence of a name.\\[1ex] % \texttt{boldface} & Set the first use of a name in boldface.\\[1ex] -% \texttt{noformat} & This option suppresses name formatting \emph{after} the invocation of \cmd{\NamesActive}. It does not prevent formatting like the \texttt{frontmatter} option. Additional formatting options are discussed in Section \ref{sec:formatting}, which works differently than the methods in Section \ref{sec:SectionFormat}.\\[0.25ex]\hline -% {\large\strut}\texttt{nocomma} & Suppress commas between surnames and suffixes, following modern styles like \emph{Chicago Manual of Style}. See also Section \ref{sec:suffix}.\\[1ex] -% \texttt{comma} & Retain commas between surnames and suffixes. This imposes limits on the use of certain macros.\\[0.25ex]\hline -% {\large\strut}\texttt{index} & Create index entries in place with the names.\\[1ex] -% \texttt{noindex} & Prevent indexing before the invocation of the macro \cmd{\IndexActive}. See also Section \ref{sec:SectionIndex}.\\ +% \texttt{noformat} & This formatting option creates no special formatting, but it does not alter the formatting mechanism like the \texttt{frontmatter} option.\\ % \end{tabular} -% \end{quote} % \clearpage % % \subsection{Quick Start Guide} +% \label{sec:start} % -% This gets one using about 60\% of the package features right away. +% This general section gets one using about 60\% of the package features right away. The seven basic patterns for names are:\\ % -% \label{sec:start} +% \begin{small} +% \begin{tabular}{ll} +% \normalsize Pattern&\normalsize Restrictions\\ +% \cmd{\Name}\oarg{Forenames}\marg{Surnames}\dotfill\hbox{}&\emph{none}\\ +% \cmd{\Name}\oarg{Forenames}\marg{Surnames, Suffix}\dotfill\hbox{}&\texttt{comma}, \texttt{nocomma}\\ +% \cmd{\Name}\oarg{Forenames}\marg{Surnames}\oarg{Nicknames}\dotfill\hbox{}&\emph{none}\\ +% \cmd{\Name}\oarg{Forenames}\marg{Surnames, Suffix}\oarg{Nicknames}&\texttt{comma}, \texttt{nocomma}\\ +% \cmd{\Name}\marg{Mononym}\dotfill\hbox{}&\emph{none}\\ +% \cmd{\Name}\marg{Mononym, Suffix or Sobriquet}\dotfill\hbox{}&\texttt{comma}, \texttt{nocomma}\\ +% \cmd{\Name}\oarg{Mononym}\oarg{Sobriquet}\dotfill\hbox{}&\cmd{\AKA} and \cmd{\PName}\\ +% \end{tabular} +% \end{small}\\[2ex] +% The comma and nocomma options affect the appearance of names. That is especially true for the last two forms above. These patterns apply to all macros that accept a name form, with some restrictions. +% +% \subsubsection{Hints for Easier Usage} +% \begin{tabular}{lp{4in}} +% Q:&There is too much space between the initials in the names.\\[0.5ex] +% A:&Bringhurst's \emph{Elements of Typographic Style} discourages full spaces between initials, calling for no spaces or thin spaces. Using \cmd{\frenchspacing} greatly simplifies related issues and it conforms with Bringhurst's guidelines.\\[1ex] +% Q:&I see two index entries that are exactly the same!\\[0.5ex] +% A:&As of version 1.4, the effect of spurious spaces in the printed names is negligible, but those spaces cause duplicate index entries. If you follow those entries to their pages, chances are that you will be able to track down the offending errors in short order.\\[1ex] +% Q:&OK, you threw a bazillion macros at me, I used them all, and now I am Googling your personal info because I'm on a deadline and you will soon have a date with a Cyberman.\\[0.5ex] +% A:&Hop in your TARDIS and leave a sticky note to yourself in the past to start just with \cmd{\Name} and spend a few pages breaking it in. See what happens in the index too. Use the other macros only when you need a function that the current ones are not fulfilling.\\[1ex] +% Q:&|\Name[Davey]{Jones}[a Monkee]| shows ``a Monkee Jones.''\\[0.5ex] +% A:&\cmd{\Name}\oarg{Forenames}\marg{Surnames}\oarg{Nickname} creates a nickname, not a sobriquet.\\[1ex] +% Q:&I see ``Paragraph ended\dots'' or ``Missing \meta{grouping token} inserted'' and execution stops.\\[0.5ex] +% A:&Check if the |{|braces|}| and |[|brackets|]| are balanced.\\[1ex] +% \end{tabular} % -% \subsubsection{Rules of Thumb} -% \begin{multicols}{2}\small -% \begin{itemize}\setlength\itemsep{0pt} -% \item Use \cmd{\frenchspacing}. -% \item The indexed forms of the names remain the same if you follow the macro input charts consistently. -% \item Examine index entries to find and correct mistakes. -% \item Trade work for consistency. -% \item Use just the macros you \emph{need}. -% \end{itemize} -% \end{multicols} +% \begin{tabular}{lp{4in}} +% Q:&|\Name[Henry]{VII}[Tudor]| prints either ``Tudor VII'' or ``VII''; |\FName[Henry]{VII}[Tudor]| prints either ``Tudor VII'' or ``Tudor.'' May I hurt you now?\\[0.5ex] +% A:&The pattern \cmd{\Name}\oarg{King}\marg{Suffix} fails because even though authorities like Mulvany, \emph{Indexing Books} talk about optional surnames, it is far easier to encode royal names and mononyms as if they were surnames. Use either |\Name{Henry, VII}| with the \texttt{nocomma} option or |\Name{Henry}[VII]| with the \texttt{comma} option. Indicate that he was of House Tudor manually in the text and consider using something like |\TagName{Henry, VII}{ (Tudor)}| to indicate his house as part of the index entry.\\[1ex] +% Q:&|\Name{Aethelred, the really}[Unreadig]| shows ``Aethelred the really Unreadig.''\\[0.5ex] +% A:&Its index entry is messed up too. The form \cmd{\Name}\marg{Mononym, Suffix}\oarg{Sobriquet} creates two sobriquets, but badly. This is because the sobriquet feature of the final argument is best used with the \texttt{comma} option while the suffixed form is best used with the \texttt{nocomma} option. Mix them at your peril or at your whimsy.\\[1ex] +% Q:&I tried |\AKA{Boris}[the Animal]{Just Boris}| and that went about as well as getting my head used as a bowling ball.\\[0.5ex] +% A:&You cannot use \cmd{\AKA}\marg{Mononym}\oarg{Sobriquet}\dots\ because that would call for a macro with an ambiguous argument list that forces adding extra explicit arguments to work properly. Then you have to remember if you did or did not\,---\,or should or should not\,---\,add the explicit macro, and by that time the point of diminishing returns would have passed for both the package author and the package users. Sorry, but the manual solution is better. That also applies to the pattern \cmd{\AKA}\oarg{Forenames}\marg{Surnames}\oarg{Nicknames}\dots\ and the use of \cmd{\PName}.\\[1ex] +% Q:&So how do I deal with some stage names and the like?\\[0.5ex] +% A:&Use a forename or first initials to prevent failure:\\[0.5ex] +% &OK: |\Name[J.]{Kreskin}[The Amazing]|\\&\qquad|\AKA[J.]{Kreskin}[Joseph]{Kresge}|\\[0.5ex] +% &FAIL: |\Name{Kreskin}[The Amazing]|\\&\qquad|\AKA{Kreskin}[Joseph]{Kresge}|\\[1ex] +% Q:&\cmd{\Name} has a full name in the source, but it is shorter in the text!\\[0.5ex] +% A:&And you did not mean that to happen. Use \cmd{\Name*} in that case. It can be easy to forget that \cmd{\Name} can automatically shorten a reference even if you use the full name in the source text. Remember:\\[0.5ex] +% &|\Name[John]{Smith}| gives \Name[John]{Smith}\\[0.5ex] +% &|\Name[John]{Smith}| gives \Name[John]{Smith}\\[0.5ex] +% &|\FName[John]{Smith}| gives \FName[John]{Smith}\ForgetName[John]{Smith}\\[1ex] +% \end{tabular} % -% \subsubsection{Basic Naming} -% \begin{multicols}{2}\small -% \noindent The macro used most often is \cmd{\Name}. When referring to a name for the first time, the following macros all have the same result: -% \begin{enumerate}\setlength\itemsep{0pt} -% \item First reference: \ForgetName[John]{Smith}\Name[John]{Smith}\\[0.5ex] -% |\Name*[John]{Smith}| or\\ |\Name[John]{Smith}| or\\ |\FName[John]{Smith}| -% \item First mononym reference: \ForgetName{Plato}\Name{Plato}\\[0.5ex] -% |\Name*{Plato}| or\\ |\Name{Plato}| or\\ |\FName{Plato}| -% \end{enumerate} -% Subsequent references to names have a different format depending on the macro used: -% \begin{enumerate}\setlength\itemsep{0pt} -% \item Subsequent full name: \Name*[John]{Smith}\\[0.5ex] -% |\Name*[John]{Smith}| -% \item Subsequent surname: \Name[John]{Smith}\\[0.5ex] -% |\Name[John]{Smith}| -% \item Subsequent forename: \FName[John]{Smith}\\[0.5ex] -% |\FName[John]{Smith}| -% \item Subsequent mononym: \Name{Plato}\\[0.5ex] -% |\Name*{Plato}| or\\ |\Name{Plato}| or\\ |\FName{Plato}| -% \end{enumerate} -% These next examples work with or without the \texttt{comma} option. \cmd{\AKA} and \cmd{\PName} cannot cross-reference these forms. Page \pageref{sec:Intermediate}, Section \ref{sec:suffix}, and Section \ref{sec:pennames} address this issue with different solutions. -% \begin{enumerate}\setlength\itemsep{0pt} -% \item First Eastern ref: \ForgetName{Mao}[Tse-tung]\Name{Mao}[Tse-tung]\\[0.5ex] -% |\Name*{Mao}[Tse-tung]| or\\ |\Name{Mao}[Tse-tung]| -% \item Subsequent references: \Name*{Mao}[Tse-tung]\\[0.5ex] -% |\Name*{Mao}[Tse-tung]| -% \item Subsequent references: \Name{Mao}[Tse-tung]\\[0.5ex] -% |\Name{Mao}[Tse-tung]| or\\ |\FName{Mao}[Tse-tung]| -% \item First royal: \ForgetName{Louis}[the Pious]\Name{Louis}[the Pious]\\[0.5ex] -% |\Name*{Louis}[the Pious]| or\\ |\Name{Louis}[the Pious]| or\\ |\FName{Louis}[the Pious]| -% \item Subsequent refs: \Name*{Louis}[the Pious]\\[0.5ex] -% |\Name*{Louis}[the Pious]| -% \item Subsequent references: \Name{Louis}[the Pious]\\[0.5ex] -% |\Name{Louis}[the Pious]| or\\ |\FName{Louis}[the Pious]| -% \item First ancient: \ForgetName{Ptolemy I}[Soter]\Name{Ptolemy I}[Soter]\\[0.5ex] -% |\Name*{Ptolemy I}[Soter]| or\\ |\Name{Ptolemy I}[Soter]| or\\ |\FName{Ptolemy I}[Soter]| -% \item Subsequent refs: \Name*{Ptolemy I}[Soter]\\[0.5ex] -% |\Name*{Ptolemy I}[Soter]| -% \item Subsequent refs: \Name{Ptolemy I}[Soter]\\[0.5ex] -% |\Name{Ptolemy I}[Soter]| or\\ |\FName{Ptolemy I}[Soter]| -% \item First royal: \ForgetName{Henry}[VIII]\Name{Henry}[VIII]\\[0.5ex] -% |\Name*{Henry}[VIII]| or\\ |\Name{Henry}[VIII]| or\\ |\FName{Henry}[VIII]| -% \item Subsequent refs: \Name*{Henry}[VIII]\\[0.5ex] -% |\Name*{Henry}[VIII]| -% \item Subsequent references: \Name{Henry}[VIII]\\[0.5ex] -% |\Name{Henry}[VIII]| or\\ |\FName{Henry}[VIII]| -% \end{enumerate} -% These examples show printing of alternate forenames, keeping the same name in the index. They use both the first and final optional parameters of \cmd{\Name} and friends. -% \begin{enumerate}\setlength\itemsep{0pt}\small -% \item Long first ref: \ForgetName[J.Q.]{Public}\Name[J.Q.]{Public}[Jane Q.]\\[0.5ex] -% |\Name*[J.Q.]{Public}[Jane Q.]| or\\ |\Name[J.Q.]{Public}[Jane Q.]| or\\ |\FName[J.Q.]{Public}[Jane Q.]| -% \item Different forenames, same surname: \Name*[J.Q.]{Public}[Jane Qetsiyah]\\[0.5ex] -% {\footnotesize |\Name*[J.Q.]{Public}[Jane Qetsiyah]|} -% \item Subsequent name: \Name*[J.Q.]{Public}\\[0.5ex] -% |\Name*[J.Q.]{Public}| -% \item Alternate forename: \FName[J.Q.]{Public}[Janie]\\[0.5ex] -% |\FName[J.Q.]{Public}[Janie]| -% \end{enumerate} -% \end{multicols} +% \begin{tabular}{lp{4in}} +% Q:&How do I refer to ``Iron Mike'' Tyson?\\[0.5ex] +% A:&Very, very carefully. Use |``\Name[Mike]{Tyson}[Iron Mike]''| and |\SubvertName[Mike]{Tyson}\Name[Mike]{Tyson}| to produce the example above. Or create two separate names and cross-reference them manually in order to track them both in the index (see page \pageref{manualxref}). Or use |``\AKA[Mike]{Tyson}{Iron Mike}''| if you just want to cross-reference the main name.\\[1ex] +% Q:&I had seen errors like ``Argument of |\Name| has an extra |}|''\\[0.5ex] +% A:&Older versions of \texttt{nameauth} were susceptible to fragility and moving arguments. Version 1.4 and later of \textsf{nameauth} address many of these issues.\\[1ex] +% \end{tabular} +% \subsubsection{Error Handling} +% \label{sec:error} % -% \subsubsection{Intermediate Naming} -% \label{sec:Intermediate} -% \begin{multicols}{2}\small -% \noindent Always use a comma to delimit suffixes, followed by a space or thin space. \cmd{\AKA} and \cmd{\PName} will cross-reference these forms. See also Section \ref{sec:suffix}. Macros that are too wide for the column are split across lines using the comment token, but need not be so in the text. -% \begin{enumerate}\setlength\itemsep{0pt} -% \item First: \ForgetName[George S.]{Patton, Jr.}\Name[George S.]{Patton, Jr.}\\[0.5ex] -% {\footnotesize |\Name*[George S.]{Patton, Jr.}| or\\ |\Name[George S.]{Patton, Jr.}| or\\ |\FName[George S.]{Patton, Jr.}|} -% \item Subsequent full: \Name*[George S.]{Patton, Jr.}\\[0.5ex] -% |\Name*[George S.]{Patton, Jr.}| -% \item Subsequent surname: \Name[George S.]{Patton, Jr.}\\[0.5ex] -% |\Name[George S.]{Patton, Jr.}| -% \item Subsequent forename: \FName[George S.]{Patton, Jr.}[George]\\[0.5ex] -% |\FName[George S.]{Patton, Jr.}%|\\|[George]| -% \end{enumerate} -% These cases depend on the default \texttt{nocomma} option, whereby one can use comma suppression to implement forms of ancient, royal and Eastern names. By avoiding the final optional parameter of \cmd{\Name} and friends, \cmd{\AKA} and \cmd{\PName} will cross-reference these forms. +% Except for the indexing parts of macros, most of the macros in this package print any erroneous arguments in the text, but not in the index. To find errors, one can look at index entries for irregularities or examine package warnings. Unless there is a syntax error, all macros emit meaningful warnings. Convenience macros like \cmd{\PName} produces warnings via their component macros \cmd{\Name} and \cmd{\AKA}. % -% |\Name{Ptolemy I}[Soter]| (see above) keeps the number with the name. Below, the form |\Name{Demetrius, I Soter}| keeps the number with the sobriquet. To keep the number with the name, use |\Name{Demetrius I, Soter}|. -% \begin{enumerate}\setlength\itemsep{0pt} -% \item First reference: \ForgetName{Francis, I}\Name{Francis, I}\\[0.5ex] -% |\Name*{Francis, I}| or\\ |\Name{Francis, I}| or\\ |\FName{Francis, I}| -% \item Subsequent full name: \Name*{Francis, I}\\[0.5ex] -% |\Name*{Francis, I}| -% \item Subsequent name: \Name{Francis, I}\\[0.5ex] -% |\Name{Francis, I}| or\\ |\FName{Francis, I}| -% \item First reference: \ForgetName{Demetrius, I Soter}\Name{Demetrius, I Soter}\\[0.5ex] -% |\Name*{Demetrius, I Soter}| or\\ |\Name{Demetrius, I Soter}| or\\ |\FName{Demetrius, I Soter}| -% \item Next full name: \Name*{Demetrius, I Soter}\\[0.5ex] -% |\Name*{Demetrius, I Soter}| -% \item Subsequent name: \Name{Demetrius, I Soter}\\[0.5ex] -% |\Name{Demetrius, I Soter}| or\\ |\FName{Demetrius, I Soter}| -% \item First reference: \ForgetName{Sun, Yat-sen}\Name{Sun, Yat-sen}\\[0.5ex] -% |\Name*{Sun, Yat-sen}| or\\ |\Name{Sun, Yat-sen}| or\\ |\FName{Sun, Yat-sen}| -% \item Subsequent full name: \Name*{Sun, Yat-sen}\\[0.5ex] -% |\Name*{Sun, Yat-sen}| -% \item Subsequent name: \Name{Sun, Yat-sen}\\[0.5ex] -% |\Name{Sun, Yat-sen}| or\\ |\FName{Sun, Yat-sen}| -% \end{enumerate} -% Particulate names contain prepositions that refer to an ancestral place or name. The following illustrate the American style of particulate names. -% \begin{enumerate}\setlength\itemsep{0pt} -% \item First: \Name[Walter]{de la Mare}\\[0.5ex] -% |\Name*[Walter]{de la Mare}| or\\ |\Name[Walter]{de la Mare}| or\\ |\FName[Walter]{de la Mare}| -% \item Next reference: \Name[Walter]{de la Mare}\\[0.5ex] -% |\Name[Walter]{de la Mare}| -% \item At start of sentence: \CapThis\Name[Walter]{de la Mare}\\[0.5ex] -% |\CapThis\Name[Walter]{de la Mare}| -% \item Forename: \FName[Walter]{de la Mare}\\[0.5ex] -% |\FName[Walter]{de la Mare}| -% \end{enumerate} -% \label{FirstVonLast} -% The following examples illustrate the Continental style of particulate names. Forms 1--4 keep the particles with the names in the index. Forms 5--7 omit the particles in the index by using alternate forenames. Long commands are split using the comment token, but need not be so in the text. -% \begin{enumerate}\setlength\itemsep{0pt} -% \item The (admittedly long) first use:\\\Name[Johann Wolfgang von]{Goethe}\\[0.5ex] -% |\Name*[Johann Wolfgang von]%|\\|{Goethe}| or\\ |\Name[Johann Wolfgang von]%|\\|{Goethe}| or\\ |\FName[Johann Wolfgang von]%|\\|{Goethe}| -% \item Subsequent: \Name[Johann Wolfgang von]{Goethe}\\[0.5ex] -% |\Name[Johann Wolfgang von]%|\\|{Goethe}| -% \item Forenames: \FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang]\\[0.5ex] -% |\FName[Johann Wolfgang von]%|\\ |{Goethe}[Johann Wolfgang]| -% \item First: \Name[Adolf]{Harnack}[Adolf von]\\[0.5ex] -% |\Name*[Adolf]{Harnack}[Adolf von]|\,or\\ |\Name[Adolf]{Harnack}[Adolf von]|\,or\\ |\FName[Adolf]{Harnack}[Adolf von]| -% \item Next full name: \Name*[Adolf]{Harnack}[Adolf von]\\[0.5ex] -% |\Name*[Adolf]{Harnack}[Adolf von]| -% \item Subsequent surname: \Name[Adolf]{Harnack}[Adolf von]\\[0.5ex] -% |\Name[Adolf]{Harnack}[Adolf von]| or |\Name[Adolf]{Harnack}| -% \item Subsequent forename: \FName[Adolf]{Harnack}\\[0.5ex] -% |\FName[Adolf]{Harnack}| -% \end{enumerate} -% \end{multicols} +% Not all warnings are created equal. For example, the multiple creation of a cross-reference with \cmd{\AKA} will generate a warning, but it will have no ill effects and may be intentional. Other warnings, especially in the case of indexing macros, indicate that the macro produced no output.\\ % -% \subsubsection{Common Pitfalls} -% Avoiding the following pitfalls will save much time and frustration: -% \begin{enumerate}\setlength\itemsep{0pt} -% \item Mixing sobriquets with modern forms fails due to the ``alternate name'' feature that replaces the first with the final optional parameters, e.g.:\\ |\Name[First]{Ancient}[Sobriquet]|\\ |\Name[King]{Number}[Sobriquet]| -% \item Using \cmd{\AKA} and \cmd{\PName} with forms that use the final optional parameter of \cmd{\Name} and friends will fail unless one uses comma-delimited suffixes. See Section \ref{sec:suffix} and Section \ref{sec:AKA}. -% \item Using a forename or first initials can prevent failure in some cases:\\[0.5ex]{\footnotesize OK: |\Name[J.]{Kreskin}[The Amazing] (\AKA[J.]{Kreskin}[Joseph]{Kresge})|\\[0.5ex] FAIL: |\Name[]{Kreskin}[The Amazing] (\AKA{Kreskin}[Joseph]{Kresge})|\\[0.5ex] FAIL: |\Name{Kreskin}[The Amazing] (\AKA{Kreskin}[Joseph]{Kresge})|} -% \item \cmd{\Name} can shorten a reference even if you use the full name in the text. Do not depend on the name you see when you are typing. Depend on the form of the macro, whether \cmd{\Name}, \cmd{\Name*}, or \cmd{\FName}. -% \item Unbalanced or incorrect \texttt{\{} braces \texttt{\}} and \texttt{[} brackets \texttt{]}, putting a star |*| after |\FName|, and forgetting periods in initials create errors that can be difficult to track. Leading spaces in macro arguments will create incorrectly sorted index entries. The results are usually a failure to finish scanning the document or a spurious index entry. +% \noindent Warnings result from: +% +% \begin{enumerate}\setlength{\itemsep}{-0.4ex} +% \item Using a cross-reference \oarg{alternate FNN}\marg{alternate SNN}\oarg{alt. names} created by \cmd{\AKA} as a reference in \cmd{\Name}, \cmd{\FName}, and \cmd{\PName}. +% \item Using a reference \oarg{FNN}\marg{SNN}\oarg{alternate names} created by \cmd{\Name}, \cmd{\FName}, and \cmd{\PName} as a cross-reference in \cmd{\AKA}. +% \item Using \cmd{\AKA} to create the same cross-reference multiple times. +% \item Using \cmd{\IndexName} to index a cross-reference as a main entry. +% \item Using \cmd{\TagName} to tag a cross-reference. +% \item Using \cmd{\ExcludeName} to exclude a name that has already been used. % \end{enumerate} +% \clearpage % % \subsection{Naming Macros} % -% \subsubsection{Surnames: \cmd{\Name} and \cmd{\Name*}} +% \subsubsection{Surnames: \texttt{\textbackslash Name} and \texttt{\textbackslash Name*}} % % \DescribeMacro{\Name} % \DescribeMacro{\Name*} @@ -343,77 +278,69 @@ % \noindent From now on we will abbreviate \meta{forename(s)} with \meta{FNN} and \meta{surname(s)} with \meta{SNN} at various points. The following table helps to show how the syntax description works with first and subsequent references: % % \begin{quote}\small -% \begin{tabular}{llll}\hline -% {\large\strut}\meta{FNN} & \meta{SNN} & \meta{Alternate Names} & Result\\\hline -% \texttt{Albert} & \texttt {Einstein} & (none) & \Name[Albert]{Einstein}\\ -% \texttt{Albert} & \texttt {Einstein} & (none) & \Name[Albert]{Einstein}\\ -% (none) & \texttt{Confucius} & (none) & \Name{Confucius}\\ -% (none) & \texttt{Confucius} & (none) & \Name{Confucius}\\ -% \texttt{M.T.} & \texttt{Cicero} & \texttt{Marcus Tullius} & \Name[M.T.]{Cicero}[Marcus Tullius]\\ -% \texttt{M.T.} & \texttt{Cicero} & \texttt{Marcus Tullius} & \Name[M.T.]{Cicero}[Marcus Tullius]\\ -% (none) & \texttt{Charles} & \texttt{the Bald} & \Name{Charles}[the Bald]\\ -% (none) & \texttt{Charles} & \texttt{the Bald} & \Name{Charles}[the Bald]\\\hline +% \begin{tabular}{ll}\hline +% {\normalsize\strut}|\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\ +% |\Name*[Albert]{Einstein}| & \Name*[Albert]{Einstein}\\ +% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\hline +% {\normalsize\strut}|\Name{Confucius}| & \Name{Confucius}\\ +% |\Name*{Confucius}| & \Name{Confucius}\\ +% |\Name{Confucius}| & \Name*{Confucius}\\\hline +% {\normalsize\strut}|\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\ +% |\Name*[M.T.]{Cicero}[Marcus Tullius]| & \Name*[M.T.]{Cicero}[Marcus Tullius]\\ +% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\hline +% {\normalsize\strut}|\Name{Charles}[the Bald]| & \Name{Charles}[the Bald]\\ +% |\Name*{Charles}[the Bald]| & \Name*{Charles}[the Bald]\\ +% |\Name{Charles}[the Bald]| & \Name{Charles}[the Bald]\\\hline % \end{tabular} % \end{quote} % -% \noindent Basically, \cmd{\Name} connects the \meta{FNN} to the \meta{SNN} to create respective printed and indexed forms, usually \meta{FNN}\,\meta{SNN} and \meta{SNN},\,\meta{FNN}. This takes care of most Western names. For those with one name, such as ancient figures or stage names, one can drop the \meta{FNN} so that \cmd{\Name} produces the result \meta{SNN} for both text and index.\cmd{\Name} always prints the surname or ``base name.'' -% -% 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'' \meta{FNN} are present, then the alternate names conditionally will replace the \meta{FNN} in the printed form, but not in the indexed form. If no regular \meta{FNN} are present, then the alternate names will be appended to the \meta{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. +% \noindent \cmd{\Name} connects the \meta{FNN} to the \meta{SNN} to create respective printed and indexed forms, as illustrated in Section \ref{sec:PatRef} and thereafter. The invocation of \cmd{\Name} always prints the \meta{SNN} field. \cmd{\Name} prints the ``full name'' at the first occurrence, then only the partial form thereafter. \cmd{\Name*} always prints the full 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. +% Nicknames and sobriquets of some historical figures are implemented in slightly different ways. A nickname assumes the presence of \meta{FNN} and \meta{SNN} (see the example for \Name[M.T.]{Cicero}[Marcus Tullius] above). The \meta{alternate names} field allows a nickname to replace the \meta{FNN} field in the text while keeping the \meta{FNN} field in the index. Nicknames are truly optional. As long as the \meta{FNN} and \meta{SNN} fields are consistent, the index entries will be consistent. The shorter name printed by \cmd{\Name} will not print forenames or nicknames. See also Section \ref{sec:start} and \cmd{\FName} below. % -% As long as the ``main'' \meta{FNN} are constant in Western-style names, the ``alternate names'' field can vary, yet the index entries will be constant. Section \ref{sec:start} contains examples that illustrate this ability to swap out forenames. This is useful when dropping out references to middle initials in \cmd{\FName}. Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*} and \cmd{\FName}. The surname argument is \emph{always} printed in \cmd{\Name*} and \cmd{\Name}. +% In the example of \Name*{Charles}[the Bald] above, ``the Bald'' is not a nickname because no \meta{FNN} are present. In that case the \meta{alternate names} field is appended to the \meta{SNN} in both the printed form \emph{and} in the index form. This behavior implies that, while ``the Bald'' uses an optional parameter, it is not truly optional once used. % -% Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \cmd{\AKA} and \cmd{\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\ForgetName{Henry}[VIII] -% \begin{tabular}{llp{1.2cm}ll}\hline -% {\normalsize\strut}\meta{FNN} & \meta{SNN} & \meta{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} -% \egroup\bigskip -% -% \noindent Again, alternate forenames \emph{override} the \meta{FNN} in the text. Sobriquets are \emph{appended} to \meta{SNN}. The presence or absence of \meta{FNN} triggers this difference between the two actions---\textbf{this is a central concept}. -% -% \emph{Note}: Throughout this manual I play a ``dirty trick'' that makes a name print as if it had not yet occurred. In some cases I make a first occurrence print as if the name already had 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. +% Later we shall see that a similar effect, perhaps more preferable, can be achieved with the default \texttt{nocomma} option and |\Name{Charles, the Bald}|, as seen in Section \ref{sec:suffix}. One must always be consistent in using these forms. Otherwise one will get bogus index entries and errors in the text that are difficult to track. +% \clearpage % -% \subsubsection{Forenames: \cmd{\FName}} +% \subsubsection{Forenames: \texttt{\textbackslash FName}} % % \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. \cmd{\FName} is intended for Western-style names. The syntax is basically the same: +% \DescribeMacro{\FName*} +% This casual friend of \cmd{\Name} prints only ``first'' names, but it will still print a full name when a first use occurs. \cmd{\FName} is intended for Western-style names. \cmd{\FName*} is only a synonym for \cmd{\FName}. The syntax is basically the same: % \begin{quote} % \cmd{\FName}\oarg{FNN}\marg{SNN}\oarg{alternate names} % \end{quote} -% Remember that \cmd{\FName} \emph{has no starred form}. Next we see what it does: +% The following table shows the output at a glance:\ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles}[the Bald] % % \begin{quote}\small -% \begin{tabular}{llll}\hline -% {\large\strut}\meta{FNN} & \meta{SNN} & \meta{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 +% \begin{tabular}{ll}\hline +% {\normalsize\strut}|\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\ +% |\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\\hline +% {\normalsize\strut}|\FName{Confucius}| & \FName{Confucius}\\ +% |\FName{Confucius}| & \FName{Confucius}\\\hline +% {\normalsize\strut} |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\ +% |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\\hline +% {\normalsize\strut} |\FName{Charles}[the Bald]| & \FName{Charles}[the Bald]\\ +% |\FName{Charles}[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}. For nicknames use the ``alternate names'' option. For example, aviation hero \Name[Chesley B.]{Sullenberger, III} can be noted as: +% \noindent See how the first reference is a full name? That prevents an accidental reference to a first name before a person has been introduced. Nicknames are used by including them in the \meta{alternate names} field in addition to \meta{FNN}. 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} -% \cmd{\FName} suppresses extra periods if a forename with initials occurs at the end of a sentence, as in the plot-line ``who shot \FName[J.D.]{Rock, III}.'' See also Section \ref{sec:suffix}. +%\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} package option (see Section \ref{sec:suffix}). These include names like like the fictional \FName[J.D.]{Rock, III} and the real \FName{Charles, V}: +% \begin{quote}|\FName[J.D.]{Rock, III}|, ``\FName[J.D.]{Rock, III}''; |\FName{Charles, V}|, ``\FName{Charles, V}.''\end{quote} +% \cmd{\FName} suppresses extra periods if a forename with initials occurs at the end of a sentence, as in |``who shot \FName[J.D.]{Rock, III}.''| ``who shot \FName[J.D.]{Rock, III}.'' % % \subsection{Advanced Naming Topics} % \subsubsection{Naming Conventions} % % \DescribeMacro{\CapThis} -% English names with the particles \emph{de}, \emph{de\ la}, \emph{d'}, \emph{von}, \emph{van}, and \emph{ten} generally keep them with the last name, using varied capitalization. \emph{Le}, \emph{La}, and \emph{L'} are capitalized unless preceded by \emph{de}. In English, these particles go in the \meta{SNN} field of \cmd{\Name}, e.g., \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}. To capitalize the first particle in a subsequent \cmd{\Name} reference at the beginning of a sentence, use |\CapThis\Name[Walter]{de la Mare}|. \CapThis\Name[Walter]{de la Mare} will think it fair. \textsc{Du Cange}\IndexName{du Cange}\SubvertName{du Cange} (\AKA{du Cange}[Charles]{du Fresne}) might disagree. For the present, at the start of a sentence, use |\textsc{Du Cange}\IndexName{du Cange}\SubvertName{du Cange}|. +% English names with the particles \emph{de}, \emph{de\ la}, \emph{d'}, \emph{von}, \emph{van}, and \emph{ten} generally keep them with the last name, using varied capitalization. \emph{Le}, \emph{La}, and \emph{L'} are capitalized unless preceded by \emph{de}. In English, these particles go in the \meta{SNN} field of \cmd{\Name}, e.g., \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}. To capitalize the first particle in a subsequent \cmd{\Name} reference at the beginning of a sentence, use |\CapThis\Name[Walter]{de la Mare}|. \CapThis\Name[Walter]{de la Mare} will think it fair. \CapThis\Name{du Cange} (\AKA{du Cange}[Charles]{du Fresne}) would too, because \cmd{\CapThis} now works for all instances of \cmd{\Name} as of version 1.4. % -% Names foreign to English usually put these particles in the \meta{FNN} field of \cmd{\Name}. Yet these particles are not first names. Using \cmd{\FName} with alternate forenames avoids the particles. See the examples on page \pageref{FirstVonLast}. +% Names foreign to English usually put these particles in the \meta{FNN} field of \cmd{\Name}. Yet these particles are not first names. Using \cmd{\FName} with alternate forenames avoids that issue. See the examples starting on page \pageref{FirstVonLast}. % % \subsubsection{Hyphenation} @@ -422,17 +349,32 @@ % % 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{Suffix Removal} +% \subsubsection{Suffixes and Non-Western Names} % \label{sec:suffix} % -% \cmd{\Name}---not \cmd{\Name*}---truncates comma-delimited suffixes from last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. One must always use a comma to activate this, e.g., |\Name[Oskar]{Hammerstein, II}|. You should use a space or a thin space after the comma in order to separate the suffix from the surname. +% \DescribeMacro{\ShowComma} +% This package has two main settings: \texttt{comma} and \texttt{nocomma}. These settings are meant to accommodate different typesetting conventions. When using the default \texttt{nocomma} option, the user can force a comma to appear between the name and suffix in the \meta{SNN} field as appropriate by putting \cmd{\ShowComma} before \cmd{\Name} and friends, such as |\ShowComma\Name[Louis]{Gossett, Jr.}| \ShowComma\Name[Louis]{Gossett, Jr.}. + +%The \texttt{comma} option restricts the flexibility of expressing some royal names and basic Eastern names. \cmd{\AKA} and \cmd{\PName} cannot create cross-references to these forms, but \cmd{\AKA} can cross-reference \emph{from} these forms in its second set of arguments. These restricted forms are shown below: +% +% \begin{quote}\ForgetName{Henry}[VIII] +% \begin{tabular}{ll}\hline +% {\normalsize\strut}|\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\ +% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\\hline +% {\normalsize\strut}|\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\ +% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\\hline +% \end{tabular} +% \end{quote} % -% Again, \textbf{the comma is not optional with suffixes}. It is how this feature works. More than one comma in the \meta{SNN} argument of \cmd{\Name} and friends will cause unwanted results. Fortunately, that is unlikely. +% \noindent Again, alternate forenames \emph{override} the \meta{FNN} in the text. Sobriquets are \emph{appended} to \meta{SNN}. The presence or absence of \meta{FNN} triggers this difference between the two actions\,---\,\textbf{this is a central concept}. % -% 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 combinations: -% -% \ForgetName[Martin Luther]{King, Jr.}% -% \begin{quote}\small +%There is perhaps a less-confusing manner of working with such names. \cmd{\Name}\,---\,not \cmd{\Name*}\,---\,truncates comma-delimited suffixes from last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. One must always use a comma to activate this, e.g., |\Name[Oskar]{Hammerstein, II}|. Spaces (or no spaces) between the comma and the suffix must remain consistent or else they will produce duplicate index entries. Extra space does not, however, affect the formatted output. +% +% Again, \textbf{the comma is essential to how this feature works}. Using, e.g., |\Name{Base, suff1, suff2}| for the \meta{SNN} argument yields: \IndexInactive \Name{Base, suff1, suff2}; then \Name{Base, suff1, suff2}.\IndexActive\ See how only the first comma is suppressed. +% +% 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 combinations: +% +% \begin{quote}\small\ForgetName[Martin Luther]{King, Jr.} % \begin{tabular}{ll} % |\Name[Martin Luther]{King, Jr.}.| & \Name[Martin Luther]{King, Jr.}.\\ % |\Name[Martin Luther]{King, Jr.}.| & \Name[Martin Luther]{King, Jr.}.\\ @@ -441,27 +383,25 @@ % |\Name*[Martin Luther]{King, Jr.}| & \Name*[Martin Luther]{King, Jr.} % \end{tabular} % \end{quote} -% -% Using the default class option \texttt{nocomma} with suffix removal, one can take advantage of the suffix feature to tweak more possibilities out of \cmd{\Name}. Instead of the sobriquet feature, one could use the following variants: -% -% \begin{quote}\small\ForgetName{Sun, Yat-sen} -% \begin{tabular}{llp{1.2cm}ll}\hline -% {\large\strut}\meta{FNN} & \meta{SNN} & \meta{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}|\\ -% (none) & \texttt{Sun, Yat-sen} & (none) & \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\\\hline +% Using the default package option \texttt{nocomma} with suffix removal, one can use the suffix feature to tweak more possibilities out of \cmd{\Name}. Instead of the sobriquet feature, one could use the following variants: +% +% \begin{quote}\ForgetName{Sun, Yat-sen} +% \begin{tabular}{ll}\hline +% {\normalsize\strut} |\Name{Louis, XIV}| & \Name{Louis, XIV}\\ +% |\Name{Louis, XIV}| & \Name{Louis, XIV}\\\hline +% {\normalsize\strut} |\Name{Sun, Yat-sen}| & \Name{Sun, Yat-sen}\\ +% |\Name{Sun, Yat-sen}| & \Name{Sun, Yat-sen}\\\hline % \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. The sobriquet feature would otherwise prevent such usage. % -% 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. +% 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}. % % \subsubsection{Accented Names} % \label{sec:accents} % -% The following Unicode characters are available using \textsf{inputenc}/\textsf{fontenc}: +% If you use accented names, \textsf{xindy} (or \textsf{texindy}) are strongly recommended. The following Unicode characters are available using \textsf{inputenc}/\textsf{fontenc}: % \begin{quote} % \begin{tabular}{llll} % \scshape À Á Â Ã Ä Å Æ & \scshape Ç È É Ê Ë & \scshape Ì Í Î Ï Ð Ñ & \scshape first use \\ @@ -480,11 +420,10 @@ % Ś Ş ş Š š Ţ ţ Ť ť & Ů ů Ű ű & Ź ź Ż ż Ž ž & second use \\ % \end{tabular} % \end{quote} -% Please remember that if you use accented names, you may prefer using \textsf{xindy} (or \textsf{texindy}) on the \texttt{.idx} file. It simplifies the whole process and I recommend it. % %With \textsf{makeindex} there are a number of solutions, but some depend on the availability of the |-g| option and user-created settings in an |.ist| file whose description goes beyond the scope of this document. You also could use \cmd{\IndexActive} and \cmd{\IndexInactive} to suppress indexing, then create manual entries. For non-English documents, however, that solution is not optimal. % -% One may add control sequences to names, thanks to the help of \Name*[Robert]{Schlicht}. The next example adds more accented characters under \textsf{inputenc}/\textsf{fontenc}: +% One may use control sequences in \cmd{\Name} (thanks \Name*[Robert]{Schlicht}). That means more accents with NFSS, such as the next example that uses \textsf{inputenc}/\textsf{fontenc}: % \begin{quote}\small % |\usepackage{newunicodechar}|\\ % |\DeclareTextSymbolDefault{\textlongs}{TS1}|\\ @@ -519,7 +458,7 @@ % \end{tabular}\\ % \clearpage % -% I used the following in the text itself to allow for conditional processing that helps one document work under multiple engines:\\ +% I used the following in the text itself to allow for conditional processing that helps one to document work under multiple engines:\\ % % \begin{tabular}{l} % |\ifxetex |\meta{xelatex text}|%|\\ @@ -540,7 +479,7 @@ % \label{sec:formatting} % % \DescribeMacro{\NamesFormat} -% The first instance of a name is formatted with \cmd{\NamesFormat}. In addition to using the class options, one can redefine \cmd{\NamesFormat}. For example, if you wanted to suppress formatting in footnotes, you could do something like: +% The first instance of a name is formatted with \cmd{\NamesFormat} when formatting is active. Additionally, the \texttt{alwaysformat} option will cause every name to be formatted when formatting is active. In addition to using the package options, one can redefine \cmd{\NamesFormat} to create some custom effects. For example, if you wanted to suppress formatting in footnotes, you could do something like: % % \begin{quote} % |\makeatletter|\\ @@ -549,18 +488,19 @@ % |\makeatother| % \end{quote} % -% \noindent This approach synchronizes the ``first use'' feature in the text and the footnotes, but only suppresses the formatting. It takes advantage of the deep nesting of \cmd{\@makefntext} and a localized \cmd{\def} to make a temporary change. -% -% A second example puts the mention of first names in the margin. The code below gives us: -% \let\oldformat\NamesFormat -% \renewcommand{\NamesFormat}[1]{\textbf{#1}\ifinner\else\marginpar{\scriptsize #1}\fi} +% \noindent This approach synchronizes the ``first use'' feature in the text and the footnotes, but only suppresses the formatting. It takes advantage of the deep nesting of \cmd{\@makefntext} and a localized \cmd{\def} to make a temporary change. A second example puts the mention of first names in the margin if possible: % % \begin{quote} -% \bgroup\small\ttfamily % |\let\oldformat\NamesFormat|\\ % |\renewcommand{\NamesFormat}[1]{\textbf{#1}%|\\ % |\ifinner\else\marginpar{\scriptsize #1}\fi}| +% \end{quote} +% The result produces something like: % +% \begin{quote} +% \let\oldformat\NamesFormat% +% \renewcommand{\NamesFormat}[1]{\textbf{#1}\ifinner\else\marginpar{\scriptsize #1}\fi}% +% \bgroup\small\ttfamily% % |\Name{Vlad III}[Dracula]| was known as Vlad Ţepeş, ``The Impaler,''\break after his death. He was the son of |\Name{Vlad II}%| |[Dracul]|, a\break member of the Order of the Dragon. Later references to\break |\Name{Vlad III}[Dracula]| appear thus.\egroup % % \Name{Vlad III}[Dracula] was 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. @@ -569,16 +509,16 @@ % \noindent The forms above do not work with \cmd{\PName} and \cmd{\AKA}. Consistently use either the suffix mechanism (Section \ref{sec:suffix}) or see Section \ref{sec:pennames} regarding manual entries. If you use the suffix mechanism, you would use the following forms: % %\begin{quote}\ForgetName{Vlad III}[Dracula]\ForgetName{Vlad II}[Dracul] -% \bgroup\small\ttfamily |\Name{Vlad III, Dracula}| was known as |\AKA{Vlad III, Dracula}%|\break|{Vlad}[Ţepeş]|, |``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler],''|\break after his death. He was the son of |\Name{Vlad II, Dracul}|, a\break member of the Order of the Dragon. Later references to\break |\Name{Vlad III, Dracula}| appear thus.\egroup +% \let\oldformat\NamesFormat% +% \renewcommand{\NamesFormat}[1]{\textbf{#1}\ifinner\else\marginpar{\scriptsize #1}\fi}% +% \bgroup\small\ttfamily% +% |\Name{Vlad III, Dracula}| was known as |\AKA{Vlad III, Dracula}%|\break|{Vlad}[Ţepeş]|, |``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler],''|\break after his death. He was the son of |\Name{Vlad II, Dracul}|, a\break member of the Order of the Dragon. Later references to\break |\Name{Vlad III, Dracula}| appear thus.\egroup % % \Name{Vlad III, Dracula} was 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} -% \let\NamesFormat\oldformat % -% \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]. -% -% The ``Dracula'' example above was manipulated extensively. Mixing the sobriquet and suffix forms otherwise may cause errors to ``bite.'' Puns aside, \Name{Vlad III}[Dracula] was a complex historical figure, more so than the character of \Name[Bram]{Stoker}. +% \noindent The redefinition of \cmd{\NamesFormat} given above follows scoping rules. Since I used it in a quote environment, it reverts to normal and now we have: \ForgetName{Vlad III}[Dracula]\Name{Vlad III}[Dracula]. Later references produce \Name{Vlad III}[Dracula]. The ``Dracula'' example was manipulated extensively with the tweaking macros \cmd{\ForgetName} and \cmd{\SubvertName}. Mixing the sobriquet and suffix forms otherwise might cause errors to ``bite.'' % % \subsubsection{Formatting Certain Sections} % \label{sec:SectionFormat} @@ -609,9 +549,9 @@ % \end{tabular} % \end{quote} % -%\noindent Notice that we have two cases of ``first use.'' That works fine in different parts of the document, but not within the same part. Avoid using \cmd{\NamesInactive} to turn off formatting in footnotes because that can produce undesirable results like the example above. Fixing that would require use of the tweaking macros in both body text and footnotes. Instead, use the example for suppressing formatting in Section \ref{sec:formatting} and apply tweaks like \cmd{\ForgetName} in the body text as needed. +%\noindent Notice that we have two independent cases of ``first use'' above. That is intended for different sections of the document, like front matter and main matter. It clashes on the same page. That is why you should suppress formatting in the main matter with a custom definition of \cmd{\NamesFormat} (Section \ref{sec:formatting}) instead of using \cmd{\NamesInactive}. The following section covers tweaks that help to minimize certain first-use clashes. % -% \subsubsection{Tweaks: \cmd{\ForgetName} and \cmd{\SubvertName}} +% \subsubsection{Tweaks: \texttt{\textbackslash ForgetName} and \texttt{\textbackslash SubvertName}} % \label{sec:Tweaks} % % These two macros are meant for tweaking text at or near final draft stage. They affect both front matter and main matter. @@ -622,7 +562,7 @@ % \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 cross-references (see the next section) 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. The syntax is: @@ -633,16 +573,14 @@ % \noindent This macro causes \cmd{\Name} and friends to think that a prior use of a name already has occurred. The next use will print as if it were a ``subsequent use.'' % % \subsection{Name Variant Macros} -% \subsubsection{Introduction and Manual Index Entries} +% \subsubsection{Introduction} % \label{sec:pennames} % -% The macro \cmd{\AKA} deals with pseudonyms, stage names, \emph{noms de plume}, etc. With this macro we move into a hybrid naming/indexing area of functionality. \cmd{\Name} and friends produce index entries compatible with manual index entries since version 0.9. If needed, the \texttt{.idx} file can be a helpful reference when linking manual entries with \textsf{nameauth} entries. -% -% Before we examine \cmd{\AKA} in detail, we should cover the manual solution that \cmd{\AKA} helps to automate. This remains the only solution for name forms that use the final optional parameter of \cmd{\Name} and friends, especially if one chooses the \texttt{comma} option. It also is the only option for using special formatting in the text. +% \cmd{\AKA} handles pseudonyms, stage names, \emph{noms de plume}, and so on. Before we examine \cmd{\AKA} in detail, we should cover the manual solution that \cmd{\AKA} helps to automate. If needed, the \texttt{.idx} file can be a helpful reference when linking manual entries with \textsf{nameauth} entries. This remains the only solution for certain cases, especially with the \texttt{comma} option: % % \begin{quote} % \bgroup\ttfamily\small -% \verb!\index{Jean the Fearless|see{Jean sans Peur}}%!\\ +% \verb+\index{Jean the Fearless|see{Jean sans Peur}}%+\\ % |\Name{Jean}[sans Peur]| (Jean the Fearless) reigned as Duke of\break Burgundy from 1404 to 1419. % \egroup % @@ -651,21 +589,20 @@ % \Name{Jean}[sans Peur] (Jean the Fearless) reigned as Duke of Burgundy from 1404 to 1419. % \end{quote} % -% \noindent The suffix workaround would use |\Name{Jean, sans Peur}| but be careful; see Section \ref{sec:formatting}. A more complicated example is: +% \noindent The suffix workaround would use |\Name{Jean, sans Peur}| and the author need merely type |\AKA{Jean, sans Peur}{Jean the Fearless}|. See also Section \ref{sec:suffix}. Using \textsf{makeindex} also requires some manual entries: % \begin{quote} -% \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]|\break (Thomas of Aquino), also known as |\textit{Doctor Angelicus}|. His name\break ``Aquinas'' is not a surname, so many modern scholars simply refer to him\break as |\Name{Thomas}[Aquinas]|. +% \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. % \egroup % -% \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} +% \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. +% \end{quote} % -% \noindent This case must be handled manually due to the italic text formatting. -% \subsubsection{\cmd{\AKA}} +% \subsubsection{\texttt{\textbackslash AKA}} % \label{sec:AKA} % % \DescribeMacro{\AKA} @@ -676,32 +613,28 @@ % \cmd{\AKA*}\oarg{FNN}\marg{SNN}\oarg{alt. FNN}\marg{alt. SNN}\oarg{alt. names} % \end{quote} % -% \noindent The \meta{FNN} and \meta{SNN} arguments \emph{do not include} the final optional argument of \cmd{\Name} to avoid ambiguity. \cmd{\AKA} will not create a \emph{see} reference to a name with a sobriquet or to an Eastern name unless one uses the suffix feature mentioned previously. This macro is designed with Western names in mind. -% -% \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. +% \noindent The \meta{FNN} and \meta{SNN} arguments \emph{do not include} the final optional argument of \cmd{\Name} to avoid ambiguity. \cmd{\AKA} will not create a \emph{see} reference to a name that uses the \meta{alternate names} field. That must be done manually (see above). This macro is designed mainly with Western names in mind. % -% Here is a quick review of what works and what fails: +% \cmd{\AKA} only prints the alternate name, not the name to which it refers. It assumes that a \cmd{\Name} macro occurs somewhere to create the page-indexed target of a cross-reference. \textbf{No error checking} occurs for this. The macro also prevents double periods. Following is a quick review of what works and what fails for examples using \Name[Bob]{Hope}, \ForgetName{Louis, XIV}\Name{Louis, XIV}, and \Name{Gregory, I}: % % \begin{quote}\footnotesize -% \begin{tabular}{llllll}\hline -% {\normalsize\strut}\meta{FNN} & \meta{SNN} & \meta{Alt. FNN} & \meta{Alt. SNN} & \meta{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 +% \begin{tabular}{ll}\hline +% {\small\strut}|\AKA[Bob]{Hope}[Leslie Townes]{Hope}| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}\\ +% {\small\strut}\dag|\AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]\\\hline +% {\small\strut}\ddag|\AKA{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\ +% {\small\strut}|\AKA{Louis}[XIV]{Sun King}| & FAIL\\\hline +% {\small\strut}\S|\AKA{Gregory, I}{Gregory}[the Great]| & \AKA{Gregory, I}{Gregory}[the Great]\\ +% {\small\strut}|\AKA*{Gregory, I}{Gregory}[the Great]| & \AKA*{Gregory, I}{Gregory}[the Great]\\ +% {\small\strut}|\AKA{Gregory}[I]{Gregory}[the Great]| & FAIL\\\hline % \end{tabular} % -% \smallskip\dag{} This succeeds, but replaces ``Leslie Townes'' with ``Lester T.''\\ +% \smallskip\dag{} This succeeds, but replaces ``Leslie Townes'' with ``Lester T.'' in the text, while keeping ``Hope, Leslie Townes'' as the \emph{see} reference in the index.\\ % \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} % -% \noindent \cmd{\AKA} prints an alternate name and creates a cross reference in the index. The target of this cross-reference is either \meta{SNN}, \meta{FNN} or just \meta{SNN}. In the cross-reference, the \meta{alternate names} replace the \meta{alternate FNN} if both exist. Otherwise the \meta{alternate names} follow the \meta{alternate SNN}. +% \noindent \cmd{\AKA} prints an alternate name and creates a cross reference in the index. The target of this cross-reference is either \meta{SNN}, \meta{FNN} or just \meta{SNN}. In the cross-reference, the \meta{alternate names} replace the \meta{alternate FNN} if both exist. Otherwise the \meta{alternate names} follow the \meta{alternate SNN}: % -% If the starred form \cmd{\AKA*} is used with the template \meta{none}\marg{alternate SNN}\oarg{alt. names}, it only prints the \meta{alt. names}. With the same template, \cmd{\AKA} prints \meta{alternate SNN} followed by \meta{alt. names}. Section \ref{sec:TagName} offers a complete presentation of related features. A brief example follows: -% % \begin{quote} % \bgroup\ttfamily % Today we consider |\AKA[George]{Eliot}[Mary Anne]{Evans}| and her literary contributions as |\Name[George]{Eliot}|. @@ -709,18 +642,20 @@ % % Today we consider \AKA[George]{Eliot}[Mary Anne]{Evans} and her literary contributions as \Name[George]{Eliot}. % \end{quote} -% -% \noindent The cross-references generated by \cmd{\AKA} and \cmd{\AKA*} cannot be used with other macros in this package. See also Section \ref{sec:error}. % -% In certain cases, the alternate name might need to be indexed with page numbers. Do not use \cmd{\AKA} if that is so. Use \cmd{\Name} for both the main and the alternate names. Then create manual cross-references with \cmd{\index}, e.g.:\label{Rambam}\bigskip +% \noindent If the starred form \cmd{\AKA*} is used with the template \meta{none}\meta{alternate SNN}\meta{alt. names}, it only prints the \meta{alt. names}. With the same template, \cmd{\AKA} prints \meta{alternate SNN} followed by \meta{alt. names}. Section \ref{sec:TagName} offers a complete presentation of related features. +% +% The cross-references generated by \cmd{\AKA} and \cmd{\AKA*} are meant to be \emph{see} references and thus the other macros in this package will not create page references for these cross-references. See also Section \ref{sec:error}. In certain cases, the alternate name might need to be indexed with page numbers. Do not use \cmd{\AKA} in those cases. Use \cmd{\Name} for both the main and the alternate names. Then, only after both instances of \cmd{\Name} have been invoked, create manual cross-references with \cmd{\index}, e.g.: % -% \bgroup\footnotesize\index{Rambam|seealso{Maimonides}} +% \label{manualxref}% +% \bgroup\footnotesize\label{Rambam} % \begin{tabular}{p{0.7in}ll}\hline % Authoritative Name & Alternate Name & Example of Use\\\hline -% \Name{Maimonides} & \AKA{Maimonides}{Moses ben-Maimon} & |\AKA{Maimonides}{Moses ben-Maimon}|\\ +% \Name{Maimonides} & \AKA{Maimonides}{Moses ben-Maimon} & |\Name{Maimonides}|\\ +% &&|\AKA{Maimonides}{Moses ben-Maimon}|\\ % \Name{Maimonides} & \Name{Rambam} & |\Name{Rambam}%|\\& & \verb!\index{Rambam|seealso{Maimonides}}!\\\hline % \end{tabular} -% \egroup +% \index{Rambam|seealso{Maimonides}}\egroup % % \bigskip\noindent\cmd{\AKA} will not create multiple instances of a cross-reference. This allows the macro \cmd{\ExcludeName} to work, but it also prevents 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}. \cmd{\AKA} produces the first cross-reference; the user manually creates the second: % \index{Snellius|see{Snel van Royen, Rudolph}}% @@ -728,38 +663,38 @@ % \verb!\index{Snellius|see{Snel van Royen, Rudolph}}! % \end{quote} % -% \subsubsection{\cmd{\PName}} +% \subsubsection{\texttt{\textbackslash PName}} % % \DescribeMacro{\PName} -% \cmd{\PName} is a ``convenience macro'' that sacrifices flexibility for simplicity. It does not implement \cmd{\AKA*} and it works best with Western-style names. It calls \cmd{\Name} or \cmd{\Name*} and prints a Western-style ``main'' name. It then always calls \cmd{\AKA} with a full alternate name and prints it in parentheses. The syntax is: +% \cmd{\PName} is a ``convenience macro'' that sacrifices flexibility for simplicity. It uses only the \meta{FNN}\meta{SNN} use of \cmd{\AKA}. It does not use \cmd{\AKA*}. It is meant for Western-style names. It calls formats a Western-style ``main'' name followed by a cross-reference in parentheses. The syntax is: % \begin{quote} -% \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{lesser-known FNN}\marg{lesser-known SNN} +% \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{other FNN}\marg{other SNN}\oarg{other alt.} % \end{quote} % % \noindent The author determines the name that is indexed (the first name) and the subsequent name that only occurs as a \emph{see} reference. For example: % -% \begin{quote} -% |\PName*[Mark]{Twain}[Samuel L.]{Clemens}| compared to\\ -% |\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}| and\\ -% |\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}. +% \begin{quote}\footnotesize +% \begin{tabular}{lp{1.3in}}\hline +% {\normalsize\strut}|\PName[Mark]{Twain}[Samuel L.]{Clemens}| & \PName[Mark]{Twain}[Samuel L.]{Clemens}\\ +% |\PName*[Mark]{Twain}[Samuel L.]{Clemens}| & \PName*[Mark]{Twain}[Samuel L.]{Clemens}\\ +% |\PName[Mark]{Twain}[Samuel L.]{Clemens}| & \PName[Mark]{Twain}[Samuel L.]{Clemens}\\\hline +% {\normalsize\strut}|\PName{Voltaire}[François-Marie]{Arouet}| & \PName{Voltaire}[François-Marie]{Arouet}\\ +% |\PName*{Voltaire}[François-Marie]{Arouet}| & \PName*{Voltaire}[François-Marie]{Arouet}\\ +% |\PName{Voltaire}[François-Marie]{Arouet}| & \PName{Voltaire}[François-Marie]{Arouet}\\\hline +% \end{tabular} % \end{quote} % -% \noindent 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{Indexing Macros} -% \subsubsection{\cmd{\IndexName}} +% \subsubsection{\texttt{\textbackslash IndexName}} % % \DescribeMacro{\IndexName} % This macro creates an index entry like those created by \cmd{\Name} and friends. It prints no text in the body and permits no special formatting. The syntax is: % \begin{quote} % \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{alternate names} % \end{quote} -% \cmd{\IndexName} does not index the alternate names unless \meta{FNN} are absent. If indexing is switched off (see Section \ref{sec:SectionIndex}), this macro does nothing. It will not create index entries for names that have been used as cross-references. +% \cmd{\IndexName} does not index \meta{alternate names} unless \meta{FNN} are absent, whereupon it treats \meta{alternate names} as a sobriquet. If indexing is switched off (see Section \ref{sec:SectionIndex}), this macro does nothing. It will not create index entries for names that have been used as cross-references. % -% \subsubsection{\cmd{\TagName}} +% \subsubsection{\texttt{\textbackslash TagName}} % \label{sec:TagName} % % \DescribeMacro{\TagName} @@ -767,21 +702,21 @@ % \begin{quote} % \cmd{\TagName}\oarg{FNN}\marg{SNN}\oarg{alternate names}\marg{tag} % \end{quote} -% Tags created by \cmd{\TagName} can be helpful in the indexes of history texts. Several features of this package are designed for historical research. Suppose you are working with medieval subject matter. The following macros come in handy:\\ +% \cmd{\TagName} and \cmd{\UntagName} handle their name arguments like \cmd{\IndexName}. Tags created by \cmd{\TagName} can be helpful in the indexes of history texts. Several features of this package are designed for historical research. Suppose you are working with medieval subject matter. The following macros come in handy:\\ % % \begin{tabular}{p{2in}p{2in}} -% |\TagName{Leo, I}{, pope}| |\TagName{Gregory, I}{, pope}| & Tag these names at the beginning of the document.\TagName{Leo, I}{, pope}\TagName{Gregory, I}{, pope}\\ +% |\TagName{Leo, I}{, pope}| |\TagName{Gregory, I}{, pope}| & Tag these names at the beginning of the document.\\ % \dots & \\ -% |\Name{Leo, I}| |\Name{Gregory, I}| & First references to \Name{Leo, I} and \Name{Gregory, I}\\ +% |\Name{Leo, I}| |\Name{Gregory, I}| & First references to \Name{Leo, I} and \ForgetName{Gregory, I}\Name{Gregory, I}\\ % \dots & \\ % |\Name*{Leo, I} was known as| |\AKA{Leo, I}{Leo}[the Great].| & \Name*{Leo, I} was known as \AKA{Leo, I}{Leo}[the Great].\\ % \dots & \\ % |\Name{Gregory, I}| |``\AKA*{Gregory, I}%| |{Gregory}[the Great]''| & \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great]'' was another major pope.\\ -% \end{tabular}\\ +% \end{tabular}\\[1ex] % -% \noindent \cmd{\TagName} causes tags in the index entries to be inserted automatically from the point of invocation. \cmd{\AKA} prints the name and the sobriquet, while \cmd{\AKA*} only prints the sobriquet, One could do similarly with emperors, kings, etc. +% \noindent \cmd{\TagName} causes tags in the index entries to be inserted automatically from the point of invocation. \cmd{\AKA} prints the name and the sobriquet, while \cmd{\AKA*} only prints the sobriquet. The tag is literal text; it can be comma-delimited, in parentheses, or whetever an author might want. % -% \subsubsection{\cmd{\UntagName}} +% \subsubsection{\texttt{\textbackslash UntagName}} % % \DescribeMacro{\UntagName} % This macro removes a tag created by \cmd{\TagName}. The syntax is: @@ -793,12 +728,12 @@ % \begin{tabular}{p{2in}p{2in}} % |\ForgetName[John]{Smith}| |\TagName[John]{Smith}%| |{, the other one}| |\Name[John]{Smith}|\dots & This is the first reference to \ForgetName[John]{Smith}\TagName[John]{Smith}{, the other one}\Name[John]{Smith}, ``the other one'' in the index. Notice that it is tweaked.\\ % |\ForgetName[John]{Smith}| |\TagName[John]{Smith}%| |{, the third}| |\Name[John]{Smith}|\dots & This refers to \ForgetName[John]{Smith}\TagName[John]{Smith}{, the third}\Name[John]{Smith} ``the third'' in the index. It is tweaked again as a ``first occurrence.''\\ -% |\SubvertName[John]{Smith}| |\UntagName[John]{Smith}| |\Name*[John]{Smith}| & This refers to the \SubvertName[John]{Smith}\UntagName[John]{Smith}\Name*[John]{Smith} in the quick start guide. It is tweaked in order to force a subsequent reference.\\ +% |\SubvertName[John]{Smith}| |\UntagName[John]{Smith}| |\Name*[John]{Smith}| & This refers to the \SubvertName[John]{Smith}\UntagName[John]{Smith}\Name*[John]{Smith} in Section \ref{sec:start}. It is tweaked in order to force a subsequent reference.\\[1ex] % \end{tabular}\\ % % \noindent Tagging and untagging in this manner requires the author to juggle more info. With more freedom comes more responsibility. % -% \subsubsection{\cmd{\ExcludeName}} +% \subsubsection{\texttt{\textbackslash ExcludeName}} % % \DescribeMacro{\ExcludeName} % This prevents \cmd{\Name}, etc. from both formatting and indexing a specific name, but \emph{only if that name has not been used}. See also Section \ref{sec:error}. The syntax is: @@ -823,26 +758,141 @@ % \item In all cases of the variant spelling, wrap \cmd{\Name} and friends between \cmd{\IndexInactive} and \cmd{\IndexActive}. A macro can do this easily. % \item Call \cmd{\IndexName} with the authoritative form right after \cmd{\IndexActive}. Again, this can be part of a macro. % \end{enumerate} -% % This looks cumbersome, but it ensures accuracy. It cannot be reduced to an all-purpose macro because that would generate an ambiguous argument list. It should only be used in those cases where minor variations in spelling do not cause the reader to question the identity of the person in question. % -% \subsection{Error Handling} -% \label{sec:error} -% -% Except for the indexing macros, most of the macros in this package print any erroneous arguments in the text without formatting. Unless there is a syntax error, all macros emit meaningful warnings. The convenience macros do not emit warnings; however, their component macros do. For example, \cmd{\PName} produces warnings via \cmd{\Name} and \cmd{\AKA}. +% \subsection{Naming Pattern Reference} +% \label{sec:PatRef} +% \subsubsection{Basic Naming} +% \begin{multicols}{2}\small +% \noindent The macro used most often is \cmd{\Name}, but we list the starred form first here because it always produces the fullest name form. When referring to a name for the first time, the following macros have the same result: +% \begin{enumerate}\setlength\itemsep{0pt} +% \item First reference: \ForgetName[John]{Smith}\Name[John]{Smith}\\[0.5ex] +% |\Name*[John]{Smith}| or\\ |\Name[John]{Smith}| or\\ |\FName[John]{Smith}| +% \item First mononym reference: \ForgetName{Plato}\Name{Plato}\\[0.5ex] +% |\Name*{Plato}| or\\ |\Name{Plato}| or\\ |\FName{Plato}| +% \end{enumerate} +% Subsequent references to names have a different format depending on the macro used: +% \begin{enumerate}\addtocounter{enumi}{2}\setlength\itemsep{0pt} +% \item Subsequent full name: \Name*[John]{Smith}\\[0.5ex] +% |\Name*[John]{Smith}| +% \item Subsequent surname: \Name[John]{Smith}\\[0.5ex] +% |\Name[John]{Smith}| +% \item Subsequent forename: \FName[John]{Smith}\\[0.5ex] +% |\FName[John]{Smith}| +% \item Subsequent mononym: \Name{Plato}\\[0.5ex] +% |\Name*{Plato}| or\\ |\Name{Plato}| or\\ |\FName{Plato}| +% \end{enumerate} +% These examples show printing of alternate forenames, keeping the same name in the index. They use both the first and final optional parameters of \cmd{\Name} and friends. +% \begin{enumerate}\addtocounter{enumi}{6}\setlength\itemsep{0pt}\small +% \item Long first ref: \ForgetName[J.Q.]{Public}\Name[J.Q.]{Public}[Jane Q.]\\[0.5ex] +% |\Name*[J.Q.]{Public}[Jane Q.]| or\\ |\Name[J.Q.]{Public}[Jane Q.]| or\\ |\FName[J.Q.]{Public}[Jane Q.]| +% \item Different forenames, same surname: \Name*[J.Q.]{Public}[Jane Qetsiyah]\\[0.5ex] +% {\footnotesize |\Name*[J.Q.]{Public}[Jane Qetsiyah]|} +% \item Subsequent name: \Name*[J.Q.]{Public}\\[0.5ex] +% |\Name*[J.Q.]{Public}| +% \item Alternate forename: \FName[J.Q.]{Public}[Janie]\\[0.5ex] +% |\FName[J.Q.]{Public}[Janie]| +% \end{enumerate} +% These next examples work with or without the \texttt{comma} option. \cmd{\AKA} and \cmd{\PName} cannot cross-reference these forms. Page \pageref{sec:Intermediate}, Section \ref{sec:suffix}, and Section \ref{sec:pennames} address this issue with different solutions. +% \begin{enumerate}\addtocounter{enumi}{10}\setlength\itemsep{0pt} +% \item First Eastern ref: \ForgetName{Mao}[Tse-tung]\Name{Mao}[Tse-tung]\\[0.5ex] +% |\Name*{Mao}[Tse-tung]| or\\ |\Name{Mao}[Tse-tung]| +% \item Subsequent references: \Name*{Mao}[Tse-tung]\\[0.5ex] +% |\Name*{Mao}[Tse-tung]| +% \item Subsequent references: \Name{Mao}[Tse-tung]\\[0.5ex] +% |\Name{Mao}[Tse-tung]| or\\ |\FName{Mao}[Tse-tung]| +% \item First royal: \ForgetName{Louis}[the Pious]\Name{Louis}[the Pious]\\[0.5ex] +% |\Name*{Louis}[the Pious]| or\\ |\Name{Louis}[the Pious]| or\\ |\FName{Louis}[the Pious]| +% \item Subsequent refs: \Name*{Louis}[the Pious]\\[0.5ex] +% |\Name*{Louis}[the Pious]| +% \item Subsequent references: \Name{Louis}[the Pious]\\[0.5ex] +% |\Name{Louis}[the Pious]| or\\ |\FName{Louis}[the Pious]| +% \item First ancient: \ForgetName{Ptolemy I}[Soter]\Name{Ptolemy I}[Soter]\\[0.5ex] +% |\Name*{Ptolemy I}[Soter]| or\\ |\Name{Ptolemy I}[Soter]| or\\ |\FName{Ptolemy I}[Soter]|\columnbreak +% \item Subsequent refs: \Name*{Ptolemy I}[Soter]\\[0.5ex] +% |\Name*{Ptolemy I}[Soter]| +% \item Subsequent refs: \Name{Ptolemy I}[Soter]\\[0.5ex] +% |\Name{Ptolemy I}[Soter]| or\\ |\FName{Ptolemy I}[Soter]| +% \item First royal: \ForgetName{Henry}[VIII]\Name{Henry}[VIII]\\[0.5ex] +% |\Name*{Henry}[VIII]| or\\ |\Name{Henry}[VIII]| or\\ |\FName{Henry}[VIII]| +% \item Subsequent refs: \Name*{Henry}[VIII]\\[0.5ex] +% |\Name*{Henry}[VIII]| +% \item Subsequent references: \Name{Henry}[VIII]\\[0.5ex] +% |\Name{Henry}[VIII]| or\\ |\FName{Henry}[VIII]| +% \end{enumerate} +% \end{multicols} % -% Not all warnings are created equal. For example, the multiple creation of a cross-reference with \cmd{\AKA} will generate a warning, but it will have no ill effects. Some warnings, especially in the case of indexing macros, indicate that the macro produced no output. +% \subsubsection{Suffixes} +% \label{sec:Intermediate}% +% \begin{multicols}{2}\small +% \noindent Always use a comma to delimit suffixes. \cmd{\AKA} and \cmd{\PName} will cross-reference these forms. See also Section \ref{sec:suffix}. Macros that are too wide for the column are split using the comment token for readability. +% \begin{enumerate}\setlength\itemsep{0pt} +% \item First: \ForgetName[George S.]{Patton, Jr.}\Name[George S.]{Patton, Jr.}\\[0.5ex] +% {\footnotesize |\Name*[George S.]{Patton, Jr.}| or\\ |\Name[George S.]{Patton, Jr.}| or\\ |\FName[George S.]{Patton, Jr.}|} +% \item Subsequent full: \Name*[George S.]{Patton, Jr.}\\[0.5ex] +% |\Name*[George S.]{Patton, Jr.}| +% \item Subsequent surname: \Name[George S.]{Patton, Jr.}\\[0.5ex] +% |\Name[George S.]{Patton, Jr.}| +% \item Subsequent forename: \FName[George S.]{Patton, Jr.}[George]\\[0.5ex] +% |\FName[George S.]{Patton, Jr.}%|\\|[George]| +% \end{enumerate} +% The next cases depend on the default \texttt{nocomma} option, whereby one can use comma suppression to implement forms of ancient, royal and Eastern names. \cmd{\AKA} and \cmd{\PName} will cross-reference these forms. % -% Examine the warning messages and check the index in order to find possible errors. Warnings result from: +% Cf. the reference to \Name{Ptolemy I}[Soter] (above). Using |\Name{Demetrius, I Soter}| keeps the number with the suffix. To keep the number with the name, use |\Name{Demetrius I, Soter}|.\columnbreak +% \begin{enumerate}\addtocounter{enumi}{4}\setlength\itemsep{0pt} +% \item First reference: \ForgetName{Francis, I}\Name{Francis, I}\\[0.5ex] +% |\Name*{Francis, I}| or\\ |\Name{Francis, I}| or\\ |\FName{Francis, I}| +% \item Subsequent full name: \Name*{Francis, I}\\[0.5ex] +% |\Name*{Francis, I}| +% \item Subsequent name: \Name{Francis, I}\\[0.5ex] +% |\Name{Francis, I}| or\\ |\FName{Francis, I}| +% \item First reference: \ForgetName{Demetrius, I Soter}\Name{Demetrius, I Soter}\\[0.5ex] +% |\Name*{Demetrius, I Soter}| or\\ |\Name{Demetrius, I Soter}| or\\ |\FName{Demetrius, I Soter}| +% \item Next full name: \Name*{Demetrius, I Soter}\\[0.5ex] +% |\Name*{Demetrius, I Soter}| +% \item Subsequent name: \Name{Demetrius, I Soter}\\[0.5ex] +% |\Name{Demetrius, I Soter}| or\\ |\FName{Demetrius, I Soter}| +% \item First reference: \ForgetName{Sun, Yat-sen}\Name{Sun, Yat-sen}\\[0.5ex] +% |\Name*{Sun, Yat-sen}| or\\ |\Name{Sun, Yat-sen}| or\\ |\FName{Sun, Yat-sen}| +% \item Subsequent full name: \Name*{Sun, Yat-sen}\\[0.5ex] +% |\Name*{Sun, Yat-sen}| +% \item Subsequent name: \Name{Sun, Yat-sen}\\[0.5ex] +% |\Name{Sun, Yat-sen}| or\\ |\FName{Sun, Yat-sen}| +% \end{enumerate} +% \end{multicols} % -% \begin{enumerate}\setlength{\itemsep}{-0.4ex} -% \item Using a cross-reference \oarg{alternate FNN}\marg{alternate SNN}\oarg{alt. names} created by \cmd{\AKA} as a reference in \cmd{\Name}, \cmd{\FName}, and \cmd{\PName}. -% \item Using a reference \oarg{FNN}\marg{SNN}\oarg{alternate names} created by \cmd{\Name}, \cmd{\FName}, and \cmd{\PName} as a cross-reference in \cmd{\AKA}. -% \item Using \cmd{\AKA} to create the same cross-reference multiple times. -% \item Using \cmd{\IndexName} to index a cross-reference as a main entry. -% \item Using \cmd{\TagName} to tag a cross-reference. -% \item Using \cmd{\ExcludeName} to exclude a name that has already been used. +% \subsubsection{Particles} +% \begin{multicols}{2}\small +% \noindent The following illustrate the American style of particulate names. +% \begin{enumerate}\setlength\itemsep{0pt} +% \item First: \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}\\[0.5ex] +% |\Name*[Walter]{de la Mare}| or\\ |\Name[Walter]{de la Mare}| or\\ |\FName[Walter]{de la Mare}| +% \item Next reference: \Name[Walter]{de la Mare}\\[0.5ex] +% |\Name[Walter]{de la Mare}| +% \item At start of sentence: \CapThis\Name[Walter]{de la Mare}\\[0.5ex] +% |\CapThis\Name[Walter]{de la Mare}| +% \item Forename: \FName[Walter]{de la Mare}\\[0.5ex] +% |\FName[Walter]{de la Mare}| % \end{enumerate} +% \label{FirstVonLast} +% The Continental style differs slightly. Forms 5--7 put the particles in the index. Forms 8--11 use the nickname feature to omit the particles from the index. Long macros are split for readability. +% \begin{enumerate}\addtocounter{enumi}{4}\setlength\itemsep{0pt} +% \item The (admittedly long) first use:\\\Name[Johann Wolfgang von]{Goethe}\\[0.5ex] +% |\Name*[Johann Wolfgang von]%|\\|{Goethe}| or\\ |\Name[Johann Wolfgang von]%|\\|{Goethe}| or\\ |\FName[Johann Wolfgang von]%|\\|{Goethe}| +% \item Subsequent: \Name[Johann Wolfgang von]{Goethe}\\[0.5ex] +% |\Name[Johann Wolfgang von]%|\\|{Goethe}| +% \item Forenames: \FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang]\\[0.5ex] +% |\FName[Johann Wolfgang von]%|\\ |{Goethe}[Johann Wolfgang]| +% \item First: \Name[Adolf]{Harnack}[Adolf von]\\[0.5ex] +% |\Name*[Adolf]{Harnack}[Adolf von]|\,or\\ |\Name[Adolf]{Harnack}[Adolf von]|\,or\\ |\FName[Adolf]{Harnack}[Adolf von]| +% \item Next full name: \Name*[Adolf]{Harnack}[Adolf von]\\[0.5ex] +% |\Name*[Adolf]{Harnack}[Adolf von]| +% \item Subsequent surname: \Name[Adolf]{Harnack}[Adolf von]\\[0.5ex] +% |\Name[Adolf]{Harnack}[Adolf von]| or |\Name[Adolf]{Harnack}| +% \item Subsequent forename: \FName[Adolf]{Harnack}\\[0.5ex] +% |\FName[Adolf]{Harnack}| +% \end{enumerate} +% \end{multicols} % \clearpage % % \StopEventually{\PrintChanges\clearpage\PrintIndex} @@ -852,14 +902,22 @@ % \iffalse %<*package> % \fi -% \subsection{Class Options and Required Packages} +% \subsection{Package Options and Required Packages} +% +% \begin{macrocode} +\newif\if@nameauth@FullName +\newif\if@nameauth@FirstName +\newif\if@nameauth@AltAKA +% \end{macrocode} +% Used internally to control printed name forms. |@nameauth@FullName| is only used to decide long or short forms in subsequent occurrences of names. The next Boolean, |@nameauth@FirstName|, switches surnames and forenames in the short form. |@nameauth@AltAKA| determines the cross-references that \cmd{\AKA} will print.\\ % % \begin{macrocode} \newif\if@nameauth@DoFormat \newif\if@nameauth@DoIndex -\newif\if@nameauth@DoComma +\newif\if@nameauth@AlwaysFormat +\newif\if@nameauth@ShowComma % \end{macrocode} -% These Boolean values control formatting, index suppression, and comma suppression. They all may be set with class options. The first two can be toggled with \cmd{\NamesActive}---\cmd{\NamesInctive} and \cmd{\IndexActive}---\cmd{\IndexInctive}.\\ +% These Boolean values control formatting. The first two can be toggled with \cmd{\NamesActive} and \cmd{\NamesInctive}, as well as \cmd{\IndexActive} and \cmd{\IndexInctive}. The first three are set with package options. The last is set with \cmd{\ShowComma} and cleared by \cmd{\Name} and friends.\\ % % \begin{macrocode} \newif\if@nameauth@Comma @@ -870,7 +928,7 @@ % \begin{macrocode} \newif\if@nameauth@DoCaps % \end{macrocode} -% This Boolean triggers capitalization in \cmd{\Name} of particles like \emph{de la} that may occur at the start of a sentence.\\ +% This Boolean triggers capitalization in \cmd{\Name} of particles like \emph{de la} that may occur at the start of a sentence. It is triggered with \cmd{\CapThis}.\\ % % \begin{macrocode} \DeclareOption{mainmatter}{\@nameauth@DoFormattrue} @@ -879,16 +937,18 @@ \DeclareOption{italic}{\renewcommand{\NamesFormat}{\itshape}} \DeclareOption{boldface}{\renewcommand{\NamesFormat}{\bfseries}} \DeclareOption{noformat}{\renewcommand{\NamesFormat}{}} -\DeclareOption{comma}{\@nameauth@DoCommatrue} -\DeclareOption{nocomma}{\@nameauth@DoCommafalse} +\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue} +\DeclareOption{comma}{\protected@edef\Interspace{,\space}} +\DeclareOption{nocomma}{\protected@edef\Interspace{\space}} \DeclareOption{index}{\@nameauth@DoIndextrue} \DeclareOption{noindex}{\@nameauth@DoIndexfalse} \ExecuteOptions{smallcaps,mainmatter,nocomma,index} \ProcessOptions\relax \RequirePackage{etoolbox} -\RequirePackage{xparse} +\RequirePackage{suffix} +\RequirePackage{xargs} % \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. Most options can be changed with user interface macros.\\ +% 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. Most options can be changed with user interface macros. Avoid changing the internal Boolean values directly.\\ % % \subsection{Internal Macros} % \begin{macro}{\@nameauth@CleanName} @@ -900,20 +960,22 @@ } % \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.\bigskip\hrule\bigskip -% \noindent The following macros parse a ``base'' name into a radix and a suffix. They are designed so that their function occurs at the time of macro expansion, not execution. This expandability is key to the proper indexing function of this package. They form the kernel of the suffix removal and comma suppression features. +% 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.\\ +% +% The following macros parse a ``base'' name into a radix and a suffix. They are designed so that their function occurs at the time of macro expansion, not execution. This expandability is key to the proper indexing 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 suffix handling} % \changes{v0.9}{2012/02/10}{renamed macro; suffix handling expandable} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} \newcommand*{\@nameauth@Root}[1]% {% - \@nameauth@TrimRoot#1\relax% + \@nameauth@TrimRoot#1,\@empty\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 \cmd{\@nameauth@CheckComma} below, one can call this macro only when the parameter takes the form <a,b>. This allows one to select the root and suffix without having a trailing comma hanging about. +% Anything starting with a comma and ending with the end of the name is stripped off. That includes ``Sr.,'' ``Jr.,'' ``III,'' and so on. % % \begin{macro}{\@nameauth@TrimRoot} % \changes{v0.85}{2012/02/05}{Divide suffix handling into functional parts} @@ -924,49 +986,47 @@ % \end{macro} % This delimited-parameter macro strips off the second parameter as it returns the first. % -% \begin{macro}{\@nameauth@Suffix} -% \changes{v0.9}{2012/02/10}{added macro} +% \begin{macro}{\@nameauth@CapRoot} +% \changes{v0.95}{2012/02/17}{Added macro} % \begin{macrocode} -\newcommand*{\@nameauth@Suffix}[1]% +\newcommand*{\@nameauth@CapRoot}[1]% {% - \@nameauth@TrimSuffix#1\relax% + \@nameauth@CR#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 the Boolean |@nameauth@Comma| and the macro \cmd{\@nameauth@CheckComma} or else errors will result. This macro calls its auxiliary macro below. +% This macro implements the particulate name capitalization mechanism. % -% \begin{macro}{\@nameauth@TrimSuffix} -% \changes{v0.9}{2012/02/10}{added macro} +% \begin{macro}{\@nameauth@CR} +% \changes{v0.95}{2012/02/17}{Added macro} % \begin{macrocode} -\def\@nameauth@TrimSuffix#1,#2\relax{#2} +\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} % \end{macrocode} % \end{macro} -% This delimited-parameter macro strips off the first parameter and returns the second. +% This delimited-parameter macro caps the first parameter and strips suffixes off the second. % -% \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{macro}{\@nameauth@Suffix} +% \changes{v0.9}{2012/02/10}{added macro} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} -\newcommand*{\@nameauth@CheckComma}[1]% +\newcommand*{\@nameauth@Suffix}[1]% {% - \@nameauth@CheckSuffix#1,\relax% + \@nameauth@TrimSuffix#1\relax% } % \end{macrocode} % \end{macro} -% This macro checks for a comma-delimited suffix. It calls the auxiliary macro below. -% -% \begin{macro}{\@nameauth@CheckSuffix} -% \changes{v0.9}{2012/02/10}{Added macro} +% Anything before a comma is stripped off by |\@nameauth@Suffix|, but it should be called only in a conditional where one knows that a comma will be present. +% +% \begin{macro}{\@nameauth@TrimSuffix} +% \changes{v0.9}{2012/02/10}{added macro} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} -\def\@nameauth@CheckSuffix#1,#2\relax% -{% - \def\Test{#2}% - \ifx\Test\@empty\@nameauth@Commafalse\else\@nameauth@Commatrue\fi% -} +\def\@nameauth@TrimSuffix#1,#2\relax{#2} % \end{macrocode} % \end{macro} -% This macro checks for a comma-delimited suffix and sets the Boolean value of |@nameauth@Comma| to true if the suffix is not equal to the empty string.\bigskip\hrule\bigskip -%\noindent The next macros check whether the next token is a period. They are only called if the terminal character produced within \cmd{\Name} and \cmd{\FName} is itself a period. +% This delimited-parameter macro strips the first parameter and returns the second.\\ +% +% The next macros check whether the next token is a period. They are only called if the terminal character produced within \cmd{\Name} and \cmd{\FName} is itself a period. % % \begin{macro}{\@nameauth@CheckDot} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} @@ -1000,9 +1060,9 @@ } % \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.\bigskip\hrule\bigskip +% 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.\\ % -% \noindent The following macros format the output for \cmd{\Name} and friends. +% The following macros format the output for \cmd{\Name} and friends. The intent is to separate formatting in modular fashion from name parsing. % % \begin{macro}{\@nameauth@FmtName} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} @@ -1011,54 +1071,51 @@ % \changes{v0.94}{2012/02/15}{Added particle caps} % \changes{v0.95}{2012/02/17}{Fixed incompatibility with \textsf{microtype}} % \begin{macrocode} -\DeclareDocumentCommand\@nameauth@FmtName{s m}% +\newcommand{\@nameauth@FmtName}[1]% {% - \@nameauth@DoCapsfalse% - \@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% - {#2}% - {\bgroup\NamesFormat{#2}\egroup}% + \@nameauth@TestDot{#1}% + \if@nameauth@DoFormat% + \bgroup\NamesFormat{#1}\egroup% + \else% + #1% + \fi% +} +\WithSuffix\newcommand\@nameauth@FmtName*[1]% +{% + \@nameauth@TestDot{#1}% + \if@nameauth@DoFormat% + \if@nameauth@AlwaysFormat% + \bgroup\NamesFormat{#1}\egroup% + \else% + #1% + \fi% + \else% + #1% + \fi% } % \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. +% \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 conditional |\if@nameauth@AlwaysFormat| causes formatting to occur always (when possible). % % \begin{macro}{\@nameauth@Index} % \changes{v0.94}{2012/02/15}{Added macro} % \begin{macrocode} -\DeclareDocumentCommand\@nameauth@Index{m o}% +\newcommandx\@nameauth@Index[2][2=\@empty]% {% - \IfValueTF{#2} - {\ifcsname#2\endcsname% - \if@nameauth@DoIndex\index{#1\csname#2\endcsname}\fi% - \else% + \ifx#2\@empty% \if@nameauth@DoIndex\index{#1}\fi% - \fi}% - {\if@nameauth@DoIndex\index{#1}\fi}% + \else% + \ifcsname#2\endcsname% + \if@nameauth@DoIndex\index{#1\csname#2\endcsname}\fi% + \else% + \if@nameauth@DoIndex\index{#1}\fi% + \fi% + \fi% } % \end{macrocode} % \end{macro} % If the indexing flag is true, create an index entry, otherwise do nothing.\clearpage % -% \begin{macro}{\@nameauth@CapRoot} -% \changes{v0.95}{2012/02/17}{Added macro} -% \begin{macrocode} -\newcommand*{\@nameauth@CapRoot}[1]% -{% - \@nameauth@CR#1\relax% -} -% \end{macrocode} -% \end{macro} -% This macro implements the particulate name capitalization mechanism. All of the macros that manipulate strings through parametrized expansion appear to work best when called immediately in \cmd{\Name} and \cmd{\FName}. -% -% \begin{macro}{\@nameauth@CR} -% \changes{v0.95}{2012/02/17}{Added macro} -% \begin{macrocode} -\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} -% \end{macrocode} -% \end{macro} -% This delimited-parameter macro caps the first parameter and strips suffixes on the second. -% % \subsection{User Interface Macros} % % \begin{macro}{\CapThis} @@ -1070,7 +1127,18 @@ } % \end{macrocode} % \end{macro} -% Toggle the capitalizing of particles. \cmd{\@nameauth@FmtName} always reverts the Boolean to false, thus localizing any changes until this is called again. +% Force the capitalizing of particles. This affects the next occurrence of \cmd{\Name}, which then turns off the forced caps. +% +% \begin{macro}{\ShowComma} +% \changes{v1.4}{2012/07/24}{Added macro} +% \begin{macrocode} +\newcommand{\ShowComma}% +{% + \@nameauth@ShowCommatrue% +} +% \end{macrocode} +% \end{macro} +% Force a comma between a name and a suffix on a per-issue basis. % % \begin{macro}{\Name} % \changes{v0.75}{2012/01/19}{Added ``sobriquet'' feature} @@ -1082,172 +1150,217 @@ % \changes{v0.96}{2012/02/19}{Fixed occasional incompatibility with \textsf{memoir}.} % \changes{v1.0}{2012/02/20}{Fixed compatibility issues.} % \changes{v1.26}{2012/04/24}{Fixed sorting of name suffixes in index} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} -\DeclareDocumentCommand\Name{s o m o}% +\newcommandx\Name[3][1=\@empty, 3=\@empty]% {% - \protected@edef\Surnames{#3}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoCaps% - \protected@edef\Shortnames{\@nameauth@CapRoot{#3,}}% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \leavevmode\hbox{}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% \else% - \protected@edef\Shortnames{\@nameauth@Root{#3,}}% + \let\Space\Interspace% \fi% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#3}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% - \protected@edef\Suffix{\@nameauth@Suffix{#3}}% + \protected@edef\RawSurnames{#2}% + \protected@edef\RawShort{\@nameauth@Root{#2}}% + \protected@edef\CapShort{\@nameauth@CapRoot{#2}}% + \let\IndexShort\RawShort% + \let\IndexSurnames\RawShort% + \ifx\RawSurnames\RawShort% + \protected@edef\Suffix{\@empty}% + \if@nameauth@DoCaps% + \let\Surnames\CapShort% + \let\PrintShort\CapShort% + \else% + \let\Surnames\RawShort% + \let\PrintShort\RawShort% \fi% - \fi% - \IfValueTF{#2}% - {\IfValueTF{#4}% - {\def\Forenames{#4}}{\def\Forenames{#2}}% - \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \PackageWarning{nameauth}% - {macro Name Cross-reference: #2 #3 cannot be a page reference.}% \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% + \protected@edef\Suffix{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\IndexSurnames{\RawShort\Space\Suffix}% + \if@nameauth@DoCaps% + \protected@edef\Surnames{\CapShort\Space\Suffix}% + \let\PrintShort\CapShort% + \else% + \protected@edef\Surnames{\RawShort\Space\Suffix}% + \let\PrintShort\RawShort% + \fi% + \fi% + \@nameauth@DoCapsfalse% + \@nameauth@ShowCommafalse% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \Name: Xref: #2 cannot be a page reference.}% \else% - \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% + \@nameauth@Index{\IndexSurnames}[\@nameauth@CleanName{#2}]% \fi% - \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% + \if@nameauth@DoFormat% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% + \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2!MN!}}{}% + \expandafter\@nameauth@FmtName\expandafter{\Surnames}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% + \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \fi% \fi% - \fi% - \fi}% - {\IfValueTF{#4} - {\ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \PackageWarning{nameauth}% - {macro Name Cross-reference: #3 #4 cannot be a page reference.}% \else% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \Name: Xref: #2 #3 cannot be a page reference.}% + \else% + \@nameauth@Index{\IndexSurnames\space#3}[\@nameauth@CleanName{#2#3}]% + \fi% \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% - \Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]% + \expandafter\Surnames\expandafter\space#3}% \fi% \else% - \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% \fi% \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% + \fi% + \else% + \ifx\testiii\@empty% + \protected@edef\Forenames{#1}% + \else% + \protected@edef\Forenames{#3}% + \fi + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro Name Cross-reference: #3 cannot be a page reference.}% + {macro \Name: Xref: #1 #2 cannot be a page reference.}% \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - {\@nameauth@FmtName*{\Shortnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% + \ifx\Suffix\@empty% + \@nameauth@Index{\IndexShort, #1}[\@nameauth@CleanName{#1#2}]% + \else% + \@nameauth@Index{\IndexShort, #1, \Suffix}[\@nameauth@CleanName{#1#2}]% + \fi% + \fi% + \if@nameauth@DoFormat% + \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \let\PrintShort\Forenames% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% \else% - \csgdef{\@nameauth@CleanName{#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% \fi% \else% - \ifcsname\@nameauth@CleanName{#3!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - {\@nameauth@FmtName*{\Shortnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% + \expandafter\@nameauth@FmtName\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \let\PrintShort\Forenames% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% \else% - \csgdef{\@nameauth@CleanName{#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% \fi% + \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% \fi% - \fi}% - }% + \fi% + \fi% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } % \end{macrocode} % \end{macro} -% \cmd{\Name} is the heart of this package. \Name*[Marc van]{Dongen} provided the basic structure. % -%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. -% -% 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. -% -% 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} and \cmd{\Surnames}. The former needs to be fully expanded for the double-period checking to work, thus using \cmd{\edef}. The latter should not be fully expanded when using the \textsf{memoir} class with the utf8 option of \textsf{inputenc}. This will be passed respectively to \cmd{\@nameauth@FmtName} and \cmd{\@nameauth@Index}.\\ -% -%\noindent \cmd{\Name} then checks for the forenames argument. Two outcomes are possible. -% \begin{enumerate} -% \item Forenames are present. In this case, the alternate names argument creates two choices. -% \begin{enumerate} -% \item The alternate names replace the forenames in the printed form, not the indexed form. -% \item The absence of alternate names will result in the forenames being used for both forms. -% \end{enumerate} -% \item Forenames are absent. In that case, the alternate names argument creates two different choices. -% \begin{enumerate} -% \item The alternate names are appended to the surnames in both printed and indexed forms. -% \item Only the surnames are used. -% \end{enumerate} -% \end{enumerate} -% -% 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. +% \begin{macro}{\Name*} +% \changes{v1.4}{2012/07/24}{Refactored} +% \begin{macrocode} +\WithSuffix\newcommandx\Name*[3][1=\@empty, 3=\@empty]% +{% + \@nameauth@FullNametrue% + \Name[#1]{#2}[#3]% +} +% \end{macrocode} +% \end{macro} +% \cmd{\Name} is the heart of this package. \Name*[Marc van]{Dongen} provided the basic structure. The present version has been refactored to isolate indexing and parsing. Macros have been redesigned to be smaller, more efficient, and more robust. % -% 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 present version of \cmd{\Name} incorporates \cmd{\FName} as well. % % 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. % @@ -1257,117 +1370,27 @@ % \changes{v0.96}{2012/02/19}{Fixed occasional incompatibility with \textsf{memoir}.} % \changes{v1.0}{2012/02/20}{Fixed compatibility issues.} % \changes{v1.26}{2012/04/24}{Fixed sorting of name suffixes in index} +% \changes{v1.4}{2012/07/24}{Refactored} % \begin{macrocode} -\DeclareDocumentCommand\FName{o m o}% +\newcommandx\FName[3][1=\@empty, 3=\@empty]% {% - \protected@edef\Surnames{#2}% - \protected@edef\Shortnames{\@nameauth@Root{#2,}}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#2}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% - \protected@edef\Suffix{\@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}% - {macro FName Cross-reference: #1 #2 cannot be a page reference.}% - \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \else% - \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \fi% - \else% - \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \else% - \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \fi% - \fi% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#3}% - \PackageWarning{nameauth}% - {macro FName Cross-reference: #2 #3 cannot be a page reference.}% - \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \else% - \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName% - \expandafter{\Surnames\space#3}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \fi% - \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \else% - \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#3}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \fi% - \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \PackageWarning{nameauth}% - {macro FName Cross-reference: #2 cannot be a page reference.}% - \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \else% - \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \fi% - \else% - \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \else% - \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \fi% - \fi% - \fi}% - }% - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% + \@nameauth@FirstNametrue% + \Name[#1]{#2}[#3]% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\FName} +% \changes{v1.4}{2012/07/24}{Refactored} +% \begin{macrocode} +\WithSuffix\newcommandx\FName*[3][1=\@empty, 3=\@empty]% +{% + \@nameauth@FirstNametrue% + \Name[#1]{#2}[#3]% } % \end{macrocode} % \end{macro} -% \cmd{\FName} is derived from \cmd{\Name} and uses its logic to print forename(s) in a subsequent use. It obeys the \texttt{nocomma} option and eliminates double periods. +% \cmd{\FName} and \cmd{\FName*} are identical and derived from \cmd{\Name} using it to print forename(s) in a subsequent use. % % \begin{macro}{\AKA} % \changes{v0.85}{2012/02/05}{Add comma suppression, ltxdoc compatibility} @@ -1377,121 +1400,146 @@ % \changes{v1.0}{2012/02/20}{Fixed compatibility issues.} % \changes{v1.1}{2012/03/08}{Fixed warning reporting.} % \changes{v1.26}{2012/04/24}{Fixed sorting of name suffixes in index} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} -\DeclareDocumentCommand\AKA{s o m o m o}% +\newcommandx\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]% {% - \protected@edef\Surnamesi{#3}% - \protected@edef\Surnamesii{#5}% - \protected@edef\Shortnamesi{\@nameauth@Root{#3,}}% - \protected@edef\Shortnamesii{\@nameauth@Root{#5,}}% - \protected@edef\Suffixi{\@empty}% - \protected@edef\Suffixii{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#3}% - \if@nameauth@Comma% - \protected@edef\Surnamesi{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% - \protected@edef\Suffixi{\@nameauth@Suffix{#3}}% - \fi% - \@nameauth@CheckComma{#5}% - \if@nameauth@Comma% - \protected@edef\Surnamesii{\@nameauth@Root{#5}\@nameauth@Suffix{#5}}% - \protected@edef\Suffixii{\@nameauth@Suffix{#5}}% - \fi% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \protected@edef\testv{#5}% + \leavevmode\hbox{}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% + \else% + \let\Space\Interspace% \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% - \PackageWarning{nameauth}% - {macro AKA XRef: #4 #5 exists.}% - \else% - \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% + \protected@edef\RawSurnamesi{#2}% + \protected@edef\RawSurnamesii{#4}% + \protected@edef\Shorti{\@nameauth@Root{#2}}% + \protected@edef\Shortii{\@nameauth@Root{#4}}% + \ifx\RawSurnamesi\Shorti% + \let\Surnamesi\Shorti% + \protected@edef\Suffixi{\@empty}% + \else% + \protected@edef\Suffixi{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\Surnamesi{\Shorti\Space\Suffixi}% + \fi% + \ifx\RawSurnamesii\Shortii% + \let\Surnamesii\Shortii% + \protected@edef\Suffixii{\@empty}% + \else% + \protected@edef\Suffixii{\ignorespaces\@nameauth@Suffix{#4}}% + \protected@edef\Surnamesii{\Shortii\Space\Suffixii}% + \fi% + \@nameauth@ShowCommafalse% + \ifx\testiii\@empty% + \ifx\testv\@empty% + \ifcsname\@nameauth@CleanName{#4!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #4 #5 already exists; no see ref.}% + {macro \AKA: XRef: #4 exists.}% \else% - \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#4!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #4 #5 already exists; no see ref.}% + {macro \AKA: Name reference: #4 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty% - \ifx\Suffixii\@empty% - \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}% - \else% - \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi, #2}}% - \fi% - \else% - \ifx\Suffixii\@empty% - \@nameauth@Index{\Surnamesii, #4|see{\Shortnamesi, #2, \Suffixi}}% - \else% - \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Shortnamesi, #2, \Suffixi}}% - \fi% - \fi% - }% - {% - \ifx\Suffixii\@empty \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}% - \else\@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi}}\fi% - }% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \AKA: Name reference: #4 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4!PN!}}{}% + \ifx\testi\@empty% + \@nameauth@Index{\Surnamesii|see{\Surnamesi}}% + \else% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii|see{\Surnamesi, #1}}% + \else\@nameauth@Index{\Surnamesii|see{\Shorti, #1, \Suffixi}}\fi% + \fi% + \fi% \fi% \fi% - \fi}% - {\IfValueTF{#6}% - {\IfBooleanTF{#1}% - {\@nameauth@FmtName*{#6}}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnamesii\space#6}}% - \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro AKA XRef: #5 #6 exists.}% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% \else% - \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 #6 already exists; no see ref.}% + {macro \AKA: XRef: #4 #5 exists.}% \else% - \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 #6 already exists; no see ref.}% + {macro \AKA: Name reference: #4 #5 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}% - \else\@nameauth@Index{\Surnamesii\space#6|see{\Shortnamesi, #2, \Suffixi}}\fi% - }% - {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi}}}% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% + \ifx\testi\@empty% + \@nameauth@Index{\Surnamesii\space#5|see{\Surnamesi}}% + \else% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii\space#5|see{\Surnamesi, #1}}% + \else\@nameauth@Index{\Surnamesii\space#5|see{\Shorti, #1, \Suffixi}}\fi% + \fi% + \fi% \fi% \fi% - \fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% - \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname% + \if@nameauth@AltAKA% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{#5}% + \else% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii\space#5}% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA XRef: #5 exists.}% + {macro \AKA: XRef: #3 #4 exists.}% \else% - \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 already exists; no see ref.}% + {macro \AKA: Name reference: #3 #4 already exists; no see ref.}% \else% - \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 already exists; no see ref.}% + {macro \AKA: Name reference: #3 #4 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#5!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}% - \else\@nameauth@Index{\Surnamesii|see{\Shortnamesi, #2, \Suffixi}}\fi% - }% - {\@nameauth@Index{\Surnamesii|see{\Surnamesi}}}% + \csgdef{\@nameauth@CleanName{#3#4!PN!}}{}% + \ifx\testi\@empty% + \ifx\Suffixii\@empty \@nameauth@Index{\Surnamesii, #3|see{\Surnamesi}}% + \else\@nameauth@Index{\Shortii, #3, \Suffixii|see{\Surnamesi}}\fi% + \else% + \ifx\Suffixi\@empty% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #3|see{\Surnamesi, #1}}% + \else% + \@nameauth@Index{\Shortii, #3, \Suffixii|see{\Surnamesi, #1}}% + \fi% + \else% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #3|see{\Shorti, #1, \Suffixi}}% + \else% + \@nameauth@Index{\Shortii, #3, \Suffixii|see{\Shorti, #1, \Suffixi}}% + \fi% + \fi% + \fi% \fi% \fi% - \fi}% - }% + \fi% + \@nameauth@AltAKAfalse% + \ifx\testv\@empty% + \protected@edef\Forenames{#3}% + \else% + \protected@edef\Forenames{#5}% + \fi% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnamesii}% + \fi% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } +\WithSuffix\newcommandx\AKA*[5][1=\@empty,3=\@empty,5=\@empty]% +{% + \@nameauth@AltAKAtrue% + \AKA[#1]{#2}[#3]{#4}[#5]% +} % \end{macrocode} % \end{macro} % \cmd{\AKA} prints a pseudonym and creates index cross-references. Its starred form prints only the alternate name parameter, if that exists. It prevents multiple generation of cross-references and suppresses double periods. @@ -1499,10 +1547,13 @@ % \begin{macro}{\PName} % \changes{v0.85}{2012/02/05}{Add comma suppression} % \begin{macrocode} -\DeclareDocumentCommand\PName{s o m o m o}% +\newcommandx\PName[5][1=\@empty,3=\@empty,5=\@empty]% +{% + \Name[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% +} +\WithSuffix\newcommandx\PName*[5][1=\@empty,3=\@empty,5=\@empty]% {% - \IfBooleanTF{#1}{\Name*[#2]{#3}}{\Name[#2]{#3}}% - {\space}(\AKA[#2]{#3}[#4]{#5}[#6])% + \Name*[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% } % \end{macrocode} % \end{macro} @@ -1511,29 +1562,34 @@ % \begin{macro}{\TagName} % \changes{v1.2}{2012/02/25}{Added macro.} % \begin{macrocode} -\DeclareDocumentCommand\TagName{o m o m}% +\newcommandx\TagName[4][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #1 #2.}% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \textbackslash TagName Cannot tag xref: #2.}% + \else% + \csgdef{\@nameauth@CleanName{#2}}{#4}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#1#2}}{#4}% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #2 #3.}% + {macro \textbackslash TagName Cannot tag xref: #2 #3.}% \else% \csgdef{\@nameauth@CleanName{#2#3}}{#4}% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #2.}% + {macro \textbackslash TagName Cannot tag xref: #1 #2.}% \else% - \csgdef{\@nameauth@CleanName{#2}}{#4}% - \fi}% - }% + \csgdef{\@nameauth@CleanName{#1#2}}{#4}% + \fi% + \fi% } % \end{macrocode} % \end{macro} @@ -1542,14 +1598,19 @@ % \begin{macro}{\UntagName} % \changes{v1.2}{2012/02/25}{Added macro.} % \begin{macrocode} -\DeclareDocumentCommand\UntagName{o m o}% +\newcommandx\UntagName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {\csundef{\@nameauth@CleanName{#1#2}}}% - {\IfValueTF{#3} - {\csundef{\@nameauth@CleanName{#2#3}}}% - {\csundef{\@nameauth@CleanName{#2}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csundef{\@nameauth@CleanName{#2}}% + \else% + \csundef{\@nameauth@CleanName{#2#3}}% + \fi% + \else% + \csundef{\@nameauth@CleanName{#1#2}}% + \fi% } % \end{macrocode} % \end{macro} @@ -1563,41 +1624,52 @@ % \changes{v1.0}{2012/02/20}{Fixed compatibility issues.} % \changes{v1.2}{2012/02/25}{Added warnings.} % \changes{v1.26}{2012/04/24}{Fixed sorting of name suffixes in index} +% \changes{v1.4}{2012/07/24}{Made more robust} % \begin{macrocode} -\DeclareDocumentCommand\IndexName{o m o}% +\newcommandx\IndexName[3][1=\@empty, 3=\@empty]% {% - \protected@edef\Surnames{#2}% - \protected@edef\Short{\@nameauth@Root{#2,}}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#2}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% - \protected@edef\Suffix{\@nameauth@Suffix{#2}}% - \fi% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% + \else% + \let\Space\Interspace% \fi% - \IfValueTF{#1}% - {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro IndexName XRef: #1 #2 exists.}% + \protected@edef\RawSurnames{#2}% + \protected@edef\Short{\@nameauth@Root{#2}}% + \ifx\RawSurnames\Short% + \let\Surnames\Short% + \protected@edef\Suffix{\@empty}% + \else% + \protected@edef\Suffix{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\Surnames{\Short\Space\Suffix}% + \fi% + \@nameauth@ShowCommafalse% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 exists.}% + \else% + \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% + \fi% \else% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Short, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \PackageWarning{nameauth}% - {macro IndexName XRef: #2 #3 exists.}% + {macro \IndexName: XRef: #2 #3 exists.}% \else% \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro IndexName XRef: #2 exists.}% + {macro \IndexName: XRef: #1 #2 exists.}% \else% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \fi}% - }% + \ifx\Suffix\@empty \@nameauth@Index{\Short, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Short, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% + \fi% + \fi% } % \end{macrocode} % \end{macro} @@ -1606,56 +1678,60 @@ % \begin{macro}{\ExcludeName} % \changes{v0.94}{2012/02/15}{Added macro} % \begin{macrocode} -\DeclareDocumentCommand\ExcludeName{o m o}% +\newcommandx\ExcludeName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {% - \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName XRef: #1 #2 exists.}% - \else% - \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #1 #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \fi% \fi% \fi% - \fi}% - {\IfValueTF{#3}% - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 #3 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #2 #3 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \fi% \fi% \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: XRef: #1 #2 exists.}% \else% - \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #1 #2 already exists; no exclusion.}% \else% - \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #1 #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% \fi% \fi% - \fi}% - }% + \fi% + \fi% } % \end{macrocode} % \end{macro} @@ -1664,17 +1740,22 @@ % \begin{macro}{\ForgetName} % \changes{v0.75}{2012/01/19}{New parameter added} % \begin{macrocode} -\DeclareDocumentCommand\ForgetName{o m o}% +\newcommandx\ForgetName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {\csundef{\@nameauth@CleanName{#1#2!MN!}}% - \csundef{\@nameauth@CleanName{#1#2!NF!}}}% - {\IfValueTF{#3}% - {\csundef{\@nameauth@CleanName{#2#3!MN!}}% - \csundef{\@nameauth@CleanName{#2#3!NF!}}}% - {\csundef{\@nameauth@CleanName{#2!MN!}}% - \csundef{\@nameauth@CleanName{#2!NF!}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csundef{\@nameauth@CleanName{#2!MN!}}% + \csundef{\@nameauth@CleanName{#2!NF!}}% + \else% + \csundef{\@nameauth@CleanName{#2#3!MN!}}% + \csundef{\@nameauth@CleanName{#2#3!NF!}}% + \fi% + \else% + \csundef{\@nameauth@CleanName{#1#2!MN!}}% + \csundef{\@nameauth@CleanName{#1#2!NF!}}% + \fi% } % \end{macrocode} % \end{macro} @@ -1683,21 +1764,26 @@ % \begin{macro}{\SubvertName} % \changes{v0.9}{2012/02/10}{Added macro} % \begin{macrocode} -\DeclareDocumentCommand\SubvertName{o m o}% +\newcommandx\SubvertName[3][1=\@empty, 3=\@empty]% {% - \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!}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csgdef{\@nameauth@CleanName{#2!MN!}}{}% + \csgdef{\@nameauth@CleanName{#2!NF!}}{}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% + \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% + \fi% + \else% + \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% + \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% + \fi% } % \end{macrocode} % \end{macro} -% \cmd{\SubvertName} defines control sequences to suppress the ``first use'' of \cmd{\Name}.\bigskip\hrule\bigskip +% \cmd{\SubvertName} defines control sequences to suppress the ``first use'' of \cmd{\Name}.\\ % % \noindent The following macros toggle formatting and indexing. % diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index 8a85de3f081..333ac40c544 100644 --- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty +++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty @@ -22,11 +22,16 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{nameauth} - [2012/04/24 v1.26 name authority macros to aid consistent display and indexing of names] + [2012/07/24 v1.4 name authority macros to aid consistent display and indexing of names] + +\newif\if@nameauth@FullName +\newif\if@nameauth@FirstName +\newif\if@nameauth@AltAKA \newif\if@nameauth@DoFormat \newif\if@nameauth@DoIndex -\newif\if@nameauth@DoComma +\newif\if@nameauth@AlwaysFormat +\newif\if@nameauth@ShowComma \newif\if@nameauth@Comma \newif\if@nameauth@Punct \newif\if@nameauth@DoCaps @@ -36,37 +41,35 @@ \DeclareOption{italic}{\renewcommand{\NamesFormat}{\itshape}} \DeclareOption{boldface}{\renewcommand{\NamesFormat}{\bfseries}} \DeclareOption{noformat}{\renewcommand{\NamesFormat}{}} -\DeclareOption{comma}{\@nameauth@DoCommatrue} -\DeclareOption{nocomma}{\@nameauth@DoCommafalse} +\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue} +\DeclareOption{comma}{\protected@edef\Interspace{,\space}} +\DeclareOption{nocomma}{\protected@edef\Interspace{\space}} \DeclareOption{index}{\@nameauth@DoIndextrue} \DeclareOption{noindex}{\@nameauth@DoIndexfalse} \ExecuteOptions{smallcaps,mainmatter,nocomma,index} \ProcessOptions\relax \RequirePackage{etoolbox} -\RequirePackage{xparse} +\RequirePackage{suffix} +\RequirePackage{xargs} \newcommand*{\@nameauth@CleanName}[1]% {% \expandafter\zap@space\detokenize{#1} \@empty% } \newcommand*{\@nameauth@Root}[1]% {% - \@nameauth@TrimRoot#1\relax% + \@nameauth@TrimRoot#1,\@empty\relax% } \def\@nameauth@TrimRoot#1,#2\relax{#1} +\newcommand*{\@nameauth@CapRoot}[1]% +{% + \@nameauth@CR#1\relax% +} +\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} \newcommand*{\@nameauth@Suffix}[1]% {% \@nameauth@TrimSuffix#1\relax% } \def\@nameauth@TrimSuffix#1,#2\relax{#2} -\newcommand*{\@nameauth@CheckComma}[1]% -{% - \@nameauth@CheckSuffix#1,\relax% -} -\def\@nameauth@CheckSuffix#1,#2\relax% -{% - \def\Test{#2}% - \ifx\Test\@empty\@nameauth@Commafalse\else\@nameauth@Commatrue\fi% -} \def\@nameauth@CheckDot{\futurelet\@token\@nameauth@EvalDot} \def\@nameauth@EvalDot% {% @@ -80,537 +83,578 @@ \@nameauth@Punctfalse% \TestDot#1\TestEnd.\TestEnd\TestStop% } -\DeclareDocumentCommand\@nameauth@FmtName{s m}% +\newcommand{\@nameauth@FmtName}[1]% {% - \@nameauth@DoCapsfalse% - \@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% - {#2}% - {\bgroup\NamesFormat{#2}\egroup}% + \@nameauth@TestDot{#1}% + \if@nameauth@DoFormat% + \bgroup\NamesFormat{#1}\egroup% + \else% + #1% + \fi% } -\DeclareDocumentCommand\@nameauth@Index{m o}% +\WithSuffix\newcommand\@nameauth@FmtName*[1]% {% - \IfValueTF{#2} - {\ifcsname#2\endcsname% - \if@nameauth@DoIndex\index{#1\csname#2\endcsname}\fi% + \@nameauth@TestDot{#1}% + \if@nameauth@DoFormat% + \if@nameauth@AlwaysFormat% + \bgroup\NamesFormat{#1}\egroup% + \else% + #1% + \fi% \else% - \if@nameauth@DoIndex\index{#1}\fi% - \fi}% - {\if@nameauth@DoIndex\index{#1}\fi}% + #1% + \fi% } -\newcommand*{\@nameauth@CapRoot}[1]% +\newcommandx\@nameauth@Index[2][2=\@empty]% {% - \@nameauth@CR#1\relax% + \ifx#2\@empty% + \if@nameauth@DoIndex\index{#1}\fi% + \else% + \ifcsname#2\endcsname% + \if@nameauth@DoIndex\index{#1\csname#2\endcsname}\fi% + \else% + \if@nameauth@DoIndex\index{#1}\fi% + \fi% + \fi% } -\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} \newcommand{\CapThis}% {% \@nameauth@DoCapstrue% } -\DeclareDocumentCommand\Name{s o m o}% +\newcommand{\ShowComma}% {% - \protected@edef\Surnames{#3}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoCaps% - \protected@edef\Shortnames{\@nameauth@CapRoot{#3,}}% + \@nameauth@ShowCommatrue% +} +\newcommandx\Name[3][1=\@empty, 3=\@empty]% +{% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \leavevmode\hbox{}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% \else% - \protected@edef\Shortnames{\@nameauth@Root{#3,}}% + \let\Space\Interspace% \fi% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#3}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% - \protected@edef\Suffix{\@nameauth@Suffix{#3}}% + \protected@edef\RawSurnames{#2}% + \protected@edef\RawShort{\@nameauth@Root{#2}}% + \protected@edef\CapShort{\@nameauth@CapRoot{#2}}% + \let\IndexShort\RawShort% + \let\IndexSurnames\RawShort% + \ifx\RawSurnames\RawShort% + \protected@edef\Suffix{\@empty}% + \if@nameauth@DoCaps% + \let\Surnames\CapShort% + \let\PrintShort\CapShort% + \else% + \let\Surnames\RawShort% + \let\PrintShort\RawShort% \fi% - \fi% - \IfValueTF{#2}% - {\IfValueTF{#4}% - {\def\Forenames{#4}}{\def\Forenames{#2}}% - \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \PackageWarning{nameauth}% - {macro Name Cross-reference: #2 #3 cannot be a page reference.}% \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% + \protected@edef\Suffix{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\IndexSurnames{\RawShort\Space\Suffix}% + \if@nameauth@DoCaps% + \protected@edef\Surnames{\CapShort\Space\Suffix}% + \let\PrintShort\CapShort% + \else% + \protected@edef\Surnames{\RawShort\Space\Suffix}% + \let\PrintShort\RawShort% + \fi% + \fi% + \@nameauth@DoCapsfalse% + \@nameauth@ShowCommafalse% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \Name: Xref: #2 cannot be a page reference.}% \else% - \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% + \@nameauth@Index{\IndexSurnames}[\@nameauth@CleanName{#2}]% \fi% - \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% + \if@nameauth@DoFormat% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% + \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2!MN!}}{}% + \expandafter\@nameauth@FmtName\expandafter{\Surnames}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% - \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% + \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnames}% + \fi% \fi% - \fi% - \fi}% - {\IfValueTF{#4} - {\ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \PackageWarning{nameauth}% - {macro Name Cross-reference: #3 #4 cannot be a page reference.}% \else% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \Name: Xref: #2 #3 cannot be a page reference.}% + \else% + \@nameauth@Index{\IndexSurnames\space#3}[\@nameauth@CleanName{#2#3}]% + \fi% \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% - \Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]% + \expandafter\Surnames\expandafter\space#3}% \fi% \else% - \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]}% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#4}% - \@nameauth@Index{\Surnames\space#4}[\@nameauth@CleanName{#3#4}]% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Surnames\expandafter\space#3}% \fi% \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% + \fi% + \else% + \ifx\testiii\@empty% + \protected@edef\Forenames{#1}% + \else% + \protected@edef\Forenames{#3}% + \fi + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro Name Cross-reference: #3 cannot be a page reference.}% + {macro \Name: Xref: #1 #2 cannot be a page reference.}% \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - {\@nameauth@FmtName*{\Shortnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - \else% - \csgdef{\@nameauth@CleanName{#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]% - \fi% + \ifx\Suffix\@empty% + \@nameauth@Index{\IndexShort, #1}[\@nameauth@CleanName{#1#2}]% \else% - \ifcsname\@nameauth@CleanName{#3!NF!}\endcsname% - \IfBooleanTF{#1}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - {\@nameauth@FmtName*{\Shortnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]}% - \else% - \csgdef{\@nameauth@CleanName{#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#3}]% - \fi% + \@nameauth@Index{\IndexShort, #1, \Suffix}[\@nameauth@CleanName{#1#2}]% \fi% - \fi}% - }% - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% -} -\DeclareDocumentCommand\FName{o m o}% -{% - \protected@edef\Surnames{#2}% - \protected@edef\Shortnames{\@nameauth@Root{#2,}}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#2}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% - \protected@edef\Suffix{\@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}% - {macro FName Cross-reference: #1 #2 cannot be a page reference.}% - \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \let\PrintShort\Forenames% + \fi% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% + \else% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% + \fi% \else% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \else% - \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Forenames\expandafter\space\Surnames}% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \fi% - \fi% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#3}% - \PackageWarning{nameauth}% - {macro FName Cross-reference: #2 #3 cannot be a page reference.}% - \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \else% - \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName% - \expandafter{\Surnames\space#3}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% + \if@nameauth@FirstName% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \let\PrintShort\Forenames% \fi% - \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \else% - \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames\space#3}% - \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \fi% - \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \PackageWarning{nameauth}% - {macro FName Cross-reference: #2 cannot be a page reference.}% - \else% - \if@nameauth@DoFormat% - \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% + \if@nameauth@FullName% + \@nameauth@FullNamefalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% \else% - \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\PrintShort}% \fi% \else% - \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \else% - \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnames}% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \fi% + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnames}% \fi% - \fi}% - }% + \fi% + \fi% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } -\DeclareDocumentCommand\AKA{s o m o m o}% +\WithSuffix\newcommandx\Name*[3][1=\@empty, 3=\@empty]% {% - \protected@edef\Surnamesi{#3}% - \protected@edef\Surnamesii{#5}% - \protected@edef\Shortnamesi{\@nameauth@Root{#3,}}% - \protected@edef\Shortnamesii{\@nameauth@Root{#5,}}% - \protected@edef\Suffixi{\@empty}% - \protected@edef\Suffixii{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#3}% - \if@nameauth@Comma% - \protected@edef\Surnamesi{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% - \protected@edef\Suffixi{\@nameauth@Suffix{#3}}% - \fi% - \@nameauth@CheckComma{#5}% - \if@nameauth@Comma% - \protected@edef\Surnamesii{\@nameauth@Root{#5}\@nameauth@Suffix{#5}}% - \protected@edef\Suffixii{\@nameauth@Suffix{#5}}% - \fi% + \@nameauth@FullNametrue% + \Name[#1]{#2}[#3]% +} +\newcommandx\FName[3][1=\@empty, 3=\@empty]% +{% + \@nameauth@FirstNametrue% + \Name[#1]{#2}[#3]% +} +\WithSuffix\newcommandx\FName*[3][1=\@empty, 3=\@empty]% +{% + \@nameauth@FirstNametrue% + \Name[#1]{#2}[#3]% +} +\newcommandx\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]% +{% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \protected@edef\testv{#5}% + \leavevmode\hbox{}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% + \else% + \let\Space\Interspace% \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% - \PackageWarning{nameauth}% - {macro AKA XRef: #4 #5 exists.}% - \else% - \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% + \protected@edef\RawSurnamesi{#2}% + \protected@edef\RawSurnamesii{#4}% + \protected@edef\Shorti{\@nameauth@Root{#2}}% + \protected@edef\Shortii{\@nameauth@Root{#4}}% + \ifx\RawSurnamesi\Shorti% + \let\Surnamesi\Shorti% + \protected@edef\Suffixi{\@empty}% + \else% + \protected@edef\Suffixi{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\Surnamesi{\Shorti\Space\Suffixi}% + \fi% + \ifx\RawSurnamesii\Shortii% + \let\Surnamesii\Shortii% + \protected@edef\Suffixii{\@empty}% + \else% + \protected@edef\Suffixii{\ignorespaces\@nameauth@Suffix{#4}}% + \protected@edef\Surnamesii{\Shortii\Space\Suffixii}% + \fi% + \@nameauth@ShowCommafalse% + \ifx\testiii\@empty% + \ifx\testv\@empty% + \ifcsname\@nameauth@CleanName{#4!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #4 #5 already exists; no see ref.}% + {macro \AKA: XRef: #4 exists.}% \else% - \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#4!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #4 #5 already exists; no see ref.}% + {macro \AKA: Name reference: #4 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty% - \ifx\Suffixii\@empty% - \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}% - \else% - \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi, #2}}% - \fi% - \else% - \ifx\Suffixii\@empty% - \@nameauth@Index{\Surnamesii, #4|see{\Shortnamesi, #2, \Suffixi}}% - \else% - \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Shortnamesi, #2, \Suffixi}}% - \fi% - \fi% - }% - {% - \ifx\Suffixii\@empty \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}% - \else\@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi}}\fi% - }% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \AKA: Name reference: #4 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4!PN!}}{}% + \ifx\testi\@empty% + \@nameauth@Index{\Surnamesii|see{\Surnamesi}}% + \else% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii|see{\Surnamesi, #1}}% + \else\@nameauth@Index{\Surnamesii|see{\Shorti, #1, \Suffixi}}\fi% + \fi% + \fi% \fi% \fi% - \fi}% - {\IfValueTF{#6}% - {\IfBooleanTF{#1}% - {\@nameauth@FmtName*{#6}}% - {\expandafter\@nameauth@FmtName\expandafter*% - \expandafter{\Surnamesii\space#6}}% - \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro AKA XRef: #5 #6 exists.}% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% \else% - \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 #6 already exists; no see ref.}% + {macro \AKA: XRef: #4 #5 exists.}% \else% - \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 #6 already exists; no see ref.}% + {macro \AKA: Name reference: #4 #5 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}% - \else\@nameauth@Index{\Surnamesii\space#6|see{\Shortnamesi, #2, \Suffixi}}\fi% - }% - {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi}}}% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% + \ifx\testi\@empty% + \@nameauth@Index{\Surnamesii\space#5|see{\Surnamesi}}% + \else% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii\space#5|see{\Surnamesi, #1}}% + \else\@nameauth@Index{\Surnamesii\space#5|see{\Shorti, #1, \Suffixi}}\fi% + \fi% + \fi% \fi% \fi% - \fi}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% - \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname% + \if@nameauth@AltAKA% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{#5}% + \else% + \@nameauth@AltAKAfalse% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii\space#5}% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#3#4!PN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA XRef: #5 exists.}% + {macro \AKA: XRef: #3 #4 exists.}% \else% - \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 already exists; no see ref.}% + {macro \AKA: Name reference: #3 #4 already exists; no see ref.}% \else% - \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% \PackageWarning{nameauth}% - {macro AKA Name reference: #5 already exists; no see ref.}% + {macro \AKA: Name reference: #3 #4 already exists; no see ref.}% \else% - \csgdef{\@nameauth@CleanName{#5!PN!}}{}% - \IfValueTF{#2}% - {% - \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}% - \else\@nameauth@Index{\Surnamesii|see{\Shortnamesi, #2, \Suffixi}}\fi% - }% - {\@nameauth@Index{\Surnamesii|see{\Surnamesi}}}% + \csgdef{\@nameauth@CleanName{#3#4!PN!}}{}% + \ifx\testi\@empty% + \ifx\Suffixii\@empty \@nameauth@Index{\Surnamesii, #3|see{\Surnamesi}}% + \else\@nameauth@Index{\Shortii, #3, \Suffixii|see{\Surnamesi}}\fi% + \else% + \ifx\Suffixi\@empty% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #3|see{\Surnamesi, #1}}% + \else% + \@nameauth@Index{\Shortii, #3, \Suffixii|see{\Surnamesi, #1}}% + \fi% + \else% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #3|see{\Shorti, #1, \Suffixi}}% + \else% + \@nameauth@Index{\Shortii, #3, \Suffixii|see{\Shorti, #1, \Suffixi}}% + \fi% + \fi% + \fi% \fi% \fi% - \fi}% - }% + \fi% + \@nameauth@AltAKAfalse% + \ifx\testv\@empty% + \protected@edef\Forenames{#3}% + \else% + \protected@edef\Forenames{#5}% + \fi% + \expandafter\@nameauth@FmtName\expandafter*\expandafter{% + \expandafter\Forenames\expandafter\space\Surnamesii}% + \fi% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } -\DeclareDocumentCommand\PName{s o m o m o}% +\WithSuffix\newcommandx\AKA*[5][1=\@empty,3=\@empty,5=\@empty]% {% - \IfBooleanTF{#1}{\Name*[#2]{#3}}{\Name[#2]{#3}}% - {\space}(\AKA[#2]{#3}[#4]{#5}[#6])% + \@nameauth@AltAKAtrue% + \AKA[#1]{#2}[#3]{#4}[#5]% } -\DeclareDocumentCommand\TagName{o m o m}% +\newcommandx\PName[5][1=\@empty,3=\@empty,5=\@empty]% {% - \IfValueTF{#1}% - {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #1 #2.}% + \Name[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% +} +\WithSuffix\newcommandx\PName*[5][1=\@empty,3=\@empty,5=\@empty]% +{% + \Name*[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% +} +\newcommandx\TagName[4][1=\@empty, 3=\@empty]% +{% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \textbackslash TagName Cannot tag xref: #2.}% + \else% + \csgdef{\@nameauth@CleanName{#2}}{#4}% + \fi% \else% - \csgdef{\@nameauth@CleanName{#1#2}}{#4}% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #2 #3.}% + {macro \textbackslash TagName Cannot tag xref: #2 #3.}% \else% \csgdef{\@nameauth@CleanName{#2#3}}{#4}% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro TagName Cannot tag xref: #2.}% + {macro \textbackslash TagName Cannot tag xref: #1 #2.}% \else% - \csgdef{\@nameauth@CleanName{#2}}{#4}% - \fi}% - }% + \csgdef{\@nameauth@CleanName{#1#2}}{#4}% + \fi% + \fi% } -\DeclareDocumentCommand\UntagName{o m o}% +\newcommandx\UntagName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {\csundef{\@nameauth@CleanName{#1#2}}}% - {\IfValueTF{#3} - {\csundef{\@nameauth@CleanName{#2#3}}}% - {\csundef{\@nameauth@CleanName{#2}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csundef{\@nameauth@CleanName{#2}}% + \else% + \csundef{\@nameauth@CleanName{#2#3}}% + \fi% + \else% + \csundef{\@nameauth@CleanName{#1#2}}% + \fi% } -\DeclareDocumentCommand\IndexName{o m o}% +\newcommandx\IndexName[3][1=\@empty, 3=\@empty]% {% - \protected@edef\Surnames{#2}% - \protected@edef\Short{\@nameauth@Root{#2,}}% - \protected@edef\Suffix{\@empty}% - \if@nameauth@DoComma\else% - \@nameauth@CheckComma{#2}% - \if@nameauth@Comma% - \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% - \protected@edef\Suffix{\@nameauth@Suffix{#2}}% - \fi% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \if@nameauth@ShowComma% + \protected@edef\Space{,\space}% + \else% + \let\Space\Interspace% \fi% - \IfValueTF{#1}% - {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro IndexName XRef: #1 #2 exists.}% + \protected@edef\RawSurnames{#2}% + \protected@edef\Short{\@nameauth@Root{#2}}% + \ifx\RawSurnames\Short% + \let\Surnames\Short% + \protected@edef\Suffix{\@empty}% + \else% + \protected@edef\Suffix{\ignorespaces\@nameauth@Suffix{#2}}% + \protected@edef\Surnames{\Short\Space\Suffix}% + \fi% + \@nameauth@ShowCommafalse% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 exists.}% + \else% + \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% + \fi% \else% - \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% - \else \@nameauth@Index{\Short, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% - \fi}% - {\IfValueTF{#3} - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \PackageWarning{nameauth}% - {macro IndexName XRef: #2 #3 exists.}% + {macro \IndexName: XRef: #2 #3 exists.}% \else% \@nameauth@Index{\Surnames\space#3}[\@nameauth@CleanName{#2#3}]% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% + \fi% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {macro IndexName XRef: #2 exists.}% + {macro \IndexName: XRef: #1 #2 exists.}% \else% - \@nameauth@Index{\Surnames}[\@nameauth@CleanName{#2}]% - \fi}% - }% + \ifx\Suffix\@empty \@nameauth@Index{\Short, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Short, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% + \fi% + \fi% } -\DeclareDocumentCommand\ExcludeName{o m o}% +\newcommandx\ExcludeName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {% - \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName XRef: #1 #2 exists.}% - \else% - \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #1 #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \fi% \fi% \fi% - \fi}% - {\IfValueTF{#3}% - {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% \else% - \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 #3 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #2 #3 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \fi% \fi% \fi% - \fi}% - {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% + \fi% + \else% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {macro \ExcludeName: XRef: #1 #2 exists.}% \else% - \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #1 #2 already exists; no exclusion.}% \else% - \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% \PackageWarning{nameauth}% - {macro ExcludeName Reference: #2 already exists; no exclusion.}% + {macro \ExcludeName: Reference: #1 #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% \fi% \fi% - \fi}% - }% + \fi% + \fi% } -\DeclareDocumentCommand\ForgetName{o m o}% +\newcommandx\ForgetName[3][1=\@empty, 3=\@empty]% {% - \IfValueTF{#1}% - {\csundef{\@nameauth@CleanName{#1#2!MN!}}% - \csundef{\@nameauth@CleanName{#1#2!NF!}}}% - {\IfValueTF{#3}% - {\csundef{\@nameauth@CleanName{#2#3!MN!}}% - \csundef{\@nameauth@CleanName{#2#3!NF!}}}% - {\csundef{\@nameauth@CleanName{#2!MN!}}% - \csundef{\@nameauth@CleanName{#2!NF!}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csundef{\@nameauth@CleanName{#2!MN!}}% + \csundef{\@nameauth@CleanName{#2!NF!}}% + \else% + \csundef{\@nameauth@CleanName{#2#3!MN!}}% + \csundef{\@nameauth@CleanName{#2#3!NF!}}% + \fi% + \else% + \csundef{\@nameauth@CleanName{#1#2!MN!}}% + \csundef{\@nameauth@CleanName{#1#2!NF!}}% + \fi% } -\DeclareDocumentCommand\SubvertName{o m o}% +\newcommandx\SubvertName[3][1=\@empty, 3=\@empty]% {% - \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!}}}% - }% + \protected@edef\testi{#1}% + \protected@edef\testiii{#3}% + \ifx\testi\@empty% + \ifx\testiii\@empty% + \csgdef{\@nameauth@CleanName{#2!MN!}}{}% + \csgdef{\@nameauth@CleanName{#2!NF!}}{}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% + \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% + \fi% + \else% + \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% + \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% + \fi% } \newcommand{\NamesInactive}{\@nameauth@DoFormatfalse} \newcommand{\NamesActive}{\@nameauth@DoFormattrue} |