diff options
author | Karl Berry <karl@freefriends.org> | 2012-02-16 23:41:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-02-16 23:41:19 +0000 |
commit | 716d6141fc106c94a768963503ee5b7ddde8d5d1 (patch) | |
tree | 5f378e75fb7677b5b12a2b33ef11f60c996be9f8 /Master/texmf-dist | |
parent | 44b76a2e5aba72caff21321358b15e295e27ffba (diff) |
nameauth 0.94 (15feb12)
git-svn-id: svn://tug.org/texlive/trunk@25410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/Makefile | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/nameauth.pdf | bin | 630329 -> 640907 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/nameauth/nameauth.dtx | 574 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 280 |
5 files changed, 573 insertions, 286 deletions
diff --git a/Master/texmf-dist/doc/latex/nameauth/Makefile b/Master/texmf-dist/doc/latex/nameauth/Makefile index 5d9cf08c64e..bb2b992a217 100644 --- a/Master/texmf-dist/doc/latex/nameauth/Makefile +++ b/Master/texmf-dist/doc/latex/nameauth/Makefile @@ -15,12 +15,13 @@ sty : nameauth.dtx nameauth.ins clean : rm -f nameauth.aux - rm -f nameauth.log rm -f nameauth.glo rm -f nameauth.gls rm -f nameauth.idx rm -f nameauth.ilg rm -f nameauth.ind + rm -f nameauth.log + rm -f nameauth.out clobber : clean rm -f nameauth.dvi diff --git a/Master/texmf-dist/doc/latex/nameauth/README b/Master/texmf-dist/doc/latex/nameauth/README index 8f2329dc6e0..01df2cec6aa 100644 --- a/Master/texmf-dist/doc/latex/nameauth/README +++ b/Master/texmf-dist/doc/latex/nameauth/README @@ -1,7 +1,7 @@ The nameauth package Charles P. Schaum charles dot schaum at att dot net -v0.92 from 2012/02/12 +v0.94 from 2012/02/15 Abstract diff --git a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf Binary files differindex 6a5ade8859d..d111dea0a6e 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 760de69b194..c81664fdf4a 100644 --- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx +++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx @@ -26,7 +26,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] %<package>\ProvidesPackage{nameauth} %<*package> - [2012/02/12 v0.92 name authority macros to aid consistent display and indexing of names] + [2012/02/15 v0.94 name authority macros to aid consistent display and indexing of names] %</package> % %<*driver> @@ -56,7 +56,8 @@ \fi \fi \usepackage{makeidx} -\usepackage{nameauth}[2012/02/12] +\usepackage{nameauth}[2012/02/15] +\usepackage{hyperref} \begingroup\lccode`!=`\\\lowercase{\endgroup\def\bsc{!}} \makeindex \frenchspacing @@ -71,7 +72,7 @@ %</driver> % \fi % -% \CheckSum{746} +% \CheckSum{922} % % \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 @@ -91,14 +92,15 @@ % % % \changes{v0.7}{2011/12/26}{Initial version} -% \changes{v0.75}{2012/01/19}{New features described; documentation clarified} -% \changes{v0.8}{2012/01/29}{Refactoring to improve functionality and compatibility; documentation expanded} -% \changes{v0.85}{2012/02/05}{Added comma suppression and additional functionality; revised documentation} +% \changes{v0.75}{2012/01/19}{New features described; documentation subject to change until 1.0} +% \changes{v0.8}{2012/01/29}{Refactoring improved functionality and compatibility} +% \changes{v0.85}{2012/02/05}{Added comma suppression, new class options, and more functionality} % \changes{v0.86}{2012/02/06}{Fixed some regressions} -% \changes{v0.9}{2012/02/10}{Added first name formatting, comma and suffix handling now expandable, edited documentation} -% \changes{v0.92}{2012/02/12}{Build with all major \LaTeX{} engines; minor documentation changes} +% \changes{v0.9}{2012/02/10}{Added first name formatting, comma and suffix handling expandable} +% \changes{v0.92}{2012/02/12}{Build with all major \LaTeX{} engines} +% \changes{v0.94}{2012/02/15}{Added index suppression, error checking, better particle handling} % -% \DoNotIndex{\newcommand, \newenvironment, \@empty, \@gobble, \bfseries, \bgroup, \def, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \fi, \if, \ifx, \IfBooleanTF, \IfValueTF, \itshape, \let, \newif, \relax, \renewcommand, \RequirePackage, \scshape, \space, \DeclareDocumentCommand, \DeclareOption, \ProcessOptions, \@token, \@period, \csgdef, \csundef, \detokenize, \expandafter, \Forenames, \futurelet, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@Punct, \ifcsname, \index, \PackageWarning, \Surnames, \Surnamesi, \Surnamesii, \TestDot, \TestEnd, \TestPunct, \TestStop, \zap@space, \edef, \if@nameauth@DoIndex, \if@nameauth@Comma, \Test} +% \DoNotIndex{\newcommand, \newenvironment, \@empty, \@gobble, \bfseries, \bgroup, \def, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \fi, \if, \ifx, \IfBooleanTF, \IfValueTF, \itshape, \let, \newif, \relax, \renewcommand, \RequirePackage, \scshape, \space, \DeclareDocumentCommand, \DeclareOption, \ProcessOptions, \@token, \@period, \csgdef, \csundef, \detokenize, \expandafter, \Forenames, \futurelet, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@Punct, \ifcsname, \index, \PackageWarning, \Surnames, \Surnamesi, \Surnamesii, \TestDot, \TestEnd, \TestPunct, \TestStop, \zap@space, \edef, \if@nameauth@DoIndex, \if@nameauth@Comma, \Test, \bsc, \uppercase, \Input, \Output, \if@nameauth@DoCaps, \Cap, \@Cap} % % \providecommand*{\url}{\texttt} % \GetFileInfo{nameauth.dtx} @@ -113,7 +115,7 @@ % % \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 that person more desirable for publication. +% 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. % % \subsection{Typesetting, Indexing, and Design} % @@ -127,18 +129,19 @@ % % \subsection{Package Options} % If the default behavior is not desired, the following options easily alter it. The class options are listed with defaults first in each category: -% \changes{v0.85}{2012/02/05}{Added new class options} % % \begin{quote}\small % \begin{tabular}{lp{3in}} % \texttt{mainmatter} & The default behavior triggers special typesetting of the first occurrence of a name, starting at the beginning of a document.\\[1ex] -% \texttt{frontmatter} & This option suppresses the special typesetting of the first occurrence of a name before the invocation of \cmd{\NamesActive}. This option fits well with front matter from a contributor who may not intend the same formatting and emphasis found in the main matter. The indexing and aliasing features of the package remain operative. \emph{Note}: One can switch at will between formatted and non-formatted sections; see Section \ref{sec:SectionFormat}{\large\strut}.\\\hline +% \texttt{frontmatter} & This option suppresses the special typesetting of the first occurrence of a name before the invocation of \cmd{\NamesActive}. This option fits well with front matter from a contributor who may not intend the same formatting and emphasis found in the main matter. The indexing and aliasing features of the package remain operative. \emph{Note}: One can switch at will between formatted and non-formatted sections; see Section \ref{sec:SectionFormat}.\\[0.25ex]\hline % {\large\strut}\texttt{smallcaps} & The default behavior when a name is first encountered is to print it in small caps.\\[1ex] % \texttt{italic} & This option causes the first occurrence of the name to be italicized.\\[1ex] % \texttt{boldface} & This option causes the first occurrence of the name to be set in boldface.\\[1ex] -% \texttt{noformat} & This option suppresses document formatting after the invocation of \cmd{\NamesActive}. If an author wants the indexing and aliasing functions without any special typesetting, this option accomplishes that easily. \emph{Note}: One can override the name typesetting options manually; see Section \ref{sec:FontAttributes}. This option is \emph{not} equivalent to \texttt{frontmatter}. The latter functions independently and never produces any formatting. This approach allows one to toggle formatting on and off without retyping the document. With \cmd{\NamesFormat} It anticipates variation among publishers' house styles.{\large\strut}\\\hline +% \texttt{noformat} & This option suppresses document formatting after the invocation of \cmd{\NamesActive}. If an author wants the indexing and aliasing functions without any special typesetting, this option accomplishes that easily. Additional formatting options are discussed in Section \ref{sec:formatting}. This option is \emph{not} equivalent to \texttt{frontmatter}, which prevents formatting when in force. The \texttt{noformat} option simply sets the `formatting'' to nil, helping one to write the same document for different publishers' style requirements.\\[0.25ex]\hline % {\large\strut}\texttt{nocomma} & The default behavior suppresses printing of commas between surnames and suffixes, following modern styles like \emph{Chicago Manual of Style}. See Section \ref{sec:suffix} for implications of this behavior.\\[1ex] -% \texttt{comma} & Print commas between surnames and suffixes, following older styles. See also Section \ref{sec:suffix}.\\ +% \texttt{comma} & Print commas between surnames and suffixes, following older styles. See also Section \ref{sec:suffix}.\\[0.25ex]\hline +% {\large\strut}\texttt{index} & The default behavior creates index entries in place with the names.\\[1ex] +% \texttt{noindex} & Similar to \texttt{frontmatter}, this option prevents indexing until a call to \cmd{\IndexActive}. See also Section \ref{sec:SectionIndex}.\\ % \end{tabular} % \end{quote} % \clearpage @@ -152,14 +155,14 @@ % \noindent\textbf{Example Text:} % \label{sec:example} % -% {\ttfamily This is a toast to |\Name[John]{Smith}| and his childhood sweetheart,\break |\Name[J.Q.]{Public}[Jane Q.]|. |\FName[John]{Smith}| and\break |``\FName[J.Q.]{Public}[Janie]''| have finally made it official today!\break They first met in college, where they had to learn about\break |\Name{Aristotle}| and all the stuff that I couldn't keep in my head.\break [laughs] Nevertheless, by the time they got to\break |\Name{John}[Duns Scotus]| they were definitely a number. They studied medieval history-makers like |\Name{Gregory, I}|\break |``\AKA*{Gregory, I}{Gregory}[the Great]''| and by the Renaissance they were engaged. After spending time in separate grad schools, these\break promising medievalists got faculty positions at adjoining colleges and here we are. As the brother of |\FName[J.Q.]{Public}[Jane]|\break |``\AKA*[J.Q.]{Public}{Jane}[the Great]''| I am happy to welcome\break |\FName[John]{Smith}[Sir John]| to our raucous family.}\\ +% {\small\ttfamily This is a toast to |\Name[John]{Smith}| and his longtime sweetheart,\break |\Name[J.Q.]{Public}[Jane Q.]|. |\FName[John]{Smith}| and\break |``\FName[J.Q.]{Public}[Janie]''| have finally made it official today! After\break casual dating as teenagers, they met again in college where they learned\break about |\Name{Aristotle}| and all the stuff that I can't keep in my head.\break [laughs] Nevertheless, by the time they got to |\Name{John}[Duns Scotus]| they were definitely a number. They studied medieval history-makers like\break |\Name{Gregory, I}| |``\AKA*{Gregory, I}{Gregory}[the Great]''| and by the\break Renaissance they were engaged. After spending time in separate grad schools, these promising medievalists got faculty positions at adjoining colleges\break and here we are. As the brother of |\FName[J.Q.]{Public}[Jane]|\break |``\AKA*[J.Q.]{Public}{Jane}[the Great]''| I am happy to welcome\break |\FName[John]{Smith}[Sir John]| to our raucous family.}\\ % -% This is a toast to \Name[John]{Smith} and his childhood sweetheart, \Name[J.Q.]{Public}[Jane Q.]. \FName[John]{Smith} and ``\FName[J.Q.]{Public}[Janie]'' have finally made it official today! They first met in college, where they had to learn about \Name{Aristotle} and all the stuff that I couldn't keep in my head. [laughs] Nevertheless, by the time they got to \Name{John}[Duns Scotus] they were definitely a number. They studied medieval history-makers like \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great]'' and by the Renaissance they were engaged. After spending time in separate grad schools, these promising medievalists got faculty positions at adjoining colleges and here we are. As the brother of \FName[J.Q.]{Public}[Jane] ``\AKA*[J.Q.]{Public}{Jane}[the Great]'' I am happy to welcome \FName[John]{Smith}[Sir John] to our raucous family.\\ +% This is a toast to \Name[John]{Smith} and his longtime sweetheart, \Name[J.Q.]{Public}[Jane Q.]. \FName[John]{Smith} and ``\FName[J.Q.]{Public}[Janie]'' have finally made it official today! After casual dating as teenagers, they met again in college where they learned about \Name{Aristotle} and all the stuff that I can't keep in my head. [laughs] Nevertheless, by the time they got to \Name{John}[Duns Scotus] they were definitely a number. They studied medieval history-makers like \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great]'' and by the Renaissance they were engaged. After spending time in separate grad schools, these promising medievalists got faculty positions at adjoining colleges and here we are. As the brother of \FName[J.Q.]{Public}[Jane] ``\AKA*[J.Q.]{Public}{Jane}[the Great]'' I am happy to welcome \FName[John]{Smith}[Sir John] to our raucous family.\\ % % Here you will notice that one can make a reference to Pope |\Name{Gregory, I}| followed by ``the Great'' via |``\AKA*{Gregory, I}{Gregory}[the Great]''|. That is achieved by the ambiguous behavior of the default \texttt{nocomma} option plus the ``sobriquet only'' feature of \cmd{\AKA*}. It is easy to use these features, but can be tricky to debug. Sections \ref{sec:suffix} and \ref{sec:pennames} have more details. % % \subsection{Quick Start Guide} -% \changes{v0.8}{2012/01/29}{Added quick start guide for the impatient} +% \changes{v0.8}{2012/01/29}{Added quick start guide} % \changes{v0.85}{2012/02/05}{Updated quick start guide} % % This page and the next comprise a ``cheat sheet'' for the impatient. None of the examples in this subsection generate index entries. These examples help you get used to the package, but they do not show all possibilities. @@ -252,14 +255,18 @@ % \cmd{\Name*}\oarg{forename(s)}\marg{surname(s)}\oarg{alternate names} % \end{quote} % -% \noindent From now on we will abbreviate \emph{forename(s)} with \emph{FNN} and \emph{surname(s)} with \emph{SNN} at various points. The syntax descriptions above do not capture exactly how the \cmd{\Name} macro behaves. The following table should help: +% \noindent From now on we will abbreviate \emph{forename(s)} with \emph{FNN} and \emph{surname(s)} with \emph{SNN} at various points. The syntax descriptions do not capture exactly how the \cmd{\Name} macro behaves. The following table helps to show first and subsequent references: % % \begin{quote}\small % \begin{tabular}{llll}\hline % {\large\strut}\emph{FNN} & \emph{SNN} & 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 % \end{tabular} % \end{quote} @@ -268,61 +275,24 @@ % % Sometimes you might want to have the option of using either an alternate set of forenames, like a nickname, or a sobriquet that functions as a surname for ancient figures. These two alternatives are handled by the final, optional field of \cmd{\Name}. If ``regular'' \emph{FNN} are present, then the alternate names conditionally will replace the \emph{FNN} in the printed form, but not in the indexed form. If no regular \emph{FNN} are present, then the alternate names will be appended to the \emph{SNN} in the printed form \emph{and} in the indexed form. You may choose to include or exclude nicknames and such, but you must always use the sobriquet form of a name consistently. % -% I mentioned conditional use. The unstarred form prints the ``full name'' at the first occurrence, then only the partial form thereafter. The starred form always prints the full name. Both macros usually apply a different ``font attribute'' to the name when it first appears in the running text. Here are more examples: +% 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. % -% \begin{quote}\small -% |\Name*[Johann Wolfgang von]{Goethe}|\\ -% Print \Name*[Johann Wolfgang von]{Goethe} the first time it appears.\\ -% Later, print the full name \Name*[Johann Wolfgang von]{Goethe}.\\[1ex] -% |\Name[Johann Wolfgang von]{Goethe}|\\ -% \ForgetName[Johann Wolfgang von]{Goethe}% -% Print \Name[Johann Wolfgang von]{Goethe} the first time it appears.\\ -% Later, print only the last name \Name[Johann Wolfgang von]{Goethe}.\\[1ex] -% |\Name{Boethius}| and |\Name*{Boethius}| -% Print \Name{Boethius} the first time it appears. Later, print \Name{Boethius}. -% \end{quote} -%\clearpage -% -% \begin{quote}\small -% |\Name*{Antiochus IV}[Epiphanes]|\\ -% Print \Name*{Antiochus IV}[Epiphanes] the first time it appears. Later, print the name and sobriquet \Name*{Antiochus IV}[Epiphanes].\\[1ex] -% \ForgetName{Antiochus IV}[Epiphanes]% -% |\Name{Antiochus IV}[Epiphanes]|\\ -% Print \Name{Antiochus IV}[Epiphanes] the first time it appears. Later, print just the name \Name{Antiochus IV}[Epiphanes]. -% \end{quote} +% As long as the ``main'' \emph{FNN} are constant, the ``alternate names'' field can vary, yet the index entries will be constant. All references below refer to ``De Wette, Wilhelm M.L.'' in the index: % -% \noindent\emph{Note}: I am playing a ``dirty trick'' by making each line begin as if the name had not yet occurred. This trick can be used, for example, to force the formatting of the first name in a chapter or section. See Section \ref{sec:Tweaks} for more. -% -% \subsubsection{Tabular Summary of \texttt{\bsc Name}} -% -% Again, the common uses of \cmd{\Name} include: -% % \begin{quote}\small -% \begin{tabular}{llll}\hline -% {\large\strut}\emph{FNN} & \emph{SNN} & Alternate Names & Result\\\hline -% \texttt{Harry S.} & \texttt {Truman} & (none) & \Name[Harry S.]{Truman}\\ -% (none) & \texttt{Mencius} & (none) & \Name{Mencius}\\ -% \texttt{John Q.} & \texttt{Adams} & \texttt{John Quincy} & \Name[John Q.]{Adams}[John Quincy]\\ -% (none) & \texttt{Ptolemy I} & \texttt{Soter} & \Name{Ptolemy I}[Soter]\\\hline -% \end{tabular} -% \end{quote} -% -% \noindent Here are examples that show variation among alternate names. As long as the ``main'' \emph{FNN} are constant, so will the index entries be constant: -% -% \begin{quote}\small -% In all cases, the index entries contain ``De Wette, Wilhelm M.L.''\\[1ex] % \texttt{\bsc Name[Wilhelm M.L.]\{De Wette\}[Wilhelm Martin Leberecht]}\\ % \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, first occurrence)\\ -% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, second occurrence)\\[1ex] +% \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, second occurrence)\\ +% % \ForgetName[Wilhelm M.L.]{De Wette}% % \texttt{\bsc Name*[Wilhelm M.L.]\{De Wette\}}\\ % \Name*[Wilhelm M.L.]{De Wette} (text, first occurrence)\\ % \Name*[Wilhelm M.L.]{De Wette} (text, second occurrence) % \end{quote} % -% \noindent Alternate forenames \emph{override} the \emph{FNN} in the text. Sobriquets are \emph{appended} to \emph{SNN}. The presence or absence of \emph{FNN} triggers this difference. Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*}. The surname argument is \emph{always} printed.\medskip +% \noindent Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*}. The surname argument is \emph{always} printed. % -% \noindent Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \texttt{\bsc AKA} and \texttt{\bsc PName} cannot refer to these forms, although they can use these forms in the \emph{second} name argument to construct a cross-reference. A workaround is discussed in Section \ref{sec:suffix}. The following method is the only one that works with the \texttt{comma} option. Valid ``sobriquet'' forms are:\\ +% Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \texttt{\bsc AKA} and \texttt{\bsc PName} cannot refer to these forms, although they can use these forms in the \emph{second} name argument to construct a cross-reference. A workaround is discussed in Section \ref{sec:suffix}. The following method is the only one that works with the \texttt{comma} option. Valid ``sobriquet'' forms are:\\ % % \bgroup\footnotesize % \begin{tabular}{llp{1.2cm}ll}\hline @@ -332,14 +302,18 @@ % (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 +% \egroup\bigskip +% +% \noindent Again, alternate forenames \emph{override} the \emph{FNN} in the text. Sobriquets are \emph{appended} to \emph{SNN}. The presence or absence of \emph{FNN} triggers this difference between the two actions---\emph{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. % % \subsubsection{\texttt{\bsc 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. The syntax is basically the same: % \begin{quote} -% \cmd{\FName}\oarg{forename(s)}\marg{surname(s)}\oarg{alternate names} +% \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: % @@ -353,25 +327,36 @@ % \end{tabular} % \end{quote} % -% \noindent If one accidentally referred to |\FName[Max]{Planck}| as a first reference, that would appear as \FName[Max]{Planck}. otherwise it would just be \FName[Max]{Planck}. Using the ``alternate names'' option prints them instead. For example, aviation hero \Name[Chesley B.]{Sullenberger, III} can be noted as: +% \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: % % \begin{quote}|``\FName[Chesley B.]{Sullenberger, III}[Sully]''|\quad``\FName[Chesley B.]{Sullenberger, III}[Sully]''\end{quote} % %\noindent A good way to cut keystrokes would be to assign the above macro to the control sequence \cmd{\Sully}. With comma-delimited suffixes we note special cases governed by the \texttt{nocomma} class option (see Section \ref{sec:suffix}). These include names like like \FName[J.D.]{Rock, III} and \FName{Charles, V}: % \begin{quote}|\FName[J.D.]{Rock, III}|, ``\FName[J.D.]{Rock, III},'' |\FName{Charles, V}|, ``\FName{Charles, V}''\end{quote} -% \noindent \FName{Mao}[Tse-tung], ``\FName{Mao}[Tse-tung],'' does not work with \cmd{\FName} because it is an Eastern name. \cmd{\FName} works best with Western names and mononyms.\\ +% \noindent \FName{Mao}[Tse-tung], ``\FName{Mao}[Tse-tung],'' does not work well with \cmd{\FName}, which assumes Western names and mononyms. % -% \noindent \cmd{\FName} understands that an extra period could result from typing: -% \begin{quote} -% |My boss is \Name*[J.D.]{Rock, III}.|\\ |We all call him \FName[J.D.]{Rock, III}.| -% \end{quote} -%\cmd{\FName} solves this by scanning for and eliminating that extra period: -% \begin{quote} -% My boss is \Name*[J.D.]{Rock, III}.\\ We all call him \FName[J.D.]{Rock, III}. -% \end{quote} +% \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}. % % \subsection{Advanced Topics} +% +% \subsubsection{Error Handling} +% \label{sec:error} +% +% Except for \cmd{\ExcludeName}, the macros silently print any erroneous arguments in the text and emit warnings. Sometimes a warning is just a warning. \cmd{\PName} produces warnings via \cmd{\Name} and \cmd{\AKA}. 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 xref multiple times. +% \item Using \cmd{\ExcludeName} to exclude a name that has already been used. +% \end{enumerate} % +% \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 \emph{SNN} field of \cmd{\Name}, e.g., \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. +% +% Names foreign to English usually put these particles in the \emph{FNN} field of \cmd{\Name}. Yet these particles are not first names. Using \cmd{\FName} with alternate forenames overcomes this issue. |\FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang]| prints subsequently as \SubvertName[Johann Wolfgang von]{Goethe}\FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang]. This trades work for robustness. +% % \subsubsection{Hyphenation} % % I find it helpful to use the \textsf{babel} or \textsf{polyglossia} packages to help with name hyphenation. If one is using English as the main language, the default hyphenation patterns may not suffice. For example, the name \Name[John]{Strietelmeier} may break thus: ``Stri-etelmeier.'' That is fixed by creating a \cmd{\de} macro equivalent to |\newcommand{\de}[1]{\foreignlanguage{ngerman}{#1}}| (using \textsf{babel}) and writing |\de{\Name[John]{Strietelmeier}}|. @@ -381,26 +366,35 @@ % \subsubsection{\texttt{\bsc IndexName}} % % \DescribeMacro{\IndexName} -% This macro allows one to create an index entry with the same format as \cmd{\Name} and friends. It prints no text in the body and can be used like \cmd{\index}, but without any special formatting. The syntax is similar to \cmd{\Name}: +% This macro creates an index entry like \cmd{\Name} and friends. It prints no text in the body and includes no special formatting. The syntax is similar to \cmd{\Name}: % \begin{quote} % \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{alternate names} % \end{quote} -% \cmd{\IndexName} does not index the alternate names unless no \emph{FNN} are present, at which time is acts like \cmd{\Name} using the sobriquet feature. +% \cmd{\IndexName} does not index the alternate names unless \emph{FNN} are absent, like \cmd{\Name} using the sobriquet feature. See also Section \ref{sec:SectionIndex} for switching indexing on and off. +% +% \subsubsection{\texttt{\bsc 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: +% \begin{quote} +% \cmd{\ExcludeName}\oarg{FNN}\marg{SNN}\oarg{alternate names} +% \end{quote} +% To suppress only indexing but retain formatting, enclose \cmd{\Name}, etc. between \cmd{\IndexInactive} and \cmd{\IndexActive}. % % \subsubsection{Manual Index Entries} % \label{sec:manual} % -% Starting with version 0.9, \cmd{\Name} and friends produce index entries that are compatible with manual index entries. The comma and suffix handling are now entirely expandable. One can see how these index entries are formed by running \textsf{latex} and friends and examining the \texttt{.idx} file. +% \cmd{\Name} and friends produce index entries compatible with manual index entries since version 0.9. The \texttt{.idx} file is a helpful reference when linking manual entries with \textsf{nameauth} entries, although it is usually unnecessary to consult. % % \subsubsection{Suffix Removal} % \label{sec:suffix} % \changes{v0.85}{2012/02/05}{New suffix removal features} % -% \texttt{\bsc Name} and \texttt{\bsc Name*} have an additional difference. \texttt{\bsc Name} will truncate the suffixes from subsequent occurrences of last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. \emph{The input form always uses a comma}, e.g., \texttt{\bsc Name[Oskar]\{Hammerstein, II\}}. Moreover, the space after the comma is literal, but not manipulated by the package in case one wants to use a thin space instead. That is left to the author. +% \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., \texttt{\bsc Name[Oskar]\{Hammerstein, II\}}. The space after the comma is literal, but not manipulated by the package in case one wants to use a thin space. % % Again, \textbf{the comma is not optional with suffixes}. It is how this feature works. More than one comma in the \emph{SNN} argument of \cmd{\Name} and friends will cause unwanted results. Fortunately, that is unlikely. % -% These macros keep track of whether the name ends with the period of an abbreviation like ``Jr.'' and ``Sr.'' That should also work with abbreviations like ``d.~\"{A}.'' (\textit{der \"{A}ltere}). Two periods are not printed when the full name is printed at the end of a sentence. The following example shows the possible combinations: +% 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 possible combinations: % % \ForgetName[Martin Luther]{King, Jr.}% % \begin{quote}\small @@ -413,7 +407,7 @@ % \end{tabular} % \end{quote} % -% \noindent Using the default class option \texttt{nocomma}, one can take advantage of the suffix feature to tweak more options out of \cmd{\Name}. Instead of the sobriquet feature, one could use the following variants: +% 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 % \begin{tabular}{llp{1.2cm}ll}\hline @@ -432,19 +426,19 @@ % \subsubsection{Pen Names: An Introduction} % \label{sec:pennames} % -% The macro \cmd{\AKA} deals with pseudonyms, stage names, \emph{noms de plume}, etc. We already saw the strengths and weaknesses of the suffix feature above as a workaround for sobriquets and Eastern names when using \cmd{\AKA}. Before we examine its function in detail, we touch on the only solution for some name forms, especially if one chooses the \texttt{comma} option: +% The macro \cmd{\AKA} deals with pseudonyms, stage names, \emph{noms de plume}, etc. We already saw the suffix feature above as a workaround for sobriquets and Eastern names when using \cmd{\AKA}. Before we examine its function in detail, we touch on the only solution for some name forms, especially if one chooses the \texttt{comma} option: % % \begin{quote} -% \bgroup\ttfamily +% \bgroup\ttfamily\small % \verb!\index{Jean the Fearless|see{Jean sans Peur}}%!\\ -% |\Name{Jean}[sans Peur]| (Jean the Fearless) was Duke of\break Burgundy from 1404 to 1419. +% |\Name{Jean}[sans Peur]| (Jean the Fearless) was Duke of Burgundy\break from 1404 to 1419. % \egroup % % \index{Jean the Fearless|see{Jean sans Peur}}% % \Name{Jean}[sans Peur] (Jean the Fearless) was Duke of Burgundy from 1404 to 1419. % \end{quote} % -% \noindent The suffix workaround also can work with this example, but not with something like |\Name{Vlad, III}[Dracula]|. In order to make that form work, you would have to use |\Name{Vlad, III Dracula}|. The latter two forms both shorten to Vlad and look the same using the \texttt{nocomma} option. If you use both forms (see Section \ref{sec:formatting}) errors may bite. A more complicated example is: +% \noindent The suffix workaround also can work with the above example, but be careful; see Section \ref{sec:formatting}. A more complicated example is: % \begin{quote} % \bgroup\ttfamily\footnotesize % \verb!\index{Doctor Angelicus@\textit{Doctor Angelicus}|see{Thomas Aquinas}}%!\\ @@ -487,7 +481,7 @@ % % \noindent Since \cmd{\AKA} is designed to handle a number of otherwise incompatible needs, its use may be the most complex of all macros in this package. \cmd{\AKA} creates a cross reference. The target of this cross-reference is either \emph{SNN}, \emph{FNN} or just \emph{SNN}. The main entry in which the cross-reference occurs is constructed exactly like \cmd{\Name} handles its arguments. The \emph{alternate FNN} are replaced by the \emph{alternate names} if both exist. The \emph{alternate names} follow the \emph{alternate SNN} otherwise. % -% The twist is the starred form \cmd{\AKA*}. If the starred form is used with the template (none)\marg{alternate SNN}\oarg{alt. names}, it only prints the \oarg{alt. names}. This allows it to be used in the manner of the example text in Section \ref{sec:example}. \cmd{\AKA} prints \marg{alternate SNN} followed by \oarg{alt. names}. A difference between the behavior of \cmd{\AKA*} and \cmd{\Name} using sobriquets is that \cmd{\AKA*} creates a cross-reference and allows the sobriquet to be printed separately from the main name within some manner of punctuation. +% The twist is the starred form \cmd{\AKA*}. If the starred form is used with the template (none)\marg{alternate SNN}\oarg{alt. names}, it only prints the \oarg{alt. names}. This allows it to be used in the manner of the example text in Section \ref{sec:example}. \cmd{\AKA} prints \marg{alternate SNN} followed by \oarg{alt. names}. A difference between this macro and \cmd{\Name} using sobriquets is that this macro creates a cross-reference and allows the ``sobriquet'' to be printed separately. % % \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. % @@ -501,9 +495,9 @@ % Today we consider \AKA[George]{Eliot}[Mary Anne]{Evans} and her literary contributions as \Name[George]{Eliot}. % \end{quote} % -% \noindent The alternate name references generated by \cmd{\AKA} and \cmd{\AKA*} only work as cross-references. If you include these alternate names in the parameters of \cmd{\Name}, it will print the alternate names in the text and emit a warning. It will not index the alternate names at that point. +% \noindent The alternate name references generated by \cmd{\AKA} and \cmd{\AKA*} only work as cross-references and cannot be used with \cmd{\Name} and \cmd{\FName}, which print the alternate names and emit a warning. See also Section \ref{sec:error}. % -% In some cases, that is enough. In other cases, one might wish to index an alternate name with page numbers. In that case, do not use \cmd{\AKA}. Use \cmd{\Name} for both the main name and the alternate name. You will have to create manual cross-references with \cmd{\index}. For example:\medskip +% 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.:\bigskip % % \bgroup\footnotesize\index{Rambam|seealso{Maimonides}} % \begin{tabular}{p{0.7in}ll}\hline @@ -513,7 +507,7 @@ % \end{tabular} % \egroup % -% \medskip\noindent\cmd{\AKA} will not create multiple instances of a cross-reference. This prevents possible errors in the index, but it also excludes the special case where one moniker applies to multiple people, e.g.: \PName*[Willebrord]{Snel van Royen}{Snellius} and his son \PName*[Rudolph]{Snel van Royen}{Snellius}. One must add a manual index entry: +% \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}}% % \begin{quote} % \verb!\index{Snellius|see{Snel van Royen, Rudolph}}! @@ -522,13 +516,13 @@ % \subsubsection{\texttt{\bsc PName}} % % \DescribeMacro{\PName} -% \cmd{\PName} is a ``convenience macro'' that sacrifices some of the flexibility of \cmd{\AKA} for simplicity. It does not implement \cmd{\AKA*} and it works best with Western-style names. Like \cmd{\Name}, \cmd{\PName} prints a Western-style ``main'' name using either starred or unstarred forms that affect only that name. Like \cmd{\AKA}, it follows with an alternate name, but prints the full alternate name in parentheses. \cmd{\PName} also handles double-periods. The syntax is: +% \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: % \begin{quote} % \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{lesser-known FNN}\marg{lesser-known SNN} % \end{quote} % -% \noindent The following examples demonstrate uses of \cmd{\PName}. The macros are agnostic of the ``pen name'' itself. The author determines the name that is indexed (the first name) and the subsequent name that only occurs as a \emph{see} reference. -% +% \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}|\\ % |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\ @@ -538,7 +532,8 @@ % Print \PName{Voltaire}[François-Marie]{Arouet} the first time it appears. Later, print \PName{Voltaire}[François-Marie]{Arouet}. Both forms do the same thing in this case. % \end{quote} % -% If you use the unstarred forms \cmd{\PName} and \cmd{\Name}, you must remember that, just because you include a full name as a parameter does not mean that the full name will print. You could end up with ambiguous references to the same last name, e.g., ``Snel van Royen.'' You are responsible for checking this. +% \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. +%\clearpage % % \subsection{Accented Names} % \label{sec:Accents} @@ -549,13 +544,13 @@ % \begin{tabular}{ll} % |\usepackage{ifxetex}|\\ % |\usepackage{ifluatex}|\\ -% |\ifxetex| & |uses fontspec and other packages|\\ +% |\ifxetex| & |% uses fontspec and other packages|\\ % \hbox{\quad}|\usepackage{fontspec}|\\ % \hbox{\quad}|\defaultfontfeatures{Mapping=tex-text}|\\ % \hbox{\quad}|\usepackage{xunicode}|\\ % \hbox{\quad}|\usepackage{xltxtra}|\\ % |\else|\\ -% \hbox{\quad}|\ifluatex| & |also uses fontspec|\\ +% \hbox{\quad}|\ifluatex| & |% also uses fontspec|\\ % \hbox{\quad}\hbox{\quad}|\usepackage{fontspec}|\\ % \hbox{\quad}\hbox{\quad}|\defaultfontfeatures{Ligatures=TeX}|\\ % \hbox{\quad}|\else| & |% with pdflatex and latex|\\ @@ -573,7 +568,7 @@ % \end{tabular} % \egroup\\ % -% \noindent The following accented characters are available using \textsf{inputenc}/\textsf{fontenc}: +% \noindent The following Unicode characters are available using \textsf{inputenc}/\textsf{fontenc}: % \begin{quote} % \begin{tabular}{llll} % \scshape À Á Â Ã Ä Å Æ & \scshape Ç È É Ê Ë & \scshape Ì Í Î Ï Ð Ñ & \scshape first use \\ @@ -593,14 +588,10 @@ % \end{tabular} % \end{quote} % -% \noindent More accented characters are possible via the \textsf{newunicodechar} package, but that could complicate matters with \textsf{makeindex} embedding control sequences in index entries. Some control sequences, like the ``a'' with macron |\=a|, will fail using \textsf{makeindex} and \texttt{gind.ist} because it will be interpreted as a ``literal'' character. +% \noindent More accented characters are possible via the \textsf{newunicodechar} package, but that could complicate matters with \textsf{makeindex} embedding control sequences in index entries. Some control sequences, like the ``a'' with macron |\=a|, will fail using \textsf{makeindex} and \texttt{gind.ist} because they will be interpreted as ``literals.'' % % \subsection{Name Formatting} % \label{sec:formatting} -% -% \subsubsection{Font Attributes} -% \label{sec:FontAttributes} -% \changes{v0.8}{2012/01/29}{Expanded description of functionality} % % \DescribeMacro{\NamesFormat} % The first time a name is printed, it is formatted with the font attribute stored in \cmd{\NamesFormat}. This is set with the class options or manually. \cmd{\NamesFormat} can use either the command form or the declaration form of selecting font attributes, e.g., \cmd{\textsc} or \cmd{\scshape}. By redefining this macro, one can ``hook'' into the special typesetting of the first occurrence of a name. Consider the following: @@ -624,7 +615,7 @@ % % \noindent After using \cmd{\let} to revert \cmd{\NamesFormat}, a first occurrence again takes the form: \ForgetName{Vlad III}[Dracula]\Name{Vlad III}[Dracula], while subsequent references are to \Name{Vlad III}[Dracula].\\ % -% Let me again stress that ``royal'' names used in this manner do not work with \cmd{\PName} and \cmd{\AKA}. Consistently use either the suffix mechanism (Section \ref{sec:suffix}) or use as a guide the examples above for \Name*{Jean}[sans Peur] and \Name*{Thomas}[Aquinas]. If you use the suffix mechanism, you would use the forms: +% Let me again stress that ``royal'' names used in this manner do not work with \cmd{\PName} and \cmd{\AKA}. Consistently use either the suffix mechanism (Section \ref{sec:suffix}) or use as a guide the examples above for \Name*{Jean}[sans Peur] and \Name*{Thomas}[Aquinas]. If you use the suffix mechanism, you would use the following forms: % %\begin{quote}\ForgetName{Vlad III}[Dracula]\ForgetName{Vlad II}[Dracul] % \bgroup\ttfamily |\Name{Vlad III, Dracula}| became known as \break |\AKA{Vlad III, Dracula}{Vlad}[Ţepeş]|,\break |``\AKA{Vlad III, Dracula}{Vlad}[the Impaler],''| after his death. He was the son of |\Name{Vlad II, Dracul}|, a member of the Order of the Dragon. Later references to |\Name{Vlad III, Dracula}| appear thus.\egroup @@ -632,13 +623,13 @@ % \Name{Vlad III, Dracula} became known as \AKA{Vlad III, Dracula}{Vlad}[Ţepeş], ``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler],'' after his death. He was the son of \Name{Vlad II, Dracul}, a member of the Order of the Dragon. Later references to \Name{Vlad III, Dracula} appear thus. % \end{quote} % -% \noindent NOTE: The ``Dracula'' example is complex and the usual ``first use'' feature has been manipulated extensively to produce these results. If you mix casually the sobriquet and suffix forms, errors may ``bite.'' \Name{Vlad III}[Dracula] was a complex historical figure, as was his father, living in the no-man's land between the Ottoman Empire and the Holy Roman Empire. The story of the Jagiellon monarchy of Hungary, later to come under Hapsburg control, is also complex, as was that of \Name{Ivan, IV} ``\AKA*{Ivan, IV}{Ivan}[the Terrible]'' in fifteenth-century Muscovy. I am not trying to saddle a historical figure with the fiction of \Name[Bram]{Stoker}, although the latter is probably responsible for much tourism regarding \Name{Vlad III}[Dracula]. +% \noindent NOTE: The ``Dracula'' example is complex and the usual ``first use'' feature has been manipulated extensively to produce these results. If you mix casually the sobriquet and suffix forms, errors may ``bite.'' Puns aside, \Name{Vlad III}[Dracula] was a complex historical figure, as was his father, living in the no-man's land between the Ottoman Empire and the Holy Roman Empire. % % \subsection{Formatting Certain Sections} % \label{sec:SectionFormat} % % \DescribeMacro{\NamesActive} -% \DescribeMacro{\NamesInctive} +% \DescribeMacro{\NamesInactive} % Using the \texttt{frontmatter} option deactivates formatting until \cmd{\NamesActive} occurs. Another macro, \cmd{\NamesInactive}, will deactivate formatting again. These two macros toggle formatting on and off. The mechanism works in a complementary, yet independent manner. It can be used throughout the document. % % Here we switch to the ``front matter'' mode with \cmd{\NamesInactive}: @@ -663,10 +654,17 @@ % \end{tabular} % \end{quote} % +% \subsection{Indexing Certain Sections} +% \label{sec:SectionIndex} +% +%% \DescribeMacro{\IndexActive} +% \DescribeMacro{\IndexInactive} +% Using the \texttt{noindex} option deactivates indexing until \cmd{\IndexActive} occurs. Another macro, \cmd{\IndexInactive}, will deactivate indexing again. These can be used throughout the document, independently of \cmd{\ExcludeName}. +% % \subsection{Tweaks: \texttt{\bsc ForgetName} and \texttt{\bsc SubvertName}} % \label{sec:Tweaks} % -% Using these two macros may hinder the arbitrary rearrangement of text. I suggest that one wait until the final draft before implementing them. They either force or suppress the active formatting of names. +% Using these two macros may hinder the arbitrary rearrangement of text. I suggest that one wait until the final draft before implementing them. % % \DescribeMacro{\ForgetName} % This macro is a ``dirty trick'' of sorts that takes the same optional and mandatory parameters used by \cmd{\Name}. It handles its arguments in the same way, except that it ignores the final parameter if \emph{FNN} are present. The syntax is: @@ -677,13 +675,12 @@ % \noindent This macro causes \cmd{\Name} and friends to ``forget'' prior uses of a name with respect to typesetting. The next use will print as if it were a ``first use.'' Index entries and pseudonyms (see above) are \emph{never} forgotten. % % \DescribeMacro{\SubvertName} -% This macro is the opposite of the one above. It takes the same parameters. It handles its arguments in the same manner as \cmd{\Name}, except that it ignores the final parameter if \emph{FNN} are present. The syntax is: +% 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: % \begin{quote} % \cmd{\SubvertName}\oarg{FNN}\marg{SNN}\oarg{alternate names} % \end{quote} % % \noindent This macro causes \cmd{\Name} and friends to think that prior uses of a name have already occurred. The next use will print as if it were a ``subsequent use.'' -% \clearpage % % \StopEventually{\PrintChanges\clearpage\PrintIndex} % @@ -697,8 +694,9 @@ % \begin{macrocode} \newif\if@nameauth@DoFormat \newif\if@nameauth@DoComma +\newif\if@nameauth@DoIndex % \end{macrocode} -% These Boolean values are used to control formatting and comma suppression. Both may be set with class options, but only |@nameauth@DoFormat| can be toggled with use interface macros \cmd{\NamesActive} and \cmd{\NamesInactive}.\\ +% These Boolean values are used to control formatting, comma, and index suppression. They all may be set with class options, but the latter two can be toggled with user interface macros.\\ % % \begin{macrocode} \newif\if@nameauth@Comma @@ -706,7 +704,14 @@ % \end{macrocode} % These Boolean values are used internally for detection of suffixes and final periods.\\ % +% \changes{v0.94}{2012/02/15}{Added capitalization feature} +% \begin{macrocode} +\newif\if@nameauth@DoCaps +% \end{macrocode} +% This Boolean triggers select first letter capitalization of names preceded by particles like \emph{de la} that may need occasional initial capitalization.\\ +% % \changes{v0.85}{2012/02/05}{Added nocomma, comma options} +% \changes{v0.94}{2012/02/15}{Added index, noindex options} % \begin{macrocode} \DeclareOption{mainmatter}{\@nameauth@DoFormattrue} \DeclareOption{frontmatter}{\@nameauth@DoFormatfalse} @@ -714,28 +719,31 @@ \DeclareOption{italic}{\renewcommand{\NamesFormat}{\itshape}} \DeclareOption{boldface}{\renewcommand{\NamesFormat}{\bfseries}} \DeclareOption{noformat}{\renewcommand{\NamesFormat}{}} -\DeclareOption{nocomma}{\@nameauth@DoCommafalse} \DeclareOption{comma}{\@nameauth@DoCommatrue} -\ExecuteOptions{smallcaps,mainmatter,nocomma} +\DeclareOption{nocomma}{\@nameauth@DoCommafalse} +\DeclareOption{index}{\@nameauth@DoIndextrue} +\DeclareOption{noindex}{\@nameauth@DoIndexfalse} +\ExecuteOptions{smallcaps,mainmatter,nocomma,index} \ProcessOptions\relax \RequirePackage{etoolbox} \RequirePackage{xparse} % \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. The other options can be changed without problem and several user interface macros provide that functionality.\\ +% The options above interact with the prior Boolean values. Suppressing and showing commas is set at load time and should not be changed in the document or else significant errors will result. Most options can be changed with user interface macros.\\ % % \subsection{Internal Macros} % \begin{macro}{\@nameauth@CleanName} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \begin{macrocode} -\newcommand*{\@nameauth@CleanName}[1]{\expandafter\zap@space\detokenize{#1} \@empty} +\newcommand*{\@nameauth@CleanName}[1]% + {\expandafter\zap@space\detokenize{#1} \@empty} % \end{macrocode} % \end{macro} % Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string based on the forename/surname parameters of \cmd{\Name} and friends. With this we can construct a control sequence name. Testing for the presence of that control sequence determines the existence of pseudonyms and the first occurrence of a name.\bigskip\hrule\bigskip -% The following macros parse a ``base'' name into a radix and a suffix. They are designed so that their function occurs completely at the time of macro expansion, not execution. This expandability is key to the proper function of this package. They form the kernel of the suffix removal and comma suppression features. +% \noindent The following macros parse a ``base'' name into a radix and a suffix. They are designed so that their function occurs completely at the time of macro expansion, not execution. This expandability is key to the proper function of this package. They form the kernel of the suffix removal and comma suppression features. % % \begin{macro}{\@nameauth@Root} -% \changes{v0.85}{2012/02/05}{Revise extant suffix handling} -% \changes{v0.9}{2012/02/10}{renamed macro; suffix handling is expandable} +% \changes{v0.85}{2012/02/05}{Revise suffix handling} +% \changes{v0.9}{2012/02/10}{renamed macro; suffix handling expandable} % \begin{macrocode} \newcommand*{\@nameauth@Root}[1]{% \@nameauth@TrimRoot#1\relax% @@ -746,7 +754,7 @@ % % \begin{macro}{\@nameauth@TrimRoot} % \changes{v0.85}{2012/02/05}{Divide suffix handling into functional parts} -% \changes{v0.9}{2012/02/10}{Renamed macro; suffix handling is expandable} +% \changes{v0.9}{2012/02/10}{Renamed macro; suffix handling expandable} % \begin{macrocode} \def\@nameauth@TrimRoot#1,#2\relax{#1} % \end{macrocode} @@ -754,7 +762,6 @@ % This delimited-parameter macro strips off the first parameter. % % \begin{macro}{\@nameauth@Suffix} -% \changes{v0.85}{2012/02/05}{Revise extant suffix handling} % \changes{v0.9}{2012/02/10}{added macro} % \begin{macrocode} \newcommand*{\@nameauth@Suffix}[1]{% @@ -784,7 +791,7 @@ % This macro checks for a comma-delimited suffix. It calls its auxiliary macro below. % % \begin{macro}{\@nameauth@CheckSuffix} -% \changes{v0.9}{2012/02/10}{Added macro; comma checking expandable} +% \changes{v0.9}{2012/02/10}{Added macro} % \begin{macrocode} \def\@nameauth@CheckSuffix#1,#2\relax{% \def\Test{#2}% @@ -795,7 +802,7 @@ % This macro checks for a comma-delimited suffix and sets the Boolean |@nameauth@Comma| accordingly. % % \begin{macro}{\@nameauth@NoComma} -% \changes{v0.85}{2012/02/05}{Revise extant suffix handling} +% \changes{v0.85}{2012/02/05}{Revise suffix handling} % \changes{v0.9}{2012/02/10}{Redesigned macro} % \begin{macrocode} \newcommand*{\@nameauth@NoComma}[1]{% @@ -804,7 +811,7 @@ % \end{macrocode} % \end{macro} % This macro removes a comma from a name by breaking a <root, suffix> pair into a <root><suffix> pair. It preserves the leading space or lack thereof in the suffix.\bigskip\hrule\bigskip -% The following macros implement the mechanism to prevent the double-printing of a period after ``Sr.,'' ``Jr.,'' and so on. +% \noindent The following macros implement the mechanism to prevent the double-printing of a period after ``Sr.,'' ``Jr.,'' and so on. % % \begin{macro}{\@nameauth@CheckDot} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} @@ -812,12 +819,13 @@ \def\@nameauth@CheckDot{\futurelet\@token\@nameauth@EvalDot} % \end{macrocode} % \end{macro} -% This macro assigns the lookahead token \cmd{\@token} to be evaluated by \cmd{\@nameauth@EvalDot} while keeping \cmd{\@token} non-destructively on the list of input tokens. I use this method instead of \cmd{\@nextchar} because I do not want to gobble spaces. +% This macro assigns the lookahead token \cmd{\@token} to be evaluated by\break \cmd{\@nameauth@EvalDot} while keeping \cmd{\@token} non-destructively on the list of input tokens. This does not gobble spaces like \cmd{\@nextchar}. % % \begin{macro}{\@nameauth@EvalDot} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \begin{macrocode} -\def\@nameauth@EvalDot{\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} +\def\@nameauth@EvalDot% + {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} % \end{macrocode} % \end{macro} % \cmd{\@nameauth@EvalDot} checks if \cmd{\@token} is a period. If so it gobbles it by using \cmd{\expandafter} to get past the grouping. Another \cmd{\expandafter} occurs immediately before the invocation of \cmd{\@nameauth@CheckDot} in \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA}. @@ -827,36 +835,81 @@ % \begin{macrocode} \newcommand*{\@nameauth@TestDot}[1]{% \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}% - \def\TestPunct##1{\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% + \def\TestPunct##1% + {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% \@nameauth@Punctfalse% \TestDot#1\TestEnd.\TestEnd\TestStop% } % \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.\clearpage\hrule\bigskip +% +% \noindent The following two macros format the output for \cmd{\Name} and friends. One is used only by \cmd{\FName} because that has different formatting needs that clash with other instances of formatting. Here also is where indexing is controlled. +% % \begin{macro}{\@nameauth@FmtName} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \changes{v0.85}{2012/02/05}{Add comma suppression} % \changes{v0.9}{2012/02/10}{Redesigned macro} +% \changes{v0.94}{2012/02/15}{Added particle caps} % \begin{macrocode} \DeclareDocumentCommand\@nameauth@FmtName{s m}% {% - \@nameauth@TestDot{#2}% + \edef\Input{#2}% + \def\Cap##1{\@Cap##1}% + \def\@Cap##1##2{\uppercase{##1}##2}% + \if@nameauth@DoCaps% + \expandafter\def\expandafter\Output\expandafter{% + \expandafter\Cap\expandafter{\Input}}% + \else\let\Output\Input\fi% + \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% \IfBooleanTF{#1}% - {#2}% + {\Output}% {\bgroup\NamesFormat{#2}\egroup}% } % \end{macrocode} % \end{macro} % \cmd{\@nameauth@FmtName} is where the first occurrences of a name are formatted. Notice how \cmd{\NamesFormat} sits between a \cmd{\bgroup} and an \cmd{\egroup} to localize the font change. The \cmd{\NamesFormat} hook has been discussed above. The main reason for making this a separate macro was to offer a means of adding features in modular fashion. % +% \begin{macro}{\@nameauth@FmtFName} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\DeclareDocumentCommand\@nameauth@FmtFName{s m}% +{% + \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% + \IfBooleanTF{#1}% + {#2}% + {\bgroup\NamesFormat{#2}\egroup}% +} +% \end{macrocode} +% \end{macro} +% This formatting macro is called from \cmd{\FName} because the particle caps mechanism is incompatible with forenames. +% +% \begin{macro}{\@nameauth@Index} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\newcommand{\@nameauth@Index}[1]{% + \if@nameauth@DoIndex\index{#1}\fi% +} +% \end{macrocode} +% \end{macro} +% If the indexing flag is true, create an index entry, otherwise do nothing +% % \subsection{User Interface Macros} +% +% \begin{macro}{\CapThis} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\newcommand{\CapThis}{\@nameauth@DoCapstrue} +% \end{macrocode} +% \end{macro} +% Toggle the capitalizing of particles. The next time a formatting macro is called it will flip the state back to no caps until this is called again. +% % \begin{macro}{\Name} % \changes{v0.75}{2012/01/19}{Added ``sobriquet'' feature} % \changes{v0.8}{2012/01/29}{Merged all major functionality here} -% \changes{v0.85}{2012/02/05}{Add comma suppression to indexing, ltxdoc compatibility} -% \changes{v0.86}{2012/02/06}{Slight tweak} +% \changes{v0.85}{2012/02/05}{Add comma suppression to indexing} % \changes{v0.9}{2012/02/10}{Redesigned macro} +% \changes{v0.94}{2012/02/15}{Error checking expanded} % \begin{macrocode} \DeclareDocumentCommand\Name{s o m o}% {% @@ -868,40 +921,41 @@ \fi% \fi% \IfValueTF{#2}% - {\IfValueTF{#4}{\edef\Forenames{#4}}{\edef\Forenames{#2}}% + {\IfValueTF{#4}% + {\edef\Forenames{#4}}{\edef\Forenames{#2}}% \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2 #3.}% + {\bsc 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}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}% + \@nameauth@Index{\Surnames, #2}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}% + \@nameauth@Index{\Surnames, #2}% \fi% \fi% \fi}% @@ -910,35 +964,35 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #3 #4.}% + {\bsc Name Cross-reference: #3 #4 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \Surnames\space#4}% - \index{\Surnames\space#4}% + \@nameauth@Index{\Surnames\space#4}% \fi% \else% \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}% + \@nameauth@Index{\Surnames\space#4}% \fi% \fi% \fi}% @@ -946,34 +1000,34 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #3.}% + {\bsc Name Cross-reference: #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#3!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \fi% \fi}% @@ -988,7 +1042,7 @@ % % 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}. This will be passed to \cmd{\index} and |\@nameauth@FmtName|.\\ +% Here is how these many factors interrelate: \cmd{\Name} first checks for comma suppression. if so it stores a comma-suppressed version of the third parameter in \cmd{\Surnames}. Otherwise it stores an unchanged version in \cmd{\Surnames}. This will be passed to \cmd{\@nameauth@Index} and |\@nameauth@FmtName|.\\ % %\noindent \cmd{\Name} then checks for the forenames argument. Two outcomes are possible. % \begin{enumerate} @@ -1014,6 +1068,7 @@ % % \begin{macro}{\FName} % \changes{v0.9}{2012/02/10}{Added macro} +% \changes{v0.94}{2012/02/15}{Error checking expanded} % \begin{macrocode} \DeclareDocumentCommand\FName{o m o}% {% @@ -1027,87 +1082,88 @@ \IfValueTF{#1}% {\IfValueTF{#3}{\edef\Forenames{#3}}{\edef\Forenames{#1}}% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #1 #2.}% + {\bsc 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\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{% + \expandafter\@nameauth@FmtFName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \Forenames\expandafter\space\Surnames}% - \index{\Surnames, #1}% + \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter{\Forenames\expandafter\space\Surnames}% + \@nameauth@Index{\Surnames, #1}% \fi% \fi% \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames\space#3}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2 #3.}% + {\bsc 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,}}% - \index{\Surnames\space#3}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames\space#3}% - \index{\Surnames\space#3}% + \expandafter\@nameauth@FmtFName% + \expandafter{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames\space#3}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames\space#3}% - \index{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi% \fi% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2.}% + {\bsc FName Cross-reference: #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \index{\Surnames}% + \expandafter\@nameauth@FmtFName\expandafter{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \fi% \fi}% @@ -1116,12 +1172,13 @@ } % \end{macrocode} % \end{macro} -% \cmd{\FName} is entirely derived from \cmd{\Name}, but scaled back to print forename(s) in a subsequent use. It obeys the \texttt{nocomma} behavior and eliminates double periods. +% \cmd{\FName} is derived from \cmd{\Name}, but scaled back to print forename(s) in a subsequent use. It obeys the \texttt{nocomma} behavior and eliminates double periods. % % \begin{macro}{\AKA} % \changes{v0.85}{2012/02/05}{Add comma suppression, ltxdoc compatibility} % \changes{v0.86}{2012/02/06}{Fixed some regressions} % \changes{v0.9}{2012/02/10}{Added starred mode; redesigned} +% \changes{v0.94}{2012/02/15}{Added error checking} % \begin{macrocode} \DeclareDocumentCommand\AKA{s o m o m o}% {% @@ -1138,38 +1195,75 @@ \fi% \fi% \IfValueTF{#4}% - {\IfValueTF{#6}{\edef\Forenames{#6}}{\edef\Forenames{#4}}% + {\IfValueTF{#6}% + {\edef\Forenames{#6}}{\edef\Forenames{#4}}% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnamesii}% - \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii, #4|see{\Surnamesi, #2}}}% - {\index{\Surnamesii, #4|see{\Surnamesi}}}% + \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA XRef: #1 #2 exists.}% + \else% + \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}}% + \fi% + \fi% \fi}% {\IfValueTF{#6}% {\IfBooleanTF{#1}% {\@nameauth@FmtName*{#6}}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii #6}}% - \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii\space#6|see{\Surnamesi, #2}}}% - {\index{\Surnamesii\space#6|see{\Surnamesi}}}% + {\expandafter\@nameauth@FmtName\expandafter*% + \expandafter{\Surnamesii\space#6}}% + \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi}}}% + \fi% + \fi% \fi}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% - \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#5!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii|see{\Surnamesi, #2}}}% - {\index{\Surnamesii|see{\Surnamesi}}}% - \fi}% + \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#5!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii|see{\Surnamesi}}}% + \fi% + \fi% + \fi}% }% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } % \end{macrocode} % \end{macro} -% \cmd{\AKA} prints a pseudonym and creates index cross-references. Its starred form suppresses the ``main'' pseudonym if a sobriquet is passed in the alternate name parameter. It prevents multiple generation of cross-references. Like \cmd{\Name} it suppresses double periods. Its choices reflect the different choices of index references, based on the arguments it receives.. +% \cmd{\AKA} prints a pseudonym and creates index cross-references. Its starred form suppresses the ``main'' pseudonym if a sobriquet is passed in the alternate name parameter. It prevents multiple generation of cross-references. Like \cmd{\Name} it suppresses double periods. Its choices reflect the different choices of index references, based on the arguments it receives. % % \begin{macro}{\PName} % \changes{v0.85}{2012/02/05}{Add comma suppression} @@ -1201,16 +1295,16 @@ \IfValueTF{#1}% {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \else% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \else% - \index{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% \else% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi}% }% } @@ -1218,6 +1312,64 @@ % \end{macro} % \cmd{\IndexName} creates an index entry that is not already a pseudonym. It prints nothing. It does ensure consistent formatting. % +% \begin{macro}{\ExcludeName} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\DeclareDocumentCommand\ExcludeName{o m o}% +{% + \IfValueTF{#1}% + {% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName XRef: #1 #2 exists.}% + \else% + \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}<HOOT>% + \fi% + \fi% + \fi}% + {\IfValueTF{#3}% + {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \fi% + \fi% + \fi}% + {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \fi% + \fi% + \fi}% + }% +} +% \end{macrocode} +% \end{macro} +% This macro prevents a name from being indexed by using the exclusion mechanism of \cmd{\AKA} to prevent the other macros from indexing a name. +% % \begin{macro}{\ForgetName} % \changes{v0.75}{2012/01/19}{New parameter added} % \begin{macrocode} @@ -1270,6 +1422,22 @@ % \end{macro} % This macro is called automatically with the \texttt{mainmatter} option. % +% \begin{macro}{\IndexInactive} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\newcommand{\IndexInactive}{\@nameauth@DoIndexfalse} +% \end{macrocode} +% \end{macro} +% This macro deactivates indexing in sections where one may want formatting but not indexing. +% +% \begin{macro}{\IndexActive} +% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macrocode} +\newcommand{\IndexActive}{\@nameauth@DoIndextrue} +% \end{macrocode} +% \end{macro} +% This macro is called automatically with the \texttt{index} option. +% % \clearpage % \Finale \endinput diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index d930e1b9a9b..156a8e79862 100644 --- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty +++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty @@ -22,24 +22,30 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{nameauth} - [2012/02/12 v0.92 name authority macros to aid consistent display and indexing of names] + [2012/02/15 v0.94 name authority macros to aid consistent display and indexing of names] +%% \DescribeMacro{\IndexActive} \newif\if@nameauth@DoFormat \newif\if@nameauth@DoComma +\newif\if@nameauth@DoIndex \newif\if@nameauth@Comma \newif\if@nameauth@Punct +\newif\if@nameauth@DoCaps \DeclareOption{mainmatter}{\@nameauth@DoFormattrue} \DeclareOption{frontmatter}{\@nameauth@DoFormatfalse} \DeclareOption{smallcaps}{\newcommand{\NamesFormat}{\scshape}} \DeclareOption{italic}{\renewcommand{\NamesFormat}{\itshape}} \DeclareOption{boldface}{\renewcommand{\NamesFormat}{\bfseries}} \DeclareOption{noformat}{\renewcommand{\NamesFormat}{}} -\DeclareOption{nocomma}{\@nameauth@DoCommafalse} \DeclareOption{comma}{\@nameauth@DoCommatrue} -\ExecuteOptions{smallcaps,mainmatter,nocomma} +\DeclareOption{nocomma}{\@nameauth@DoCommafalse} +\DeclareOption{index}{\@nameauth@DoIndextrue} +\DeclareOption{noindex}{\@nameauth@DoIndexfalse} +\ExecuteOptions{smallcaps,mainmatter,nocomma,index} \ProcessOptions\relax \RequirePackage{etoolbox} \RequirePackage{xparse} -\newcommand*{\@nameauth@CleanName}[1]{\expandafter\zap@space\detokenize{#1} \@empty} +\newcommand*{\@nameauth@CleanName}[1]% + {\expandafter\zap@space\detokenize{#1} \@empty} \newcommand*{\@nameauth@Root}[1]{% \@nameauth@TrimRoot#1\relax% } @@ -59,20 +65,40 @@ \@nameauth@Root{#1}\@nameauth@Suffix{#1}% } \def\@nameauth@CheckDot{\futurelet\@token\@nameauth@EvalDot} -\def\@nameauth@EvalDot{\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} +\def\@nameauth@EvalDot% + {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} \newcommand*{\@nameauth@TestDot}[1]{% \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}% - \def\TestPunct##1{\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% + \def\TestPunct##1% + {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% \@nameauth@Punctfalse% \TestDot#1\TestEnd.\TestEnd\TestStop% } \DeclareDocumentCommand\@nameauth@FmtName{s m}% {% - \@nameauth@TestDot{#2}% + \edef\Input{#2}% + \def\Cap##1{\@Cap##1}% + \def\@Cap##1##2{\uppercase{##1}##2}% + \if@nameauth@DoCaps% + \expandafter\def\expandafter\Output\expandafter{% + \expandafter\Cap\expandafter{\Input}}% + \else\let\Output\Input\fi% + \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% + \IfBooleanTF{#1}% + {\Output}% + {\bgroup\NamesFormat{#2}\egroup}% +} +\DeclareDocumentCommand\@nameauth@FmtFName{s m}% +{% + \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% \IfBooleanTF{#1}% {#2}% {\bgroup\NamesFormat{#2}\egroup}% } +\newcommand{\@nameauth@Index}[1]{% + \if@nameauth@DoIndex\index{#1}\fi% +} +\newcommand{\CapThis}{\@nameauth@DoCapstrue} \DeclareDocumentCommand\Name{s o m o}% {% \def\Surnames{#3}% @@ -83,40 +109,41 @@ \fi% \fi% \IfValueTF{#2}% - {\IfValueTF{#4}{\edef\Forenames{#4}}{\edef\Forenames{#2}}% + {\IfValueTF{#4}% + {\edef\Forenames{#4}}{\edef\Forenames{#2}}% \ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2 #3.}% + {\bsc 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}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}% + \@nameauth@Index{\Surnames, #2}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames, #2}}% + \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #2}% + \@nameauth@Index{\Surnames, #2}% \fi% \fi% \fi}% @@ -125,35 +152,35 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #3 #4.}% + {\bsc Name Cross-reference: #3 #4 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \Surnames\space#4}% - \index{\Surnames\space#4}% + \@nameauth@Index{\Surnames\space#4}% \fi% \else% \ifcsname\@nameauth@CleanName{#3#4!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames\space#4}}% + \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% - \index{\Surnames\space#4}% + \@nameauth@Index{\Surnames\space#4}% \fi% \fi% \fi}% @@ -161,34 +188,34 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #3.}% + {\bsc Name Cross-reference: #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#3!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% - \index{\Surnames}}% + \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \fi% \fi}% @@ -207,87 +234,88 @@ \IfValueTF{#1}% {\IfValueTF{#3}{\edef\Forenames{#3}}{\edef\Forenames{#1}}% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #1 #2.}% + {\bsc 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\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{% + \expandafter\@nameauth@FmtFName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Forenames}% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*\expandafter{% - \Forenames\expandafter\space\Surnames}% - \index{\Surnames, #1}% + \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter{\Forenames\expandafter\space\Surnames}% + \@nameauth@Index{\Surnames, #1}% \fi% \fi% \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames\space#3}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2 #3.}% + {\bsc 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,}}% - \index{\Surnames\space#3}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames\space#3}% - \index{\Surnames\space#3}% + \expandafter\@nameauth@FmtFName% + \expandafter{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames\space#3}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames\space#3}% - \index{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi% \fi% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {You cannot create a page reference from the xref: #2.}% + {\bsc FName Cross-reference: #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtName\expandafter{\Surnames}% - \index{\Surnames}% + \expandafter\@nameauth@FmtFName\expandafter{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtName*{\@nameauth@Root{#2,}}% - \index{\Surnames}% + \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtName\expandafter*% + \expandafter\@nameauth@FmtFName\expandafter*% \expandafter{\Surnames}% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi% \fi% \fi}% @@ -309,32 +337,69 @@ \fi% \fi% \IfValueTF{#4}% - {\IfValueTF{#6}{\edef\Forenames{#6}}{\edef\Forenames{#4}}% + {\IfValueTF{#6}% + {\edef\Forenames{#6}}{\edef\Forenames{#4}}% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnamesii}% - \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii, #4|see{\Surnamesi, #2}}}% - {\index{\Surnamesii, #4|see{\Surnamesi}}}% + \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA XRef: #1 #2 exists.}% + \else% + \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}}% + \fi% + \fi% \fi}% {\IfValueTF{#6}% {\IfBooleanTF{#1}% {\@nameauth@FmtName*{#6}}% - {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii #6}}% - \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii\space#6|see{\Surnamesi, #2}}}% - {\index{\Surnamesii\space#6|see{\Surnamesi}}}% + {\expandafter\@nameauth@FmtName\expandafter*% + \expandafter{\Surnamesii\space#6}}% + \ifcsname\@nameauth@CleanName{#5#6!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi}}}% + \fi% + \fi% \fi}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Surnamesii}% - \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname\relax\else% - \csgdef{\@nameauth@CleanName{#5!PN!}}{}% - \IfValueTF{#2}% - {\index{\Surnamesii|see{\Surnamesi, #2}}}% - {\index{\Surnamesii|see{\Surnamesi}}}% - \fi}% + \ifcsname\@nameauth@CleanName{#5!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 already exists; no see ref.}% + \else% + \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc AKA Name reference: #5 already exists; no see ref.}% + \else% + \csgdef{\@nameauth@CleanName{#5!PN!}}{}% + \IfValueTF{#2}% + {\@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}}% + {\@nameauth@Index{\Surnamesii|see{\Surnamesi}}}% + \fi% + \fi% + \fi}% }% \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi% } @@ -355,19 +420,70 @@ \IfValueTF{#1}% {\ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \else% - \index{\Surnames, #1}% + \@nameauth@Index{\Surnames, #1}% \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% \else% - \index{\Surnames\space#3}% + \@nameauth@Index{\Surnames\space#3}% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% \else% - \index{\Surnames}% + \@nameauth@Index{\Surnames}% \fi}% }% } +\DeclareDocumentCommand\ExcludeName{o m o}% +{% + \IfValueTF{#1}% + {% + \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName XRef: #1 #2 exists.}% + \else% + \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}<HOOT>% + \fi% + \fi% + \fi}% + {\IfValueTF{#3}% + {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% + \fi% + \fi% + \fi}% + {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname\relax% + \else% + \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + \else% + \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% + \PackageWarning{nameauth}% + {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + \else% + \csgdef{\@nameauth@CleanName{#2!PN!}}{}% + \fi% + \fi% + \fi}% + }% +} \DeclareDocumentCommand\ForgetName{o m o}% {% \IfValueTF{#1}% @@ -394,6 +510,8 @@ } \newcommand{\NamesInactive}{\@nameauth@DoFormatfalse} \newcommand{\NamesActive}{\@nameauth@DoFormattrue} +\newcommand{\IndexInactive}{\@nameauth@DoIndexfalse} +\newcommand{\IndexActive}{\@nameauth@DoIndextrue} \endinput %% %% End of file `nameauth.sty'. |