diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-27 21:23:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-27 21:23:31 +0000 |
commit | aa5b2a5b49cfcd05ec9d1a4f3051320f78c4afbf (patch) | |
tree | 1ab16e5892ca3503125823ab93802a5a5e5a6048 /Master | |
parent | df9414db777046cce78cd97a995a21ffb3175ce3 (diff) |
nameauth (27oct16)
git-svn-id: svn://tug.org/texlive/trunk@42368 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/Makefile | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/README | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/README.txt | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/examples.tex | 372 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/nameauth.pdf | bin | 860872 -> 874877 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/nameauth/nameauth.dtx | 5782 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/nameauth/nameauth.ins | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 1860 |
8 files changed, 3834 insertions, 4249 deletions
diff --git a/Master/texmf-dist/doc/latex/nameauth/Makefile b/Master/texmf-dist/doc/latex/nameauth/Makefile index e2d3263d43d..aa012f76403 100644 --- a/Master/texmf-dist/doc/latex/nameauth/Makefile +++ b/Master/texmf-dist/doc/latex/nameauth/Makefile @@ -21,7 +21,7 @@ $(NAME).pdf: $(NAME).dtx clean: rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out,toc} README.txt distclean: clean - rm -f $(NAME).{dvi,pdf,sty} README + rm -f $(NAME).{dvi,pdf,sty,synctex.gz} README inst: all mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME) cp $(NAME).dtx $(UTREE)/source/latex/$(NAME) diff --git a/Master/texmf-dist/doc/latex/nameauth/README b/Master/texmf-dist/doc/latex/nameauth/README index 418fc47a383..1e50e9ee7e3 100644 --- a/Master/texmf-dist/doc/latex/nameauth/README +++ b/Master/texmf-dist/doc/latex/nameauth/README @@ -1,6 +1,6 @@ | --------:| ---------------------------------------------------------------- -nameauth:| Name authority mechanism for consistency in text and index +nameauth:| Name authority management for consistency in text and index Author:| Charles P. Schaum E-mail:| charles dot schaum at comcast dot net License:| Released under the LaTeX Project Public License v1.3c or later @@ -8,9 +8,9 @@ nameauth:| Name authority mechanism for consistency in text and index Short description: -The nameauth package automates the formatting and indexing of names. -This aids the use of a name authority and the process of textual reordering -and revision without needing to retype name references. +The nameauth package automates the correct formatting and indexing of names +for professional writing. This aids the use of a name authority and the +editing process without needing to retype name references. Files Distribution @@ -29,9 +29,12 @@ www.ctan.org/tex-archive/macros/latex/contrib/nameauth Unpack nameauth.zip in an appropriate directory. -Note that the instructions below assume that you are using a *nix- -compatible computer. If that is otherwise, you will need to modify -these instructions to your needs. +Note that the instructions below assume that you are using a kind of +Unix, BSD, Linux, Mac, or Cygwin under Microsoft Windows. If you have +a different operating environment, you will need to modify these +instructions to your own needs. Please be aware that this package is +designed to be stored in a UTF-8 encoded text file and built in a +Unicode-capable environment. If you have a make utility compatible with GNU make you can type @@ -75,13 +78,16 @@ $TEXMFLOCAL/doc/latex/nameauth pdf file, README, examples.tex The above environment variables often are /usr/local/texlive/texmf-local and ~/texmf. +The make process normally renames the README.txt file created from the dtx file +to just README by using mv (move/rename utility in the *nix userland). Windows +distributions of TeX and LaTeX often keep the txt file as well. + Run mktexlsr with the appropriate level of permissions to complete the install. Testing notes: -This packages works and builds with latex, lualatex, pdflatex, and xelatex. -It can be used with makeindex and texindy. The documentation builds with -lualatex, pdflatex, and xelatex, using makeindex. +This package and documentation work and build with latex, lualatex, pdflatex, +and xelatex. It can be used with makeindex/texindy. For testing, the make file permits one to change the typesetting engine on the command line. The default is to build the package and documentation @@ -93,4 +99,3 @@ This material is subject to the LaTeX Project Public License: http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html Happy TeXing! - diff --git a/Master/texmf-dist/doc/latex/nameauth/README.txt b/Master/texmf-dist/doc/latex/nameauth/README.txt index 418fc47a383..1e50e9ee7e3 100644 --- a/Master/texmf-dist/doc/latex/nameauth/README.txt +++ b/Master/texmf-dist/doc/latex/nameauth/README.txt @@ -1,6 +1,6 @@ | --------:| ---------------------------------------------------------------- -nameauth:| Name authority mechanism for consistency in text and index +nameauth:| Name authority management for consistency in text and index Author:| Charles P. Schaum E-mail:| charles dot schaum at comcast dot net License:| Released under the LaTeX Project Public License v1.3c or later @@ -8,9 +8,9 @@ nameauth:| Name authority mechanism for consistency in text and index Short description: -The nameauth package automates the formatting and indexing of names. -This aids the use of a name authority and the process of textual reordering -and revision without needing to retype name references. +The nameauth package automates the correct formatting and indexing of names +for professional writing. This aids the use of a name authority and the +editing process without needing to retype name references. Files Distribution @@ -29,9 +29,12 @@ www.ctan.org/tex-archive/macros/latex/contrib/nameauth Unpack nameauth.zip in an appropriate directory. -Note that the instructions below assume that you are using a *nix- -compatible computer. If that is otherwise, you will need to modify -these instructions to your needs. +Note that the instructions below assume that you are using a kind of +Unix, BSD, Linux, Mac, or Cygwin under Microsoft Windows. If you have +a different operating environment, you will need to modify these +instructions to your own needs. Please be aware that this package is +designed to be stored in a UTF-8 encoded text file and built in a +Unicode-capable environment. If you have a make utility compatible with GNU make you can type @@ -75,13 +78,16 @@ $TEXMFLOCAL/doc/latex/nameauth pdf file, README, examples.tex The above environment variables often are /usr/local/texlive/texmf-local and ~/texmf. +The make process normally renames the README.txt file created from the dtx file +to just README by using mv (move/rename utility in the *nix userland). Windows +distributions of TeX and LaTeX often keep the txt file as well. + Run mktexlsr with the appropriate level of permissions to complete the install. Testing notes: -This packages works and builds with latex, lualatex, pdflatex, and xelatex. -It can be used with makeindex and texindy. The documentation builds with -lualatex, pdflatex, and xelatex, using makeindex. +This package and documentation work and build with latex, lualatex, pdflatex, +and xelatex. It can be used with makeindex/texindy. For testing, the make file permits one to change the typesetting engine on the command line. The default is to build the package and documentation @@ -93,4 +99,3 @@ This material is subject to the LaTeX Project Public License: http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html Happy TeXing! - diff --git a/Master/texmf-dist/doc/latex/nameauth/examples.tex b/Master/texmf-dist/doc/latex/nameauth/examples.tex index 00eaadd2635..f469316175f 100644 --- a/Master/texmf-dist/doc/latex/nameauth/examples.tex +++ b/Master/texmf-dist/doc/latex/nameauth/examples.tex @@ -1,11 +1,15 @@ -% This is an example file used with the nameauth package. -% See README and nameauth.pdf for copyright info. -% +\documentclass{article} +\usepackage{verbatim} +\begin{document} +%% This is an example file used with the nameauth package. +%% See README and nameauth.pdf for copyright info. +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Test which LaTeX engine you are using +%% Test which LaTeX engine you are using %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% - +%% +\section*{Test for Latex Engine} +\begin{verbatim} \usepackage{ifxetex} \usepackage{ifluatex} @@ -23,17 +27,18 @@ \usepackage[TS1,T1]{fontenc} \fi \fi - +\end{verbatim} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Print the first use of a name in text and margin +%% Print the first use of a name in text and margin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Below we print the argument both in the text and in a margin paragraph -% unless we are in internal vertical mode. -% -% This macro is suitable to replace \NamesFormat and \FrontNamesFormat. -% - +%% +%% Below we print the argument both in the text and in a margin paragraph +%% unless we are in internal vertical mode. +%% +%% This macro is suitable to replace \NamesFormat and \FrontNamesFormat. +%% +\section*{First Use in Margin} +\begin{verbatim} \renewcommand*\NamesFormat[1]% {% #1% @@ -42,17 +47,19 @@ \marginpar{\raggedleft\scriptsize #1}% \fi } - +\end{verbatim} +\clearpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Print a text tag after first name use +%% Print a text tag after first name use %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Below we print the argument in the text and then we query the text tag -% database to see if we can print a text tag after the argument. -% -% This macro is suitable to replace \NamesFormat and \FrontNamesFormat. -% - +%% +%% Below we print the argument in the text and then we query the text tag +%% database to see if we can print a text tag after the argument. +%% +%% This macro is suitable to replace \NamesFormat and \FrontNamesFormat. +%% +\section*{Text Tag With First Use} +\begin{verbatim} \newif\ifNoTextTag \makeatletter \renewcommand*\NamesFormat[1]% @@ -78,27 +85,27 @@ \global\NoTextTagfalse% } \makeatother - +\end{verbatim} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Surname index entries in small caps -% First surname instances in text are small caps +%% Surname index entries in small caps +%% First surname instances in text are small caps %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Below we create a Boolean value \ifSC and set it true. That means -% the surnames in the index will be in small caps. -% -% We then create a macro \DoFormat that prints its argument in -% small caps if \ifSC is true, or makes no font change -% and prints the the argument. -% -% \MainNameHook ignores its argument, sets \SCfalse to suppress -% small caps in the text only, then uses control sequences and -% token registers internal to the naming macros to parse and -% print the current name values without any formatting. -% -% The hook macro can replace both \MainNameHook and \FrontNameHook. -% - +%% +%% Below we create a Boolean value \ifSC and set it true. That means +%% the surnames in the index will be in small caps. +%% +%% We then create a macro \DoFormat that prints its argument in +%% small caps if \ifSC is true, or makes no font change +%% and prints the the argument. +%% +%% \MainNameHook ignores its argument, sets \SCfalse to suppress +%% small caps in the text only, then calls the name parser used +%% specifically in formatting hooks. +%% +%% The hook macro can replace both \MainNameHook and \FrontNameHook. +%% +\section*{Continental Small Caps} +\begin{verbatim} \makeatletter \newif\ifSC @@ -112,139 +119,33 @@ \fi } -\renewcommand*\MainNameHook[1]{% - \let\ex\expandafter% - \SCfalse% - \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}% - \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}% - \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}% - \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}% - \ifx\argb\testb - \protected@edef\Suff{\@empty}% - \let\Reversed\argb% - \let\SNN\argb% - \let\Short\argb% - \else - \protected@edef\Suff{\ex\@nameauth@Suffix\ex{\the\@nameauth@toksb}}% - \protected@edef\Reversed{\Suff\Space\testb}% - \protected@edef\SNN{\testb\Space\Suff}% - \if@nameauth@RevThis - \let\Short\Suff% - \else - \let\Short\testb% - \fi - \fi - \if@nameauth@InAKA - \ifx\arga\@empty - \ifx\argc\@empty - \if@nameauth@RevThis - \Reversed% - \else - \SNN% - \fi - \else - \if@nameauth@AltAKA - \argc% - \else - \if@nameauth@RevThis - \ex\argc\ex\space\SNN% - \else - \ex\SNN\ex\space\argc% - \fi - \fi - \fi - \else - \ifx\argc\@empty - \let\FNN\arga% - \else - \let\FNN\argc% - \fi - \if@nameauth@AltAKA - \FNN% - \else - \if@nameauth@RevThis - \ex\SNN\ex\Space\FNN% - \else - \ex\FNN\ex\space\SNN% - \fi - \fi - \fi - \else - \ifx\arga\@empty - \ifx\argc\@empty - \if@nameauth@FullName - \if@nameauth@RevThis - \Reversed% - \else - \SNN% - \fi - \else - \Short% - \fi - \else - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\argc\ex\space\SNN% - \else - \ex\SNN\ex\space\argc% - \fi - \else - \if@nameauth@RevThis - \argc% - \else - \Short% - \fi - \fi - \fi - \else - \ifx\argc\@empty - \let\FNN\arga% - \else - \let\FNN\argc% - \fi - \let\Short\FNN% - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\SNN\ex\Space\FNN% - \else - \ex\FNN\ex\space\SNN% - \fi - \else - \if@nameauth@FirstName - \Short% - \else - \testb% - \fi - \fi - \fi - \fi -} -\makeatother - +\renewcommand*\MainNameHook[1]{\SCfalse\NameParser} +\let\FrontNameHook\MainNameHook +\end{verbatim} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Surname index entries in talic -% First surname instances in text are italic -% Capitalize name within that formatting +%% Surname index entries in talic +%% First surname instances in text are italic +%% Capitalize name within that formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Below we create a Boolean value \ifItal and set it true. -% This will trigger italics, similar to the Continental -% example above. -% -% We then create a macro \DoFormat that prints its argument in -% italic when \ifItal is true, or makes no font change otherwise. -% -% The \CP macro only capitalizies its argument inside \NamesFormat below. -% -% \Namesformat ignores its argument, sets \InHooktrue, then -% uses control sequences internal to the naming macros to -% parse and print the current name values with formatting. -% -% The hook macro is suitable to replace \NamesFormat and \FrontNamesFormat. -% To replace \MainNameHook and \FrontNameHook, wrap the hook macro -% between \Italfalse and \italtrue for first-only italic. -% - +%% +%% Below we create a Boolean value \ifItal and set it true. +%% This will trigger italics, similar to the Continental +%% example above. +%% +%% We then create a macro \DoFormat that prints its argument in +%% italic when \ifItal is true, or makes no font change otherwise. +%% +%% The \CP macro only capitalizies its argument inside \NamesFormat below. +%% +%% \Namesformat ignores its argument, sets \InHooktrue, then +%% calls the name parser used specifically in formatting hooks. +%% +%% The hook macro is suitable to replace \NamesFormat and \FrontNamesFormat. +%% To replace \MainNameHook and \FrontNameHook, wrap the hook macro +%% between \Italfalse and \italtrue for first-only italic. +%% +\section*{Formatting and Capping} +\begin{verbatim} \newif\ifItal \newif\ifFirstCap \newif\ifInHook @@ -255,7 +156,7 @@ } \def\CP#1{% \ifInHook - \ifFirstCap\uppercase{#1}\else#1\fi% + \ifFirstCap\uppercase{#1}\else#1\fi \else #1% \fi @@ -263,112 +164,17 @@ \newcommand*\CapMe{\FirstCaptrue} \makeatletter% -\renewcommand*\NamesFormat[1]{\ignorespaces% - \let\ex\expandafter\ignorespaces% - \InHooktrue\ignorespaces% - \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}\ignorespaces% - \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}\ignorespaces% - \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}\ignorespaces% - \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}\ignorespaces% - \ifx\argb\testb - \protected@edef\Suff{\@empty}\ignorespaces% - \let\Reversed\argb\ignorespaces% - \let\SNN\argb\ignorespaces% - \let\Short\argb\ignorespaces% - \else - \protected@edef\Suff{\ex\@nameauth@Suffix\ex{\the\@nameauth@toksb}}\ignorespaces% - \protected@edef\Reversed{\Suff\Space\testb}\ignorespaces% - \protected@edef\SNN{\testb\Space\Suff}\ignorespaces% - \if@nameauth@RevThis - \let\Short\Suff% - \else - \let\Short\testb% - \fi - \fi - \if@nameauth@InAKA - \ifx\arga\@empty - \ifx\argc\@empty - \if@nameauth@RevThis - \Reversed% - \else - \SNN% - \fi - \else - \if@nameauth@AltAKA - \argc% - \else - \if@nameauth@RevThis - \ex\argc\ex\space\SNN% - \else - \ex\SNN\ex\space\argc% - \fi - \fi - \fi - \else - \ifx\argc\@empty - \let\FNN\arga% - \else - \let\FNN\argc% - \fi - \if@nameauth@AltAKA - \FNN% - \else - \if@nameauth@RevThis - \ex\SNN\ex\Space\FNN% - \else - \ex\FNN\ex\space\SNN% - \fi - \fi - \fi - \else - \ifx\arga\@empty - \ifx\argc\@empty - \if@nameauth@FullName - \if@nameauth@RevThis - \Reversed% - \else - \SNN% - \fi - \else - \Short% - \fi - \else - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\argc\ex\space\SNN% - \else - \ex\SNN\ex\space\argc% - \fi - \else - \if@nameauth@RevThis - \argc% - \else - \Short% - \fi - \fi - \fi - \else - \ifx\argc\@empty - \let\FNN\arga% - \else - \let\FNN\argc% - \fi - \let\Short\FNN% - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\SNN\ex\Space\FNN% - \else - \ex\FNN\ex\space\SNN% - \fi - \else - \if@nameauth@FirstName - \Short% - \else - \testb% - \fi - \fi - \fi - \fi - \InHookfalse% +\renewcommand*\NamesFormat[1] +{% + \InHooktrue\NameParser\InHookfalse% \global\FirstCapfalse% -}
\ No newline at end of file +} +\renewcommand*\MainNameHook[1] +{% + \Italfalse\InHooktrue\NameParser\InHookfalse% + \global\FirstCapfalse\Italtrue% +} +\let\FrontNamesFormat\Namesformat +\let\FrontNameHook\MainNameHook +\end{verbatim} +\end{document} diff --git a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf Binary files differindex defe59b63b3..e7741d41c8b 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 3d437622860..7fb789ddda2 100644 --- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx +++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx @@ -6,7 +6,7 @@ %<*readme> | --------:| ---------------------------------------------------------------- -nameauth:| Name authority mechanism for consistency in text and index +nameauth:| Name authority management for consistency in text and index Author:| Charles P. Schaum E-mail:| charles dot schaum at comcast dot net License:| Released under the LaTeX Project Public License v1.3c or later @@ -15,9 +15,9 @@ nameauth:| Name authority mechanism for consistency in text and index Short description: -The nameauth package automates the formatting and indexing of names. -This aids the use of a name authority and the process of textual reordering -and revision without needing to retype name references. +The nameauth package automates the correct formatting and indexing of names +for professional writing. This aids the use of a name authority and the +editing process without needing to retype name references. Files Distribution @@ -36,9 +36,12 @@ www.ctan.org/tex-archive/macros/latex/contrib/nameauth Unpack nameauth.zip in an appropriate directory. -Note that the instructions below assume that you are using a *nix- -compatible computer. If that is otherwise, you will need to modify -these instructions to your needs. +Note that the instructions below assume that you are using a kind of +Unix, BSD, Linux, Mac, or Cygwin under Microsoft Windows. If you have +a different operating environment, you will need to modify these +instructions to your own needs. Please be aware that this package is +designed to be stored in a UTF-8 encoded text file and built in a +Unicode-capable environment. If you have a make utility compatible with GNU make you can type @@ -82,13 +85,16 @@ and you create the following manual installation directories for local site: The above environment variables often are /usr/local/texlive/texmf-local and ~/texmf. +The make process normally renames the README.txt file created from the dtx file +to just README by using mv (move/rename utility in the *nix userland). Windows +distributions of TeX and LaTeX often keep the txt file as well. + Run mktexlsr with the appropriate level of permissions to complete the install. Testing notes: -This packages works and builds with latex, lualatex, pdflatex, and xelatex. -It can be used with makeindex and texindy. The documentation builds with -lualatex, pdflatex, and xelatex, using makeindex. +This package and documentation work and build with latex, lualatex, pdflatex, +and xelatex. It can be used with makeindex/texindy. For testing, the make file permits one to change the typesetting engine on the command line. The default is to build the package and documentation @@ -115,7 +121,7 @@ Happy TeXing! \preamble --------:| ---------------------------------------------------------------- -nameauth:| Name authority mechanism for consistency in text and index +nameauth:| Name authority management for consistency in text and index Author:| Charles P. Schaum E-mail:| charles dot schaum at comcast dot net License:| Released under the LaTeX Project Public License v1.3c or later @@ -137,8 +143,8 @@ This work is "maintained" (as per LPPL maintenance status) by Charles P. Schaum. This work consists of the files nameauth.dtx, examples.tex, and a Makefile. -Running "make" generates the derived files README, nameauth.pdf and nameauth.sty. -Running "make inst" installs the files in the user's TeX tree. +Running "make" generates the derived files README, nameauth.pdf and +nameauth.sty. Running "make inst" installs the files in the user's TeX tree. Running "make install" installs the files in the local TeX tree. \endpostamble @@ -174,7 +180,7 @@ Running "make install" installs the files in the local TeX tree. %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{nameauth} %<*package> - [2016/09/19 v2.6 Name authority mechanism for consistency in text and index] + [2016/10/26 v3.0 Name authority management for consistency in text and index] %</package> %<*driver> \documentclass[11pt]{ltxdoc} @@ -208,7 +214,21 @@ Running "make install" installs the files in the local TeX tree. \usepackage{setspace} \usepackage{enumitem} \usepackage{booktabs} -\usepackage{tikz} +\ifxetex + \usepackage{tikz}% +\else + \ifluatex + \ifpdf + \usepackage{tikz}% + \else + \fi + \else + \ifpdf + \usepackage{tikz}% + \else + \fi + \fi +\fi \usepackage[numbered]{hypdoc} \setlist{rightmargin=\leftmargin,itemsep=0pt} \frenchspacing @@ -216,177 +236,170 @@ Running "make install" installs the files in the local TeX tree. \CodelineIndex \RecordChanges \begin{nameauth} - \< Wash & George & Washington & > - \< Soto & Hernando & de Soto & > - \< JRII & John David & Rockefeller, II & > - \< JRIV & John David & Rockefeller, IV & > - \< JayR & John David & Rockefeller, IV & Jay > + \< Aeths & & \noexpand\DoFormat{Æþelstan} & > \< Aris & & Aristotle & > - \< Eliz & & Elizabeth, I & > \< Attil & & Attila, the Hun & > - \< Dagb & & Dagobert & I > - \< Konoe & Fumimaro & Konoe & > - \< Yamt & & Yamamoto, Isoroku & > - \< Yosh & & Yoshida & Shigeru > - \< Einstein & Albert & Einstein & > + \< Cao & & \noexpand\DoFormat{Cao}, Cao & > + \< CBald & & Charles, the Bald & > + \< Chas & & \noexpand\DoFormat{Charles}, I & > \< Cicero & M.T. & Cicero & > \< Confucius & & Confucius & > - \< CBald & & Charles, the Bald & > - \< White & E.\,B. & White & > - \< Smith & John & Smith & > - \< JQP & J.Q. & Public & > - \< Patton & George S. & Patton, Jr. & > - \< Francis & & Francis, I & > - \< Dem & & Demetrius, I Soter & > - \< Sun & & Sun, Yat-sen & > - \< Plato & & Plato & > - \< Henry & & Henry & VIII > - \< Ptol & & Ptolemy & I Soter > - \< Mao & & Mao & Tse-tung > + \< Dagb & & Dagobert & I > + \< Dem & & Demetrius, I & > + \< deSmet & Pierre-Jean & \noexpand\DoFormat{\noexpand\CP{d}e Smet} & > \< DLM & Walter & de la Mare & > - \< JWG & Johann Wolfgang von & Goethe & > + \< Einstein & Albert & Einstein & > + \< Eliz & & Elizabeth, I & > + \< Francis & & Francis, I & > + \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & > \< Harnack & Adolf & Harnack & > - \< Bier & Johann & Bier\-mann & > + \< Henry & & Henry & VIII > \< Howell & Thurston & \textsc{Howell},\textsc{III} &> - \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & > - \< OFukuyama & & \uppercase{Fukuyama} & Takeshi > + \< JayR & John David & Rockefeller, IV & Jay > + \< JQA & John Quincy & \noexpand\DoFormat{Adams} & > + \< JRII & John David & Rockefeller, II & > + \< JRIII & John David & \noexpand\DoFormat{Rockefeller}, III & > + \< JRIV & John David & Rockefeller, IV & > + \< JWG & J.W. von & Goethe & > \< KempMed & & Thomas, à~Kempis & > \< KempW & Thomas & à~Kempis & > + \< Konoe & Fumimaro & Konoe & > \< Lewis & Clive Staples & Lewis & C.S. > - \< Jack & Clive Staples & Lewis & Jack > - \< JQA & John Quincy & \noexpand\DoFormat{Adams} & > - \< Aeths & & \noexpand\DoFormat{Æþelstan} & > - \< Chas & & \noexpand\DoFormat{Charles}, I & > - \< Cao & & \noexpand\DoFormat{Cao}, Cao & > - \< JRIII & John David & \noexpand\DoFormat{Rockefeller}, III & > + \< LewisFull & Clive Staples & Lewis & > + \< Mao & & Mao & Tse-tung > + \< Miyazaki & & Miyazaki, Hayao & > + \< OFukuyama & & \uppercase{Fukuyama} & Takeshi > + \< Patton & George S. & Patton, Jr. & > + \< Plato & & Plato & > + \< Ptol & & Ptolemy & I > \< SDJR & Sammy & \noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}. & > - \< deSmet & Pierre-Jean & \noexpand\DoFormat{\noexpand\CP{d}e Smet} & > + \< Soto & Hernando & de Soto & > + \< Sun & & Sun, Yat-sen & > + \< Wash & George & Washington & > + \< White & E.\,B. & White & > + \< Yamt & & Yamamoto, Isoroku & > + \< Yosh & & Yoshida & Shigeru > \end{nameauth} -\TagName[George]{Washington}{, president|hyperpage} +\PretagName[Catherine]{\textsc{de'~Medici}}{de Medici, Catherine} +\PretagName[E.\,B.]{White}{White, E. B.} +\PretagName[Greta]{\textsc{Garbo}}{Garbo, Greta} +\PretagName[Heinrich Wilhelm]{\textsc{Rühmann}}{Ruehmann, Heinrich Wilhelm} +\PretagName[Heinz]{\textsc{Rühmann}}{Ruehmann, Heinz} +\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan} +\PretagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{Rockefeller, John David, III} +\PretagName[John Quincy]{\noexpand\DoFormat{Adams}}{Adams, John Quincy} +\PretagName[Pierre-Jean]{\noexpand\DoFormat{\noexpand\CP{d}e Smet}}{de Smet, Pierre-Jean} +\PretagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{Davis, Sammy, Jr.} +\PretagName[Thurston]{\textsc{Howell},\textsc{III}}{Howell, Thurston 3} +\PretagName{\noexpand\DoFormat{Æþelstan}}{Aethelstan} +\PretagName{\noexpand\DoFormat{Cao}, Cao}{Cao Cao} +\PretagName{\noexpand\DoFormat{Charles}, I}{Charles 1} +\PretagName{\noexpand\DoFormat{Mengde}}{Mengde} +\PretagName{\uppercase{Fukuyama}, Takeshi}{Fukuyama, T} +\PretagName{Æthelred, II}{Aethelred 2} +\PretagName{Atatürk}{Ataturk} +\PretagName{Thomas, à~Kempis}{Thomas a Kempis} +\PretagName{Vlad, Ţepeş}{Vlad Tepes} +\TagName[Adolf]{Harnack}{|hyperpage} +\TagName[Albert]{Einstein}{|hyperpage} +\TagName[Bob]{Hope}{|hyperpage} +\TagName[Catherine]{\textsc{de'~Medici}}{|hyperpage} +\TagName[Charles]{du Fresne}{|hyperpage} +\TagName[Charlie]{Chaplin}{|hyperpage} +\TagName[Chesley B.]{Sullenberger, III}{|hyperpage} +\TagName[Clive Staples]{Lewis}{|hyperpage} +\TagName[Dan]{Luecking}{|hyperpage} +\TagName[E.\,B.]{White}{|hyperpage} +\TagName[Enrico]{Gregorio}{|hyperpage} +\TagName[Fumimaro]{Konoe}{\dag, PM|hyperpage} +\TagName[George S.]{Patton, Jr.}{|hyperpage} +\TagName[George]{Eliot}{|hyperpage} +\TagName[George]{Washington}{, pres.|hyperpage} +\TagName[Greta]{\textsc{Garbo}}{|hyperpage} +\TagName[Heiko]{Oberdiek}{|hyperpage} +\TagName[Heinz]{\textsc{Rühmann}}{|hyperpage} \TagName[Hernando]{de Soto}{|hyperpage} +\TagName[J.E.]{Carter, Jr.}{, pres.|hyperpage} +\TagName[J.S.]{Mill}{|hyperpage} +\TagName[J.W. von]{Goethe}{|hyperpage} +\TagName[Jan]{Łukasiewicz}{|hyperpage} +\TagName[Jesse]{Ventura}{|hyperpage} +\TagName[Johann]{Andreä}{|hyperpage} +\TagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{|hyperpage} \TagName[John David]{Rockefeller, II}{|hyperpage} \TagName[John David]{Rockefeller, IV}{|hyperpage} +\TagName[John Maynard]{Keynes}{|hyperpage} +\TagName[John Quincy]{\noexpand\DoFormat{Adams}}{, pres.|hyperpage} +\TagName[John]{Smith}{*|hyperpage} +\TagName[John]{Strietelmeier}{|hyperpage} +\TagName[Lafcadio]{Hearn}{|hyperpage} +\TagName[Louis]{Gossett, Jr.}{|hyperpage} +\TagName[M.T.]{Cicero}{|hyperpage} +\TagName[Marc van]{Dongen}{|hyperpage} +\TagName[Mark]{Twain}{|hyperpage} +\TagName[Martin Luther]{King, Jr.}{|hyperpage} +\TagName[Mike]{Tyson}{|hyperpage} +\TagName[Mustafa]{Kemal}{|hyperpage} +\TagName[Nicolas]{Malebranche}{|hyperpage} +\TagName[Oskar]{Hammerstein, II}{|hyperpage} +\TagName[Patrick]{Cousot}{|hyperpage} +\TagName[Patrick]{Cousot}{|hyperpage} +\TagName[Philipp]{Stephani}{|hyperpage} +\TagName[Pierre-Jean]{\noexpand\DoFormat{\noexpand\CP{d}e Smet}}{|hyperpage} +\TagName[Robert]{Schlicht}{|hyperpage} +\TagName[Rudolph]{Carnap}{|hyperpage} +\TagName[R.]{Snel van Royen}{|hyperpage} +\TagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{|hyperpage} +\TagName[Schuyler]{Colfax}{, v.p.|hyperpage} +\TagName[The Amazing]{Kreskin}{|hyperpage} +\TagName[Thurston]{\textsc{Howell},\textsc{III}}{*|hyperpage} +\TagName[Ulysses S.]{Grant}{, pres.|hyperpage} +\TagName[Uwe]{Lueck}{|hyperpage} +\TagName[W.E.B.]{Du Bois}{|hyperpage} +\TagName[Walter]{de la Mare}{|hyperpage} +\TagName[W.]{Snel van Royen}{|hyperpage} +\TagName[Yoko]{Kanno}{\dag|hyperpage} +\TagName{\noexpand\DoFormat{Æþelstan}}{, king|hyperpage} +\TagName{\noexpand\DoFormat{Cao}, Cao}{|hyperpage} +\TagName{\noexpand\DoFormat{Charles}, I}{, king|hyperpage} +\TagName{\uppercase{Fukuyama}, Takeshi}{|hyperpage} +\TagName{Æthelred, II}{, king|hyperpage} +\TagName{Arai, Akino}{|hyperpage} \TagName{Aristotle}{|hyperpage} -\TagName{Elizabeth, I}{, queen|hyperpage} \TagName{Attila, the Hun}{|hyperpage} -\TagName{Dagobert}[I]{\ddag, king|hyperpage} -\TagName[Fumimaro]{Konoe}{\dag, PM|hyperpage} -\TagName{Yamamoto, Isoroku}{|hyperpage} -\TagName{Yoshida}[Shigeru]{\ddag, PM|hyperpage} -\TagName[Albert]{Einstein}{|hyperpage} -\TagName[M.T.]{Cicero}{|hyperpage} -\TagName{Confucius}{|hyperpage} +\TagName{Bernard, of Clairvaux}{|hyperpage} +\TagName{Boris, the Animal}{*|hyperpage} \TagName{Charles, the Bald}{, emperor|hyperpage} -\TagName[George S.]{Patton, Jr.}{|hyperpage} +\TagName{Chiang}[Kai-shek]{\ddag, pres.|hyperpage} +\TagName{Confucius}{|hyperpage} +\TagName{Dagobert}[I]{\ddag, king|hyperpage} +\TagName{Demetrius, I}{ Soter, king|hyperpage} +\TagName{Elizabeth, I}{, queen|hyperpage} \TagName{Francis, I}{, king|hyperpage} -\TagName{Demetrius, I Soter}{, king|hyperpage} -\TagName{Sun, Yat-sen}{, president|hyperpage} -\TagName{Plato}{|hyperpage} -\TagName{Henry}[VIII]{\ddag, king|hyperpage} -\TagName{Ptolemy}[I Soter]{\ddag, king|hyperpage} -\TagName{Mao}[Tse-tung]{\ddag, chairman|hyperpage} -\TagName[Walter]{de la Mare}{|hyperpage} -\TagName[Johann Wolfgang von]{Goethe}{|hyperpage} -\TagName[Adolf]{Harnack}{|hyperpage} -\TagName{Antiochus, IV}{ Epi\-phanes, king|hyperpage} -\TagName{Chiang}[Kai-shek]{\ddag, president|hyperpage} -\TagName{Louis, XIV}{, king|hyperpage} -\TagName{Leo, I}{, pope|hyperpage} \TagName{Gregory, I}{, pope|hyperpage} -\TagName[John]{Smith}{*|hyperpage} -\TagName[J.Q.]{Public}{*|hyperpage} -\TagName[James Earl]{Carter, Jr.}{, president|hyperpage} -\TagName{Jean, sans Peur}{, duke|hyperpage} -\PretagName[E.\,B.]{White}{White, E. B.} -\TagName[E.\,B.]{White}{|hyperpage} -\TagName{Anaximander}{|hyperpage} -\TagName{Arai, Akino}{|hyperpage} -\TagName{Boris, the Animal}{*|hyperpage} -\TagName[Rudolph]{Carnap}{|hyperpage} -\TagName[Patrick]{Cousot}{|hyperpage} -\TagName[Marc van]{Dongen}{|hyperpage} -\TagName[W.E.B.]{Du Bois}{|hyperpage} -\TagName[Charles]{du Fresne}{|hyperpage} -\TagName[George]{Eliot}{|hyperpage} -\TagName[Louis]{Gossett, Jr.}{|hyperpage} -\TagName[Enrico]{Gregorio}{|hyperpage} -\TagName[Oskar]{Hammerstein, II}{|hyperpage} -\TagName[Lafcadio]{Hearn}{|hyperpage} -\TagName[Bob]{Hope}{|hyperpage} +\TagName{Henry}[VIII]{\ddag, king|hyperpage} \TagName{Ishida}[Yoko]{\ddag|hyperpage} +\TagName{Jean, sans Peur}{, duke|hyperpage} \TagName{John, Eriugena}{|hyperpage} -\TagName[Yoko]{Kanno}{\dag|hyperpage} -\TagName[Martin Luther]{King, Jr.}{|hyperpage} -\TagName[The Amazing]{Kreskin}{|hyperpage} \TagName{Lao-tzu}{|hyperpage} -\TagName[Uwe]{Lueck}{|hyperpage} -\TagName[Dan]{Luecking}{|hyperpage} +\TagName{Leo, I}{, pope|hyperpage} +\TagName{Louis, XIV}{, king|hyperpage} \TagName{Maimonides}{|hyperpage} -\TagName[Nicolas]{Malebranche}{|hyperpage} -\TagName[J.S.]{Mill}{|hyperpage} -\TagName[Aiko]{Nakano}{\dag|hyperpage} -\TagName{Nogawa}[Sakura]{\ddag|hyperpage} -\TagName[Heiko]{Oberdiek}{|hyperpage} +\TagName{Mao}[Tse-tung]{\ddag, chairman|hyperpage} +\TagName{Miyazaki, Hayao}{|hyperpage} +\TagName{Plato}{|hyperpage} +\TagName{Ptolemy}[I]{ Soter\ddag, king|hyperpage} \TagName{Rambam}{|hyperpage} -\TagName[Robert]{Schlicht}{|hyperpage} -\TagName{Shikata, Akiko}{|hyperpage} -\TagName[Rudolph]{Snel van Royen}{|hyperpage} -\TagName[Willebrord]{Snel van Royen}{|hyperpage} -\TagName[Philipp]{Stephani}{|hyperpage} -\TagName[John]{Strietelmeier}{|hyperpage} -\TagName[Johann]{Bier\-mann}{*|hyperpage} -\TagName[Chesley B.]{Sullenberger, III}{|hyperpage} +\TagName{Sun, Yat-sen}{, pres.|hyperpage} +\TagName{Thomas, à~Kempis}{|hyperpage} \TagName{Thomas, Aquinas}{|hyperpage} -\TagName[Mark]{Twain}{|hyperpage} -\TagName[Mike]{Tyson}{|hyperpage} \TagName{Vlad II, Dracul}{|hyperpage} \TagName{Vlad III, Dracula}{|hyperpage} \TagName{Voltaire}{|hyperpage} -\TagName{Yohko}{|hyperpage} -\TagName[Johann]{Andreä}{|hyperpage} -\TagName{Bernard, of Clairvaux}{|hyperpage} -\TagName[Schuyler]{Colfax}{, VP|hyperpage} -\TagName[Ulysses S.]{Grant}{, president|hyperpage} -\PretagName{Æthelred, II}{Aethelred 2} -\TagName{Æthelred, II}{, king|hyperpage} -\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan} -\TagName[Jan]{Łukasiewicz}{|hyperpage} -\PretagName{Vlad, Ţepeş}{Vlad Tepes} -\TagName[Patrick]{Cousot}{|hyperpage} -\PretagName[Greta]{\textsc{Garbo}}{Garbo, Greta} -\TagName[Greta]{\textsc{Garbo}}{|hyperpage} -\PretagName[Thurston]{\textsc{Howell},\textsc{III}}{Howell, Thurston 3} -\TagName[Thurston]{\textsc{Howell},\textsc{III}}{*|hyperpage} -\PretagName{\uppercase{Fukuyama}, Takeshi}{Fukuyama, T} -\TagName{\uppercase{Fukuyama}, Takeshi}{|hyperpage} -\PretagName{Thomas, à~Kempis}{Thomas a Kempis} -\TagName{Thomas, à~Kempis}{|hyperpage} -\TagName[Clive Staples]{Lewis}{|hyperpage} -\PretagName[Heinz]{\textsc{Rühmann}}{Ruehmann, Heinz} -\TagName[Heinz]{\textsc{Rühmann}}{|hyperpage} -\PretagName[Heinrich Wilhelm]{\textsc{Rühmann}}{Ruehmann, Heinrich Wilhelm} \TagName{William, I}{|hyperpage} -\TagName[Charlie]{Chaplin}{|hyperpage} -\TagName[John Maynard]{Keynes}{|hyperpage} -\PretagName{Atatürk}{Ataturk} -\TagName[Mustafa]{Kemal}{|hyperpage} -\PretagName[Catherine]{\textsc{de'~Medici}}{de Medici, Catherine} -\TagName[Catherine]{\textsc{de'~Medici}}{|hyperpage} -\PretagName[John Quincy]{\noexpand\DoFormat{Adams}}{Adams, John Quincy} -\TagName[John Quincy]{\noexpand\DoFormat{Adams}}{, president|hyperpage} -\PretagName{\noexpand\DoFormat{Æþelstan}}{Aethelstan} -\TagName{\noexpand\DoFormat{Æþelstan}}{, king|hyperpage} -\PretagName{\noexpand\DoFormat{Charles}, I}{Charles 1} -\TagName{\noexpand\DoFormat{Charles}, I}{, king|hyperpage} -\PretagName{\noexpand\DoFormat{Cao}, Cao}{Cao Cao} -\TagName{\noexpand\DoFormat{Cao}, Cao}{|hyperpage} -\PretagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{Rockefeller, John David, III} -\TagName[John David]{\noexpand\DoFormat{Rockefeller}, III}{|hyperpage} -\PretagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{Davis, Sammy, Jr.} -\TagName[Sammy]{\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}{|hyperpage} -\PretagName{\noexpand\DoFormat{Mengde}}{Mengde} -\PretagName[Pierre-Jean]{\noexpand\DoFormat{\noexpand\CP{d}e Smet}}{de Smet, Pierre-Jean} -\TagName[Pierre-Jean]{\noexpand\DoFormat{\noexpand\CP{d}e Smet}}{|hyperpage} +\TagName{Yamamoto, Isoroku}{|hyperpage} +\TagName{Yohko}{|hyperpage} +\TagName{Yoshida}[Shigeru]{\ddag, PM|hyperpage} \IndexActual{=} \begin{document} \DocInput{\jobname.dtx} @@ -394,7 +407,7 @@ Running "make install" installs the files in the local TeX tree. %</driver> % \fi % -% \CheckSum{3259} +% \CheckSum{3101} % % \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 @@ -413,13 +426,8 @@ Running "make install" installs the files in the local TeX tree. % Right brace \} Tilde \~} % % \changes{v0.7}{2011/12/26}{Initial release} -% \changes{v0.85}{2012/02/05}{Add package options} -% \changes{v1.0}{2012/02/20}{Works fully with \textsf{microtype} and \textsf{memoir}} -% \changes{v1.5}{2013/02/22}{Add package options} -% \changes{v1.7}{2013/04/02}{Fix options processing} -% \changes{v2.0}{2015/11/11}{Use dtxgen template instead of dtxtut; update docs} -% \changes{v2.42}{2016/03/18}{Do not use \cmd{\cmd} in section headings} -% \changes{v2.5}{2016/04/06}{More examples; no default formatting} +% \changes{v2.0}{2015/11/11}{Use dtxgen template} +% \changes{v2.5}{2016/04/06}{No default formatting} % \GetFileInfo{\jobname.dtx} % \DoNotIndex{\@empty, \@gobble, \@period, \@token, \trim@spaces, \zap@space} % \DoNotIndex{\begingroup, \bfseries, \bgroup, \csdef, \csgdef, \csname, \csundef, \DeclareOption, \def, \detokenize, \edef, \egroup, \else, \endcsname, \endgroup, \endinput, \ExecuteOptions, \expandafter, \fi, \futurelet, \global, \hbox, \if, \ifcsname, \ifx, \ignorespaces, \index, \itshape, \leavevmode, \let, \newcommand, \newcommandx, \newenvironment, \newif, \nobreakspace, \PackageError, \PackageWarning, \ProcessOptions, \relax, \renewcommand, \RequirePackage, \scshape, \space, \textbackslash, \uppercase} @@ -435,16 +443,15 @@ Running "make install" installs the files in the local TeX tree. % \ifluatex\ifpdf\DoTikZtrue\fi % \else\ifpdf\DoTikZtrue\fi\fi\fi % -% \title{\textsf{nameauth} --- Name authority mechanism for consistency in text and index\thanks{This file -% describes version \fileversion, last revised \filedate.} -% } +% \title{\textsf{nameauth} --- Name authority management\\ for consistency in text and +% index\thanks{This file describes version \fileversion, last revised \filedate.}} % \author{Charles P. Schaum\thanks{E-mail: charles dot schaum at comcast dot net}} % \date{Released \filedate} % % \maketitle -% +% % \begin{abstract} -% \noindent The \textsf{nameauth} package automates the formatting and indexing of names. This aids the use of a \textbf{name authority} and the process of textual reordering and revision without needing to retype name references. +% \noindent The \textsf{nameauth} package automates the correct formatting and indexing of names for professional writing. This aids the use of a \textbf{name authority} and the editing process without needing to retype name references. % \end{abstract} % % {\small\tableofcontents} @@ -455,64 +462,74 @@ Running "make install" installs the files in the local TeX tree. % \subsection{Preliminary Information} % % \begin{center}\large\bfseries Disclaimer\end{center} -% This manual uses names of living and dead historical figures because users refer to real people. At no time do I intend any disrespect or statement of bias regarding any particular person, culture, or tradition. All names herein are used only for teaching purposes. Especially in the index, fictional names have an asterisk (*), Eastern names with Western index forms have a dagger (\dag), and names that use the older syntax have a double dagger (\ddag). +% \noindent This manual uses names of living and dead historical figures because users refer to real people. At no time do I intend any disrespect or statement of bias for or against any particular person, culture, or tradition. All names herein are used only for teaching purposes. +% +% \begin{center}\large\bfseries Denotative Signs\end{center} +% \noindent In the index, fictional names have an asterisk (*). In this manual, ``non-native'' Eastern names are shown with a dagger (\dag). Names that use the older syntax are shown with a double dagger (\ddag). These marks are not added by the package macros and will not appear in users' works. % % \begin{center}\large\bfseries Design\end{center} -% When publications use hundreds of names, it takes time and money to check them. This package automates much of that work: -% \begin{itemize} -% \item \textbf{Automation} of name forms in the text aids professional writing and allows the arbitrary replacement of text without retyping names. +% \noindent When publications use hundreds of names, it takes time and money to check them. This package automates much of that work: % \begin{itemize}\small +% \item \textbf{Automation} of name forms to aid professional writing. Move blocks of text and see the names reformat themselves. +% \begin{itemize} % \item Default to long name references first, then shorter ones. % \item Use alternate names only in the body text, not the index. % \item Perform name caps and reversing only in the body text. % \end{itemize} % \item Name variants in the text still produce \textbf{consistent index entries}. -% \item One can design \textbf{complex name formatting.} +% \item One can design \textbf{complex name formatting}. Default is English typography, but other standards, such as ``Continental'' use of small caps, can be applied (Sections~\ref{sec:accents}, \ref{sec:nonenglish}, \ref{sec:IndexSort}, and~\ref{sec:Hooksc}). % \item One can \textbf{automate information retrieval} about names. -% \item One can implement and automate a \textbf{name authority,} a master list of names that permits known name variants. +% \item One can implement and automate a \textbf{name authority}, a master list of names that permits known name variants. % \item Some \textbf{cross-cultural naming conventions} are possible. % \item \textbf{Automatic sort keys and tags} aid indexing. % \item Provide \textbf{automatic name presentation} that could work in a \LaTeX\ backend for a document transform, database report, etc. % \end{itemize} % -% This package grew from generalized needs for translating old German and Latin texts into English. One can enable Continental and non-English standards via control sequences in the macro arguments or through bypassing and reformatting the post-processing modules (Sections~\ref{sec:accents}, \ref{sec:nonenglish}, \ref{sec:IndexSort}, and~\ref{sec:Hooksc}). +% Indexing generally conforms to the standard in Nancy C. Mulvany, \emph{Indexing Books} (Chicago: University of Chicago Press, 1994). % -% Indexing generally conforms to the standard in Nancy C. Mulvany, \emph{Indexing Books} (Chicago: University of Chicago Press, 1994). This should be suitable for a very wide application across a number of disciplines. +% \begin{center}\large\bfseries Thanks\end{center} +% \noindent {\def\NamesFormat{\bfseries} Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, \Name[Uwe]{Lueck}, and \Name[Robert]{Schlicht} for their assistance in the early versions of this package. Thanks also to the users and their feedback.} % \clearpage % -% \begin{center}\large\bfseries Technical Notes\end{center} -% \begin{itemize} -% \item We take an ``easy stuff first'' approach and indicate when the number or complexity of concepts might be confusing. -% \item When this\marginpar{\small\raggedleft\dbend} manual touches on some of the more esoteric points of this package that require more caution, it uses the ``dangerous bend.'' -% \item This manual uses package macros and internals in special ways to isolate and show its examples. In some cases we point that out, while in others we assume that the reader understands this. -% \item With\marginpar{\small\raggedleft\dbend} version 2.5 no formatting is selected by default. To implement formatting, see Sections~\ref{sec:nonenglish}, \ref{sec:CustomHooks}, and~\ref{sec:Hooksa}ff. These sections can be more complex than others. -% \item Version 2.6 fixes several issues with the \texttt{comma} option and with the old syntax. The \texttt{comma} option no longer affects Eastern and ancient names. The old and new syntax are interchangeable, save with \cmd{\AKA} and its derivatives. See Sections~\ref{sec:obsolete}, \ref{sec:Affix}, and~\ref{sec:AKA}. -% \item This package really should be rewritten at some point. The author offers his humble apologies for any current shortcomings.\footnote{Future possibilities include: \cmd{\RevName} and friends force long name references; \cmd{\RevComma} and friends work only on Western names, independent of the present reversing system; a better way of parsing names and setting values will be implemented.} +% \subsection{Technical Notes} +% About the package itself: +% \begin{itemize}\small +% \item Most current changes are compatible with older versions. +% \item The package works with \texttt{xindy} and \texttt{makeindex}. We recommend \texttt{xindy} for languages whose collating sequences do not map to English.\footnote{\cmd{\PretagName} may not be useful in that case. German \emph{does} map to English: ä, ö, ü, and ß are ae, oe, ue, and ss. Norwegian \emph{does not} map to English: æ, ø, and å come after z.} +% \item Notable\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} changes, features, and fixes that correspond to version numbers are indicated in the margin. +% \item We\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} support Eastern alternate names when using ``native'' format. We simplify indexing, custom formatting, and other tasks. +% \item Name\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} output, index page entries, and index cross-references are independent due to modular design. +% \item Warnings\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} for the indexing macros are suppressed unless one uses the \texttt{verbose} option. The \texttt{nameauth} environment will produce warnings. +% \item The\marginpar{\large\raggedleft\textsf{\bfseries 2.6}\strut} \texttt{comma} option and the old syntax are no longer restrictive, save with \cmd{\AKA} and its derivatives. See Sections~\ref{sec:obsolete}, \ref{sec:Affix}, and~\ref{sec:AKA}. +% \item No\marginpar{\large\raggedleft\textsf{\bfseries 2.5\strut}} formatting is selected by default. To implement formatting, see Sections~\ref{sec:nonenglish}, \ref{sec:formatting}, and~\ref{sec:Hooksa}f. +% \end{itemize} +% \noindent About the manual: +% \begin{itemize}\small +% \item With\marginpar{\small\raggedleft\dbend} the ``dangerous bend'' we show incompatibilities, complex topics, and points where caution is needed. % \item This manual is designed to be compatible with both A4 and US letter stock size formats. % \item Macro references are minimized for a ``clean'' index, showing how \textsf{nameauth} ``normally'' handles indexing. -% \item The \textsf{nameauth} package requires \textsf{etoolbox}, \textsf{ifxetex}, \textsf{ifluatex}, \textsf{suffix}, \textsf{trimspaces}, and \textsf{xargs}. -% \item With each release, this documentation is tested with dvi-mode \texttt{latex,} \texttt{pdflatex,} \texttt{lualatex,} and \texttt{xelatex} using \texttt{makeindex.} This is done by running the GNU Makefile with the ENGINE=\meta{engine} option. -% \item Only the \texttt{pdflatex} version is released with the package. -% \item The package also works with \texttt{xindy,} although \cmd{\PretagName} may not be necessary in that case. Using \texttt{xindy} is best for languages that have sort orders for letters that cannot map to English. German \emph{does} map to English: Ä, Ö, Ü, and ß are AE, OE, UE, and SS. Norwegian \emph{does not} map to English: Æ, Ø, and Å come after Z in that order. -% \item This manual was typeset with \ifxetex\texttt{xelatex}\else +% \item Some examples use package macros and internals in special ways to demonstrate a particular point. Usually we mention that with the example. +% \end{itemize} +% About package building: +% \begin{itemize}\small +% \item The \textsf{nameauth} package requires \textsf{etoolbox}, \textsf{suffix}, \textsf{trimspaces}, and \textsf{xargs}. The \texttt{dtx} file encoding is UTF-8; we cannot guarantee building and using this package on systems that are not Unicode-compliant. +% \item With each release, we test \textsf{nameauth} with dvi-mode \texttt{latex} and with pdf-mode engines \texttt{pdflatex}, \texttt{lualatex}, and \texttt{xelatex} using \texttt{makeindex}. We run the GNU Makefile with the ENGINE=\meta{engine} option.\footnote{The manual is used as the test suite. In dvi mode the manual omits all references to \emph{TikZ} because some dvi display programs (\emph{e.g.} \texttt{dviout}, but not \texttt{xdvi}) will emit errors about bad specials even if one just includes the \textsf{tikz} package. The \emph{TikZ} diagrams herein will appear as blank space in that case. This does not affect \textsf{nameauth} proper.} +% \item This build used \ifxetex\texttt{xelatex}\else % \ifluatex\ifpdf\texttt{lualatex} in \texttt{pdf} mode\else % \texttt{lualatex} in \texttt{dvi} mode\fi % \else\ifpdf\texttt{pdflatex}\else -% \texttt{latex}\fi\fi\fi -% \ using \texttt{makeindex} and \texttt{gind.ist.} (This item changes, depending on the \LaTeX\ engine). +% \texttt{latex}\fi\fi\fi. This item changes per \LaTeX\ engine. +% \item This package is tested on Ubuntu Linux and Windows 7 (both vanilla \TeX\ Live). Cygwin provides \texttt{make} on Windows. The \texttt{pdflatex} version of this package is released from the Ubuntu platform to CTAN. % \end{itemize} -% -% \begin{center}\large\bfseries Thanks\end{center} -% {\def\NamesFormat{\bfseries} Thanks to \Name[Marc van]{Dongen}, \Name[Enrico]{Gregorio}, \Name[Philipp]{Stephani}, \Name[Heiko]{Oberdiek}, \Name[Uwe]{Lueck}, and \Name[Robert]{Schlicht} for their assistance in the early versions of this package. Thanks also to the users of this package, whose feedback has helped me do a better job than I could have done otherwise.} % \clearpage % % \subsection{What's In A Name?} % \label{sec:NameTypes} % -% Name forms are ambiguous apart from historical and cultural contexts. The \textsf{nameauth} package uses this ambiguity to help you encode names from many contexts. In this manual we refer to three classes of names, shown below. Section~\ref{sec:start} shows how these classes are implemented. +% Name forms are ambiguous apart from historical and cultural contexts. In this manual we refer to three general classes of names, shown below. Section~\ref{sec:start} shows how these classes are implemented. % -% Professional writing often calls for the full form of a person's name to be used in its first occurrence, with shorter forms used thereafter. This package implements that principle as a central part of its design. In each class there is a required name and optional name elements.\footnote{Some professional literature speaks of forenames and optional surnames. See Mulvany, \emph{Indexing Books}, pages 152--82, which I used as a guide along with the \emph{Chicago Manual of Style}. That approach does not work in \LaTeX, where we use optional forenames for the same effect.} -% Other naming systems can be adapted to these general categories, \emph{e.g.}, Icelandic, Hungarian, etc. +% Professional writing often calls for the full form of a person's name to be used when it first occurs, with shorter forms used thereafter. That is why, in each class, there is a required name and optional name elements.\footnote{Compare Mulvany, \emph{Indexing Books}, pages 152--82, and the \emph{Chicago Manual of Style}. That approach is adapted to \LaTeX\ and its way of handling optional arguments.} +% Other naming systems can be adapted to these categories, \emph{e.g.}, Icelandic, Hungarian, etc. % % \begin{enumerate}[noitemsep] % \item Western name:\\[1ex] @@ -619,121 +636,23 @@ Running "make install" installs the files in the local TeX tree. % \end{scope} % \end{tikzpicture}\else\vfill\fi % \end{enumerate} -% \clearpage -% \section{Usage} -% -% \subsection{Package Options} -% \label{sec:options} -% -% |\usepackage[|\meta{$option_1$}|,|\meta{$option_2$}|,|\dots|]{nameauth}|\medskip -% -% \noindent From the user's perspective these options proceed from the most general to more specific details. Package options address the following: -% \begin{enumerate}[noitemsep] -% \item Enable or disable features (formatting, indexing, index sorting) -% \item Affect the syntax of names (commas, capitalization, and reversing) -% \item Typographic display of names (formatted or not, and how) -% \end{enumerate}\smallskip -% -% \noindent\begin{tabular}{p{0.96\textwidth}}\toprule\hfil\bfseries Default options are in boldface.\hfil\\\bottomrule\end{tabular} -% -% \begin{center}\large\bfseries Choose Features\end{center} -% {\bfseries Choose Formatting}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{mainmatter} & \bfseries Start with ``main-matter names'' and formatting hooks (page~\pageref{page:PostProcess}).\\[1ex] -% \quad\texttt{frontmatter} & Start with ``front-matter names'' and hooks.\\[1ex] -% \quad\texttt{alwaysformat} & Use only respective ``first use'' formatting hooks.\\[1ex] -% \quad\texttt{formatAKA} & Format names declared by \cmd{\AKA} like other main- and front-matter names.\\[2ex] -% \end{tabular}\\ -% The default \texttt{mainmatter} option and the \texttt{frontmatter} option enable two different systems of name use and formatting. They are mutually exclusive. \cmd{\NamesActive} starts the main matter system when \texttt{frontmatter} is used. See Section~\ref{sec:FrontFormat}. -% -% The \texttt{alwaysformat} option forces ``first use'' hooks globally. The \texttt{formatAKA} option affects ``first-use'' formatting and \cmd{\AKA} (Section~\ref{sec:AKA}). Both \texttt{alwaysformat} and \texttt{formatAKA} can be used with either \texttt{mainmatter} or \texttt{frontmatter.}\bigskip -% -% \noindent{\bfseries Enable/Disable Indexing}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{index} & \bfseries Create index entries in place with names.\\[1ex] -% \quad\texttt{noindex} & Suppress indexing of names.\\[2ex] -% \end{tabular}\\ -% These apply only to the \textsf{nameauth} package macros. The default \texttt{index} option enables name indexing right away. The \texttt{noindex} option disables the indexing of names until \cmd{\IndexActive} enables it. {\bfseries Both \texttt{noindex} and \cmd{\IndexInactive} suppress index tags.} See Section~\ref{sec:SectionIndex}.\bigskip -% -% \noindent{\bfseries Enable/Disable Index Sorting}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{pretag} & \bfseries Create sort keys used with \texttt{makeindex}.\\[1ex] -% \quad\texttt{nopretag} & Do not create sort keys. \\[2ex] -% \end{tabular}\\ -% The default allows \cmd{\PretagName} to create sort keys used with NFSS or \texttt{makeindex} and its analogues. Seldom would one change this option unless a document is designed to work with both \texttt{makeindex} and \texttt{xindy}. See Section~\ref{sec:IndexSort}. -% \clearpage -% -% \begin{center}\large\bfseries Affect the Syntax of Names\end{center} -% {\bfseries Show/Hide Affix Commas}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{nocomma} & \bfseries Suppress commas between surnames and affixes, following the \emph{Chicago Manual of Style} and other conventions.\\[1ex] -% \quad\texttt{comma} & Retain commas between surnames and affixes.\\[2ex] -% \end{tabular}\\ -% This option is set at load time. If you use \emph{modern standards}, choose the default \texttt{nocomma} option to get, \emph{e.g.}, {\def\NamesFormat{\bfseries} \Name[James Earl]{Carter, Jr.}.} If you need to adopt \emph{older standards} that use commas between surnames and affixes, you have two choices: -% \begin{enumerate} -% \item The \texttt{comma} option produces, \emph{e.g.}, \ForgetName[James Earl]{Carter, Jr.}{\def\NamesFormat{\bfseries}\ShowComma\Name[James Earl]{Carter, Jr.}.} -% \item Section~\ref{sec:Affix} shows how one can use \cmd{\ShowComma} with the \texttt{nocomma} option and \cmd{\NoComma} with the \texttt{comma} option to get per-name results. -% \end{enumerate}\medskip -% -% \noindent{\bfseries Capitalize Entire Surnames}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{normalcaps} & \bfseries Do not perform any special capitalization.\\[1ex] -% \quad\texttt{allcaps} & Capitalize entire surnames, such as romanized Eastern names.\\[2ex] -% \end{tabular}\\ -% This only capitalizes names printed in the body text. English standards usually do not propagate typographic changes into the index. % -% Still,\marginpar{\small\raggedleft\dbend} you can use this package with non-English conventions. You can add, \emph{e.g.}, uppercase or small caps in surnames, formatting them also in the index. See also Sections~\ref{sec:nonenglish} and ~\ref{sec:Hooksc} The simplified interface aids the embedding of control sequences in names. Section~\ref{sec:Eastern} deals with capitalization on a section-level and per-name basis.\bigskip -% -% \noindent{\bfseries Reverse Name Order}\\[2ex] -% \begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} -% \quad\bfseries\texttt{notreversed} & \bfseries Print names in the order specified by \cmd{\Name} and the other macros.\\[1ex] -% \quad\texttt{allreversed} & Print all name forms in ``smart'' reverse order.\\[1ex] -% \quad\texttt{allrevcomma} & Print all names in ``Surname, Forenames'' order, meant for Western names.\\[2ex] -% \end{tabular}\\ -% These options, along with th macros in Sections~\ref{sec:Eastern} and~\ref{sec:LastFirst}, assume that you are using long name references. Usually, the best approach is to use \cmd{\RevName} and \cmd{\RevComma} with \cmd{\Name*} and equivalents on a per-name basis. -% -% See Section~\ref{sec:Eastern} for related macros to control name reversing by section or by name. Reversing can have unwanted results with short name references or ancient/medieval names. -% -% So-called ``last-comma-first'' lists of names via \texttt{allrevcomma} and the macros \cmd{\ReverseCommaActive} and \cmd{\RevComma} (Section~\ref{sec:LastFirst}) are \emph{not} the same as the \texttt{comma} option. They are designed for Western names. -% \clearpage -% -% \begin{center}\large\bfseries Name Post-Processing\end{center} -% \label{page:PostProcess} -% Sections~\ref{sec:nonenglish},\marginpar{\small\raggedleft\dbend} \ref{sec:CustomHooks}, and~\ref{sec:Hooksa}ff. explain this topic in greater detail, but are more advanced regarding technical details. Post-processing does not affect the index and comes after ``syntactic formatting'' (control sequences always present in the \textsf{nameauth} macro arguments).\footnote{This package was designed with type hierarchies in mind, although it has become more flexible. See Robert Bringhurst, \emph{The Elements of Typographic Style}, version 3.2 (Point Roberts, Washington: Hartley \& Marks, 2008), 53--60.} -% -% As of version 2.4, what was ``typographic formatting'' has become a generalized concept of ``name post-processing'' via these hook macros: -% \begin{itemize} -% \item \cmd{\NamesFormat} formats first uses of main-matter names. -% \item \cmd{\MainNameHook} formats subsequent uses of main-matter names. -% \item \cmd{\FrontNamesFormat} formats first uses of front-matter names. -% \item \cmd{\FrontNameHook} formats subsequent uses of front-matter names. -% \end{itemize}\smallskip -% -% Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. offer substantially more complex possibilities for such hooks.\footnote{I drew some inspiration from the typography in Bernhard Lohse, \emph{Luthers Theologie} (G\"ottingen: Vandenhoeck \& Ruprecht, 1995) and the five-volume series by Jaroslav J. Pelikan Jr., The Christian Tradition: A History of the Development of Doctrine (Chicago: Chicago UP, 1971--89). Each volume in the series has its own title.} -% By default, they do nothing. -% -% English typography has been the default design choice for this package. Still, one can use German, French, and similar standards, which I group as ``Continental.'' Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc} have more on the topic, as well as the use of sort tags in Section~\ref{sec:IndexSort}. Continental standards format surnames only, both in the text and in the index. This conflicts with some deliberately ambiguous name forms in \textsf{nameauth}.\footnote{Ancient, Eastern, and suffixed name forms have the same pattern.} -% To get formatting in the index one must add it in the macro arguments. The simplified interface aids this process. Continental users may have to implement their own capitalization features; see Sections~\ref{sec:standards} and~\ref{sec:Hooksc}.\medskip -% -% \noindent{\bfseries Formatting Attributes}\\[2ex] -% \begin{tabular}{ll} -% \quad\texttt{smallcaps} & Set the first use of an entire name in small caps.\footnotemark\\[1ex] -% \quad\texttt{italic} & Set the first use of an entire name in italic.\\[1ex] -% \quad\texttt{boldface} & Set the first use of an entire name in boldface.\\[1ex] -% \quad\bfseries\texttt{noformat} & \bfseries Do not define a default format.\\[2ex] -% \end{tabular} -% \footnotetext{Many users will not be affected by these changes. Many prefer the \texttt{noformat} option. If you did use the default option in the past, you can recover that behavior with the \texttt{smallcaps} option.} -% -% The options that assign a font change are intended for ``quick'' solutions based on English typography. They change only \cmd{\NamesFormat}, the macro that formats first instances of names in the main matter.\bigskip -% -% \noindent\begin{tabular}{p{0.96\textwidth}}\toprule\hfil\bfseries Versions 2.5 and onward assign no default formatting to names.\hfil\\\bottomrule\end{tabular} +% Since we use these classes of names throughout the manual, it is helpful to become familiarized with this terminology and how one can apply it to one's own culture and context. % \clearpage % +% \section{Usage} % \subsection{Quick Start Guide} % \label{sec:start} % +% Here we offer templates for the most common macros and features. The details will come later. This section also formats the first uses of names in \textbf{boldface} to illustrate how first uses are long, but long uses need not be first. +% \let\OldFormat\NamesFormat\renewcommand\NamesFormat{\bfseries} +% % \subsubsection{Main Interface} -% Here we see how \textsf{nameauth} implements the classes of names in Section~\ref{sec:NameTypes}, using \cmd{\Name} as an example (see Section~\ref{sec:Naming}). The required name for each class is the \meta{Surname(s)} argument (\meta{SNN}). Optional name arguments include \meta{Forename(s)} (\meta{FNN}), \meta{Alternate names} and \meta{affix}.\bigskip +% We see how \textsf{nameauth} implements the classes of names, using \cmd{\Name} as an example (see also Section~\ref{sec:Naming}). The macros of this package halt with an error when: +% \begin{itemize}\small +% \item The \meta{SNN} argument expands to the empty string or an \meta{SNN, Affix} pair expands to \meta{empty}, \meta{Affix}. +% \item No shorthand is present for a name in the simplified interface (Section~\ref{sec:simplestart}). +% \end{itemize} % % \noindent{\bfseries Western Names} % \ifDoTikZ @@ -778,16 +697,23 @@ Running "make install" installs the files in the local TeX tree. % \end{tikzpicture} % \end{center}\vspace{-2ex} % \else\vfill\fi -% \textbf{Usual forms:}\\[1ex] -% {\small Forenames and affixes are in optional arguments and comma-delimited suffixes so they can drop in the text. Yet they always are included for consistent index entries.\\[1ex] -% \cmd{\Name}\oarg{FNN}\marg{SNN}\dotfill|\Name[George]{Washington}|\IndexName[George]{Washington}\\ -% \cmd{\Name}\oarg{FNN}\marg{SNN|,| affix}\dotfill|\Name[John David]{Rockefeller, II}|\IndexName[John David]{Rockefeller, II}\\[1ex] +% \textbf{Examples:}\\[1ex] +% {\setstretch{1.1}One always must include all fields for consistent index entries.\\[1ex] +% |\Name[George]{Washington}|\dotfill\Name[George]{Washington}\\ +% |\Name[George]{Washington}|\dotfill\Name[George]{Washington}\\ +% |\Name[John David]{Rockefeller, II}|\dotfill\Name[John David]{Rockefeller, II}\\ +% |\Name[John David]{Rockefeller, II}|\dotfill\Name[John David]{Rockefeller, II}\\[1ex] % When using \meta{Alternate names}, the \meta{FNN} argument must have a name in it. The \meta{Alternate names} are swapped with the \meta{FNN}, but only in the body text:\\[1ex] -% \cmd{\Name}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\\ -% \hbox{}\dotfill |\Name[Bob]{Hope}[Leslie Townes]|\IndexName[Bob]{Hope}\\ -% \hbox{}\dotfill |\Name[Clive Staples]{Lewis}[C.S.]|\IndexName[Clive Staples]{Lewis}\\ -% \cmd{\Name}\oarg{FNN}\marg{SNN|,| affix}\oarg{Alternate names}\\\hbox{}\dotfill |\Name[John David]{Rockefeller, IV}[Jay]|\IndexName[John David]{Rockefeller, IV}\\[1ex] -% Western names cannot use the older syntax for affixes; see Sections~\ref{sec:obsolete} and~\ref{sec:Affix}.}\bigskip +% |\Name [Clive Staples]{Lewis}|\dotfill\Name[Clive Staples]{Lewis}\\ +% |\Name*[Clive Staples]{Lewis}[C.S.]|\dotfill\Name*[Clive Staples]{Lewis}[C.S.]\\ +% |\Name [Clive Staples]{Lewis}[C.S.]|\dotfill\Name[Clive Staples]{Lewis}[C.S.]\\ +% |\Name*[Clive Staples]{Lewis}[Jack]|\dotfill\Name*[Clive Staples]{Lewis}[Jack]\\ +% |\Name [John David]{Rockefeller, IV}|\dotfill\Name[John David]{Rockefeller, IV}\\ +% |\Name*[John David]{Rockefeller, IV}[Jay]|\dotfill\Name*[John David]{Rockefeller, IV}[Jay]\\ +% |\DropAffix\Name*[John David]{Rockefeller, IV}[Jay]|\dotfill\DropAffix\Name*[John David]{Rockefeller, IV}[Jay]\\ +% |\Name [John David]{Rockefeller, IV}[Jay]|\dotfill\Name[John David]{Rockefeller, IV}[Jay]\\[1ex] +% Western names cannot use the older syntax for affixes; see Sections~\ref{sec:obsolete} and~\ref{sec:Affix}. Notice how using nicknames or alternate names does not trigger an explicit first use. That is intentional. Compare Section~\ref{sec:tweaks} to ``bend the rules.''} +% \clearpage % % \noindent{\bfseries Eastern Names in the Text, Western Index Entry} % \ifDoTikZ @@ -826,8 +752,11 @@ Running "make install" installs the files in the local TeX tree. % \end{tikzpicture} % \end{center}\vspace{-2ex} % \else\vfill\fi -% {\small Technically, these are Western name forms without affixes. The reversing macros, such as \cmd{\RevName} (Section~\ref{sec:Eastern}) cause them to display in Eastern order in the body text only. The index entries are Western in fashion: \meta{SNN}, \meta{FNN}. This ``non-native'' form of Eastern names conflicts with both comma-delimited forms and the old syntax.} -% \clearpage +% {These are Western name forms without affixes that the reversing macros (Section~\ref{sec:Eastern}) cause to display in Eastern order in the body text only. We indicate them with a dagger.\\[1ex] +% |\Name[Fumimaro]{Konoe}|\dotfill\Name[Fumimaro]{Konoe}\dag\\ +% |\Name[Fumimaro]{Konoe}|\dotfill\Name[Fumimaro]{Konoe}\dag\\ +% |\RevName\Name*[Fumimaro]{Konoe}|\dotfill\RevName\Name*[Fumimaro]{Konoe}\dag\\[1ex] +% The index entries are Western in fashion: \meta{SNN}, \meta{FNN}. This ``non-native'' form of Eastern names conflicts with both comma-delimited forms and the old syntax.}\bigskip % % \noindent{\bfseries Eastern Names in the Text, Eastern Index Entry} % \ifDoTikZ @@ -865,10 +794,12 @@ Running "make install" installs the files in the local TeX tree. % \end{tikzpicture} % \end{center}\vspace{-2ex} % \else\vfill\fi -% \textbf{Usual form:}\\[1ex] -% {\small The striking feature of Eastern, ancient, and medieval name forms is the use of the comma-delimited suffix for the personal name. These forms have the same syntax, but different meanings. For example, you would use \cmd{\RevName} only with the Eastern form.\\[1ex] -% \cmd{\Name}\marg{SNN, FNN}\dotfill|\Name{Yamamoto, Isoroku}|\IndexName{Yamamoto, Isoroku}\\[1ex] -% These names truly are Eastern names. They take the form \meta{SNN FNN} in the index even if the reversing macros (Section~\ref{sec:Eastern}) put the names in Western order in the body text. We call this the ``native'' Eastern form. The old syntax for Eastern names is \cmd{\Name}\marg{SNN}\oarg{FNN}, retained for backward compatibility (Section~\ref{sec:obsolete}).}\bigskip +% \textbf{Examples:}\\[1ex] +% {The main feature of Eastern, ancient, and medieval name forms is the comma-delimited suffix. These forms have the same syntax, but different meanings.\\[1ex] +% |\Name{Yamamoto, Isoroku}|\dotfill\Name{Yamamoto, Isoroku}\\ +% |\Name{Yamamoto, Isoroku}|\dotfill\Name{Yamamoto, Isoroku}\\ +% |\RevName\Name*{Yamamoto, Isoroku}|\dotfill\RevName\Name*{Yamamoto, Isoroku}\\[1ex] +% These names truly are Eastern names. They always take the form \meta{SNN FNN} in the index. See Section~\ref{sec:Eastern}. We call this the ``native'' Eastern form. For the old syntax, see Section~\ref{sec:obsolete}.}\bigskip % % \noindent{\bfseries Ancient Names} % \ifDoTikZ @@ -877,7 +808,7 @@ Running "make install" installs the files in the local TeX tree. % \node [matrix,column sep=0.9em] (tipsi) at (2,2) % { % \node(opt){\quad\small Add to force full name.}; & -% \node[text width=2.6cm,align=left](a1){\small Mononym\hfil\break Mononym, affix}; & +% \node[text width=2.6cm,align=left](a1){\small Name(s)\hfil\break Name(s), affix}; & % \node[text width=3.3cm,align=left](grp){\small Add only if text in brackets |[|\,|]| follows.}; \\ % }; % \node [matrix] (macro) at (1,1) @@ -895,48 +826,78 @@ Running "make install" installs the files in the local TeX tree. % \end{tikzpicture} % \end{center}\vspace{-2ex} % \else\vfill\fi -% \textbf{Usual form:}\\[1ex] -% {\small These forms are used for royalty and ancient figures. They have one or more personal names that may or may not have suffixes.\\[1ex] -% \cmd{\Name}\marg{SNN}\dotfill|\Name{Aristotle}|\IndexName{Aristotle}\\ -% \cmd{\Name}\marg{SNN, affix}\dotfill|\Name{Elizabeth, I}|\IndexName{Elizabeth, I}\\ -% \hbox{}\dotfill|\Name{Attila, the Hun}|\IndexName{Attila, the Hun}\\[1ex] -% The older syntax takes the form \cmd{\Name}\marg{Mononym}\oarg{affix}. Cf. Section~\ref{sec:obsolete}.} -% \begin{center}\bfseries Many macros in the main interface form a pattern, \emph{e.g.}:\end{center}% +% \textbf{Examples:}\\[1ex] +% {These forms are for royalty and ancient figures. They have one or more personal names that may or may not have suffixes. For the older syntax see Section~\ref{sec:obsolete}.\\[1ex] +% |\Name{Aristotle}|\dotfill\Name{Aristotle}\\ +% |\Name{Aristotle}|\dotfill\Name{Aristotle}\\ +% |\Name{Elizabeth, I}|\dotfill\Name{Elizabeth, I}\\ +% |\Name{Elizabeth, I}|\dotfill\Name{Elizabeth, I}} +% \clearpage +% +% \begin{center}\large\bfseries Macro Patterns:\end{center} +% +% \noindent Here we see a large subset of the \textsf{nameauth} macros in order to get a feel for their patterns. This may help one get used to them. % \begin{center}\small\setstretch{1.1} % \begin{tabular}{l@{\,}r@{}c@{\,}c@{ }l}\toprule -% \meta{prefix macros}\footnotemark & \cmd{\Name} & & \meta{arguments} \\ +% \meta{prefix macros} & \cmd{\Name} & & \meta{arguments} \\ % \meta{prefix macros} & \cmd{\Name} & |*| & \meta{arguments} \\ % \meta{prefix macros} & \cmd{\FName} & & \meta{arguments} \\\midrule % & \cmd{\IndexName} & & \meta{arguments} \\ -% & \cmd{\ForgetName} & & \meta{arguments} \\ -% & \cmd{\SubvertName} & & \meta{arguments} \\ -% & \cmd{\PretagName} & & \meta{arguments} & \meta{sort key}\\ -% & \cmd{\TagName} & & \meta{arguments} & \meta{tag}\\ +% & \cmd{\IndexRef} & & \meta{arguments} & \meta{target} \\ +% & \cmd{\ExcludeName} & & \meta{arguments} \\ +% & \cmd{\IncludeName} & & \meta{arguments} \\ +% & \cmd{\IncludeName} & |*| & \meta{arguments} \\ +% & \cmd{\PretagName} & & \meta{arguments} & \meta{sort key} \\ +% & \cmd{\TagName} & & \meta{arguments} & \meta{tag} \\ % & \cmd{\UntagName} & & \meta{arguments} \\ -% & \cmd{\ExcludeName} & & \meta{arguments} \\\bottomrule +% & \cmd{\NameAddInfo} & & \meta{arguments} & \meta{tag} \\ +% & \cmd{\NameQueryInfo} & & \meta{arguments} \\ +% & \cmd{\NameClearInfo} & & \meta{arguments} & \\ +% & \cmd{\IfMainName} & & \meta{arguments} & \marg{y}\marg{n}\\ +% & \cmd{\IfFrontName} & & \meta{arguments} & \marg{y}\marg{n}\\ +% & \cmd{\IfAKA} & & \meta{arguments} & \marg{y}\marg{n}\\ +% & \cmd{\ForgetName} & & \meta{arguments} \\ +% & \cmd{\SubvertName} & & \meta{arguments} \\\bottomrule % \end{tabular} % \end{center} -% \footnotetext{The \meta{prefix macros} include one or more of \cmd{\CapThis,} \cmd{\AccentCapThis,} \cmd{\CapName,} \cmd{\RevName,} \cmd{\RevComma,} \cmd{\ShowComma,} \cmd{\NoComma,} and \cmd{\KeepAffix.}} +% +% \begin{center}\large\bfseries Prefix Macros:\end{center} +% +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{rp{0.65\textwidth}}\toprule +% \cmd{\CapThis} & Capitalize first letter of \meta{SNN} in body text.\footnotemark\\ +% \cmd{\CapName} & Cap entire \meta{SNN} in body text. Overrides \cmd{\CapThis}.\\\midrule +% \cmd{\RevName} & Reverse name order in body text (for Eastern names).\\\midrule +% \cmd{\RevComma} & Reverse Western names to \meta{SNN}, \meta{FNN}. Has no effect on native Eastern names.\\ +% \cmd{\ShowComma} & Add comma between \meta{SNN} and \meta{Affix}.\\ +% \cmd{\NoComma} & Suppress comma between \meta{SNN} and \meta{Affix}. Overrides \cmd{\ShowComma}.\\\midrule +% \cmd{\ForceFN} & Force Eastern forename/ancient affix. Only affects non-Western forms.\\ +% \cmd{\DropAffix} & Drop name affix of Western name (in long name reference). Only affects Western names.\\ +% \cmd{\KeepAffix} & Insert non-breaking space between \meta{SNN} and \meta{Affix}. Can prevent a native Eastern name from breaking.\\\midrule +% \cmd{\SeeAlso} & Toggle cross-reference type from \emph{see} to \emph{see also} (with \cmd{\IndexRef}, \cmd{\AKA}, and \cmd{\PName}).\\\bottomrule +% \end{tabular} +% \end{center} +% \footnotetext{\cmd{\AccentCapThis} is a fall-back for when the \textsf{nameauth} package is used where system architecture or file encoding might cause errors with the automatic Unicode detection under NFSS.} +% +% Most \meta{prefix macros} are ``stackable'' in front of the naming macros; for example, \cmd{\CapName}\cmd{\RevName}\cmd{\Name}\dots. % \clearpage % % \subsubsection{Simplefied Interface} % \label{sec:simplestart}% % % \DescribeEnv{nameauth} -% The |nameauth| environment can replace \cmd{\Name,} \cmd{\Name*,} and \cmd{\FName} with shorthands. This aids consistency and brevity. Still, one must use all the other macros of the main interface. Both interfaces interoperate with each other. -% -% The simplified interface produces control sequences that are fully compatible with the main interface. Although not required, |nameauth| is best used in the document preamble to avoid undefined control sequences.\footnote{The |nameauth| environment uses \cmd{\ignorespaces} to mitigate the need for trailing \texttt{\%.}} The italicized comments at right are not part of the example proper, but are there for explanation. Macro fields have uniform widths only to help compare argument types. +% The |nameauth| environment can replace \cmd{\Name}, \cmd{\Name*}, and \cmd{\FName} with name shorthands that inter-operate with the other package macros. % +% Although not required, |nameauth| is best used in the document preamble to avoid undefined control sequences.\footnote{The |nameauth| environment uses \cmd{\ignorespaces} to mitigate the need for trailing \texttt{\%}.} +% The italicized comments below are not part of the example proper. Macro fields have uniform widths only to help compare argument types. % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\ -% | \<| \meta{cseq1} |&| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|& >|\hfill\emph{Western}\footnote{This is also the form used with ``non-native'' Eastern names using reversing macros, but leaving them in Western form in the index.}\\ -% | \<| \meta{cseq2} |&| \meta{FNN} |&| \meta{SNN, affix} \,|& >|\hfill\emph{Western}\\ -% | \<| \meta{cseq3} |&| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|&| \meta{Alt. names} |>|\hfill\emph{W. nickname}\footnote{When the \meta{Alt. names} is used, \meta{FNN} never appears in the body text, but only in the index. See Section \ref{sec:Fname} to avoid possible difficulties. You could use \cmd{\AKA} to create a \emph{see} reference for the \AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller} example on the next page; see Section~\ref{sec:AKA}.}\\ -% | \<| \meta{cseq4} |&| \meta{FNN} |&| \meta{SNN, affix} \,|&| \meta{Alt. names} |>|\hfill\emph{W. nickname}\\ -% | \<| \meta{cseq5} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|& >|\hfill\emph{ancient/mono}\\ -% | \<| \meta{cseq6} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, affix} \,|& >|\hfill\emph{royal/ancient}\\ -% | \<| \meta{cseq7} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, FNN}\,|& >|\hfill\emph{Eastern}\footnote{``Native'' Eastern names can be reversed to use Western order in the body text, but they will always have an Eastern form in the index.}\\ -% | \<| \meta{cseq8} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|&| \meta{FNN/affix} |>|\hfill\emph{old syntax}\footnote{This is the old syntax for Eastern and royal names.}\\ +% | \<| \meta{$cseq_1$} |&| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|& >|\hfill|% |\emph{West./Non-native East.}\\ +% | \<| \meta{$cseq_2$} |&| \meta{FNN} |&| \meta{SNN, affix} \,|& >|\hfill|% |\emph{Western}\\ +% | \<| \meta{$cseq_3$} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|& >|\hfill|% |\emph{ancient/mono}\\ +% | \<| \meta{$cseq_4$} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, affix} \,|& >|\hfill|% |\emph{royal/ancient}\\ +% | \<| \meta{$cseq_5$} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, FNN}\,|& >|\hfill|% |\emph{Native Eastern}\\ +% | \<| \meta{$cseq_6$} |&| \hphantom{\meta{FNN}} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|&| \meta{FNN or affix} |>|\hfill|% |\emph{old syntax}\footnote{See Section~\ref{sec:obsolete}.}\\ % |\end{nameauth}| % \end{quote} % @@ -946,70 +907,81 @@ Running "make install" installs the files in the local TeX tree. % \item In this context, ``|\<|'' is an escape character and a control sequence. If you forget it or just use |<| without the backslash, you will get errors. % \item There \emph{must} be four argument fields (three ampersands) per line. Leaving out an ampersand will cause an error. Think ``holy hand grenade of Antioch'' from \emph{Monty Python and the Holy Grail}. % \item Extra spaces in each |&|-delimited field are stripped, as is also the case in the main interface (Section~\ref{sec:tolerance}). -% \item In the document text, as with the main interface, include trailing braces |{|\,|}|, control spaces, or the like if text in brackets |[|\,|]| follows any of the shorthands, \emph{e.g.}, |\LWash{} [\emph{sic}].| -% \item The old syntax (Section~\ref{sec:obsolete}), triggered by an empty \meta{FNN} field, causes the \meta{Alt. names} field to be interpreted as either \meta{Eastern FNN} or an \meta{affix}. +% \item Include trailing braces |{|\,|}| or the like if you must prevent subsequent text in brackets |[|\,|]| from being seen as an optional argument. +% \item The old syntax (Section~\ref{sec:obsolete}), triggered by an empty \meta{FNN} field, causes the \meta{Alt. names} field to be interpreted as either \meta{Eastern FNN} or \meta{affix}. % \end{itemize} +% +%Current\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} versions permit alternate names for Eastern names and Western names, but not mononyms. \textbf{To switch between \meta{FNN} and \meta{Alt. names}, simply use the forms above with an optional argument after the shorthand.} The forms below only print \meta{Alt. names}, never \meta{FNN}, in the body text. See also Section \ref{sec:Fname} and the example on the next page. +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ +% | \<| \meta{$cseq_7$} | &| \meta{FNN} |&| \meta{SNN}\hphantom{\textit{affix, }} \,|&| \meta{Alt. names} |>|\hfill|%|\,\emph{Western alt.}\footnote{Instead of this form you could use \cmd{\IndexRef} or \cmd{\AKA} to create a cross-reference, for example, from \AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller} to \LJRIV. See Sections~\ref{sec:IndexXref} and~\ref{sec:AKA}.}\\ +% | \<| \meta{$cseq_8$} | &| \meta{FNN} |&| \meta{SNN, affix} \,|&| \meta{Alt. names} |>|\hfill|% |\emph{Western alt.}\\ +% | \<| \meta{$cseq_9$} | &| \hphantom{\meta{FNN}} |&| \meta{SNN, affix} \,|&| \meta{Alt. names} |>|\hfill|% |\emph{Ancient alt.}\\ +% | \<| \meta{$cseq_{10}$} |&| \hphantom{\meta{FNN}} |&| \meta{SNN, FNN}\,|&| \meta{Alt. names} |>|\hfill|% |\emph{Eastern alt.}\\ +% |\end{nameauth}| +% \end{quote} % \clearpage % -% This example of the \texttt{nameauth} environment uses a fairly complete set of names, apart from some special cases. See how one can choose to line up the ampersands with extra spaces or not. Following that are examples of shorthand use in the body text. One may compare the forms in the text with the index. +% This example of the \texttt{nameauth} environment uses a fairly complete set of names and illustrates how extra spaces are ignored. We also see the shorthands used in the body text (and the index).\ForgetName[George]{Washington}\ForgetName[John David]{Rockefeller, II}\ForgetName[John David]{Rockefeller, IV}\ForgetName[Clive Staples]{Lewis}\ForgetName{Aristotle}\ForgetName{Elizabeth, I}\ForgetName[Fumimaro]{Konoe}\ForgetName{Yamamoto, Isoroku} % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\[0.2ex] -% | \< Wash & George & Washington & >|\hfill\emph{Western}\\ -% | \< Soto & Hernando & de Soto & >|\hfill\emph{particle}\\ -% | \< JRII & John David & Rockefeller, II & >|\hfill\emph{affix}\\ -% | \< JRIV & John David & Rockefeller, IV & >|\hfill\emph{affix}\\ -% | \< JayR & John David & Rockefeller, IV & Jay >|\hfill\emph{nickname}\\ -% | \< Lewis & Clive Staples & Lewis & C.S. >|\hfill\emph{nickname}\\ -% | \< Jack & Clive Staples & Lewis & Jack >|\hfill\emph{nickname}\\ -% | \< Aris & & Aristotle & >|\hfill\emph{ancient}\\ -% | \< Eliz & & Elizabeth, I & >|\hfill\emph{royal}\\ -% | \< Attil & & Attila, the Hun & >|\hfill\emph{ancient}\\ -% | \< Konoe & Fumimaro & Konoe & >|\hfill\emph{Eastern/Western index}\\ -% | \< Yamt & & Yamamoto, Isoroku & >|\hfill\emph{Eastern/Eastern index}\\ +% | \< Wash & George & Washington & >|\hfill|% |\emph{Western}\\ +% | \< Soto & Hernando & de Soto & >|\hfill|% |\emph{particle}\\ +% | \< JRII & John David & Rockefeller, II & >|\hfill|% |\emph{affix}\\ +% | \< JRIV & John David & Rockefeller, IV & >|\hfill|% |\emph{affix}\\ +% | \< JayR & John David & Rockefeller, IV & Jay >|\hfill|% |\emph{nickname}\\ +% | \< LewisFull & Clive Staples & Lewis & >|\hfill|% |\emph{Western}\\ +% | \< Lewis & Clive Staples & Lewis & C.S. >|\hfill|% |\emph{nickname}\\ +% | \< Aris & & Aristotle & >|\hfill|% |\emph{ancient}\\ +% | \< Eliz & & Elizabeth, I & >|\hfill|% |\emph{royal}\\ +% | \< Attil & & Attila, the Hun & >|\hfill|% |\emph{ancient}\\ +% | \< Konoe & Fumimaro & Konoe & >|\hfill|% |\emph{``non-native'' Eastern}\\ +% | \< Yamt & & Yamamoto, Isoroku & >|\hfill|% |\emph{``native'' Eastern}\\ % |\end{nameauth}| % \end{quote} % -% Below, ``non-native'' Eastern name forms are shown with a dagger (\dag). Please see Section~\ref{sec:Eastern} to avoid pitfalls with the reversing macros. We show first uses of names in italic type. -% \begin{center}\footnotesize\setstretch{1.1}\def\NamesFormat{\itshape} +% Below, ``non-native'' Eastern name forms are shown with a dagger (\dag). Please see Section~\ref{sec:Eastern} to avoid pitfalls with Eastern names and reversing macros. +% \begin{center}\footnotesize\setstretch{1.1} % \begin{tabular}{ll} -% \noindent\textbf{Western:} & \textbf{Ancient\,/\,Mononym}\\ -% |\Wash|\dotfill \Wash & |\Aris|\dotfill \Aris\\ -% |\LWash|\dotfill \LWash & |\Aris|\dotfill \Aris\\ -% |\Wash|\dotfill \Wash & \\ -% |\SWash|\dotfill \SWash & \textbf{Medieval/Royal:}\\ -% |\RevComma\LWash| & |\Eliz|\dotfill \Eliz\\ -% \dotfill \RevComma\LWash & |\Eliz|\dotfill \Eliz\\ -% & |\Attil|\dotfill \Attil\\ -% \textbf{Particles:} & |\Attil|\dotfill \Attil\\ -% |\Soto|\dotfill \Soto & \\ -% |\Soto|\dotfill \Soto & \textbf{Western / Western Index:}\\ -% |\CapThis\Soto|\dotfill \CapThis\Soto & |\Konoe|\dotfill \Konoe\\ -% & |\LKonoe|\dotfill \LKonoe\\ -% \textbf{Affixes:} & |\Konoe|\dotfill \Konoe\\ -% |\JRII|\dotfill \JRII & \\ -% |\LJRII|\dotfill \LJRII & \textbf{Eastern / Western Index:}\\ -% |\JRII|\dotfill \JRII & |\CapName\RevName\LKonoe|\\ -% |\SJRII|\dotfill \SJRII & \dotfill\CapName\RevName\LKonoe\dag\\ -% & |\CapName\Konoe|\dotfill \CapName\Konoe\dag\\ -% \textbf{Nicknames:} (Section~\ref{sec:Fname}) \\ -% |\JRIV|\dotfill \JRIV & \textbf{Eastern / Eastern Index:}\\ -% |\LJRIV[Jay]|\dotfill \LJRIV[Jay] & |\CapName\Yamt|\\ -% |\SJRIV[Jay]|\dotfill \SJRIV[Jay] & \dotfill \CapName\Yamt\\ -% |\SJRIV[Jay]| |\JRIV| \SJRIV[Jay] \JRIV & |\CapName\LYamt|\\ -% |\LJayR|\dotfill \LJayR & \dotfill \CapName\LYamt\\ -% |\SJayR|\dotfill \SJayR & |\CapName\Yamt|\dotfill \CapName\Yamt\\ -% |\SJayR\ \JayR|\dotfill \SJayR\ \JayR & \\ -% |\Lewis|\dotfill \Lewis & \textbf{Western / Eastern Index:}\\ -% |\Lewis|\dotfill \Lewis & |\RevName\LYamt|\\ -% |\LJack|\dotfill \LJack & \dotfill \RevName\LYamt\\ -% |\SJack|\dotfill \SJack & |\Yamt|\dotfill \Yamt\\ +% \textsc{Western:} & \textsc{Ancient\,/\,Mononym} \\ +% |\Wash | \dotfill \Wash & |\Aris| \dotfill \Aris \\ +% |\LWash| \dotfill \LWash & |\Aris| \dotfill \Aris \\ +% |\Wash | \dotfill \Wash & \\ +% |\SWash| \dotfill \SWash & \textsc{Medieval/Royal:} \\ +% |\RevComma\LWash| & |\Eliz | \dotfill \Eliz \\ +% \dotfill \RevComma\LWash & |\Eliz | \dotfill \Eliz \\ +% & |\Attil| \dotfill \Attil \\ +% \textsc{Particles:} \hfill (Section~\ref{sec:standards}) & |\Attil| \dotfill \Attil \\ +% |\Soto| \dotfill \Soto & \\ +% |\Soto| \dotfill \Soto & \textsc{``Non-native'' Eastern:} \\ +% |\CapThis\Soto| \dotfill \CapThis\Soto & |\Konoe | \dotfill \Konoe\dag \\ +% & |\LKonoe| \dotfill \LKonoe\dag \\ +% \textsc{Affixes:} \hfill (Section~\ref{sec:Affix}) & |\Konoe | \dotfill \Konoe\dag \\ +% |\JRII | \dotfill \JRII & |\SKonoe| \dotfill \SKonoe\dag \\ +% |\LJRII| \dotfill \LJRII & |\CapName\RevName\LKonoe| \\ +% |\DropAffix\LJRII| & \dotfill \CapName\RevName\LKonoe\dag \\ +% \dotfill \DropAffix\LJRII & |\CapName\Konoe| \dotfill \CapName\Konoe\dag \\ +% |\JRII | \dotfill \JRII & \\ +% |\SJRII| \dotfill \SJRII & \textsc{``Native'' Eastern:} \\ +% & |\CapName\Yamt| \\ +% \textsc{Nicknames:} \hfill (Section~\ref{sec:Fname}) & \dotfill \CapName\Yamt \\ +% |\JRIV | \dotfill \JRIV & |\CapName\LYamt| \\ +% |\LJRIV[Jay]| \dotfill \LJRIV[Jay] & \dotfill \CapName\LYamt \\ +% |\SJRIV[Jay]| \dotfill \SJRIV[Jay] & |\CapName\Yamt| \\ +% |\DropAffix\LJayR | \dotfill\DropAffix \LJayR & \dotfill \CapName\Yamt \\ +% |\SJayR | \dotfill \SJayR & |\RevName\LYamt| \\ +% |\LewisFull| \dotfill \LewisFull & \dotfill \RevName\LYamt \\ +% |\LLewis| \dotfill \LLewis & |\SYamt| \dotfill \SYamt \\ +% |\Lewis | \dotfill \Lewis & |\ForceFN\SYamt| \\ +% |\SLewis| \dotfill \SLewis & \dotfill \ForceFN\SYamt \\ % \end{tabular} % \end{center} +% \ExcludeName{Attila, the Hun} % \clearpage % -% Sections~\ref{sec:standards},\marginpar{\small\raggedleft\dbend} \ref{sec:accents}, and~\ref{sec:IndexSort} deal with the pitfalls of accents and capitalization, as well as why you should use \cmd{\PretagName} for any name with control sequences or extended Unicode under NFSS. This becomes very important when authors and publishers use medieval names as Western names. +% Sections~\ref{sec:standards},\marginpar{\small\raggedleft\dbend} \ref{sec:accents}, and~\ref{sec:IndexSort} deal with the pitfalls of accents and capitalization, as well as why you should use \cmd{\PretagName} for any name with control sequences or active Unicode under NFSS. This becomes very important when authors and publishers use medieval names as Western names. % -% When index tagging or pre-tagging names, the \meta{Alternate names} field has no effect on index tags because it appears only in the text. \cmd{\JRIV} and \cmd{\JayR} need only one tag, as do \cmd{\Lewis} and \cmd{\Jack}: +% When index tagging or pre-tagging names, the \meta{Alternate names} field has no effect on index tags because it appears only in the text. \cmd{\JRIV} and \cmd{\JayR} need only one tag, as do \cmd{\LewisFull} and \cmd{\Lewis}: % \begin{quote}\small\setstretch{1.1} % |\TagName[John David]{Rockefeller, IV}{|\meta{something}|}|\\ % |\TagName[Clive Staples]{Lewis}{|\meta{something}|}| @@ -1018,34 +990,32 @@ Running "make install" installs the files in the local TeX tree. % \subsubsection{Older Syntax} % \label{sec:obsolete} % -% An older syntax remains for backward compatibility with early versions of \textsf{nameauth}. The old syntax limits the use of \cmd{\AKA} and its derivatives. Section~\ref{sec:error} and other places offer cautions about the old syntax. The form is: +% An older syntax remains for backward compatibility with early versions of \textsf{nameauth}. The\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} old syntax generally inter-operates with the new, but it limits the use of \cmd{\AKA} and its derivatives. It does not permit using any name forms with comma-delimited suffixes. See also Section~\ref{sec:error}. % -% \begin{quote}\setstretch{1.1} -% |\Name{Dagobert}[I]|\hfill\emph{royal name}\\ -% |\Name{Yoshida}[Shigeru]|\hfill\emph{Eastern name}\\ -% |\begin{nameauth}|\\[0.5ex] -% | \< Dagb & & Dagobert & I >|\hfill\emph{royal name}\\ -% | \< Yosh & & Yoshida & Shigeru >|\hfill\emph{Eastern name}\\ +% \begin{quote}\small\setstretch{1.1} +% |\Name{Henry}[VIII]|\hfill|% |\emph{royal name}\\ +% |\Name{Chiang}[Kai-shek]|\hfill|% |\emph{Eastern name}\\ +% |\begin{nameauth}|\\ +% | \< Dagb & & Dagobert & I >|\hfill|% |\emph{royal name}\\ +% | \< Yosh & & Yoshida & Shigeru >|\hfill|% |\emph{Eastern name}\\ % |\end{nameauth}| % \end{quote} -% Here the \meta{FNN} fields are empty. Because that is the case, the final field changes its meaning from \meta{Alternate names} to \meta{affix} or \meta{FNN}. That means the final field will appear in the index. With this example, we have: +% Since the \meta{FNN} fields are empty, the final field becomes either \meta{affix} or \meta{FNN} and will appear in the index. With this example, we have: % % \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule -% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\ -% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\\ -% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\ -% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\\\midrule -% |\Dagb| & \Dagb\\ -% |\Dagb| & \Dagb\\ -% |\CapName\Yosh| & \CapName\Yosh\\ -% |\CapName\RevName\LYosh| & \CapName\RevName\LYosh\\\bottomrule +% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\ddag\\ +% |\Name{Henry}[VIII]| & \Name{Henry}[VIII]\ddag\\ +% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\ddag\\ +% |\Name{Chiang}[Kai-shek]| & \Name{Chiang}[Kai-shek]\ddag\\\midrule +% |\Dagb| & \Dagb\ddag\\ +% |\Dagb| & \Dagb\ddag\\ +% |\CapName\Yosh| & \CapName\Yosh\ddag\\ +% |\CapName\RevName\LYosh| & \CapName\RevName\LYosh\ddag\\\bottomrule % \end{tabular} % \end{center} % -% \noindent{\bfseries Additional Notes}\medskip -% -% \noindent|\Name{Henry}[VIII]|\marginpar{\small\raggedleft\dbend} (old syntax) will share name occurrences, tags, and index entries with |\Name{Henry, VIII}| (new syntax), as we see below. Yet we do not recommend the random admixture of these forms. +% \noindent|\Name{Henry}[VIII]|\marginpar{\large\raggedleft\textsf{\bfseries 2.6}\strut\break\small\raggedleft\dbend} (old syntax) will share name occurrences, tags, and index entries with |\Name{Henry, VIII}| (new syntax), as we see below. To avoid confusion, we do not recommend mixing these forms. % \begin{quote}\small\setstretch{1.1} % \NameAddInfo{Henry}[VIII]{ (\emph{Defensor Fidei})}|\NameAddInfo{Henry}[VIII]{ (\emph{Defensor Fidei})}|\\ % \texttt{\dots}\\ @@ -1053,58 +1023,166 @@ Running "make install" installs the files in the local TeX tree. % \Name*{Henry, VIII}\NameQueryInfo{Henry, VIII} % \end{quote} % -% \IndexInactive% -% Avoid\marginpar{\small\raggedleft\dbend} blending old and new syntax forms together in one name reference. |\Name{Henry, VIII}[Tudor]| prints ``\Name*{Henry, VIII}[Tudor]'' and ``\Name{Henry, VIII}[Tudor]'' in the body text and ``Henry VIII Tudor'' in the index. Sections~\ref{sec:tagtext} and~\ref{sec:TagName} offer more elegant solutions that add ``Tudor'' either as a text tag or an index tag. +% Presently\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut\break\small\raggedleft\dbend} |\Name*{Henry, VIII}[Tudor]| prints ``\Name*{Henry, VIII}[Tudor]'' in the body text and ``Henry VIII'' in the index. In former versions of this package it would have produced ``Henry VIII Tudor'' in the text and in the index. \textbf{Since the older behavior was discouraged, it no longer will be supported and no backward compatibility will exist.} See also Sections~\ref{sec:indextag} and~\ref{sec:tagtext}. +% \let\NamesFormat\OldFormat +% \clearpage +% +% \subsection{Package Options} +% \label{sec:options} +% +% One includes the \textsf{nameauth} package thus: +% \begin{quote}\small +% |\usepackage[|\meta{$option_1$}|,|\meta{$option_2$}|,|\dots|]{nameauth}| +% \end{quote} +% The options have no required order. Still, we discuss them from the general to the specific, as the headings below indicate. +% +% \begin{center}\bfseries Default options are shown in boldface.\\[2ex] +% \large Choosing Features\end{center} +% +% \noindent{\bfseries Enable Package Warnings}\\[1ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\texttt{verbose} & Show warnings about index cross-references.\\ +% \end{tabular}}\\[1ex] +% The default\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} suppresses package warnings from the indexing macros. Warnings from the \texttt{nameauth} environment are not suppressed.\bigskip +% +% \noindent{\bfseries Choose Formatting}\\[1ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{mainmatter} & \bfseries Start with ``main-matter names'' and formatting hooks (page~\pageref{page:PostProcess}).\\ +% \quad\texttt{frontmatter} & Start with ``front-matter names'' and hooks.\\ +% \quad\texttt{alwaysformat} & Use only respective ``first use'' formatting hooks.\\ +% \quad\texttt{formatAKA} & Format names declared by \cmd{\AKA} like other main- and front-matter names.\\ +% \quad\texttt{oldAKA} & Force \cmd{\AKA*} to act like it did before v.3.0.\\ +% \end{tabular}}\\[1ex] +% The default \texttt{mainmatter} option and the \texttt{frontmatter} option enable two different systems of name use and formatting. They are mutually exclusive. \cmd{\NamesActive} starts the main matter system when \texttt{frontmatter} is used. See Section~\ref{sec:formatting}. +% +% The \texttt{alwaysformat} option forces ``first use'' hooks globally. The \texttt{formatAKA} option affects ``first-use'' formatting and \cmd{\AKA} (Section~\ref{sec:AKA}). Both \texttt{alwaysformat} and \texttt{formatAKA} can be used with either \texttt{mainmatter} or \texttt{frontmatter}. +% +% \textbf{Using\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} \texttt{oldAKA} option forces \cmd{\AKA*} always to print a ``forename'' field in the text, as it did in versions 2.6 and older.} Otherwise the current behavior of \cmd{\AKA*} prints in the same fashion as \cmd{\FName} (see Sections~\ref{sec:Fname} and~\ref{sec:AKA}).\bigskip +% +% \noindent{\bfseries Enable/Disable Indexing}\\[1ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{index} & \bfseries Create index entries in place with names.\\ +% \quad\texttt{noindex} & Suppress indexing of names.\\ +% \end{tabular}}\\[1ex] +% These apply only to the \textsf{nameauth} package macros. The default \texttt{index} option enables name indexing right away. The \texttt{noindex} option disables the indexing of names until \cmd{\IndexActive} enables it. {\bfseries Both \texttt{noindex} and \cmd{\IndexInactive} suppress index tags.} See Section~\ref{sec:SectionIndex}.\bigskip +% +% \noindent{\bfseries Enable/Disable Index Sorting}\\[1ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{pretag} & \bfseries Create sort keys used with \texttt{makeindex}.\\ +% \quad\texttt{nopretag} & Do not create sort keys. \\ +% \end{tabular}}\\[1ex] +% The default allows \cmd{\PretagName} to create sort keys used with NFSS or \texttt{makeindex} and its analogues. This option exists to switch sorting off if needed for \texttt{xindy}. See Section~\ref{sec:IndexSort}. +% \clearpage +% +% \begin{center}\large\bfseries Affect the Syntax of Names\end{center} +% {\bfseries Show/Hide Affix Commas}\\[2ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{nocomma} & \bfseries Suppress commas between surnames and affixes, following the \emph{Chicago Manual of Style} and other conventions.\\ +% \quad\texttt{comma} & Retain commas between surnames and affixes.\\ +% \end{tabular}}\\[1ex] +% This option is set at load time. If you use \emph{modern standards}, choose the default \texttt{nocomma} option to get, \emph{e.g.}, ``\Name[J.E.]{Carter, Jr.}[James Earl].'' If you need to adopt \emph{older standards} that use commas between surnames and affixes, you have two choices: +% \begin{enumerate} +% \item The \texttt{comma} option globally produces, \emph{e.g.}, ``\ShowComma\Name*[J.E.]{Carter, Jr.}[James Earl].'' +% \item Section~\ref{sec:Affix} shows how one can use \cmd{\ShowComma} with the \texttt{nocomma} option and \cmd{\NoComma} with the \texttt{comma} option to get per-name results. +% \end{enumerate}\medskip +% +% \noindent{\bfseries Capitalize Entire Surnames}\\[2ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{normalcaps} & \bfseries Do not perform any special capitalization.\\ +% \quad\texttt{allcaps} & Capitalize entire surnames, such as romanized Eastern names.\\ +% \end{tabular}}\\[1ex] +% This only capitalizes names printed in the body text. English standards usually do not propagate typographic changes into the index. +% +% Still,\marginpar{\small\raggedleft\dbend} you can use this package with non-English conventions. You can add, \emph{e.g.}, uppercase or small caps in surnames, formatting them also in the index. See also Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc} The simplified interface aids the embedding of control sequences in names. Section~\ref{sec:Eastern} deals with capitalization on a section-level and per-name basis.\bigskip +% +% \noindent{\bfseries Reverse Name Order}\\[2ex] +% {\setstretch{1.1}\begin{tabular}{p{0.22\textwidth}p{0.6\textwidth}} +% \quad\bfseries\texttt{notreversed} & \bfseries Print names in the order specified by \cmd{\Name} and the other macros.\\ +% \quad\texttt{allreversed} & Print all name forms in ``smart'' reverse order.\\ +% \quad\texttt{allrevcomma} & Print all names in ``Surname, Forenames'' order, meant for Western names.\\ +% \end{tabular}}\\[1ex] +% These options should not be used indiscriminately. Reversing can have unwanted results with ancient/medieval names. Section~\ref{sec:Eastern} can help guide you on whether to consider global or per-name reversing for Eastern names. +% +% So-called ``last-comma-first'' lists of names via \texttt{allrevcomma} and the macros \cmd{\ReverseCommaActive} and \cmd{\RevComma} (Section~\ref{sec:LastFirst}) are \emph{not} the same as the \texttt{comma} option. They are designed for Western names. +% \clearpage +% +% \phantomsection\label{page:PostProcess} +% \begin{center}\large\bfseries Typographic Post-Processing\end{center} +% \noindent Sections~\ref{sec:nonenglish},\marginpar{\small\raggedleft\dbend} \ref{sec:formatting}, and~\ref{sec:Hooksa}f. explain this topic in greater detail, but are more advanced regarding technical details. Post-processing does not affect the index and comes after ``syntactic formatting'' (control sequences always present in the \textsf{nameauth} macro arguments).\footnote{This package was designed with type hierarchies in mind, although it has become more flexible. See Robert Bringhurst, \emph{The Elements of Typographic Style}, version 3.2 (Point Roberts, Washington: Hartley \& Marks, 2008), 53--60.} +% +% What\marginpar{\large\raggedleft\textsf{\bfseries 2.4}\strut} was ``typographic formatting'' has become a generalized concept of ``post-processing'' via these hook macros: +% \begin{itemize} +% \item \cmd{\NamesFormat} formats first uses of main-matter names. +% \item \cmd{\MainNameHook} formats subsequent uses of main-matter names. +% \item \cmd{\FrontNamesFormat} formats first uses of front-matter names. +% \item \cmd{\FrontNameHook} formats subsequent uses of front-matter names. +% \end{itemize}\smallskip +% +% Sections~\ref{sec:formatting} and~\ref{sec:Hooksa}f. offer substantially more complex possibilities for such hooks.\footnote{I drew some inspiration from the typography in Bernhard Lohse, \emph{Luthers Theologie} (G\"ottingen: Vandenhoeck \& Ruprecht, 1995) and the five-volume series by Jaroslav J. Pelikan Jr., The Christian Tradition: A History of the Development of Doctrine (Chicago: Chicago UP, 1971--89). Each volume in the series has its own title.} +% By default, they do nothing.\marginpar{\small\raggedleft\cmd{\global}} Changes to the formatting hooks apply within the scope where they are made. To change that, use \cmd{\global} explicitly. +% +% English typography has been the default design choice for this package. Still, one can use German, French, and similar standards, which I group as ``Continental.'' Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc} have more on the topic, as well as the use of sort tags in Section~\ref{sec:IndexSort}. Continental standards format surnames only, both in the text and in the index. This conflicts with some deliberately ambiguous name forms in \textsf{nameauth}.\footnote{Ancient, Eastern, and suffixed name forms have the same pattern.} +% To get formatting in the index one must add it in the macro arguments. The simplified interface aids this process. Continental users may have to implement their own capitalization features; see Sections~\ref{sec:standards} and~\ref{sec:Hooksc}.\medskip +% +% \noindent{\bfseries Formatting Attributes}\\[2ex] +% {\setstretch{1.1}\begin{tabular}{ll} +% \quad\texttt{smallcaps} & Set the first use of an entire name in small caps.\footnotemark\\ +% \quad\texttt{italic} & Set the first use of an entire name in italic.\\ +% \quad\texttt{boldface} & Set the first use of an entire name in boldface.\\ +% \quad\bfseries\texttt{noformat} & \bfseries Do not define a default format.\\ +% \end{tabular}}\\ +% \footnotetext{Many users will not be affected by these changes. Many prefer the \texttt{noformat} option. If you did use the default option in the past, you can recover that behavior with the \texttt{smallcaps} option.} +% +% The options that assign a font change are intended for ``quick'' solutions based on English typography. They change only \cmd{\NamesFormat}, the macro that formats first instances of names in the main matter.\bigskip % +% \textbf{Current\marginpar{\large\raggedleft\textsf{\bfseries 2.5}\strut} versions assign no default formatting to names.} % \clearpage % % \subsection{Naming Macros} % \label{sec:Naming} % % \subsubsection{\texttt{\textbackslash Name} and \texttt{\textbackslash Name*}} -% +% % \DescribeMacro{\Name} % \DescribeMacro{\Name*} -% This macro generates an index entry, a name in the body text, and another index entry for that name in case it spans a page break. \cmd{\FName} (next page) handles index entries in the same manner. The general syntax is: +% \cmd{\Name} displays and indexes names. Also see the quick start (Section~\ref{sec:simplestart}) and reference (Section~\ref{sec:PatRef}). It always prints the required ``surname'' field. \cmd{\Name} prints the full name at the first occurrence, then a partial form thereafter. \cmd{\Name*} always prints the full name. These macros generate index entries before and after a name in the body text in case of a page break. The general syntax is: % \begin{quote}\small\setstretch{1.1} -% \cmd{\Name}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\\ -% \cmd{\Name*}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \cmd{\Name}| |\oarg{FNN}\marg{SNN|,| opt. FNN/Affix}\oarg{Alternate names}\\ +% \cmd{\Name}|*|\oarg{FNN}\marg{SNN|,| opt. FNN/Affix}\oarg{Alternate names} % \end{quote} -% -% \noindent Here we see how the syntax works: -% -% \begin{center}\small\setstretch{1.1} -% \begin{tabular}{ll}\toprule -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\ -% |\Name*[Albert]{Einstein}| & \Name*[Albert]{Einstein}\\ -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule -% |\Name{Confucius}| & \Name{Confucius}\\ -% |\Name*{Confucius}| & \Name*{Confucius}\\ -% |\Name{Confucius}| & \Name{Confucius}\\\midrule -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\ -% |\Name*[M.T.]{Cicero}[Marcus Tullius]| & \Name*[M.T.]{Cicero}[Marcus Tullius]\\ -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\ -% |\Name*{Charles, the Bald}| & \Name*{Charles, the Bald}\\ -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule -% \end{tabular} -% \end{center} -% -% \cmd{\Name} displays and indexes names, as illustrated in Section~\ref{sec:PatRef}. It always prints the \meta{SNN} field. \cmd{\Name} prints the ``full name'' at the first occurrence, then the partial form thereafter. \cmd{\Name*} always prints the full name. -% -% The \meta{Alternate names} field replaces the \meta{FNN} field in the body text only. It does this if the \meta{FNN} field is not empty; see ``\Name[M.T.]{Cicero}[Marcus Tullius]'' above. Regarding their index entries, |\Name[M.T.]{Cicero}[Marcus Tullius]| and |\Name[M.T.]{Cicero}| are equivalent. This lets one use a nickname while keeping the indexed form constant. If the \meta{FNN} is empty, you get the old syntax for Eastern and royal names (Section~\ref{sec:obsolete}). +% In\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} the body text, not the index, the \meta{Alternate names} field replaces the \meta{FNN} field or the \meta{opt. FNN/Affix} field if they exist. If neither of the latter exist, then the old syntax is used (Section~\ref{sec:obsolete}). We see this below: % % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\ % | \< Einstein & Albert & Einstein & >|\\ % | \< Cicero & M.T. & Cicero & >|\\ % | \< Confucius & & Confucius & >|\\ +% | \< Miyazaki & & Miyazaki, Hayao & >|\\ % | \< CBald & & Charles, the Bald & >|\\ % |\end{nameauth}| % \end{quote} % -% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}% -% Here we have the equivalent with the simplified interface. |\Einstein,| |\LEinstein,| and |\Einstein| produce \Einstein, \LEinstein, and \Einstein. |\CBald| and |\CBald| give \CBald\ and \CBald. |\Confucius| yields \Confucius. |\Cicero| prints \Cicero\ and \Cicero. The preferred way to get alternate names is |\LCicero[Marcus Tullius]|: \LCicero[Marcus Tullius]. +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{ll}\toprule +% |\Name [Albert]{Einstein}| or |\Einstein| & \Name [Albert]{Einstein}\\ +% |\Name*[Albert]{Einstein}| or |\LEinstein| & \LEinstein\\ +% |\Name [Albert]{Einstein}| or |\Einstein| & \Einstein\\\midrule +% |\Name [M.T.]{Cicero}| or |\Cicero| & \Name [M.T.]{Cicero}\\ +% |\Name*[M.T.]{Cicero}[Marcus Tullius]| & \Name*[M.T.]{Cicero}[Marcus Tullius]\\ +% |\Name [M.T.]{Cicero}| or |\Cicero| & \Cicero\\\midrule +% |\Name {Confucius}| or |\Confucius| & \Confucius\\\midrule +% |\Name {Miyazaki, Hayao}| or |\Miyazaki| & \Name {Miyazaki, Hayao}\\ +% |\Name*{Miyazaki, Hayao}[Sensei]| & \Name*{Miyazaki, Hayao}[Sensei]\\ +% |\Name {Miyazaki, Hayao}| or |\Miyazaki| & \Name {Miyazaki, Hayao}\\\midrule +% |\Name {Charles, the Bald}| or |\CBald| & \CBald\\ +% |\Name*{Charles, the Bald}| or |\LCBald| & \Name*{Charles, the Bald}\\ +% |\Name {Charles, the Bald}| or |\CBald| & \Name {Charles, the Bald}\\\bottomrule +% \end{tabular} +% \end{center} +% +% When using the simplified interface, the preferred way to get alternate names is |\LCicero[Marcus Tullius]| and |\LMiyazaki[Sensei]|: \LCicero[Marcus Tullius] and \LMiyazaki[Sensei]. The next section explains why that is so. +% +% Note also that the alternate forename goes away in subsequent name references. |\Name [M.T.]{Cicero}[Marcus Tullius]| shows up as just \Name [M.T.]{Cicero}[Marcus Tullius] in that case. By default, subsequent name references are surnames only. % \clearpage % % \subsubsection{Forenames: \texttt{\textbackslash FName}} @@ -1112,54 +1190,57 @@ Running "make install" installs the files in the local TeX tree. % % \DescribeMacro{\FName} % \DescribeMacro{\FName*} -% \cmd{\FName} and its synonym \cmd{\FName*} print just forenames, but only in subsequent name uses.\footnote{The two macros are the same in case you edit \cmd{\Name*} by adding an |F| to get a first reference, just as you might edit \cmd{\Name} the same way to get the same result.} -% They are intended for Western-style names. The syntax is: +% \cmd{\FName} and its synonym \cmd{\FName*} print just personal names, but only in subsequent name uses. The two macros are the same in case you edit \cmd{\Name*} by adding an \texttt{F} to get a first reference. They print a full name, not a short name, when a name is used for the first time. The syntax is: % \begin{quote}\small -% \cmd{\FName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \cmd{\FName}\oarg{FNN}\marg{SNN|,| opt. FNN/Affix}\oarg{Alternate names} % \end{quote} -% This macro prints a full name, not a short name, when a name is first used. That prevents a first-name reference before a person has been introduced. Section~\ref{sec:Tweaks} has more on this. By design, \cmd{\FName} \emph{never} prints Eastern personal names, so that ancient names also work (cf. Section~\ref{sec:PatRef}). Examples of general use include: % +% These\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} +% \DescribeMacro{\ForceFN} +% macros work with both Eastern and Western names, but to get an Eastern personal name, one must precede these macros with \cmd{\ForceFN}. Otherwise you would get poor results with some royal and ancient names. See also Sections~\ref{sec:tweaks} and~\ref{sec:PatRef}. Examples of general use include: % % -% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}% % \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule -% |\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\ -% |\FName[Albert]{Einstein}| & \FName[Albert]{Einstein}\\\midrule -% |\FName{Confucius}| & \FName{Confucius}\\ -% |\FName{Confucius}|& \FName{Confucius}\\\midrule -% |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\ -% |\FName[M.T.]{Cicero}[Marcus Tullius]| & \FName[M.T.]{Cicero}[Marcus Tullius]\\\midrule -% |\FName{Charles, the Bald}| & \FName{Charles, the Bald}\\ -% |\FName{Charles, the Bald}| & \FName{Charles, the Bald}\\\bottomrule +% |\FName[Albert]{Einstein}| or |\SEinstein| & \SEinstein\\\midrule +% |\FName[M.T.]{Cicero}[Marcus Tullius]| \\ +% or |\SCicero[Marcus Tullius]| & \SCicero[Marcus Tullius]\\\midrule +% |\FName{Confucius}| or |\SConfucius |& \FName{Confucius}\\\midrule +% |\FName{Miyazaki, Hayao}| or |\SMiyazaki| & \FName{Miyazaki, Hayao}\\ +% |\ForceFN\FName{Miyazaki, Hayao}|\\ +% or |\ForceFN\SMiyazaki| & \ForceFN\FName{Miyazaki, Hayao}\\ +% |\ForceFN\FName{Miyazaki, Hayao}[Sensei]|\\ +% or |\ForceFN\SMiyazaki[Sensei]| & \ForceFN\FName{Miyazaki, Hayao}[Sensei]\\\midrule +% |\FName{Charles, the Bald}| or |\SCBald| & \SCBald\\ +% |\ForceFN\FName{Charles, the Bald}|\\ +% or |\ForceFN\SCBald| & \ForceFN\SCBald\\\bottomrule % \end{tabular} % \end{center} % -% With the simplified interface example from the previous page, |\SEinstein,| |\SConfucius,| |\SCicero,| and |\SCBald| give us \SEinstein, \SConfucius, \SCicero, and \SCBald. |\SCicero[Marcus Tullius]| gives \SCicero[Marcus Tullius]. However, with the macro |\FName[Chesley B.]{Sullenberger, III}[Sully]| we have ``\FName[Chesley B.]{Sullenberger, III}[Sully]'' and ``\FName[Chesley B.]{Sullenberger, III}[Sully].'' Please use caution! -% -% \ForgetName[Clive Staples]{Lewis} This may not always be a ``bug.'' Remembering Section~\ref{sec:simplestart}, you can use \Lewis\ or ``\SJack.'' |\FName[Clive Staples]{Lewis}[C.S.]| or \cmd{\Lewis} gives the first form, while |\FName[Clive Staples]{Lewis}[Jack]| or \cmd{\Jack} gives the second. |\SJayR| gave \ForgetName[John David]{Rockefeller, IV}\SJayR\ and \SJayR, but the index entry remains ``Rockefeller, John David, IV.'' -% -% Using ``default nicknames'' in the simplified interface has some caveats: -% +% If we use |\FName[Chesley B.]{Sullenberger, III}[Sully]| we get ``\FName[Chesley B.]{Sullenberger, III}[Sully]'' and ``\FName[Chesley B.]{Sullenberger, III}[Sully]'' because the \meta{Alternate names} always replace the forenames. Please use caution! % \begin{nameauth}% -% \< Ches & Chesley B. & Sullenberger, III & >% -% \< Sully & Chesley B. & Sullenberger, III & Sully >% +% \< Ches & Chesley B. & Sullenberger, III & > +% \< Sully & Chesley B. & Sullenberger, III & Sully > % \end{nameauth}% % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\ +% | \< LewisFull & Clive Staples & Lewis & >|\\ +% | \< Lewis & Clive Staples & Lewis & C.S. >|\\ % | \< Ches & Chesley B. & Sullenberger, III & >|\\ % | \< Sully & Chesley B. & Sullenberger, III & Sully >|\\ % |\end{nameauth}| % \end{quote} +% \ForgetName[Clive Staples]{Lewis}% +% Some names might call for this name-swapping. For example, if a book section refers always to \Lewis, but another section introduces him as \Name*[Clive Staples]{Lewis} and the editor wants to index him as such, then the two shorthands for \Lewis\ above might be appropriate. Section~\ref{sec:simplestart} illustrates several examples. % -% \ForgetName[Chesley B.]{Sullenberger, III} The\marginpar{\small\raggedleft\dbend} first use \cmd{\Ches} prints ``\Ches.'' Later, \cmd{\SChes} and \cmd{\SSully} print ``\SChes'' and ``\SSully.'' While |\SChes[Sully]| always gives ``\SChes[Sully],'' |\SSully[Chesley B.]| prints ``\SSully[Chesley B.].'' The \meta{Alternate names} field is always occupied when using \cmd{\Sully,} etc. Thus, the final |[Chesley B.]| is not a macro argument. +% \ForgetName[Chesley B.]{Sullenberger, III} +% Using ``default nicknames'' in the simplified interface has some caveats. The\marginpar{\small\raggedleft\dbend} first use \cmd{\Ches} prints ``\Ches.'' Later, \cmd{\SChes} and \cmd{\SSully} print ``\SChes'' and ``\SSully.'' While |\SChes[Sully]| always gives ``\SChes[Sully],'' |\SSully[Chesley B.]| prints ``\SSully[Chesley B.].'' With \cmd{\Sully}, the \meta{Alternate names} field is already occupied, making |[Chesley B.]| normal text. % \clearpage % -% -% \subsection{Affixes and Eastern Names} +% \subsection{Language Issues} % % \subsubsection{Affixes Need Commas} % \label{sec:Affix} % -% Comma-delimited affixes handle several different name types. \emph{Always include a comma as an affix delimiter}, even when the \texttt{nocomma} option does not print the comma. Extra spaces between the comma and affix are ignored. Other name types include royal, medieval, and Eastern names: +% Comma-delimited affixes handle several different name types. \emph{Always include a comma as an affix delimiter}, even when commas are not printed. Extra spaces between the comma and affix are ignored. % % \begin{center}\small\ForgetName{Sun, Yat-sen}\setstretch{1.1} % \begin{tabular}{ll}\toprule @@ -1172,13 +1253,18 @@ Running "make install" installs the files in the local TeX tree. % \end{tabular} % \end{center} % -% One\marginpar{\small\raggedleft\dbend} cannot use the old syntax with the \Name[Oskar]{Hammerstein, II} example. If you tried to use \IndexInactive|\Name[Oskar]{Hammerstein}[II]| you would get ``\Name[Oskar]{Hammerstein}[II].'' \IndexActive Western names with suffixes must use the new, comma-delimited syntax. Also, one must use comma-delimited suffixes to cross-reference all name forms with \cmd{\AKA}. For a full description see Section~\ref{sec:AKA}.\medskip +% One\marginpar{\small\raggedleft\dbend} cannot use the old syntax with the \Name[Oskar]{Hammerstein, II} example. If you tried to use {\IndexInactive|\Name[Oskar]{Hammerstein}[II]| you would get ``\Name[Oskar]{Hammerstein}[II].''} Western names with suffixes must use the comma-delimited syntax. Also, one must use comma-delimited suffixes to cross-reference all name forms with \cmd{\AKA}. For a full description see Section~\ref{sec:AKA}.\medskip % % \DescribeMacro{\KeepAffix} -% Put \cmd{\KeepAffix} before \cmd{\Name} or \cmd{\AKA} if a \meta{SNN, affix} pair is split: ``\Name*{Louis, XIV}'' by a line break or page break. |\KeepAffix\Name*{Louis, XIV}| prevents that break by inserting a non-breaking space between \meta{SNN} and \meta{affix} (or \meta{SNN} and \meta{Eastern FNN}) in the body text, but not in the index. Spaces between multiple names in each name field are not affected. This works with all name types handled by \textsf{nameauth}, including the old syntax.\medskip +% Put \cmd{\KeepAffix} before \cmd{\Name} or \cmd{\AKA} if a \meta{SNN, affix} pair is split: ``\Name*{Louis, XIV}.'' |\KeepAffix\Name*{Louis, XIV}| prevents that break by inserting a non-breaking space between \meta{SNN} and \meta{affix} (or \meta{SNN} and \meta{Eastern FNN}) in the body text, but not in the index. Spaces between multiple names in each name field are not affected. This works with all name types handled by \textsf{nameauth}.\medskip +% +% \DescribeMacro{\DropAffix} +% Preceding\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} the naming macros with \cmd{\DropAffix} will suppress an affix in a Western name. |\DropAffix\Name*[Oskar]{Hammerstein, II}| produces ``\DropAffix\Name*[Oskar]{Hammerstein, II}.'' This does not affect non-Western names.\medskip +% +% One can switch between the macros below without affecting entries in the index. Do, however, strive for consistency.\medskip % % \DescribeMacro{\ShowComma} -% If you do not want to use the \texttt{comma} option, \cmd{\ShowComma} gets the same results on a per-name basis for Western names while using the default \texttt{nocomma}. There is no affect on index entries. For example: +% If you do not want to use the \texttt{comma} option, \cmd{\ShowComma} gets the same results on a per-name basis for Western names while using the default \texttt{nocomma}: % \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule % |\Name*[Louis]{Gossett, Jr.}| & \Name*[Louis]{Gossett, Jr.}\\ @@ -1187,7 +1273,7 @@ Running "make install" installs the files in the local TeX tree. % \end{center}\medskip % % \DescribeMacro{\NoComma} -% If you do wish to use the \texttt{comma} option, \cmd{\NoComma} can suppress a comma between the surname and affix on a per-name basis.\marginpar{\small\raggedleft\dbend} For example, we simulate the \texttt{comma} option for the two tables below: +% If you\marginpar{\large\raggedleft\textsf{\bfseries 2.6}\strut} do wish to use the \texttt{comma} option, \cmd{\NoComma} can suppress a comma between the surname and affix on a per-name basis. For example, we alter package internals to simulate the \texttt{comma} option for the two tables below: % \makeatletter\@nameauth@AlwaysCommatrue\makeatother % \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule @@ -1204,24 +1290,20 @@ Running "make install" installs the files in the local TeX tree. % \end{tabular} % \end{center} % \makeatletter\@nameauth@AlwaysCommafalse\makeatother -% One can switch freely among name forms, but remember that consistent use of \cmd{\ShowComma} and \cmd{\NoComma} is important when implementing name forms. The simplified interface can help with that.\medskip -% -% \clearpage % % \subsubsection{Eastern Names} % \label{sec:Eastern} % -% The reversing macros assume that you will be using long-name references, especially with ``native'' Eastern names. Please bear this in mind. -% % The\marginpar{\small\raggedleft non-native} \textsf{nameauth} package offers ``non-native'' and ``native'' ways to handle romanized Eastern names. The ``non-native'' form really is a Western name (and it is indexed as such) that is made to look Eastern in the body text: % \begin{quote}\small -% \cmd{\RevName}\cmd{\Name*}\oarg{Eastern FNN}\marg{Eastern SNN} +% \cmd{\RevName}\cmd{\Name*}\oarg{Eastern FNN}\marg{Eastern SNN}\oarg{Alternate names} % \end{quote} -% The index entry of this name form looks like \meta{SNN}, \meta{FNN} (including the comma). This type of entry is a Western form. Pick non-native Eastern names when you need to have Western name forms in the index entries. +% The index entry of this name form looks like \meta{SNN}, \meta{FNN} (including the comma). This type of entry is a Western form. Pick non-native Eastern names when you need to have Western name forms in the index entries.\medskip % -% In\marginpar{\small\raggedleft non-native} contrast, there are two ways to make ``native'' Eastern name forms, which are indexed as such and appear in Eastern name order in the body text: +% In\marginpar{\small\raggedleft native} contrast, there are two general forms of syntax for ``native'' Eastern name forms, which are indexed as such and appear in Eastern name order in the body text. The new syntax permits alternate names; the old does not: % \begin{quote}\small\setstretch{1.1} % \cmd{\Name}\marg{Eastern SNN, Eastern FNN}\\ +% \cmd{\Name}\marg{Eastern SNN, Eastern FNN}\oarg{Alternate names}\\ % \cmd{\Name}\marg{Eastern SNN}\oarg{Eastern FNN} (old syntax) % \end{quote} % The index entry of this name form looks like \meta{SNN} \meta{FNN} (no comma). This type of entry bears similarity with ancient and medieval forms. Pick native Eastern names when you want to use Eastern forms in the index.\medskip @@ -1231,66 +1313,48 @@ Running "make install" installs the files in the local TeX tree. % \DescribeMacro{\RevName} % In addition to the class options (Section~\ref{sec:options}), the macros \cmd{\ReverseActive} and \cmd{\ReverseInactive} toggle reversing on a larger scale, while \cmd{\RevName} is used once per name. The reverse output mechanism is designed to reverse full names only. Nevertheless, it does not force full names. Results vary, based on the type of Eastern name forms being used. Non-native forms are shown by a dagger (\dag): % \begin{center}\small\setstretch{1.1} -% \begin{tabular}{lll}\toprule +% \begin{tabular}{rll}\toprule % & \emph{unchanged} & |\RevName|\\\midrule -% |\LKonoe|\dag & \LKonoe\dag & \RevName\LKonoe\dag\\ -% |\Konoe|\dag & \Konoe\dag & \RevName\Konoe\dag\\ +% |\LKonoe| & \LKonoe\dag & \RevName\LKonoe\dag\\ +% |\LKonoe[Minister]| & \LKonoe[Minister]\dag & \meta{not appropriate}\\ +% |\Konoe| & \Konoe\dag & \RevName\Konoe\dag\\ +% |\SKonoe| & \SKonoe\dag & \RevName\SKonoe\dag\\\midrule % |\LYamt| & \LYamt & \RevName\LYamt\\ -% |\Yamt| & \Yamt & \RevName\Yamt\\\bottomrule +% |\LYamt[Admiral]| & \meta{not appropriate} & \RevName\LYamt[Admiral]\\ +% |\Yamt| & \Yamt & \RevName\Yamt\\ +% |\SYamt| & \SYamt & \RevName\SYamt\\ +% |\ForceFN\SYamt| & \ForceFN\SYamt & \ForceFN\RevName\SYamt\\\bottomrule % \end{tabular} % \end{center} % -% A striking feature above is that reversing a short native Eastern form will produce a personal name. This seems bad, especially when |\SYamt| \emph{does not} produce a first name ``\SYamt,'' while |\RevName\Attil| does. Yet |\RevName\Attil| can be used to get only the affix in \Attil\ ``\RevName\Attil'' instead of using the preferred method of text and index tags (Sections~\ref{sec:tagtext} and~\ref{sec:TagName}).\footnote{Name reversing is a design point that really needs review.} -% -% Creating ``last-comma-first'' listings by surname (Section~\ref{sec:LastFirst}) only makes sense with Western names and maybe non-native Eastern names, but not with native Eastern names or ancient forms. +% Creating\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} ``last-comma-first'' listings by surname (Section~\ref{sec:LastFirst}) only makes sense with Western names and maybe non-native Eastern names, but not with native Eastern names or ancient forms. That is why native Eastern forms and ancient forms are unaffected by the commatized form of reversing. % % Please\marginpar{\small\raggedleft\cmd{\global}} note that \cmd{\ReverseActive} and \cmd{\ReverseInactive} can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect. % \clearpage % -% Consider this list of Japanese music artists. All the name references are long names (\cmd{\Name*}). Names in Western order, then non-native Eastern order are marked with a dagger ({\dag}). All other names are in native Eastern, then Western order. Old-syntax forms have a double dagger(\ddag): -% -% \begin{center}\small\setstretch{1.1} -% \begin{tabular}{lll}\toprule -% & \emph{unchanged} & |\RevName|\\\midrule -% |\Name*[Aiko]{Nakano}|\dag & \Name*[Aiko]{Nakano}\dag & \RevName\Name*[Aiko]{Nakano}\dag\\ -% |\Name*{Arai, Akino}| & \Name*{Arai, Akino} & \RevName\Name*{Arai, Akino}\\ -% |\Name*{Ishida}[Yoko]|\ddag & \Name*{Ishida}[Yoko]\ddag & \RevName\Name*{Ishida}[Yoko]\ddag\\ -% |\Name*{Yohko}| & \Name*{Yohko} & \RevName\Name*{Yohko}\\\bottomrule -% \end{tabular} -% \end{center}\smallskip -% -% % \DescribeMacro{\AllCapsActive} % \DescribeMacro{\AllCapsInactive} % \DescribeMacro{\CapName} % The \textsf{nameauth} package allows one to capitalize entire family names in the body text while keeping them in standard English form in the index. This capitalization is designed to work with Eastern name forms. -% Use \cmd{\AllCapsActive}, \cmd{\AllCapsInactive}, and \cmd{\CapName} for fully-capitalized family names in the body text. These macros are analogous to the reversing macros above and may be used alone or with those and other prefix macros, \emph{e.g.}: -% \begin{quote}\small -% \cmd{\CapName}\cmd{\RevName}\cmd{\Name*}\marg{SNN, Affix}. -% \end{quote} +% Use \cmd{\AllCapsActive}, \cmd{\AllCapsInactive}, and \cmd{\CapName} for fully-capitalized family names in the body text. These macros are analogous to the reversing macros and may be used alone or with other prefix macros, \emph{e.g.}: \cmd{\CapName}\cmd{\RevName}\cmd{\Name*}\marg{SNN, Affix}. % % Both\marginpar{\small\raggedleft\cmd{\global}} \cmd{\AllCapsActive} and \cmd{\AllCapsInactive} have the same local restrictions as the other state-changing macros. Use \cmd{\global} to force a global effect. % % In the example below, names in Western order, then non-native Eastern order are marked with a dagger ({\dag}). All other names are in native Eastern, then Western order. Old-syntax forms have a double dagger(\ddag): % % \begin{center}\small\setstretch{1.1} -% \begin{tabular}{l@{ }l@{ }l}\toprule +% \begin{tabular}{lll}\toprule % & \emph{unchanged} & |\CapName\RevName|\\\midrule -% |\Name*[Yoko]{Kanno}|\dag & \CapName\Name*[Yoko]{Kanno}\dag & \CapName\RevName\Name*[Yoko]{Kanno}\dag\\ -% |\Name*{Shikata, Akiko}| & \CapName\Name*{Shikata, Akiko} & \CapName\RevName\Name*{Shikata, Akiko}\\ -% |\Name*{Nogawa}[Sakura]|\ddag & \CapName\Name*{Nogawa}[Sakura]\ddag & \CapName\RevName\Name*{Nogawa}[Sakura]\ddag\\ +% |\Name*[Yoko]{Kanno}| & \CapName\Name*[Yoko]{Kanno}\dag & \CapName\RevName\Name*[Yoko]{Kanno}\dag\\ +% |\Name*{Arai, Akino}| & \CapName\Name*{Arai, Akino} & \CapName\RevName\Name*{Arai, Akino}\\ +% |\Name*{Ishida}[Yoko]| & \CapName\Name*{Ishida}[Yoko]\ddag & \CapName\RevName\Name*{Ishida}[Yoko]\ddag\\ % |\Name*{Yohko}| & \CapName\Name*{Yohko} & \CapName\RevName\Name*{Yohko}\\\bottomrule % \end{tabular} % \end{center}\smallskip % % Capitalization and reversing precede post-processing. The reversing and capitalization macros also work with \cmd{\AKA}. They affect only the text, not the index. For caps in the text and index see Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc}. -% \clearpage -% -% \subsection{Other Naming Topics}\medskip % -% \begin{center}\large\bfseries Language-Related Issues\vspace{-2ex}\end{center} -% -% \subsubsection{Formatting Initials} +% \subsubsection{Initials} % % Omit spaces between initials if possible; see also Bringhurst's \emph{Elements of Typographic Style}. If your publisher wants spaces between initials, try putting thin spaces |\,| between them. Use \cmd{\PretagName} to get the correct index sorting:\bigskip % @@ -1301,7 +1365,7 @@ Running "make install" installs the files in the local TeX tree. % | \< White & E.\,B. & White & >|\\ % |\end{nameauth}| % \end{minipage} -% \begin{minipage}[c]{0.4\textwidth}\footnotesize +% \begin{minipage}[c]{0.42\textwidth}\footnotesize % \def\sep{\vrule width0.5pt\kern-0.5pt}% % \begin{tabular}{ll}\hline % & \hphantom{E.}\sep\,\sep\hphantom{B.}\sep\hphantom{\ }\sep\hphantom{White}\\ @@ -1319,9 +1383,8 @@ Running "make install" installs the files in the local TeX tree. % % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\ -% | \< Bier & Johann & Bier\-mann & >|\\ -% |\end{nameauth}|\\[2ex] -% \texttt{\dots}|\IndexName[Johann]{Bier\-mann}|\IndexName[Johann]{Bier\-mann} +% | \< Striet & John & Striet\-el\-meier & >|\\ +% |\end{nameauth}| % \end{quote} % % One also can fix bad breaks with the \textsf{babel} or \textsf{polyglossia} packages. This moves the solution from ``quick and dirty'' to elegant. We force a bad break: \Name[John]{Strietelmeier}. We can stop that using \textsf{babel}: @@ -1339,38 +1402,60 @@ Running "make install" installs the files in the local TeX tree. % \DescribeMacro{\RevComma} % The reversing macros \cmd{\ReverseCommaActive}, \cmd{\ReverseCommaInactive}, and \cmd{\RevComma}\ let us reorder long Western names (via \cmd{\Name*} and the like). The first two are broad toggles, while the third works on a per-name basis. % -% Both\marginpar{\small\raggedleft\cmd{\global}} \cmd{\ReverseCommaActive} and \cmd{\ReverseCommaInactive} have the same local restrictions as the other state-changing macros unless you use \cmd{\global.} -% Eastern, medieval, and royal names do not work with these macros.\footnote{Name reversing with commas is a design point that really needs review.} -% +% These macros\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} work independently of the reversing macros used with Eastern names. This change allows reversing and commas to work harmoniously with ``native'' Eastern and ancient names: % \begin{center}\small\setstretch{1.1} % \begin{tabular}{lll}\toprule % \Name*[J.S.]{Mill}[John Stuart] & \RevComma\Name*[J.S.]{Mill}[John Stuart] & OK\\ % \Name*[Oskar]{Hammerstein, II} & \RevComma\Name*[Oskar]{Hammerstein, II} & OK\\ -% \Name*{John, Eriugena} & \RevComma\Name*{John, Eriugena} & incompatible\\ -% \Name*{Mao}[Tse-tung] & \RevComma\Name*{Mao}[Tse-tung] & incompatible\\ -% \Name*{Anaximander} & \RevComma\Name*{Anaximander} & OK\\\bottomrule +% \Name*{John, Eriugena} & \RevComma\Name*{John, Eriugena} & no change\\ +% \Name*{Mao}[Tse-tung] & \RevComma\Name*{Mao}[Tse-tung] & no change\\ +% \Name*{Confucius} & \RevComma\Name*{Confucius} & no change\\\bottomrule % \end{tabular} % \end{center} -% \clearpage +% +% Since\marginpar{\large\raggedleft\textsf{\bfseries 3.0}} reversing with commas is independent of ``native'' Eastern and ancient names, we see its effects on ``non-native'' Eastern names: +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{rl}\toprule +% |\LKonoe| & \LKonoe\dag\\ +% |\RevName\LKonoe| & \RevName\LKonoe\dag\\ +% |\RevComma\LKonoe| & \RevComma\LKonoe\dag\\\bottomrule +% \end{tabular} +% \end{center} +% +% Both\marginpar{\small\raggedleft\cmd{\global}} \cmd{\ReverseCommaActive} and \cmd{\ReverseCommaInactive} have the same local restrictions as the other state-changing macros unless you use \cmd{\global}. % % \subsubsection{Particles} % \label{sec:standards} % -% According to the \emph{Chicago Manual of Style}, English names with the particles \emph{de}, \emph{de\ la}, \emph{d'}, \emph{von}, \emph{van}, and \emph{ten} generally keep them with the last name, using varied capitalization. \emph{Le}, \emph{La}, and \emph{L'} always are capitalized unless preceded by \emph{de}. This subsection deals mainly with accented names in English contexts.\medskip +% According to the \emph{Chicago Manual of Style}, English names with the particles \emph{de}, \emph{de\ la}, \emph{d'}, \emph{von}, \emph{van}, and \emph{ten} generally keep them with the last name, using varied capitalization. \emph{Le}, \emph{La}, and \emph{L'} always are capitalized unless preceded by \emph{de}. This subsection deals mainly with accented names in English contexts. % -% \DescribeMacro{\CapThis} -% In English, these particles go in the \meta{SNN} field of \cmd{\Name}, \emph{e.g.}, \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}.\marginpar{\small\raggedleft\dbend} |\CapThis\Name[Walter]{de la Mare}| lets you capitalize \emph{de} when at the beginning of a sentence. \CapThis\Name[Walter]{de la Mare} will think it fair. \CapThis\Soto\ (using |\CapThis\Soto| from Section~\ref{sec:simplestart}) would agree. +% We\marginpar{\small\raggedleft non-breaking\break spaces} recommend inserting |~| or \cmd{\nobreakspace} between particles and names if the particles are less than three letters. This will keep them from becoming lost because of a bad break. +% \cmd{\CapThis} (below)\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} no longer consumes the space between a single-letter particle and a name. +% +% Some particles look very similar. For example, \emph{L'} and \emph{d'} are two separate glyphs each, while \emph{Ľ} and \emph{ď} are one Unicode glyph each.\medskip % -% It is a good idea to put |~| or \cmd{\nobreakspace} between particles and surnames to avoid bad breaks. This also prevents \cmd{\CapThis} from eating the space between a one-character particle and the surname (Section \ref{sec:Unicode}). +% \DescribeMacro{\CapThis} +% In English, these particles go in the \meta{SNN} field of \cmd{\Name}, \emph{e.g.}, \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare}. When the last name with the particle appears at the beginning of a sentence, one must capitalize the particle: +% \begin{quote}\small +% |\CapThis\Name[Walter]{de la Mare} will think it fair.%|\\ +% |\CapThis\Soto\ would agree.|\\[1ex] +% \CapThis\Name[Walter]{de la Mare} will think it fair. \CapThis\Soto\ would agree. +% \end{quote} +% \clearpage % -% The Continental style for surnames (Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc}) does not work with the capitalization macros. For names like \Name[Catherine]{\textsc{de'~Medici}} use |\Name[Catherine]{\textsc{de'~Medici}}| and, instead of the capping macros, |\textsc{De'~Medici}\IndexName[Catherine]{\textsc{de'~Medici}}.| Otherwise you will have to modify the examples from Section~\ref{sec:Hooksc}. Those examples can help you implement an alternate method of capitalization.\medskip +% The\marginpar{\small\raggedleft\dbend} Continental style for surnames (Sections~\ref{sec:nonenglish} and~\ref{sec:Hooksc}) does not work with \cmd{\CapThis}. Consider the example below or modify the examples from Section~\ref{sec:Hooksc} to implement an alternate method of capitalization. +% \begin{center}\footnotesize\setstretch{1.1} +% \begin{tabular}{rl}\toprule +% |\Name[Catherine]{\textsc{de'~Medici}}| & \Name[Catherine]{\textsc{de'~Medici}}\\\midrule +% |\textsc{De'~Medici}%|\\ +% |\IndexName[Catherine]{\textsc{de'~Medici}}| & \textsc{De'~Medici}\IndexName[Catherine]{\textsc{de'~Medici}}\\\bottomrule +% \end{tabular} +% \end{center} % % \DescribeMacro{\AccentCapThis} -% With \texttt{pdflatex} and \textsf{inputenc}, use \cmd{\CapThis} when the first character of the particle is \texttt{A--z} (basic Latin).\marginpar{\small\raggedleft\dbend} Use \cmd{\AccentCapThis} when the first character is extended Latin or other Unicode (see Section \ref{sec:Unicode}). Otherwise, with \texttt{pdflatex} \cmd{\CapThis} will fail if an extended Unicode character is the first letter of a particle. +% If the source files\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} for the \textsf{nameauth} package have Unicode encoding and run on a Unicode-compliant system, \cmd{\AccentCapThis} is not necessary. See also page~\pageref{page:CapRoot}. If the text encoding of the source files is changed or there are system encoding issues, \cmd{\AccentCapThis} might be needed with NFSS when the first name character is an active Unicode character. See also Section \ref{sec:Unicode}.\medskip % -% For example, \emph{L'} and \emph{d'} are two separate glyphs each, while \emph{Ľ} and \emph{ď} are one Unicode glyph each. Even with \texttt{xelatex} and \texttt{lualatex}, you would put a non-breaking space between the particle and the name because the particle is only one character. With \texttt{pdflatex} you also must use \cmd{\AccentCapThis.} -% -% Medieval names present some interesting difficulties, often based on the expected standards of the context in which they are used: +% Medieval\marginpar{\small\raggedleft Medieval name\break issues} names present some interesting difficulties, often based on the expected standards of the context in which they are used: % \begin{quote}\small\setstretch{1.1} % |\PretagName{Thomas, à~Kempis}{Thomas a Kempis}|\hfill\emph{medieval}\\ % |\PretagName[Thomas]{à~Kempis}{Thomas a Kempis}|\hfill\emph{Western}\\ @@ -1380,55 +1465,38 @@ Running "make install" installs the files in the local TeX tree. % |\end{nameauth}| % \end{quote} % The medieval forms \KempMed\ and \KempMed\ use the particle as the first part of an affix. Please do not confuse the medieval forms with the Western forms. Otherwise you will get similar names with different index entries.\footnote{Properly speaking, ``à~Kempis'' and ``Aquinas'' are not surnames but suffixed place names. They create different index entries from Western names and look different in the text.} -% \IndexInactive -% Many people still use medieval affixes as Western surnames: \SubvertName[Thomas]{à~Kempis}``\AccentCapThis\KempW.''\footnote{Ethnocentric treatment of names still occurs in academic literature. This is due to simplicity in work flow or conformity to name authorities. The \textsf{nameauth} package will accommodate those approaches, even if I personally disagree with them.} -% \clearpage -% The Western form is |\AccentCapThis\KempW.| One might run into problems unless one considers the following caveats, as Section~\ref{sec:Unicode} explains: -% \begin{itemize}\small -% \item |\CapThis\KempW| halts execution with |Argument| |of| |\UTFviii@two@| |octets| |has| |an| |extra| |\| when using \texttt{latex} or \texttt{pdflatex} and NFSS. -% \item |\AccentCapThis\Name[Thomas]{à| |Kempis}| produces ``\AccentCapThis\Name[Thomas]{à Kempis}'' (space removed). Instead, use |\AccentCapThis\Name[Thomas]{à~Kempis}.| -% \item With \texttt{latex} or \texttt{pdflatex} \cmd{\AccentCapThis} fails for particles like |lé|\,---\,use \cmd{\CapThis} in that case to avoid breaking the \emph{second} character. -% \item |\AccentCapThis\Soto| gives \AccentCapThis\Soto, but only with \texttt{latex} or \texttt{pdflatex}. Only use it with accented first letters. -% \end{itemize} -% \IndexActive % -% All this being said, the publisher's way of handling names may differ from the standard way. This package allows for such variations. Yet even some publishers fall afoul of confusion regarding name forms.\footnote{An example of a true error is the index entry ``Yat-sen, Sun'' (as if Sun were a forename) in Immanuel Geiss, \emph{Personen: Die biographische Dimension der Weltgeschichte}, Geschichte Griffbereit vol. 2 (Munich: Wissen Media Verlag, 2002), 720. Still, the six-volume set is good.} -% Developing a good rapport with the publisher will help you apply this package to the company's style. +% {\IndexInactive Many people still use medieval affixes as Western surnames: |\CapThis\KempW| displays \SubvertName[Thomas]{à~Kempis}``\CapThis\KempW.''\footnote{Ethnocentric treatment of names still occurs in academic literature. This is due to simplicity in work flow or conformity to name authorities. The \textsf{nameauth} package accommodates that, even if the package author finds such practices to be culturally insensitive.}} +% The publisher's way of handling names may differ from the standard way. This package allows for such variations. Yet some publishers have problems with some name forms.\footnote{An example of a true error is the index entry ``Yat-sen, Sun'' (as if Sun were a forename) in Immanuel Geiss, \emph{Personen: Die biographische Dimension der Weltgeschichte}, Geschichte Griffbereit vol. 2 (Munich: Wissen Media Verlag, 2002), 720. Still, the six-volume set is good.} +% Developing a good rapport with the publisher will help you apply this package to the company's style.\medskip % -% You\marginpar{\small\raggedleft Alternates} could use name forms with braces, like |\Name[Thomas]{{à}~Kempis}|, and control sequences, like |\Name[Thomas]{\`a~Kempis}|. Using those forms consistently, with \cmd{\PretagName,} would require you to use \cmd{\CapThis,} never \cmd{\AccentCapThis}. See Section~\ref{sec:Unicode} for more details. +% If\marginpar{\small\raggedleft Alternates} the \textsf{nameauth} package is not used with UTF-8 encoding under NFSS or with \texttt{xelatex}/\texttt{lualatex}, the package still will work. Instead use control sequences, like |\Name[Thomas]{\`a~Kempis}|. % -% Non-English contexts do not necessarily bind particles to surnames. Using \cmd{\Name} and \cmd{\FName} with alternate forenames helps address this and may skirt the particle capitalization issue. See also Section~\ref{sec:Particles}. +% Non-English contexts do not necessarily bind particles to surnames. Using \cmd{\Name} and \cmd{\FName} with alternate forenames helps address this and may skirt the particle capitalization issue. See also Section~\ref{sec:PatRef}. +% \clearpage % % \subsubsection{Accented Names} % \label{sec:accents} -% -% For names that contain accented characters, using \texttt{xelatex} or \texttt{lualatex} with \texttt{xindy} (\texttt{texindy}) is recommended. Section~\ref{sec:engines} shows how you can work with multiple engines using the same document. % -% If the leading character of \meta{SNN} is accented and lowercase (usually only in a particle), then you must use \cmd{\AccentCapThis} if you are using NFSS. Sections~\ref{sec:standards} and~\ref{sec:Unicode} give more details about \cmd{\CapThis} and \cmd{\AccentCapThis}. +% For names that contain accented characters, using \texttt{xelatex} or \texttt{lualatex} with \texttt{xindy} (\texttt{texindy}) is recommended. See also Section~\ref{sec:engines}. % -% Accented characters act like control sequences. In NFSS use \cmd{\PretagName} for all names with extended Unicode characters (Sections~\ref{sec:IndexSort} and~\ref{sec:Unicode}).\footnote{This is true especially in NFSS while using \texttt{makeindex}. With \texttt{xindy} one can make custom sorting alphabets that are more powerful than \cmd{\PretagName}.} -% -% Unicode\marginpar{\small\raggedleft\dbend} characters and ``regular'' control sequences are not interchangeable. The example below shows that the names are all long (thus, different). Were the control sequences identical, the names would be long, then short: +% In NFSS,\marginpar{\small\raggedleft\dbend} accented characters are active. Especially when using \texttt{makeindex}, use \cmd{\PretagName} for all names with active Unicode characters (Sections~\ref{sec:IndexSort} and~\ref{sec:Unicode}). These active characters differ from the control sequences you type: % \begin{quote}\small\setstretch{1.1} -% \IndexInactive% -% |\Name[Johann]{Andre\"a}|\hfill \Name[Johann]{Andre\"a}\\ -% \IndexActive% +% \ForgetName{Æthelred, II}% +% |\Name[Johann]{Andre\"a}|\hfill {\IndexInactive\Name[Johann]{Andre\"a}}\\ % |\Name[Johann]{Andreä}|\hfill \Name[Johann]{Andreä} instead of \Name[Johann]{Andreä}\\ -% \IndexInactive% -% |\Name{\AE thelred, II}|\hfill \Name{\AE thelred, II}\\ -% \IndexActive% +% |\Name{\AE thelred, II}|\hfill {\IndexInactive\Name{\AE thelred, II}}\\ % |\Name{Æthelred, II}|\hfill \Name{Æthelred, II} instead of \Name{Æthelred, II} % \end{quote} % % See Section~\ref{sec:Unicode} on how to add additional Unicode glyphs to the default set under NFSS, \textsf{inputenc}, and \textsf{fontenc}. One may use expandable control sequences in names (thanks \Name*[Robert]{Schlicht}). Also, you can use \cmd{\edef} and \cmd{\noexpand} in names (Section~\ref{sec:Hooksc}, thanks \Name[Patrick]{Cousot}). -% \clearpage % % \subsubsection{Non-English Format} % \label{sec:nonenglish} % -% See\marginpar{\small\raggedleft\dbend} Sections~\ref{sec:FrontFormat}, \ref{sec:CustomHooks}, and~\ref{sec:Hooksc} in addition to this section. We place this section here because it has a language-based element. +% See\marginpar{\small\raggedleft Continental\\ small caps} Sections~\ref{sec:formatting} and~\ref{sec:Hooksc} in addition to this section. We place this section here because it has a language-based element. % -% By default, name post-processing\marginpar{\small\raggedleft Continental\\ small caps} only affects the text. Also by default, you cannot post-process Continental formatting because it occurs in both the text and the index via control sequences in the \textsf{nameauth} macro arguments. That usually requires \cmd{\PretagName} for index sorting (Section~\ref{sec:IndexSort}). Section ~\ref{sec:Hooksc} explains how to implement post-processing via \cmd{\noexpand} and other steps. +% By default, name post-processing only affects the text. Also by default, you cannot post-process Continental formatting because it occurs in both the text and the index via control sequences in the \textsf{nameauth} macro arguments. That usually requires \cmd{\PretagName} for index sorting (Section~\ref{sec:IndexSort}). Section ~\ref{sec:Hooksc} explains how to implement post-processing via \cmd{\noexpand} and other steps. % % Here we have a very basic attempt at Continental formatting of the surname in both the body text and the index. One cannot alter this formatting: % \begin{quote}\small\setstretch{1.1} @@ -1437,32 +1505,38 @@ Running "make install" installs the files in the local TeX tree. % \end{quote} % You get \Name[Greta]{\textsc{Garbo}}, then \Name[Greta]{\textsc{Garbo}}\,---\,even in the front matter. In order to get an unformatted reference to the name ``Garbo,''\IndexName[Greta]{\textsc{Garbo}} one must type something like |``Garbo''\IndexName[Greta]{\textsc{Garbo}}.| % -% As with accented names, different control sequences produce different names. |\Name[\normalfont{Greta}]{\textsc{Garbo}}| looks exactly like name above, but it will create a different index entry and have different first\,/\,subsequent uses. -% -% A comma delimiter will split the macro argument into a root and an affix. This could halt typesetting and generate an error regarding unbalanced braces. Avoid this by formatting the name and suffix separately. Here we manually format Continental and Eastern names that contain root\,/\,affix pairs: +% As with accented names, different control sequences produce different names. |\Name[\normalfont{Greta}]{\textsc{Garbo}}| looks exactly like name above, but it has a different index entry and different first/subsequent uses. +% +% A comma delimiter will split the macro argument into a root and an affix. To avoid an error regarding unbalanced braces, format the name and suffix separately. A suffixed Western name with Continental formatting looks like: % \begin{quote}\small\setstretch{1.1} -% |\PretagName{\uppercase{Fukuyama},| |Takeshi}{Fukuyama,| |Takeshi}|\\ % |\PretagName[Thurston]{\textsc{Howell},\textsc{III}}%|\\ -% | {Howell, Thurston 3}|\\[1ex] +% | {Howell, Thurston 3}|\\ % |\begin{nameauth}|\\ -% | \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & >|\\ % | \< Howell & Thurston & \textsc{Howell},\textsc{III} & >|\\ % |\end{nameauth}| % \end{quote} -% \cmd{\Fukuyama} produces \Fukuyama\ and \Fukuyama. Of course, you could type all-capital surnames without control sequences. Likewise, \cmd{\Howell} generates \Howell\ and \Howell. +% \cmd{\Howell} generates \Howell, then \Howell. The old syntax cannot be used with \LHowell. +% \clearpage % -% The old syntax cannot be used with \LHowell. For \LFukuyama, the old syntax would be: +% For Eastern names we have a related example that uses both the new syntax and the old syntax: % \begin{quote}\small\setstretch{1.1} % |\PretagName{\uppercase{Fukuyama}}[Takeshi]{Fukuyama Takeshi}|\\ % |\begin{nameauth}|\\ -% | \< OFukuyama & & \uppercase{Fukuyama} & Takeshi >|\\ +% | \< Fukuyama & & \uppercase{Fukuyama}, Takeshi & >|\\ +% | \< OFukuyama & & \uppercase{Fukuyama} & Takeshi >|\\ % |\end{nameauth}| % \end{quote} -% \cmd{\LOFukuyama} produces \LOFukuyama. \cmd{\OFukuyama} yields \OFukuyama. This form works with the new syntax form and is not distinct from it. It is the same as |\Name{\uppercase{FUKUYAMA}}[Takeshi]|. The caps macros will not work on it, apart from the examples in Section~\ref{sec:Hooksc}. -% \clearpage +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{rl}\toprule +% |\Fukuyama| & \Fukuyama\\ +% |\OFukuyama| & \OFukuyama\\ +% |\LOFukuyama| & \LOFukuyama\\ +% |\Fukuyama| & \Fukuyama\\\bottomrule +% \end{tabular} +% \end{center} +% The old syntax and new syntax inter-operate. The built-in capitalization macros will not work here. For an alternate solution, see Section~\ref{sec:Hooksc}. % -% \begin{center}\large\bfseries Other Technical Issues\end{center} -% \subsubsection{Fault Tolerance} +% \subsection{Spaces and Punctuation} % \label{sec:tolerance} % % The \textsf{nameauth} package protects against some typing errors. Adding extra spaces \emph{normally} does not produce unique names. The simplified interface also is fault-tolerant with spaces. The variations below illustrate this point: @@ -1478,9 +1552,7 @@ Running "make install" installs the files in the local TeX tree. % \end{tabular} % \end{center} % -% \subsubsection{Detecting Punctuation} -% -% In Western names, affixes like ``Jr.'' (junior), ``Sr.'' (senior), ``d.\,J.'' (\textit{der J\"ungere}), and ``d.\,\"A.'' (\textit{der \"Altere}) can collide with the full stop in a sentence. \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA} detect this in a name and gobble the subsequent full stop as needed: +% In Western names, affixes like ``Jr.'' (junior), ``Sr.'' (senior), ``d.\,J.'' (\textit{der J\"ungere}), and ``d.\,\"A.'' (\textit{der \"Altere}) can collide with the full stop in a sentence. \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA} detect this in the printed form of a name and gobble the subsequent full stop as needed: % % \begin{center}\footnotesize\setstretch{1.1}\ForgetName[Martin Luther]{King, Jr.} % \begin{tabular}{r@{\hbox to 1em{\hfil}}c@{\hbox to 1em{\hfil}}l}\toprule @@ -1491,34 +1563,46 @@ Running "make install" installs the files in the local TeX tree. % |\Name*[Martin Luther]{King, Jr.}.| & $2\rightarrow1$ & \Name*[Martin Luther]{King, Jr.}.\\ % |\Name*[Martin Luther]{King, Jr.}|\texttt{\textvisiblespace} & $1\rightarrow1$ & \Name*[Martin Luther]{King, Jr.}\\\bottomrule % \end{tabular} -% \end{center} +% \end{center} % Grouping tokens can frustrate this: |{\Name*[Martin Luther]{King, Jr.}}.| produces ``{\Name*[Martin Luther]{King, Jr.}}.'' (two periods). Enclosing |{Jr.}| within braces or a macro will do the same. If you must format the affix, leave the period outside: |\Name[Martin Luther]{\textsc{King}, \textsc{Jr}.}| Cf. Section~\ref{sec:nonenglish}. +% \clearpage +% +% \subsection{Formatting in the Text} +% \label{sec:formatting} +% +% There are two kinds of formatting at work: +% \begin{enumerate}\small +% \item \textbf{Syntactic Formatting:} The default includes reversing and capitalizing macros. Otherwise one must embed control sequences in name arguments. +% \item \textbf{Name Post-Processing:} The hook macros apply formatting to the final form that a name takes in the text. +% \end{enumerate} % -% \subsubsection{Format: Systems} -% \label{sec:FrontFormat} +% \DescribeMacro{\NamesFormat} +% \DescribeMacro{\FrontNamesFormat} +% \DescribeMacro{\MainNameHook} +% \DescribeMacro{\FrontNameHook} +% The\marginpar{\large\raggedleft\textsf{\bfseries 2.5}\strut} +% ``main-matter'' and ``front-matter'' systems are independent systems of formatting and first/subsequent name use. The main-matter system uses \cmd{\NamesFormat} to post-process first occurrences of names and \cmd{\MainNameHook} for subsequent uses. The front-matter system uses \cmd{\FrontNamesFormat} for first occurrences of names and \cmd{\FrontNameHook} for subsequent uses. The \texttt{alwaysformat} option causes every name to be formatted with the ``first-use'' hooks. % % \DescribeMacro{\NamesActive} % \DescribeMacro{\NamesInactive} % Using the \texttt{frontmatter} option or \cmd{\NamesInactive} causes the naming macros to use the front matter formatting hook until \cmd{\NamesActive} switches the macros to the independent main matter formatting hooks. Additionally, two independent systems of names are created: front-matter names and main-matter names. -% +% % Please\marginpar{\small\raggedleft\cmd{\global}} note that these two macros can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect. % -% By default, these two systems of names differ only between first and subsequent uses. Here we change the first-use formatting hooks (Section~\ref{sec:CustomHooks}) to show a greater distinction: +% By default, these two systems of names differ only between recognition of first and subsequent uses. We change the first-use formatting hooks in this section to show a greater distinction: % \begin{quote}\small\setstretch{1.1} % |\let\OldFormat\NamesFormat|\\ % |\let\OldFrontFormat\FrontNamesFormat|\\ % |\renewcommand*\NamesFormat{\scshape}|\\ % |\renewcommand*\FrontNamesFormat{\bfseries}| % \end{quote} -% \let\OldFormat\NamesFormat -% \let\OldFrontFormat\FrontNamesFormat -% \renewcommand*\NamesFormat{\scshape} -% \renewcommand*\FrontNamesFormat{\bfseries} -% \clearpage -% -% Here we switch to the ``front matter'' mode: -% \begin{quote}\small\setstretch{1.1}\cmd{\NamesInactive}\NamesInactive\\[0.4ex] -% \NamesInactive +% \let\OldFormat\NamesFormat\ignorespaces% +% \let\OldFrontFormat\FrontNamesFormat\ignorespaces% +% \renewcommand*\NamesFormat{\scshape}\ignorespaces% +% \renewcommand*\FrontNamesFormat{\bfseries}\ignorespaces% +% Now we switch to the ``front matter'' mode: +% \begin{quote}\small\setstretch{1.1} +% \NamesInactive\cmd{\NamesInactive}\NamesInactive\\[0.4ex] % \begin{tabular}{@{}ll} % |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\ % |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\ @@ -1526,9 +1610,9 @@ Running "make install" installs the files in the local TeX tree. % |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\ % \end{tabular} % \end{quote} -% % Then we switch back to ``main matter'' mode: -% \begin{quote}\small\setstretch{1.1}\cmd{\NamesActive}\NamesActive\\[0.4ex] +% \begin{quote}\small\setstretch{1.1} +% \cmd{\NamesActive}\NamesActive\\[0.4ex] % \begin{tabular}{@{}ll} % |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\ % |\Name[Rudolph]{Carnap}| & \Name[Rudolph]{Carnap}\\ @@ -1536,25 +1620,49 @@ Running "make install" installs the files in the local TeX tree. % |\Name[Nicolas]{Malebranche}| & \Name[Nicolas]{Malebranche}\\ % \end{tabular} % \end{quote} -% -% This\marginpar{\small\raggedleft\dbend} illustrates the independent systems or ``species'' of names. This is most useful when you want to format names one way in the regular body text but another way somewhere else. In footnotes, for example, we could redefine \cmd{\NamesFormat} to create custom formatting: +% \clearpage +% +% Below\marginpar{\small\raggedleft\dbend} we simulate the \texttt{alwaysformat} option by manipulating the package internals. After the examples, we reset the formatting hooks. +% \makeatletter\@nameauth@AlwaysFormattrue\makeatother% +% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}% +% \ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}% +% \begin{itemize} +% \item\NamesInactive Using \texttt{alwaysformat} in the front matter will produce: \Name[Albert]{Einstein}, then \Name[Albert]{Einstein}; \Name{Confucius}, then \Name{Confucius}. +% \item \global\NamesActive Using \texttt{alwaysformat} in the main matter will produce: \Name[M.T.]{Cicero}[Marcus Tullius], then \Name[M.T.]{Cicero}[Marcus Tullius]; \Name{Charles, the Bald}, then \Name{Charles, the Bald}. +% \end{itemize} +% \makeatletter\@nameauth@AlwaysFormatfalse\makeatother +% +% Basic\marginpar{\small\raggedleft\dbend} formatting changes can take either the font switch forms or the font command forms. The following also work: +% \begin{quote}\small\setstretch{1.1} +% |\renewcommand*\NamesFormat{\textsc}|\\ +% |\renewcommand*\FrontNamesFormat{\textbf}| +% \end{quote} +% That is because the formatting hooks are called in such a manner that lets them either have one argument or not and keeps their changes local via: +% \begin{quote}\small\setstretch{1.1} +% \cmd{\bgroup}\meta{Hook}|{#1}|\cmd{\egroup} +% \end{quote} +% +% The\marginpar{\small\raggedleft\dbend} previous examples illustrate the independent systems or ``species'' of names. This is most useful when you want to format names one way in the regular body text but another way somewhere else. In footnotes, for example, we could locally redefine \cmd{\NamesFormat} to create custom formatting: % \begin{quote}\small\setstretch{1.1} % |\makeatletter|\\ -% |\let\@oldfntext\@makefntext%|\hfill\texttt{save original macro}\\ +% |\let\@oldfntext\@makefntext|\\ % |\long\def\@makefntext#1{%|\\ -% | \renewcommand*\NamesFormat{\scshape}\@oldfntext{#1}}|\\ +% | \renewcommand*\NamesFormat{\itshape}\@oldfntext{#1}}|\\ % |\let\@makefntext\@oldfntext% just in case|\\ % |\makeatother| % \end{quote} % \makeatletter\ignorespaces% % \let\@oldfntext\@makefntext% -% \long\def\@makefntext#1{\renewcommand*\NamesFormat{\scshape}\@oldfntext{#1}}% +% \long\def\@makefntext#1{\renewcommand*\NamesFormat{\itshape}\@oldfntext{#1}}% % \makeatother% -% The problem is that \Name[John Maynard]{Keynes} in the text could affect formatting in the footnotes.\footnote{You get \Name[John Maynard]{Keynes} instead of \ForgetName[John Maynard]{Keynes}\Name[John Maynard]{Keynes}.} -% Instead of editing footnotes as needed by inserting \cmd{\ForgetName,} there is a different solution that uses the front-matter system: +% +% The problem above is that \Name[John Maynard]{Keynes} in the text affects formatting in the footnotes.\footnote{You get the name \cmd{\Name}\texttt{[John Maynard]\{Keynes\}} \Name[John Maynard]{Keynes} instead of \cmd{\ForgetName}\texttt{[John Maynard]\{Keynes\}}\cmd{\Name}\texttt{[John Maynard]\{Keynes\}} \ForgetName[John Maynard]{Keynes}\Name[John Maynard]{Keynes}.} +% Using \cmd{\ForgetName} to address this can be tedious. +% +% A different, simpler solution uses the front-matter system: % \begin{quote}\small\setstretch{1.1} % |\makeatletter|\\ -% |\let\@oldfntext\@makefntext%|\hfill\texttt{save original macro}\\ +% |\let\@oldfntext\@makefntext|\\ % |\long\def\@makefntext#1{%|\\ % | \NamesInactive\@oldfntext{#1}\NamesActive%|\\ % |}\makeatother| @@ -1563,102 +1671,352 @@ Running "make install" installs the files in the local TeX tree. % \long\def\@makefntext#1{\NamesInactive\@oldfntext{#1}\NamesActive}% % \makeatother% % Your footnotes do not affect the main body text now.\footnote{We have \Name[John Maynard]{Keynes}, then \Name[John Maynard]{Keynes}.} -% We change footnotes back to normal with the following: +% We change footnotes back to normal and restore the formatting hooks with the following: +% \begin{quote}\small\setstretch{1.1} +% |\makeatletter%|\\ +% |\let\@makefntext\@oldfntext%|\\ +% |\makeatother|\\[1ex] +% |\let\NamesFormat\OldFormat|\\ +% |\let\FrontNamesFormat\OldFrontFormat| +% \end{quote} % \makeatletter\ignorespaces% % \let\@makefntext\@oldfntext% % \makeatother% +% \let\NamesFormat\OldFormat% +% \let\FrontNamesFormat\OldFrontFormat% +% \clearpage +% +% \subsection{Indexing Macros} +% +% Current\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} versions of \textsf{nameauth} offer greater flexibility with indexing but still implement some error protection. We cover the indexing macros here because the later macros in this manual build on many of their concepts. +% +% \subsubsection{Indexing Control} +% \label{sec:SectionIndex} +% +% \DescribeMacro{\IndexActive} +% \DescribeMacro{\IndexInactive} +% Using the \texttt{noindex} option deactivates the indexing function of this package until \cmd{\IndexActive} occurs. Another macro, \cmd{\IndexInactive}, will deactivate indexing again. These can be used throughout the document. They work differently than \cmd{\ExcludeName} and \cmd{\IncludeName}, which leverage the cross-referencing system. +% \textbf{\cmd{\IndexInactive} also suppresses index sorting and tagging macros.} +% +% Please\marginpar{\small\raggedleft\cmd{\global}} note that these two macros can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect. +% +% \subsubsection{Indexing and \textsf{babel}} +% \label{sec:babel} +% Using\marginpar{\small\raggedleft \textsf{texindy}} \textsf{babel} with Roman page numbers will put \cmd{\textlatin} in the index entries if one includes a language that does not use the Latin alphabet\,---\,even if the main language does. The \texttt{texindy} program will ignore such references. This issue can affect \textsf{nameauth}. +% +% One fairly effective workaround for \texttt{texindy} redefines \cmd{\textlatin} to produce the page number itself within a certain scope like: % \begin{quote}\small\setstretch{1.1} -% |\makeatletter%|\\ -% |\let\@makefntext\@oldfntext%|\\ -% |\makeatother| +% |\newcommand\fixindex[1]{\def\textlatin##1{##1}#1}|\\\dots\\ +% |\fixindex{| \meta{paragraphs of running text} |}| +% \end{quote} +% Of course, one can opt to check if \cmd{\textlatin} is defined, save its value, redefine it, then restore it, perhaps even in an environment. +% +% \subsubsection{Index Entries} +% \label{sec:IndexName} +% +% \DescribeMacro{\IndexName} +% The naming macros (\cmd{\Name}, etc.) use this macro to create index entries. Direct use of \cmd{\IndexName} is available also to users. It prints nothing in the body text. The syntax is: +% \begin{quote}\small +% \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% +% \cmd{\IndexName} complies with the new syntax, where a suffixed pair in \meta{SNN} is a name/affix pair that can be ancient or Eastern. If \meta{FNN} are present, it ignores \meta{Alternate names} for Western and native Eastern name forms. Otherwise, if \meta{FNN} are absent, \cmd{\IndexName} sees \meta{Alternate names} as an affix or Eastern forename using the old syntax. +% +% If used after \cmd{\IndexInactive} this macro does nothing until \cmd{\IndexActive} appears. It will not create index entries for names used as cross-references by \cmd{\IndexRef} and \cmd{\AKA}. This provides a basic level of error protection. +% +% The indexing mechanism in the \textsf{nameauth} package follows \emph{Chicago Manual of Style} standards regarding Western names and affixes. Thus the name \LChes\ becomes ``Sullenberger, Chesley B., III'' in the index. +% +% \subsubsection{Index Cross-References} +% \label{sec:IndexXref} +% +% \DescribeMacro{\IndexRef} +% The\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} cross-referencing macros (\cmd{\AKA}, etc.) use this macro. Also available to users, \cmd{\IndexRef} creates a \emph{see} reference by default from the name defined by its first three arguments to whatever one puts in the final argument. The syntax is: +% \begin{quote}\small +% \cmd{\IndexRef}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{reference target} +% \end{quote} +% +% The name used for the cross-reference is parsed in the same way as by \cmd{\IndexName}. The final argument is neither parsed nor checked to see if a corresponding main entry exists. For example, to cross-reference ``Sun King'' with \Name*{Louis, XIV} use: \cmd{\IndexRef}\texttt{\{Sun King\}\{Louis XIV\}}\IndexRef{Sun King}{Louis XIV}. +% +% {\bfseries You are encouraged to see page~\pageref{page:manualxref} for handling cases of complex cross-references with either \cmd{\AKA} or \cmd{\IndexRef}.}\medskip +% +% \DescribeMacro{\SeeAlso} +% One\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} can precede \cmd{\IndexRef}, \cmd{\AKA}, or \cmd{\PName} with \cmd{\SeeAlso} to produce a \emph{see also} reference for a name that has appeared already in the index.\footnote{When the \texttt{verbose} option is selected, \cmd{\IndexRef} warns that a name once used as a page number entry is now being used as a cross-reference. It also warns when one attempts to redefine or alter an established cross-reference.} +% However, this should be used with caution, as the following points indicate: +% \begin{itemize}\small +% \item Once a cross-reference is created, that name cannot be used for page number entries. ``Bar\dots 10, \emph{see also} Foo'' means that one cannot have an entry for ``Bar'' after page 10. +% \item The target of a reference, however, remains available. ``Bar\dots 10, \emph{see also} Foo'' means that an entry for ``Foo\dots 12, 13'' is okay. +% \item A \emph{see} reference has no page references before it. ``Bar\dots 10, \emph{see} Foo'' is an invalid index entry. +% \item A \emph{see also} reference appears after extant page references. ``Bar\dots 10, \emph{see also} Foo'' is just fine, but ``Bar\dots 10, \emph{see also} Foo, 11, 14'' is invalid. +% \item Having \emph{see} and \emph{see also} references on different index entry lines is suppressed. One can use \cmd{\IndexRef} to group reference targets in one entry. ``Bar\dots 10, \emph{see also} Foo; Baz'' is better than ``Bar\dots 10, \emph{see also} Foo; \emph{see also} Baz.''\footnote{Professional indexers often use programs like \texttt{cindex} that enforce a rigorous, standard methodology and syntax. The \textsf{nameauth} package likewise tries to follow suit.} +% \end{itemize} +% +% \cmd{\IndexRef} causes an index tag with the format \meta{some text}\verb+|+\meta{some function} to be reduced to \meta{some text} in the cross-reference. This allows cross-references to work with any index function text used by \cmd{\TagName} (Section~\ref{sec:indextag}).\medskip +% +% \DescribeMacro{\ExcludeName} +% This\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} macro prevents a name from being used as either an index entry or as an index cross-reference. It can be used at any point in the document. It ignores extant cross-references. The syntax is: +% \begin{quote}\small +% \cmd{\ExcludeName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% +% For example, you will not see any index references for the following names. We show formatting with \textbf{boldface}: +% \begin{quote}\small\setstretch{1.1}\def\NamesFormat{\bfseries}\ExcludeName[Kris]{Kringle}\ExcludeName[Santa]{Claus} +% |\ExcludeName[Kris]{Kringle}|\\ +% |\Name[Kris]{Kringle}| and |\Name[Kris]{Kringle}|:\\ +% \Name[Kris]{Kringle} and \Name[Kris]{Kringle}. \cmd{\ForgetName} will give us a first-use name again: \ForgetName[Kris]{Kringle}\Name[Kris]{Kringle}, then \Name[Kris]{Kringle}.\\[1ex] +% |\ExcludeName[Santa]{Claus}|\\ +% |\AKA[Kris]{Kringle}[Santa]{Claus}|\\ \AKA[Kris]{Kringle}[Santa]{Claus} (not formatted by \cmd{\AKA}). +% \end{quote} +% +% This can be used to prevent references in the index after you are done with a name. Unlike \cmd{\IndexInactive} and \cmd{\IndexActive} this macro does not suspend the indexing system, but only works on a per-name basis. +% +% \DescribeMacro{\IncludeName} +% \DescribeMacro{\IncludeName*} +% Feel\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} like breaking the indexing rules set by \textsf{nameauth}? Some might want to do things differently. These macros have the same syntax as \cmd{\ExcludeName}: +% \begin{quote}\small +% \cmd{\IncludeName\ }\oarg{FNN}\marg{SNN}\oarg{Alternate names}\\ +% \cmd{\IncludeName*}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% The unstarred form of \cmd{\IncludeName} only removes the exclusion placed on a page-number entry by \cmd{\ExcludeName}. The starred form of \cmd{\IncludeName} makes the \textsf{nameauth} macros forget about both an exclusion and a cross-reference. +% +% For example, we used |\ExcludeName{Attila, the Hun}| after his appearance in Section~\ref{sec:simplestart}. Using \cmd{\IfAKA} from Section~\ref{sec:tests} tells us that, ``\IfAKA{Attila, the Hun}{Attila is a cross-reference}{Attila is a name}{Attila is excluded}.'' +% Now if we |\IncludeName{Attila, the Hun}|\IncludeName{Attila, the Hun}, a reference to \Name{Attila, the Hun} will create an index entry on this page. \cmd{\IfAKA} now tells us that, ``\IfAKA{Attila, the Hun}{Attila is a cross-reference}{Attila is a name}{Attila is excluded}.'' +% +% In similar fashion, using \cmd{\IfAKA} on the cross-reference ``Jay Rockefeller'' that we created in Section~\ref{sec:simplestart} tells us that ``\IfAKA[Jay]{Rockefeller}{Jay is a cross-reference}{Jay is a name}{Jay is excluded}.'' If we use the unstarred form |\IncludeName[Jay]{Rockefeller}|\IncludeName[Jay]{Rockefeller}, we still get ``\IfAKA[Jay]{Rockefeller}{Jay is a cross-reference}{Jay is a name}{Jay is excluded}.'' Nothing happened because cross-references are given extra protection. Yet |\IncludeName*[Jay]{Rockefeller}|\IncludeName*[Jay]{Rockefeller} produces ``\IfAKA[Jay]{Rockefeller}{Jay is a cross-reference}{Jay is a name}{Jay is excluded}.'' +% Now all protection of ``Jay Rockefeller'' is removed and we can do anything to it. +% +% \subsubsection{Index Sorting} +% \label{sec:IndexSort} +% +% The general practice for sorting with \texttt{makeindex -s} involves creating your own |.ist| file (pages 659--65 in \emph{The Latex Companion}). Otherwise the following form works with both \texttt{makeindex} and \texttt{texindy}: |\index{|\meta{sort key}|@|\meta{actual}|}| +% +% \begin{center}\bfseries Basic Sorting (Makeindex)\end{center} +% +% \DescribeMacro{\PretagName} +% \noindent The \marginpar{\large\raggedleft\textsf{\bfseries 2.0}\strut} +% \textsf{nameauth} package integrates this sort of index sorting automatically by using a ``pretag.'' The syntax is: +% \begin{quote}\small +% \cmd{\PretagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} % \end{quote} % -% At this point we could restore the formatting hooks, but we will do that in the next section. We would do that by scoping or with: +% \cmd{\PretagName} creates a sort key terminated with the ``actual'' character, which is |@| by default. Do not include the ``actual'' character in the ``pretag.'' +% For example: % \begin{quote}\small\setstretch{1.1} -% |\let\NamesFormat\OldFormat|\\ -% |\let\FrontNamesFormat\OldFrontFormat|\\ +% |\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan}|\\ +% |\PretagName{Æthelred, II}{Aethelred 2}| % \end{quote} +% One need only ``pretag'' names once in the preamble. Every time that one refers to \Name*[Jan]{Łukasiewicz} or \Name*{Æthelred, II}, the proper index entry will be created. If you create a cross-reference with \cmd{\AKA} and you want to ``pretag'' it, see Section~\ref{sec:AKA}. % \clearpage % -% \subsubsection{Format: Hooks} -% \label{sec:CustomHooks} +% Although the \cmd{\PretagName} macro might look similar to the the other tagging macros, its use and scope is quite a bit different: +% \begin{itemize}\small +% \item You can ``pretag'' any name and any cross-reference. +% \item You can ``tag'' and ``untag'' only names, not cross-references. +% \item There is no command to undo a ``pretag.'' +% \end{itemize} % -% There are two kinds of formatting at work: -% \begin{enumerate}\small -% \item \textbf{Syntactic Formatting:} For the English default, this includes what the reversing and capitalizing macros do. For the alternatives, it includes any control sequences embedded in the macro arguments. -% \item \textbf{Name Post-Processing:} This happens in the hook macros after a name has been parsed into the final form it will take in the text. -% \end{enumerate} +% \DescribeMacro{\IndexActual} +% If you need to change the ``actual'' character, such as with \texttt{gind.ist}, you would put |\IndexActual{=}| in the preamble before any use of \cmd{\PretagName}. % -% \DescribeMacro{\NamesFormat} -% \DescribeMacro{\FrontNamesFormat} -% \DescribeMacro{\MainNameHook} -% \DescribeMacro{\FrontNameHook} -% Starting with version 2.5, the ``main-matter'' and ``front-matter'' systems are fully qualified and independent systems of formatting and first/subsequent name use. The main-matter system uses \cmd{\NamesFormat} to post-process first occurrences of names and \cmd{\MainNameHook} to post-process subsequent uses. The front-matter system uses \cmd{\FrontNamesFormat} to post-process first occurrences of names and \cmd{\FrontNameHook} to post-process subsequent uses. The \texttt{alwaysformat} option causes every name to be typeset as a ``first-use.''\medskip +% \begin{center}\bfseries Extra Spaces and Sorting\end{center} +% +% \noindent Under\marginpar{\small\raggedleft\dbend} NFSS, active Unicode characters expand to add one or two spaces after control sequences. See \cmd{\indexentry} and \cmd{\item} entries in your \texttt{idx} and \texttt{ind} files. For example, \texttt{ä} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\"a}\}} (one space added) and \texttt{Æ} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\AE\textvisiblespace}\}} (two spaces added). +% +% Section~\ref{sec:Unicode} shows how this is related to the number of times the active character must be expanded. The character \texttt{Æ} must expand twice, through both \cmd{\IeC} and \cmd{\T1}, while \texttt{ä} expands only once through \cmd{\IeC} to a letter. The character \texttt{ß} (\emph{scharfes Ess, Esszett}) below expands twice. +% +% Both \texttt{xelatex} and \texttt{lualatex} (using \textsf{fontspec}) avoid these issues by handling the characters natively. That produces the following: +% \begin{quote}\small\setstretch{1.1} +% NFSS: |\index{Fußball}| $\rightarrow$ \cmd{\indexentry}\ignorespaces% +% \texttt{\{Fu\cmd{\IeC\textvisiblespace}\{\cmd{\ss\textvisiblespace}\}ball\}\{}\ignorespaces% +% \meta{page}\texttt{\}} +% +% fontspec: |\index{Fußball}| $\rightarrow$ \cmd{\indexentry}\texttt{\{Fußball\}\{}\meta{page}\texttt{\}} +% +% cseq: |\index{Fu\ss ball}| $\rightarrow$ \cmd{\indexentry}\texttt{\{Fu\cmd{\ss\textvisiblespace}ball\}\{}\meta{page}\texttt{\}} +% \end{quote} +% +% A macro with the general form below, similar to \cmd{\IndexName}, will add two spaces after \emph{other} control sequences that are expanded multiple times. Those spaces only affect index sorting, not appearance. Remember this when using manual index entries with \textsf{nameauth}: +% \begin{quote}\small\setstretch{1.1} +% |\newcommand\IndexExample[1]{%|\\ +% \hbox{}\qquad|\protected@edef\argument{#1}\index{\argument}}%| +% +% |\IndexExample{\textsc{football}}| $\rightarrow$\\ \hbox{}\qquad\ignorespaces% +% \cmd{\indexentry}\ignorespaces% +% \texttt{\{\cmd{\textsc\textvisiblespace\textvisiblespace}\ignorespaces% +% \{football\}\}\{}\meta{page}\texttt{\}} +% +% |\index{\textsc{football}}| $\rightarrow$\\ \hbox{}\qquad\ignorespaces% +% \cmd{\indexentry}\ignorespaces% +% \texttt{\{\cmd{\textsc}\ignorespaces% +% \{football\}\}\{}\meta{page}\texttt{\}} +% \end{quote} +% +% These are not the only instances of macros inserting extra spaces. If something is off in the index, the best advice is to look at the \texttt{idx} or \texttt{ind} files. You can use the \textsf{verbatim} package to look at the \texttt{ind} file within your job itself: +% \begin{quote}\small +% |\usepackage{verbatim}|\\ +% |\newif\ifdebug|\\[1ex] +% |\ifdebug|\\ +% | \verbatiminput{\jobname.ind}|\\ +% |\fi| +% \end{quote} +% \clearpage +% +% \subsubsection{Index Tags} +% \label{sec:indextag} +% +% \DescribeMacro{\TagName} +% This macro creates an index tag that will be appended to all index entries for a corresponding \cmd{\Name} from when it is invoked until the end of the document or a corresponding \cmd{\UntagName}. Both \cmd{\TagName} and \cmd{\UntagName} handle their arguments like \cmd{\IndexName}. If global tags are desired, tag names in the preamble. +% \begin{quote}\small +% \cmd{\TagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} +% \end{quote} +% +% Tags are not ``pretags.'' To help sort that out, we look at what gets affected by these commands: % -% \noindent{\bfseries Front Matter} -% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}\ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald} % \begin{center}\small\setstretch{1.1} -% \NamesInactive -% \begin{tabular}{ll}\toprule -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\ -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule -% |\Name{Confucius}| & \Name{Confucius}\\ -% |\Name{Confucius}| & \Name{Confucius}\\\midrule -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\ -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\ -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule +% \begin{tabular}{r@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}l} +% & \cmd{\PretagName} & \\ +% |\index{| & |Aethelred 2@| & |Æthelred II| & |, king}|\\ +% & & & \cmd{\TagName} and \cmd{\UntagName}\\ % \end{tabular} -% \end{center}\medskip +% \end{center} +% +% All the tagging commands use the name arguments as a reference point. \cmd{\PretagName} generates the leading sort key while \cmd{\TagName} and \cmd{\UntagName} affect the trailing content of the index entry. % -% \noindent{\bfseries Main Matter} +% Tags created by \cmd{\TagName} can be helpful in the indexes of history texts, as can other package features. Below, \cmd{\TagName} causes the \textsf{nameauth} indexing macros to append ``\texttt{,\textvisiblespace pope}'' to the index entries for \Name*{Gregory, I} and \Name*{Leo, I}: % \begin{center}\small\setstretch{1.1} -% \begin{tabular}{ll}\toprule -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\ -% |\Name[Albert]{Einstein}| & \Name[Albert]{Einstein}\\\midrule -% |\Name{Confucius}| & \Name{Confucius}\\ -% |\Name{Confucius}| & \Name{Confucius}\\\midrule -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\ -% |\Name[M.T.]{Cicero}[Marcus Tullius]| & \Name[M.T.]{Cicero}[Marcus Tullius]\\\midrule -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\ -% |\Name{Charles, the Bald}| & \Name{Charles, the Bald}\\\bottomrule +% \begin{tabular}{ll} +% |\TagName{Leo, I}{, pope}| & (in the preamble)\\ +% |\TagName{Gregory, I}{, pope}| \\ +% \dots\\ +% |\Name*{Leo, I} was known as| & \Name*{Leo, I} was known as\\ +% |\AKA{Leo, I}{Leo}[the Great].| & \AKA{Leo, I}{Leo}[the Great].\\ +% \dots\\ +% |\Name{Gregory,| |I}| |``\ForceFN%| & \Name{Gregory, I} ``\ForceFN\AKA*{Gregory, I}{Gregory}[the Great],''\\ +% |\AKA*{Gregory,| |I}{Gregory}%| & another pope.\\ +% |[the Great],''| |another| |pope.|\\ % \end{tabular} -% \end{center}\medskip +% \end{center} % -% Below\marginpar{\small\raggedleft\dbend} we simulate the \texttt{alwaysformat} option by manipulating the package internals. We see that this option does not force long name forms. After the examples, we reset the formatting hooks. -% \makeatletter\@nameauth@AlwaysFormattrue\makeatother% -% \ForgetName[Albert]{Einstein}\ForgetName{Confucius}% -% \ForgetName[M.T.]{Cicero}\ForgetName{Charles, the Bald}% -% \begin{itemize} -% \item\NamesInactive Using \texttt{alwaysformat} in the front matter will produce: \Name[Albert]{Einstein}, then \Name[Albert]{Einstein}; \Name{Confucius}, then \Name{Confucius}. -% \item \global\NamesActive Using \texttt{alwaysformat} in the main matter will produce: \Name[M.T.]{Cicero}[Marcus Tullius], then \Name[M.T.]{Cicero}[Marcus Tullius]; \Name{Charles, the Bald}, then \Name{Charles, the Bald}. -% \end{itemize} -% \makeatletter\@nameauth@AlwaysFormatfalse\makeatother -% \let\NamesFormat\OldFormat -% \let\FrontNamesFormat\OldFrontFormat +% Tags are literal text that can be daggers, asterisks, and even specials. For example, all fictional names in the index of this manual are tagged with an asterisk. One must add any desired spacing to the start of the tag. Tagging aids scholarly indexing and can include life/regnal dates and other information. +% +% \cmd{\TagName} works with all name types, not just medieval names. Back in Section~\ref{sec:start} we had the example of \AKA[J.E.]{Carter, Jr.}[Jimmy]{Carter} (cross-reference in the index). \cmd{\TagName} adds ``\texttt{,\textvisiblespace president}'' to his index entry\IndexName[J.E.]{Carter, Jr.}. +% +% You\marginpar{\small\raggedleft\dbend} can use the \marg{tag} field of \cmd{\TagName} to add ``specials'' to index entries for names. Every name in this manual is tagged with at least \verb!|hyperpage! to allow hyperlinks in the index using the \textsf{ltxdoc} class and \textsf{hypdoc} package. You may have to use \cmd{\string} before \verb!|hyperpage! where a vertical bar is active. For example, the following will produce a special index entry with no page number: +% \begin{quote}\small\setstretch{1.1} +% |\newcommand\orphan[2]{#1}|\\ +% \verb+\TagName{Sine Nomine}{\string|orphan{(Sine Pagina)}}+ +% \end{quote} +% \newcommand\orphan[2]{#1}\TagName{Sine Nomine}{\string|orphan{(Sine Pagina)}}% +% Using |\Name{Sine Nomine}| \Name{Sine Nomine} here will generate this entry in the \texttt{ind} file: |\item Sine Nomine\pfill \orphan{(Sine Pagina)}{29}|. One can use this method to create special index entries via \cmd{\IndexName}, then ``protect'' the names used with \cmd{\ExcludeName} after the entries have been created. +% \clearpage +% +% \DescribeMacro{\UntagName} +% \cmd{\TagName} will replace one tag with another tag, but it does not remove a tag from a name. That is the role of \cmd{\UntagName}. The syntax is: +% \begin{quote}\small +% \cmd{\UntagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% +% By using \cmd{\TagName} and \cmd{\UntagName}, one can disambiguate different people with the same name. For example, using macros from Section~\ref{sec:tweaks}: +% +% \begin{quote}\small\setstretch{1.1} +% \ttfamily This refers to |\Name[John]{Smith}|.\\ +% Now another |\ForgetName[John]{Smith}%|\\ +% |\TagName[John]{Smith}{ (second)}\Name[John]{Smith}|.\\ +% Then a third |\ForgetName[John]{Smith}%|\\ +% |\TagName[John]{Smith}{ (third)}\Name[John]{Smith}|.\\ +% Then the first |\UntagName[John]{Smith}\Name*[John]{Smith}|. +% +% \normalfont This refers to \Name[John]{Smith}.\\ +% Now another \ForgetName[John]{Smith}\TagName[John]{Smith}{* (second)\string|hyperpage}\Name[John]{Smith}.\\ +% Then a third \ForgetName[John]{Smith}\TagName[John]{Smith}{* (third)\string|hyperpage}\Name[John]{Smith}.\\ +% Then the first \TagName[John]{Smith}{*\string|hyperpage}\Name*[John]{Smith}. +% \end{quote} +% +% The tweaking macros \cmd{\ForgetName} and \cmd{\SubvertName} make it seem like you are dealing with three people who have the same name. The index tags will group together those entries with the same tag.\footnote{Since this document, unlike the example above, puts an asterisk by all fictional names in the index, it puts an asterisk at the beginning of the tags above and does not \cmd{\UntagName} \Name*[John]{Smith}, but retags him with an asterisk again.} +% +% \subsection{``Text Tags''} +% \label{sec:tagtext} +% +% Section~\ref{sec:indextag} deals with similar tagging features in the index. ``Text tags'' differ from index tags because they are not printed automatically with every name managed by \textsf{nameauth}. +% +% These ``text tags'' are a name information database. The macros in this section are named accordingly. Section~\ref{sec:Hooksb} offers additional examples.\medskip +% +% \DescribeMacro{\NameAddInfo} +% Text tags are independent of any other name conditionals, similar to index tags. This \cmd{\long} macro's syntax is: +% \begin{quote}\small +% \cmd{\NameAddInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} +% \end{quote} +% +% For example, |\NameAddInfo[George]{Washington}{(1732--99)}|\NameAddInfo[George]{Washington}{(1732--99)} will associate the text ``\NameQueryInfo[George]{Washington}'' with the name ``\LWash.'' Note, however, that the tag does not print automatically with the name.\medskip +% +% \DescribeMacro{\NameQueryInfo} +% To retrieve the information in a text tag, one uses the name as a key to the corresponding information: +% \begin{quote}\small +% \cmd{\NameQueryInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% \NameAddInfo[Ulysses S.]{Grant}{(president 1869--77)}% +% \NameAddInfo[Schuyler]{Colfax}{\footnote{Seventeenth vice-president of the US during the first term (1869--73) of \Name[Ulysses S.]{Grant}~\NameQueryInfo[Ulysses S.]{Grant}.}}% +% Thus, |``\NameQueryInfo[George]{Washington}.''| expands to ``\NameQueryInfo[George]{Washington}.'' As with index tags, one can put a space at the start of a tag\,---\,or not, depending on the use. Sections~\ref{sec:indextag} and~\ref{sec:Hooksa}f. illustrate how this can permit tags like asterisks, daggers, and footnotes, such as one for \Name[Schuyler]{Colfax}.\NameQueryInfo[Schuyler]{Colfax} % \clearpage % +% The source for the previous example looks like: +% \begin{quote}\small\setstretch{1.1} +% |\NameAddInfo[Ulysses S.]{Grant}{(president 1869--77)}%|\\ +% |\NameAddInfo[Schuyler]{Colfax}%|\\ +% |{\footnote{Seventeenth vice-president of the US during%|\\ +% |the first term (1869--73) of \Name[Ulysses S.]{Grant}~%|\\ +% |\NameQueryInfo[Ulysses S.]{Grant}.}}|\\ +% \texttt{\dots}\\ +% |\Name[Schuyler]{Colfax}.\NameQueryInfo[Schuyler]{Colfax}| +% \end{quote} +% +% By using these text tag macros with the conditional macros, one can display information associated with a name based on whether or the name has occurred. For the example below, we turn indexing off: +% \begin{quote}\small\IndexInactive +% {\setstretch{1.1}\begin{verbatim} +%\NameAddInfo{Sam} +%{% +% \IfMainName{Freddy}% +% {\Name{Freddy}'s sidekick}% +% {a young gardener with a Midlands accent}% +%} +%There is \Name{Sam}. He is \NameQueryInfo{Sam}. +%Then \Name{Sam} met \Name{Freddy}, who lives% +%with his posh uncle \Name{Bill}. +%Now he is \NameQueryInfo{Sam} on a quest to save the realm. +% \end{verbatim}}\vspace{-2ex} +% \NameAddInfo{Sam}{\IfMainName{Freddy}{\Name{Freddy}'s sidekick}{a young gardener with a Midlands accent}} +% There is \Name{Sam}. He is \NameQueryInfo{Sam}.\\ +% Then \Name{Sam} met \Name{Freddy}, who lives with his posh uncle \Name{Bill}.\\ +% Now he is \NameQueryInfo{Sam} on a quest to save the realm. +% \end{quote} +% +% \DescribeMacro{\NameClearInfo} +% \cmd{\NameAddInfo} will replace one text tag with another text tag, but it does not delete a text tag. That is the role of \cmd{\NameClearInfo}. The syntax is: +% \begin{quote}\small +% \cmd{\NameClearInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names} +% \end{quote} +% +% For example, |\NameClearInfo[George]{Washington}|\NameClearInfo[George]{Washington} will cause the macro |``\NameQueryInfo[George]{Washington}''| to produce nothing. +% % \subsection{Name Decisions} % \subsubsection{Testing Decisions} % \label{sec:tests} % -% The macros in this section permit conditional text that depends on the presence or absence of a name. These macros use \cmd{\If}\textbf{\dots} because they differ from regular |\if| expressions. The following macros affect conditional branching: \cmd{\Name,} \cmd{\Name*,} \cmd{\FName,} \cmd{\PName,} \cmd{\AKA,} \cmd{\AKA*,} \cmd{\ForgetName,} \cmd{\SubvertName,} and \cmd{\ExcludeName.} One might consider some uses: +% The macros in this section permit conditional text that depends on the presence or absence of a name. These macros use \cmd{\If}\textbf{\dots} because they differ from regular |\if| expressions. The following macros affect conditional branching: \cmd{\Name}, \cmd{\Name*}, \cmd{\FName}, \cmd{\PName}, \cmd{\AKA}, \cmd{\AKA*}, \cmd{\ForgetName}, \cmd{\SubvertName}, \cmd{\ExcludeName}, \cmd{\IncludeName}, and \cmd{\IncludeName*}. Uses might include: % \begin{itemize}\small -% \item a book where one includes a margin paragraph, mini-bio, footnote, or other information when a name is first introduced +% \item a book where one ties information to the first mention of a name, like a ``text tag,'' margin paragraph, mini-bio, footnote, etc. % \item a game book where you have to pick a game path % \item a presentation that can change if certain names are present -% \item the ``text tag'' features in Section~\ref{sec:tagtext} % \item conditional comments using the \textsf{comment}, \textsf{pdfcomment}, and similar packages % \end{itemize} % % If one uses these macros inside other macros or passes control sequences to them, the expansion of control sequences can create false results (see \emph{The \TeX book}, 212--15). To get around those problems, consider using the following: % \begin{itemize}\small % \item Use token registers to retrieve the arguments. -% \item Regulate expansion with \cmd{\expandafter,} \cmd{\noexpand,} etc. +% \item Regulate expansion with \cmd{\expandafter}, \cmd{\noexpand}, etc. % \item That affects accented characters in \texttt{pdflatex}/NFSS. % \end{itemize} % -% See Sections~\ref{sec:Hooksb} and~\ref{sec:Hooksc} for related ideas about tokens and expansion. Using \cmd{\tracingmacros,} \cmd{\show,} or \cmd{\meaning} can help you.\medskip +% See Sections~\ref{sec:Hooksb} and~\ref{sec:Hooksc} for related ideas about tokens and expansion. Using \cmd{\tracingmacros}, \cmd{\show}, or \cmd{\meaning} can help you. % % \DescribeMacro{\IfMainName} % If you want to produce output or perform a task based on whether a ``main body'' name exists, use \cmd{\IfMainName}, whose syntax is: @@ -1671,20 +2029,19 @@ Running "make install" installs the files in the local TeX tree. % \begin{quote}\small % |\IfMainName[Bob]{Hope}{I met Bob}{I have not met Bob}| % \end{quote}% -% Please note that this test is not affected by the use of \cmd{\IndexName.} Since we have encountered \Name*[Johann]{Andreä}, we get ``\IfMainName[Johann]{Andreä}{I met Johann}{I have not met Johann}'' with a similar example: +% Please note that this test is not affected by the use of \cmd{\IndexName}. Since we have encountered \Name*[Johann]{Andreä}, we get ``\IfMainName[Johann]{Andreä}{I met Johann}{I have not met Johann}'' with a similar example: % \begin{quote}\small\setstretch{1.1} % |\IfMainName[Johann]{Andreä}{I met Johann}%|\\| {I have not met Johann}| % \end{quote} -% \clearpage % % \DescribeMacro{\IfFrontName} % If you want to produce output or perform a task based on whether a ``front matter'' name exists, use \cmd{\IfFrontName}, whose syntax is: % \begin{quote}\small % \cmd{\IfFrontName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{yes}\marg{no} % \end{quote} -% This macro works the same as \cmd{\IfMainName.} A ``front matter'' name is not capable of being formatted by this package, \emph{i.e.}, one created by the naming macros when the \texttt{frontmatter} option is used or after \cmd{\NamesInactive}. It is distinguished from those names that occur in the main matter and those that have been used as cross-references. +% This macro works the same as \cmd{\IfMainName}. A ``front matter'' name is created by the naming macros when the \texttt{frontmatter} option is used or after \cmd{\NamesInactive}. It is distinguished from those names that occur in the main matter and those that have been used as cross-references. % -% \label{page:Carnap}For example, based on Section~\ref{sec:FrontFormat}, we see that ``\ignorespaces +% \phantomsection\label{page:Carnap}For example, based on Section~\ref{sec:formatting}, we see that ``\ignorespaces % \IfFrontName[Rudolph]{Carnap}% % {\IfMainName[Rudolph]{Carnap}% % {\Name[Rudolph]{Carnap} is both}% @@ -1701,24 +2058,31 @@ Running "make install" installs the files in the local TeX tree. % | {\Name[Rudolph]{Carnap} is only formatted}%|\\ % | {\Name[Rudolph]{Carnap} is not mentioned}}| % \end{quote}% -% Please refer to Sections~\ref{sec:Tweaks} and~\ref{sec:LocalNames} to understand the scope and operation of main- and front-matter names.\medskip +% Please refer to Sections~\ref{sec:tweaks} and~\ref{sec:LocalNames} to understand the scope and operation of main- and front-matter names.\medskip +% \clearpage % % \DescribeMacro{\IfAKA} -% If you want to produce output or perform a task based on whether a ``\emph{see}-reference'' name exists, use \cmd{\IfAKA}, whose syntax is: +% If you want to produce output or perform a task based on whether a cross-reference name exists, use \cmd{\IfAKA}, whose syntax is: % \begin{quote}\small % \cmd{\IfAKA}\oarg{FNN}\marg{SNN}\oarg{Alt. names}\marg{y}\marg{n}\marg{excluded} % \end{quote} -% This macro works similarly to \cmd{\IfMainName,} although it has an additional \meta{excluded} branch in order to detect those names excluded from indexing by \cmd{\ExcludeName} (Section~\ref{sec:exclude}). +% This macro works similarly to \cmd{\IfMainName}, although it has an additional \meta{excluded} branch in order to detect those names excluded from indexing by \cmd{\ExcludeName} (Section~\ref{sec:IndexXref}). % -% A ``\emph{see}-reference'' name is printed in the body text but only exists as a cross-reference created by \cmd{\AKA} and \cmd{\AKA*}. First, in the text we see ``\AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller},'' |\AKA[John David]{Rockefeller, IV}[Jay]{Rockefeller}|. Next, we have the following example: +% A cross-reference name is created by \cmd{\IndexRef}, \cmd{\AKA}, and \cmd{\AKA*}. The following example illustrates how we use this macro: +% \begin{enumerate} +% \item In the text we refer to \Name[Jesse]{Ventura}, |\Name[Jesse]{Ventura}|. +% \item We establish his lesser-known legal name as an alias: ``\AKA[Jesse]{Ventura}[James]{Janos},'' |\AKA[Jesse]{Ventura}[James]{Janos}|. +% +% \item We construct the following test: % \begin{quote}\small\setstretch{1.1} -% |\IfAKA[Jay]{Rockefeller}%|\\ -% | {\LJRIV\ has an alias}%|\\ -% | {\LJRIV\ has no alias}%|\\ -% | {\LJRIV\ is excluded}| +% |\IfAKA[James]{Janos}%|\\ +% | {\Name[Jesse]{Ventura} has an alias}%|\\ +% | {\Name[Jesse]{Ventura} has no alias}%|\\ +% | {\Name[Jesse]{Ventura} is excluded}| % \end{quote} -% This gives us ``\IfAKA[Jay]{Rockefeller}{\LJRIV\ has an alias}{\LJRIV\ has no alias}{\LJRIV\ is excluded}.'' If you are confident that you will not be dealing with names generated by \cmd{\ExcludeName} then you can just leave the \meta{excluded} branch as |{}.| -% \clearpage +% \item This gives us ``\IfAKA[James]{Janos}{\Name[Jesse]{Ventura} has an alias}{\Name[Jesse]{Ventura} has no alias}{\Name[Jesse]{Ventura} is excluded}.'' +% \end{enumerate} +% If you are confident that you will not be dealing with names generated by \cmd{\ExcludeName} then you can just leave the \meta{excluded} branch as |{}.| % % A similar use of |\IfAKA{Confucius}| tells us that ``\IfAKA{Confucius}{\Name{Confucius} is an alias}{\Name{Confucius} is not an alias}{}.'' Yet we should test that completely: % \begin{quote}\small\setstretch{1.1} @@ -1737,8 +2101,7 @@ Running "make install" installs the files in the local TeX tree. % |}%|\\ % |{|\meta{excluded}|}| % \end{quote} -% -% Here we test for a name used with \cmd{\ExcludeName} (Section~\ref{sec:exclude}) to get the result, ``\ExcludeName{Grinch}\IfAKA{Grinch}{\Name{Grinch} is an alias}{\Name{Grinch} is not an alias}{\Name{Grinch} is excluded}'': +% Here we test for a name used with \cmd{\ExcludeName} (Section~\ref{sec:IndexXref}) to get the result, ``\ExcludeName{Grinch}\IfAKA{Grinch}{\Name{Grinch} is an alias}{\Name{Grinch} is not an alias}{\Name{Grinch} is excluded}'': % \begin{quote}\small\setstretch{1.1} % |\ExcludeName{Grinch}%|\\ % |\IfAKA{Grinch}%|\\ @@ -1746,11 +2109,12 @@ Running "make install" installs the files in the local TeX tree. % | {\Name{Grinch} is not an alias}%|\\ % | {\Name{Grinch} is excluded}| % \end{quote} +% \clearpage % % \subsubsection{Changing Decisions} -% \label{sec:Tweaks} -% -% This section describes macros that change the status of whether a name has occurred. That also helps to avoid clashes between formatted and non-formatted names. They are meant for editing at or near the final draft stage. ``\emph{See}-reference'' names created by \cmd{\AKA} are not affected by these macros.\medskip +% \label{sec:tweaks} +% +% This section describes macros that change the status of whether a name has occurred. That also helps to avoid clashes between formatted and non-formatted names. They are meant for editing at or near the final draft stage. Cross-reference names created by \cmd{\IndexRef} or \cmd{\AKA} are not affected by these macros.\medskip % % \DescribeMacro{\ForgetName} % This macro is a ``dirty trick'' of sorts that takes the same optional and mandatory arguments used by \cmd{\Name}. It handles its arguments in the same way, except that it ignores the final argument if \meta{FNN} are present. The syntax is: @@ -1758,93 +2122,60 @@ Running "make install" installs the files in the local TeX tree. % \cmd{\ForgetName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} % \end{quote} % This macro causes \cmd{\Name} and friends globally to ``forget'' prior uses of a name. The next use of that name will print as if it were a ``first use,'' even if it is not. Index entries and cross-references are \emph{never} forgotten.\medskip -% +% % \DescribeMacro{\SubvertName} % This macro is the opposite of the one above. It takes the same arguments. It handles its arguments in the same manner. The syntax is: % \begin{quote}\small % \cmd{\SubvertName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} % \end{quote} % This macro causes \cmd{\Name} and friends globally to think that a prior use of a name already has occurred. The next use of that name will print as if it were a ``subsequent use,'' even if it is not. -% \clearpage % -% One use for this macro is to get around the safeguards of \cmd{\FName.} To ensure formatting consistency: +% One use for this macro is to get around the first-use safeguards of \cmd{\FName}. To ensure formatting consistency: % \begin{quote}\small\setstretch{1.1} % \cmd{\SubvertName}\oarg{FNN}\marg{SNN}|%|\\ % |\makeatletter \@nameauth@FirstFormattrue \makeatother%|\\ % \cmd{\FName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} % \end{quote} % -% The default \marginpar{\small\raggedleft Scope} behavior of these two macros changes whether a name is ``forgotten'' or ``subverted'' simultaneously for front matter and main matter names, Remember the example on page~\pageref{page:Carnap} above that gave us the answer, ``\IfFrontName[Rudolph]{Carnap}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is both}{\Name[Rudolph]{Carnap} is only non-formatted}}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is only formatted}{\Name[Rudolph]{Carnap} is not mentioned}}?'' Now watch closely: After we use \ForgetName[Rudolph]{Carnap}|\ForgetName[Rudolph]{Carnap}| we get the result, +% The default \marginpar{\small\raggedleft Scope} behavior of these two macros changes whether a name is ``forgotten'' or ``subverted'' simultaneously for front matter and main matter names, Remember the example on page~\pageref{page:Carnap} above that gave us the answer, ``\IfFrontName[Rudolph]{Carnap}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is both}{\Name[Rudolph]{Carnap} is only non-formatted}}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is only formatted}{\Name[Rudolph]{Carnap} is not mentioned}}''? Now watch closely: After we use \ForgetName[Rudolph]{Carnap}|\ForgetName[Rudolph]{Carnap}| we get the result: % ``\IfFrontName[Rudolph]{Carnap}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is both}{\Name[Rudolph]{Carnap} is only non-formatted}}{\IfMainName[Rudolph]{Carnap}{\Name[Rudolph]{Carnap} is only formatted}{\Name[Rudolph]{Carnap} is not mentioned}}.'' Both the main matter name and the front matter name were forgotten! % -% This default behavior helps synchronize formatted and unformatted types of names. For example, if you wanted to use unformatted names in the footnotes and formatted names in the text (Section~\ref{sec:FrontFormat}), you could use, \emph{e.g.} \cmd{\SubvertName} right after the first use of a name in the body text, ensuring that all references in the text and notes would be short unless otherwise modified.\footnote{This manual takes advantage of that behavior at times in order to synchronize first and subsequent uses of names between formatted and unformatted sections of the body text.}\medskip +% This default behavior helps synchronize formatted and unformatted types of names. For example, if you wanted to use unformatted names in the footnotes and formatted names in the text (Section~\ref{sec:formatting}), you could use, \emph{e.g.} \cmd{\SubvertName} right after the first use of a name in the body text, ensuring that all references in the text and notes would be short unless otherwise modified.\footnote{This manual takes advantage of that behavior at times in order to synchronize first and subsequent uses of names between formatted and unformatted sections of the body text.}\medskip % % \DescribeMacro{\LocalNames} % \DescribeMacro{\GlobalNames} % If, however, this ``global'' behavior of \cmd{\ForgetName} and \cmd{\SubvertName} is not desired, you can use \cmd{\LocalNames} to change that behavior and \cmd{\GlobalNames} to restore the default behavior. Both of these macros work globally. % -% After \cmd{\LocalNames,} if you are in a ``front matter'' section (the \texttt{frontmatter} option or \cmd{\NamesInactive}) \cmd{\ForgetName} and \cmd{\SubvertName} will only affect unformatted names. If you are in a ``main matter'' section via the \texttt{mainmatter} option or \cmd{\NamesActive,} then \cmd{\ForgetName} and \cmd{\SubvertName} will only affect formatted names. Section~\ref{sec:LocalNames} offers a long example. -% -% \subsection{``Text Tags''} -% \label{sec:tagtext} -% -% Sections~\ref{sec:TagName} and~\ref{sec:UntagName} deal with similar tagging features in the index. ``Text tags'' differ from index tags because they are not printed automatically with every name managed by \textsf{nameauth}. Section~\ref{sec:Hooksb} offers additional solutions that use the macros in this section. -% -% Instead of ``text tags,'' perhaps one should think about ``name information database entries.'' The macros in this section are named accordingly. We retain the ``text tag'' language for simplicity.\medskip -% -% \DescribeMacro{\NameAddInfo} -% Text tags are independent of any other name conditionals, similar to index tags. This \cmd{\long} macro's syntax is: -% \begin{quote}\small -% \cmd{\NameAddInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} -% \end{quote} -% -% For example, |\NameAddInfo[George]{Washington}{ (1732--99)}|\NameAddInfo[George]{Washington}{ (1732--99)} will associate the text \texttt{\textvisiblespace(1732--99)} with the name \cmd{\LWash} \LWash. Note, however, that the tag did not print automatically with the name. +% After \cmd{\LocalNames}, if you are in a ``front matter'' section (the \texttt{frontmatter} option or \cmd{\NamesInactive}) \cmd{\ForgetName} and \cmd{\SubvertName} will only affect unformatted names. If you are in a ``main matter'' section via the \texttt{mainmatter} option or \cmd{\NamesActive}, then \cmd{\ForgetName} and \cmd{\SubvertName} will only affect formatted names. Section~\ref{sec:LocalNames} offers a long example. % \clearpage % -% \DescribeMacro{\NameQueryInfo} -% To retrieve the information in a text tag, one uses the name as a key to the corresponding information: -% \begin{quote}\small -% \cmd{\NameQueryInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names} -% \end{quote} -% \NameAddInfo[Ulysses S.]{Grant}{ (president 1869--77)}% -% \NameAddInfo[Schuyler]{Colfax}{\footnote{Seventeenth vice-president of the US during the first term (1869--73) of \Name[Ulysses S.]{Grant}\NameQueryInfo[Ulysses S.]{Grant}.}}% -% Thus, |``\NameQueryInfo[George]{Washington}.''| expands to ``\NameQueryInfo[George]{Washington}.'' Notice the space at the beginning of the tag. This is intentional, as with index tags. Sections~\ref{sec:TagName}, \ref{sec:UntagName}, and~\ref{sec:Hooksa}ff. illustrate how this can permit tags like asterisks, daggers, and footnotes, such as one for% -% \Name[Schuyler]{Colfax}.\NameQueryInfo[Schuyler]{Colfax} The source for that example looks like: -% \begin{quote}\small\setstretch{1.1} -% |\NameAddInfo[Ulysses S.]{Grant}{ (president 1869--77)}%|\\ -% |\NameAddInfo[Schuyler]{Colfax}%|\\ -% |{\footnote{Seventeenth vice-president of the US during%|\\ -% |the first term (1869--73) of \Name[Ulysses S.]{Grant}%|\\ -% |\NameQueryInfo[Ulysses S.]{Grant}.}}|\\ -% \texttt{\dots}\\ -% |\Name[Schuyler]{Colfax}.\NameQueryInfo[Schuyler]{Colfax}| -% \end{quote} -% By using these text tag macros with the conditional macros, one can display information associated with a name based on whether or the name has occurred. As of version 2.4, this can be done either outside of \cmd{\NamesFormat} and the other general hooks or inside those macros.\medskip -% -% \DescribeMacro{\NameClearInfo} -% \cmd{\NameAddInfo} will replace one text tag with another text tag, but it does not delete a text tag. That is the role of \cmd{\NameClearInfo}. The syntax is: -% \begin{quote}\small -% \cmd{\NameClearInfo}\oarg{FNN}\marg{SNN}\oarg{Alternate names} -% \end{quote} -% -% For example, |\NameClearInfo[George]{Washington}|\NameClearInfo[George]{Washington} will cause the macro |``\NameQueryInfo[George]{Washington}''| to produce nothing. -% % \subsection{Name Variant Macros} -% \subsubsection{\texttt{\textbackslash AKA}} % \label{sec:AKA} % +% The\marginpar{\large\raggedleft\textsf{\bfseries 3.0}} macros in this section are specialized and have a somewhat different syntax than others in this manual. Macros like \cmd{\IndexRef} permit one to avoid them altogether. Yet here they are, if needed.\medskip +% % \DescribeMacro{\AKA} % \DescribeMacro{\AKA*} -% \cmd{\AKA} (meaning \textit{also known as}) handles pseudonyms, stage names, \emph{noms de plume}, and so on in order to replace typing manual cross-references in the index. The syntax for \cmd{\AKA} is: +% \cmd{\AKA} (meaning \textit{also known as}) handles the occasional full-name mention of pseudonyms, stage names, \emph{noms de plume}, and so on. The syntax for \cmd{\AKA} is: % \begin{quote}\small\setstretch{1.1} -% \cmd{\AKA}\oarg{FNN}\marg{SNN}\oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names}\\ +% \cmd{\AKA\ }\oarg{FNN}\marg{SNN}\oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names}\\ % \cmd{\AKA*}\oarg{FNN}\marg{SNN}\oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} % \end{quote} -% Both macros create a cross-reference in the index from the \meta{Alt. FNN}, \meta{Alt. SNN}, and \meta{Alt. names} fields to a name defined by \meta{FNN} and \meta{SNN}, regardless of whether that name exists. +% Both macros create a cross-reference in the index from the \meta{Alt. FNN}, \meta{Alt. SNN}, and \meta{Alt. names} fields to a target defined by \meta{FNN} and \meta{SNN}, regardless of whether that name exists. +% \textbf{The name order for \cmd{\AKA} is opposite that of \cmd{\IndexRef}.} That is due to the following problem: +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{r@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}l} +% \oarg{$FNN_1$}\marg{$SNN_1$} & \oarg{$Alt_1$}\oarg{$FNN_2$} & \marg{$SNN_2$}\oarg{$Alt_2$}\\ +% & Which to pick? \\ +% \end{tabular} +% \end{center} +% By only allowing \meta{FNN1} and \meta{SNN1} for the target name, we can let the other fields permit an unrestricted cross-reference. See also Section~\ref{sec:indextag}. % -% \cmd{\AKA} prints the \meta{Alt. FNN} and \meta{Alt. SNN} fields in the body text. If the \meta{Alt. names} field is present, \cmd{\AKA} prints the \meta{Alt. names} and \meta{Alt. SNN} arguments in the body text. The caps and reversing macros work with \cmd{\AKA}. +% \cmd{\AKA} only prints long names in the text. It designed for the occasional mentioning of full alternate names. See page~\pageref{page:manualxref} for alternate solutions. \cmd{\SeeAlso} works with \cmd{\AKA}, \cmd{\AKA*}, and \cmd{\PName}. % -% For Western alternate names, in the body text, \cmd{\AKA*} only prints either \meta{Alt. FNN} or \meta{Alt. names}, if present. For non-Western alternate names, \cmd{\AKA*} prints either \meta{Alt. SNN} or \meta{Alt. names} if present. +% \cmd{\AKA} prints the \meta{Alt. FNN} and \meta{Alt. SNN} fields in the body text. If the \meta{Alt. names} field is present, \cmd{\AKA} swaps it with the \meta{Alt. FNN} field in the text. The caps and reversing macros work with \cmd{\AKA}. +% +% \cmd{\AKA*}\marginpar{\large\raggedleft\textsf{\bfseries 3.0}} prints short name references like \cmd{\FName}, meaning that \cmd{\ForceFN} works with it in the same manner. For the older behavior of \cmd{\AKA*} use the \texttt{oldAKA} option or always precede \cmd{\AKA*} with \cmd{\ForceFN}. % % \begin{center}\bfseries Basic Operation\end{center} % \begin{quote}\small\setstretch{1.1} @@ -1856,7 +2187,7 @@ Running "make install" installs the files in the local TeX tree. % \cmd{\AKA} & \hphantom{\oarg{FNN}}\marg{SNN, Affix} & \dots\\ % \cmd{\AKA} & \hphantom{\oarg{FNN}}\marg{SNN, FNN} & \dots & \emph{Eastern}\\ % \end{tabular}}\\[1ex] -% These are the ``better'' alternate-name forms after the main name:\\[1ex] +% These are the more common alternate-name forms after the main name:\\[1ex] % {\footnotesize\begin{tabular}{lll@{}l@{}} % \cmd{\AKA} & \dots\hphantom{ \quad} & \oarg{Alt. FNN}\marg{Alt. SNN} & \emph{Western}\\ % \cmd{\AKA} & \dots & \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names}\\ @@ -1866,34 +2197,51 @@ Running "make install" installs the files in the local TeX tree. % \cmd{\AKA} & \dots & \hphantom{\oarg{Alt. FNN}}\marg{Alt. SNN, Affix}\\ % \cmd{\AKA} & \dots & \hphantom{\oarg{Alt. FNN}}\marg{Alt. SNN, Alt. FNN} & \emph{Eastern}\\ % \end{tabular}}\\[1ex] +% These alternate-name forms use non-Western alternate names:\\[1ex] +% {\footnotesize\begin{tabular}{llll@{}} +% \cmd{\AKA} & \dots \hphantom{\oarg{N}} & \marg{Alt. SNN, Alt. FNN}\oarg{Alt. names}\hphantom{ \quad} & \emph{Eastern}\\ +% \cmd{\AKA} & \dots & \marg{Alt. SNN, Alt. Affix}\oarg{Alt. names} & \emph{Ancient}\\ +% \end{tabular}}\\[1ex] % These alternate-name forms use the old syntax:\\[1ex] % {\footnotesize\begin{tabular}{llll@{}} -% \cmd{\AKA} & \dots \hphantom{\oarg{NN}\marg{SNN}} & \marg{Alt. SNN}\oarg{Alt. names}\hphantom{ \quad} & \emph{Eastern}\\ -% \cmd{\AKA} & \dots & \marg{Alt. SNN}\oarg{Alt. names} & \emph{Ancient}\\ +% \cmd{\AKA} & \dots \hphantom{\oarg{NNN}\marg{SNN}} & \marg{Alt. SNN}\oarg{Alt. FNN}\hphantom{ \quad} & \emph{Eastern}\\ +% \cmd{\AKA} & \dots & \marg{Alt. SNN}\oarg{Alt. Affix} & \emph{Ancient}\\ % \end{tabular}} % \end{quote} -% See also Sections~\ref{sec:TagName} and~\ref{sec:AKAtips}. The next example makes ``alternate name'' cross-references to \Name[Bob]{Hope}, illustrating Western names: +% +% The next example makes ``alternate name'' cross-references to the target \Name[Bob]{Hope}, illustrating Western names: % \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule % |\AKA[Bob]{Hope}[Leslie Townes]{Hope}| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}\\ % |\AKA*[Bob]{Hope}[Leslie Townes]{Hope}| & \AKA*[Bob]{Hope}[Leslie Townes]{Hope}\\ -% |\AKA[Bob]{Hope}%|\\| [Leslie Townes]{Hope}[Lester T.]| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]\\ -% |\AKA*[Bob]{Hope}%|\\| [Leslie Townes]{Hope}[Lester T.]| & \AKA*[Bob]{Hope}[Leslie Townes]{Hope}[Lester T.]\\\bottomrule +% |\AKA[Bob]{Hope}%|\\| [Leslie Townes]{Hope}[Leslie]| & \AKA[Bob]{Hope}[Leslie Townes]{Hope}[Leslie]\\ +% |\AKA*[Bob]{Hope}%|\\| [Leslie Townes]{Hope}[Leslie]| & \AKA*[Bob]{Hope}[Leslie Townes]{Hope}[Leslie]\\\bottomrule % \end{tabular} % \end{center} % -% As with nicknames and \cmd{\Name,} the alternate form ``Lester T. Hope'' does not appear in the index, but only in the body text. The next example makes ``alternate name'' cross-references to \KeepAffix\Name*{Louis, XIV}, \Name{Lao-tzu}, and \KeepAffix\Name{Gregory, I}:% \begin{center}\small\setstretch{1.1} +% As with nicknames and \cmd{\Name}, the alternate forms in the text do not appear in the index. Remember that one cannot apply an index tag to a cross-reference; only a ``pretag'' will work. +% +% With \KeepAffix\Name*{Louis, XIV} and \Name{Lao-tzu} below, notice that there is no change in printed form between \cmd{\AKA} and \cmd{\AKA*}: +% \begin{center}\small\setstretch{1.1} % \begin{tabular}{ll}\toprule % |\AKA{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\ -% |\AKA*{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\ +% |\AKA*{Louis, XIV}{Sun King}| & \AKA{Louis, XIV}{Sun King}\\\midrule % |\AKA{Lao-tzu}{Li, Er}| & \AKA{Lao-tzu}{Li, Er}\\ -% |\AKA*{Lao-tzu}{Li, Er}| & \AKA{Lao-tzu}{Li, Er}\\\midrule +% |\AKA*{Lao-tzu}{Li, Er}| & \AKA{Lao-tzu}{Li, Er}\\\bottomrule +% \end{tabular} +% \end{center} +% +% This final example illustrates how \cmd{\AKA*} can be useful with medieval affixes as we consider \KeepAffix\Name{Gregory, I} ``\ForceFN\AKA*{Gregory, I}{Gregory}[the Great]'': +% \begin{center}\small\setstretch{1.1} +% \begin{tabular}{ll}\toprule % |\AKA{Gregory, I}{Gregory}[the Great]| & \AKA{Gregory, I}{Gregory}[the Great]\\ -% |\AKA*{Gregory, I}{Gregory}[the Great]| & \AKA*{Gregory, I}{Gregory}[the Great]\\\bottomrule +% |\AKA*{Gregory, I}{Gregory}[the Great]| & \AKA*{Gregory, I}{Gregory}[the Great]\\ +% |\ForceFN\AKA*{Gregory, I}%|\\ +% | {Gregory}[the Great]| & \ForceFN\AKA*{Gregory, I}{Gregory}[the Great]\\\bottomrule % \end{tabular} -% \end{center}\hbox{} +% \end{center} % -% \begin{center}\bfseries Formatting Alternate Names\end{center} +% \begin{center}\bfseries Formatting Alternate Names: General\end{center} % In this simple example we redefine the the default system of formatting to illustrate what can happen under default formatting conditions: % \begin{quote}\small\setstretch{1.1} % \renewcommand*\NamesFormat{\scshape}|\renewcommand*\NamesFormat{\scshape}|\\ @@ -1902,22 +2250,33 @@ Running "make install" installs the files in the local TeX tree. % \Name{Jean, sans Peur} (\AKA{Jean, sans Peur}{Jean the Fearless}) was Duke of Burgundy 1404--1419. % \end{quote} % -% ``\AKA{Jean, sans Peur}{Jean the Fearless}''\marginpar{\small\raggedleft\texttt{formatAKA}} usually receives no formatting because it is post-processed by \cmd{\MainNamesHook} in the main matter text and \cmd{\FrontNamesHook} in the front matter. The \texttt{formatAKA} option causes \cmd{\AKA} to use \cmd{\NamesFormat} and \cmd{\FrontNamesFormat}, but only for the first use in the whole document. This allows name exclusion to work and avoids possible errors with index cross-references. Using the \texttt{alwaysformat} option formats all names as first uses: -% -% \begin{quote}\small\setstretch{1.1}% -% \begin{tabular}{@{}rl}Illustrating & |\AKA{Elizabeth, I}[Good Queen]{Bess}|\\ and & |\AKA{Elizabeth, I}{Virgin Queen}|:\\\end{tabular} \renewcommand*\FrontNamesFormat{\itshape}\renewcommand*\NamesFormat{\scshape}\ForgetName{Elizabeth, I} -% -% {\makeatletter\@nameauth@AKAFormattrue\hbox{}\hfil\texttt{formatAKA}\\ -% \NamesInactive \textbf{Front matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Queen \Eliz\ also was known as the ``\AKA{Elizabeth, I}{Virgin Queen}.''\\ -% \NamesActive \textbf{Main matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Queen \Eliz\ also was known as the ``\AKA{Elizabeth, I}{Virgin Queen}.'' \makeatother} +% ``\AKA{Jean, sans Peur}{Jean the Fearless}''\marginpar{\small\raggedleft\texttt{formatAKA}\break\dbend} usually receives no formatting because it is post-processed by \cmd{\MainNamesHook} in the main matter text and \cmd{\FrontNamesHook} in the front matter. The \texttt{formatAKA} option causes \cmd{\AKA} to use \cmd{\NamesFormat} and \cmd{\FrontNamesFormat}, but \textbf{only once in the whole document}. Using the \texttt{alwaysformat} option formats all names as first uses. +% One can tweak the \texttt{formatAKA} option with the following and place it before \cmd{\AKA} or \cmd{\AKA*}: +% \begin{quote}\small\setstretch{1.1} +% \cmd{\makeatletter}\\ +% |\newcommand*\Format{\@nameauth@FirstFormattrue}|\\ +% \cmd{\makeatother} +% \end{quote} +% \clearpage % -% {\makeatletter\@nameauth@AlwaysFormattrue\hbox{}\hfil\texttt{ alwaysformat}\\ -% \NamesInactive \textbf{Front matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Queen \Eliz\ also was known as the ``\AKA{Elizabeth, I}{Virgin Queen}.''\\ -% \NamesActive \textbf{Main matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Queen \Eliz\ also was known as the ``\AKA{Elizabeth, I}{Virgin Queen}.'' \makeatother} +% Below we show the effects of \texttt{formatAKA} and \texttt{alwaysformat} on the example macro |\AKA{Elizabeth, I}[Good Queen]{Bess}|. We use special formatting for main-matter and front-matter names.\ignorespaces% +% \begin{quote}\leavevmode{}\small\setstretch{1.1}\ignorespaces% +% \renewcommand*\FrontNamesFormat{\itshape}\ignorespaces% +% \renewcommand*\NamesFormat{\scshape}\ignorespaces% +% \makeatletter\newcommand*\Format{\@nameauth@FirstFormattrue}\makeatother\ignorespaces% +% \ForgetName{Elizabeth, I}\ignorespaces% +% \makeatletter\@nameauth@AKAFormattrue\makeatother\hbox{}\hfil\texttt{formatAKA}\\ +% {\NamesInactive \textbf{Front Matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Again we mention Queen \Eliz, ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''\\ |\Format\AKA{Elizabeth, I}[Good Queen]{Bess}| \Format\AKA{Elizabeth, I}[Good Queen]{Bess}.\\ +% \NamesActive \textbf{Main Matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Again we mention Queen \Eliz, ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''\\ |\Format\AKA{Elizabeth, I}[Good Queen]{Bess}| \Format\AKA{Elizabeth, I}[Good Queen]{Bess}.}\\[1ex] +% \ForgetName{Elizabeth, I}\ignorespaces% +% {\makeatletter\@nameauth@AlwaysFormattrue\makeatother\hbox{}\hfil\texttt{alwaysformat}\\ +% \NamesInactive \textbf{Front Matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Again we mention Queen \Eliz, ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''\\ +% \NamesActive \textbf{Main Matter:} \LEliz\ was known as ``\AKA{Elizabeth, I}[Good Queen]{Bess}.'' Again we mention Queen \Eliz, ``\AKA{Elizabeth, I}[Good Queen]{Bess}.''} % \end{quote} % \ForgetName{Elizabeth, I}% % -% The following annotated example shows a simple Continental style where the surname is always in small caps, both in the text and in the index: +% \begin{center}\bfseries Formatting Alternate Names: Continental\end{center} +% \noindent The following annotated example shows a simple Continental style where the surname is always in small caps, both in the text and in the index: % \begin{enumerate} % \item Tag the names for proper sorting.\\[4pt] % |\PretagName[Heinz]{\textsc{Rühmann}}{Ruehmann, Heinz}%|\\ @@ -1926,44 +2285,45 @@ Running "make install" installs the files in the local TeX tree. % \item ``\Name*[Heinz]{\textsc{Rühmann}}'' is the main name. \cmd{\AKA*} uses ``\textsc{Rühmann}, Heinrich Wilhelm'' as the index cross-reference and prints only ``Heinrich Wilhelm'' in the body text.\\[4pt] % |\AKA*[Heinz]{\textsc{Rühmann}}%|\\ % | [Heinrich Wilhelm]{\textsc{Rühmann}} %| -% \item \cmd{\SubvertName} causes \cmd{\FName} to print the short version via the ``subsequent-use'' macro \cmd{\MainNameHook.}\\[4pt] +% \item \cmd{\SubvertName} causes \cmd{\FName} to print the short version via the ``subsequent-use'' macro \cmd{\MainNameHook}.\\[4pt] % |\SubvertName[Heinz]{\textsc{Rühmann}} %| % \item \cmd{\FName} prints ``\FName[Heinz]{\textsc{Rühmann}}.''\\[4pt] % |``\FName[Heinz]{\textsc{Rühmann}}'' %| % \item \cmd{\Name} prints ``\Name[Heinz]{\textsc{Rühmann}}.'' The small caps are syntactic, not typographic, because they are part of the argument to \cmd{\Name} itself.\\[4pt] -% |\Name[Heinz]{\textsc{Rühmann}}| |(7| |March| |1902--3| |October| |%|\\ -% |1994)| |was| |a| |German| |actor| |in| |over| |100| |films.| +% |\Name[Heinz]{\textsc{Rühmann}}| |(7| |March| |1902\,--\,3%|\\ +% |October 1994)| |was| |a| |German| |actor| |in| |over| |100| |films.| % \end{enumerate} % The resulting text is: % \begin{quote}\small % \AKA*[Heinz]{\textsc{Rühmann}}[Heinrich Wilhelm]{\textsc{Rühmann}} \ignorespaces% % \SubvertName[Heinz]{\textsc{Rühmann}}\ignorespaces% % ``\FName[Heinz]{\textsc{Rühmann}}'' \ignorespaces% -% \Name[Heinz]{\textsc{Rühmann}} (7 March 1902--3 October \ignorespaces% +% \Name[Heinz]{\textsc{Rühmann}} (7 March 1902\,--\,3 October \ignorespaces% % 1994) was a German actor in over 100 films. % \end{quote} % \clearpage % +% \phantomsection\label{page:manualxref} % \begin{center}\bfseries Advanced Cross-Referencing\end{center} -% \cmd{\AKA} will not create multiple cross-references. Handle the special case where one moniker applies to multiple people with a manual solution, \emph{e.g.}, ``Snellius'' for both \Name*[Willebrord]{Snel van Royen} and his son \Name*[Rudolph]{Snel van Royen}: -% \begin{quote}\small\setstretch{1.1} -% |\index{Snellius|\verb!|!{}|see{Snel|\,|van|\,|Royen,|\,|Rudolph;%|\\ |Snel|\,|van|\,|Royen,|\,|Willebrord}}| -% \index{Snellius|see{Snel van Royen, Rudolph; Snel van Royen, Willebrord}} +% \noindent \cmd{\AKA}\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} will not create multiple cross-references. Handle the special case where one moniker applies to multiple people with \cmd{\IndexRef}, \emph{e.g.}, ``Snellius'' for both \Name[W.]{Snel van Royen}[Willebrord] and his son \Name[R.]{Snel van Royen}[Rudolph]:\footnote{We shorten the index entries via \cmd{\Name}\texttt{[W.]\{Snel van Royen\}[Willebrord]}, and for his son, \cmd{\Name}\texttt{[R.]\{Snel van Royen\}[Rudolph]}.} +% \begin{quote}\small +% |\IndexRef{Snellius}{Snel| |van| |Royen,| |R.;| |Snel| |van| |Royen,| |W.}| +% \IndexRef{Snellius}{Snel van Royen, R.; Snel van Royen, W.} % \end{quote} % -% Keep in mind, however, that formatting manual index entries can present some caveats; see Section~\ref{sec:IndexSort}. -% -% Cross-references generated by \cmd{\AKA} and \cmd{\AKA*} are meant only to be \emph{see} references, never page entries. See also Section~\ref{sec:error}. In certain cases, the alternate name might need to be indexed with page numbers and \emph{see also} references. Do not use \cmd{\AKA} in those cases, rather, consider the following: -% -% \label{manualxref}\label{Rambam}% +% Cross-references generated by \cmd{\AKA} and \cmd{\AKA*} are meant only to be cross-references, never page entries. See also Section~\ref{sec:error}. In certain cases, the alternate name might need to be indexed with page numbers and \emph{see also} references: % \begin{itemize}\small -% \item Refer to the person intended, \emph{e.g.}, \Name{Maimonides} (\AKA{Maimonides}{Moses ben-Maimon}):\\ |\Name{Maimonides}| |(\AKA{Maimonides}{Moses| |ben-Maimon})| -% \item We now have a name and a \emph{see} reference. Now one must refer to the alternate name, \emph{e.g.}, \Name{Rambam}: |\Name{Rambam}|. -% \item The alternate name must occur before making a cross-reference to the main name, in this case, \Name{Maimonides}. -% \item Add \verb!\index{Rambam|seealso{Maimonides}}! at the end of the document to ensure that it is the last entry among the cross-references. Generally, \emph{see also} references follow \emph{see} references in an index entry.\footnote{Different standards exist for punctuating index entries and cross-references. Check with your publisher, style guide, docs for \textsf{xindy} and \textsf{makeindex}, and \textsf{http://tex.stackexchange.com}.} +% \item Refer to the person intended, \emph{e.g.}:\\ \hbox{}\qquad\Name{Maimonides} (\AKA{Maimonides}{Moses ben-Maimon}):\\ \hbox{}\qquad|\Name{Maimonides}| |(\AKA{Maimonides}{Moses| |ben-Maimon})| +% \item We now have a target entry and a \emph{see} reference. +% \item We also should refer to the main name. The fact that we had a target reference does not establish the index entry for the main name. Thus:\\ \hbox{}\qquad\Name{Maimonides}\\ \hbox{}\qquad|\Name{Maimonides}| +% \item Before creating a cross-reference, one must refer to the alternate name, \emph{e.g.}:\\ \hbox{}\qquad\Name{Rambam}\\ \hbox{}\qquad|\Name{Rambam}| +% \item For\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} whatever name you use for the \emph{see also} reference, put the cross-reference after all of the page references. For example, you could put both of these macros at the end of the document:\footnote{Different standards exist for punctuating index entries and cross-references. Check with your publisher, style guide, docs for \textsf{xindy} and \textsf{makeindex}, and \textsf{http://tex.stackexchange.com}.}\\\hbox{}\qquad|\SeeAlso\IndexRef{Maimonides}{Rambam}|\\\hbox{}\qquad|\SeeAlso\IndexRef{Rambam}{Maimonides}| +% \item You could let the last reference to either name be handled by \cmd{\SeeAlso}\cmd{\AKA}, but that could be more confusing and prone to error. % \end{itemize} +% \SeeAlso\IndexRef{Maimonides}{Rambam}% +% \SeeAlso\IndexRef{Rambam}{Maimonides}% % -% Using \cmd{\PretagName} helps avoid the need for manual index entries. Instead of doing a lot of extra work for some names, consider the following example: +% Using \cmd{\PretagName} (Section~\ref{sec:IndexSort}) helps to avoid the need for manual index entries. Instead of doing a lot of extra work with \texttt{makeindex} for some names, consider the following example: % % \begin{quote}\small\setstretch{1.1} % {\ttfamily% @@ -1982,8 +2342,31 @@ Running "make install" installs the files in the local TeX tree. % We use the medieval form: |\Name{Thomas, Aquinas}| because ``Aquinas'' is not a surname, even though many people, including scholars, falsely use it as such. Section~\ref{sec:standards} talks about those unfortunate situations where one must use the Western form |\Name[Thomas]{Aquinas}.| % \clearpage % -% \subsubsection{\texttt{\textbackslash PName}} +% \begin{center}\bfseries General Tips for \cmd{\AKA}\end{center} +% \begin{itemize}\small +% \item \oarg{FNN}\marg{SNN} is the target name. \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} is the cross-reference to the target. Neither create an index entry with page references for the target. +% \item The old syntax causes \cmd{\AKA} and \cmd{\AKA*} to fail:|\AKA{Louis}[XIV]{Sun| |King}| and |\AKA{Gregory}[I]{Gregory}[the| |Great]|. +% \item The \meta{Alt. SNN} field uses comma-delimited suffixes. +% \item The \meta{Alt. names} field does not use comma-delimited suffixes. +% \item Eastern names work as pseudonyms, with all that entails. One can refer to \Name[Lafcadio]{Hearn} as \CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}:\\\hbox{}\qquad|\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}|. +% \item Particles work: \CapThis\AKA[Charles]{du Fresne}{du Cange} is the alternate name for \Name[Charles]{du Fresne}, which is capitalized via \cmd{\CapThis}\cmd{\AKA}. See also Section~\ref{sec:PatRef}. +% \item Reversing works, \emph{e.g.},\\\hbox{}\qquad \cmd{\RevComma}\cmd{\AKA\dots}: \RevComma\AKA[Bob]{Hope}[Leslie Townes]{Hope}\\\hbox{}\qquad \cmd{\RevName}\cmd{\AKA\dots\ }: \RevName\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo} +% \item The\marginpar{\small\raggedleft\dbend} name fields of \cmd{\PretagName} correspond with the \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} fields of \cmd{\AKA}:\\[1ex]\hbox{}\qquad |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş}| matches\\\hbox{}\qquad |\PretagName{Vlad,| |Ţepeş}{Vlad| |Tepes}| +% \item With\marginpar{\small\raggedleft\dbend} stage names like \Name[The Amazing]{Kreskin}, if you want them in the index, use |\Name[The| |Amazing]{Kreskin}| to get ``Kreskin, The Amazing.'' {\IndexInactive Otherwise use something like |\Name[J.]{Kreskin}[The| |Amazing]| to get \Name[J.]{Kreskin}[The Amazing] in the text and ``Kreskin, J.'' in the index.\\[1ex] Using \cmd{\AKA} with such names looks like: |\AKA[The| |Amazing]{Kreskin}| |[Joseph]{Kresge}| and |\AKA[J.]{Kreskin}[Joseph]{Kresge}|.} The results are \Name*[The Amazing]{Kreskin}, a.k.a. \AKA[The Amazing]{Kreskin}[Joseph]{Kresge}. +% \item Special\marginpar{\small\raggedleft\dbend} cases like ``Iron Mike'' Tyson as the nickname for \Name[Mike]{Tyson} may be handled in a number of ways. +% \begin{itemize}\small +% \item Follow |``Iron Mike''| with |\IndexName[Mike]{Tyson}| and do whatever you want in the text. This may be the easiest solution. +% \item Use |``\AKA[Mike]{Tyson}{Iron Mike}''| to create ``\AKA[Mike]{Tyson}{Iron Mike}'' in the text and a cross-reference to ``Tyson, Mike'' in the index. Be sure to have an occurrence of |\Name[Mike]{Tyson}| in the text. See also Section~\ref{sec:AKA}. This is the best solution in terms of how \textsf{nameauth} is designed. +% \item Always get ``Iron Mike Tyson'' with something like:\\[1ex] +% |\newcommand*\Iron{\SubvertName[Mike]{Tyson}%|\\ +% |\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}}|\\[1ex] +% \newcommand*\Iron{\SubvertName[Mike]{Tyson}\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}} +% |``\Iron''| gives you ``\Iron.'' You are responsible for typesetting the first use and creating a cross-reference. This solution runs somewhat contrary to the design principles of \textsf{nameauth}, but it may be helpful if you want the invariant name ``\Iron'' to recur and you want to save typing. +% \end{itemize} +% \end{itemize} +% \clearpage % +% \begin{center}\bfseries And the Silliest Macro Comes Last\end{center} % \DescribeMacro{\PName} % \DescribeMacro{\PName*} % \cmd{\PName} is a ``convenience macro'' meant for Western names. It generates a main name followed by a cross-reference in parentheses with the following syntax: @@ -1991,7 +2374,7 @@ Running "make install" installs the files in the local TeX tree. % \cmd{\PName}\oarg{FNN}\marg{SNN}\oarg{other FNN}\marg{other SNN}\oarg{other alt.} % \end{quote} % -% Although \cmd{\PName} creates an easy shortcut, its drawbacks are many. It only can use the \meta{FNN}\meta{SNN} form of \cmd{\AKA}. Neither \cmd{\AKA*}, nor \cmd{\CapName}, \cmd{\CapThis}, \cmd{\RevComma}, \cmd{\RevName}, and the related package options work with \cmd{\PName.} Below we see the forms that \cmd{\Pname} can handle: +% Although \cmd{\PName} creates an easy shortcut, its drawbacks are many. It only can use the \meta{FNN}\meta{SNN} form of \cmd{\AKA}. Neither \cmd{\AKA*}, nor \cmd{\CapName}, \cmd{\CapThis}, \cmd{\RevComma}, \cmd{\RevName}, and the related package options work with \cmd{\PName}. Below we see the forms that \cmd{\Pname} can handle: % \begin{quote}\small\setstretch{1.1} % |\PName[Mark]{Twain}[Samuel L.]{Clemens}|\\ % \hbox{}\dotfill \PName[Mark]{Twain}[Samuel L.]{Clemens}\\ @@ -2008,258 +2391,58 @@ Running "make install" installs the files in the local TeX tree. % \hbox{}\dotfill \PName{Bernard, of Clairvaux}{\textit{Doctor mellifluus}} % \end{quote} % -% Like \cmd{\AKA,} \cmd{\PName} cannot use the old syntax \marg{SNN}\oarg{FNN} for the main name, but it can do so for the alternate name. -% -% |\PName{William,| |I}{William,| |the Conqueror}| gives \PName{William, I}{William, the Conqueror}. To limit possible confusion, avoid the old syntax in the alternate name: |\PName{William, I}{William}[the Conqueror].| Nevertheless, that \emph{does} work and will produce \PName{William, I}{William}[the Conqueror]. If \cmd{\PName*} to get \PName*{William, I}{William}[the Conqueror]. +% Like \cmd{\AKA}, \cmd{\PName} cannot use the old syntax \marg{SNN}\oarg{FNN} for the main name, but it can do so for the alternate name. % -% Also choose forms like |\PName{Lao-tzu}{Li, Er}| ``\PName{Lao-tzu}{Li, Er}'' instead of |\PName{Lao-tzu}{Li}[Er]| ``\PName{Lao-tzu}{Li}[Er].'' Both forms will work, but look real confusing when interchanged. +% |\PName{William,| |I}{William,| |the Conqueror}| gives \PName{William, I}{William, the Conqueror}. To limit possible confusion, avoid the old syntax in the alternate name: |\PName{William, I}{William}[the Conqueror].| Nevertheless, that \emph{does} work and will produce \PName{William, I}{William}[the Conqueror]. If you use \cmd{\PName*} you get \PName*{William, I}{William}[the Conqueror]. % -% The\marginpar{\small\raggedleft\dbend} form |\PName{William, I}[William]{the Conqueror}| will produce ``\IndexInactive\PName{William, I}[William]{the Conqueror}\IndexActive'' in the body text, but its index entry will be ``the Conqueror, William \emph{see} William I.'' This is a result of mixing medieval and Western forms. +% Also choose forms like |\PName{Lao-tzu}{Li, Er}| ``\PName{Lao-tzu}{Li, Er}'' instead of |\PName{Lao-tzu}{Li}[Er]| ``\PName{Lao-tzu}{Li}[Er].'' Both forms will work, but the latter form looks confusing and could lead to error. % -% \clearpage -% -% \subsection{Indexing Macros} -% -% \subsubsection{Indexing Control} -% \label{sec:SectionIndex} -% -% \DescribeMacro{\IndexActive} -% \DescribeMacro{\IndexInactive} -% Using the \texttt{noindex} option deactivates the indexing function of this package until \cmd{\IndexActive} occurs. Another macro, \cmd{\IndexInactive}, will deactivate indexing again. These can be used throughout the document, independently of \cmd{\ExcludeName}. They are global in scope, as are the other toggle macros in this package, so one must be explicit in turning indexing on and off. -% -% Please\marginpar{\small\raggedleft\cmd{\global}} note that these two macros can be used explicitly as a pair. They also can be used singly within an explicit scope, where the effects cease after leaving that scope. Use \cmd{\global} to force a global effect.\medskip -% -% \noindent\begin{tabular}{p{0.96\textwidth}}\toprule\hfil\bfseries Index tags only work when indexing is active.\hfil\\\bottomrule\end{tabular} -% -% \subsubsection{Indexing and \textsf{babel}} -% \label{sec:babel} -% Using\marginpar{\small\raggedleft \textsf{texindy}} \textsf{babel} with Roman page numbers will put \cmd{\textlatin} in the index entries if one includes a language that does not use the Latin alphabet\,---\,even if the main language does. The \texttt{texindy} program will ignore such references. This issue can affect \textsf{nameauth.} -% -% One fairly effective workaround for \texttt{texindy} redefines \cmd{\textlatin} to produce the page number itself within a certain scope like: -% \begin{quote}\small\setstretch{1.1} -% |\newcommand\fixindex[1]{\def\textlatin##1{##1}#1}|\\\dots\\ -% |\fixindex{| \meta{paragraphs of running text} |}| -% \end{quote} -% Of course, one can opt to check if \cmd{\textlatin} is defined, save its value, redefine it, then restore it, perhaps even in an environment. -% -% \subsubsection{\texttt{\textbackslash IndexName}} -% -% \DescribeMacro{\IndexName} -% This macro creates an index entry like those created by \cmd{\Name} and friends. It prints nothing in the body text. The syntax is: -% \begin{quote}\small -% \cmd{\IndexName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} -% \end{quote} -% -% \cmd{\IndexName} complies with the new syntax, where a suffixed pair in \meta{SNN} is a name/affix pair that can be ancient or Eastern. If \meta{FNN} are present, it ignores \meta{Alternate names}. Otherwise, if \meta{FNN} are absent, \cmd{\IndexName} sees \meta{Alternate names} as an affix using the old syntax. -% -% After \cmd{\IndexInactive} this macro does nothing until \cmd{\IndexActive} appears. It will not create index entries for names used with \cmd{\AKA} as cross-references. -% -% The indexing mechanism in the \textsf{nameauth} package follows \emph{Chicago Manual of Style} standards regarding Western names and affixes. Thus the name \LChes\ becomes ``Sullenberger, Chesley B., III'' in the index. Otherwise, if \meta{FNN} is absent, the comma would trigger ancient, medieval, and Eastern name forms in the index. -% -% \subsubsection{Index Sorting} -% \label{sec:IndexSort} -% -% The general practice for sorting with \texttt{makeindex -s} involves creating your own |.ist| file (pages 659--65 in \emph{The Latex Companion}). Otherwise the following form works with both \texttt{makeindex} and \texttt{texindy}: |\index{|\meta{sortkey}|@|\meta{actual}|}| -% -% \begin{center}\bfseries Basic Sorting (Makeindex)\end{center} -% -% \DescribeMacro{\PretagName} -% Since version 2.0, \textsf{nameauth} integrates this sort of index sorting automatically by using a ``pretag.'' The syntax is: -% \begin{quote}\small -% \cmd{\PretagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} -% \end{quote} -% -% \cmd{\PretagName} creates a sort key terminated with the ``actual'' character, which is |@| by default. Do not include the ``actual'' character in the ``pretag.'' -% For example: -% \begin{quote}\small\setstretch{1.1} -% |\PretagName[Jan]{Łukasiewicz}{Lukasiewicz, Jan}|\\ -% |\PretagName{Æthelred, II}{Aethelred 2}| -% \end{quote} -% One need only ``pretag'' names once in the preamble. Every time that one refers to \Name[Jan]{Łukasiewicz} or \Name{Æthelred, II}, the proper index entry will be created. If you create a cross-reference with \cmd{\AKA} and you want to ``pretag'' it, see Section~\ref{sec:AKA}. -% -% Although the \cmd{\PretagName} macro might look similar to the the other tagging macros, its use and scope is quite a bit different: -% \begin{itemize}\small -% \item You can ``pretag'' any name and any cross-reference. -% \item You can ``tag'' and ``untag'' only names, not cross-references. -% \item There is no command to undo a ``pretag.'' -% \end{itemize} -% -% \DescribeMacro{\IndexActual} -% If you need to change the ``actual'' character, such as with \texttt{gind.ist}, you would put |\IndexActual{=}| in the preamble before any use of \cmd{\PretagName}. -% -% \begin{center}\bfseries Extra Spaces and Sorting\end{center} -% -% Under\marginpar{\small\raggedleft\dbend} NFSS, extended Unicode characters expand to add one or two spaces after control sequences. See \cmd{\indexentry} and \cmd{\item} entries in your \texttt{idx} and \texttt{ind} files. For example, \texttt{ä} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\"a}\}} (one space added) and \texttt{Æ} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\AE\textvisiblespace}\}} (two spaces added). -% Both \texttt{xelatex} and \texttt{lualatex} (using \textsf{fontspec}) avoid these issues by handling the characters natively. -% \begin{quote}\small\setstretch{1.1} -% NFSS: |\index{Fußball}| $\rightarrow$ \cmd{\indexentry}\ignorespaces% -% \texttt{\{Fu\cmd{\IeC\textvisiblespace}\{\cmd{\ss\textvisiblespace}\}ball\}\{}\ignorespaces% -% \meta{page}\texttt{\}} -% -% fontspec: |\index{Fußball}| $\rightarrow$ \cmd{\indexentry}\texttt{\{Fußball\}\{}\meta{page}\texttt{\}} -% -% cseq: |\index{Fu\ss ball}| $\rightarrow$ \cmd{\indexentry}\texttt{\{Fu\cmd{\ss\textvisiblespace}ball\}\{}\meta{page}\texttt{\}} -% \end{quote} -% -% A macro with the general form below, similar to \cmd{\IndexName}, will add two spaces after \emph{some} control sequences. Those spaces only affect index sorting, not appearance. Remember this when using manual index entries with \textsf{nameauth}: -% \begin{quote}\small\setstretch{1.1} -% |\newcommand\IndexExample[1]{%|\\ -% \hbox{}\qquad|\protected@edef\argument{#1}\index{\argument}}%| -% -% |\IndexExample{\textsc{football}}| $\rightarrow$\\ \hbox{}\qquad\ignorespaces% -% \cmd{\indexentry}\ignorespaces% -% \texttt{\{\cmd{\textsc\textvisiblespace\textvisiblespace}\ignorespaces% -% \{football\}\}\{}\meta{page}\texttt{\}} -% -% |\index{\textsc{football}}| $\rightarrow$\\ \hbox{}\qquad\ignorespaces% -% \cmd{\indexentry}\ignorespaces% -% \texttt{\{\cmd{\textsc}\ignorespaces% -% \{football\}\}\{}\meta{page}\texttt{\}} -% \end{quote} -% -% \subsubsection{\texttt{\textbackslash TagName}} -% \label{sec:TagName} -% -% \DescribeMacro{\TagName} -% This macro creates an index tag that will be appended to all index entries for a corresponding \cmd{\Name} from when it is invoked until the end of the document or a corresponding \cmd{\UntagName}. Both \cmd{\TagName} and \cmd{\UntagName} handle their arguments like \cmd{\IndexName}. If global tags are desired, tag names in the preamble. -% \begin{quote}\small -% \cmd{\TagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names}\marg{tag} -% \end{quote} -% -% Tags are not ``pretags.'' To help sort that out, we look at what gets affected by these commands: -% -% \begin{center}\small\setstretch{1.1} -% \begin{tabular}{r@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}c@{\,\vrule width0.5pt\,}l} -% & \cmd{\PretagName} & \\ -% |\index{| & |Aethelred 2@| & |Æthelred II| & |, king}|\\ -% & & & \cmd{\TagName} and \cmd{\UntagName}\\ -% \end{tabular} -% \end{center} -% -% All the tagging commands use the name arguments as a reference point. \cmd{\PretagName} generates the leading sort key while \cmd{\TagName} and \cmd{\UntagName} affect the trailing content of the index entry. -% -% Tags created by \cmd{\TagName} can be helpful in the indexes of history texts, as can other package features. Here \cmd{\TagName} causes the \textsf{nameauth} indexing macros to append ``\texttt{,\textvisiblespace pope}'' to the index entries for \Name*{Gregory, I} and \Name*{Leo, I}: -% \begin{center}\small\setstretch{1.1} -% \begin{tabular}{ll} -% |\TagName{Leo, I}{, pope}| & (in the preamble)\\ -% |\TagName{Gregory, I}{, pope}| \\ -% \dots\\ -% |\Name*{Leo, I} was known as| & \Name*{Leo, I} was known as \\ -% |\AKA{Leo, I}{Leo}[the Great].| & \AKA{Leo, I}{Leo}[the Great].\\ -% \dots\\ -% |\Name{Gregory,| |I}| |``\AKA*{Gregory,| |I}%| & \Name{Gregory, I} ``\AKA*{Gregory, I}{Gregory}[the Great],''\\ -% |{Gregory}[the Great],''| |also| |was| & also was a major pope.\\ -% |a| |major| |pope.| \\ -% \end{tabular} -% \end{center} -% -% Tags are literal text that can be daggers, asterisks, and even specials. For example, all fictional names in the index of this manual are tagged with an asterisk. One must add any desired spacing to the start of the tag. Tagging aids scholarly indexing and can include life/regnal dates and other information. -% -% \cmd{\TagName} works with all name types, not just medieval names. Back in Section~\ref{sec:start} we had the example of \AKA[James Earl]{Carter, Jr.}[Jimmy]{Carter} (cross-reference in the index). \cmd{\TagName} adds ``\texttt{,\textvisiblespace president}'' to his index entry\IndexName[James Earl]{Carter, Jr.}. -% -% You can use the \marg{tag} field of \cmd{\TagName} to add specials to index entries for names. Every name in this document is tagged with at least \verb!{|hyperpage}! to allow hyperlinks in the index using the \textsf{ltxdoc} class and \textsf{hypdoc} package. -% -% \subsubsection{\texttt{\textbackslash UntagName}} -% \label{sec:UntagName} -% -% \DescribeMacro{\UntagName} -% \cmd{\TagName} will replace one tag with another tag, but it does not remove a tag from a name. That is the role of \cmd{\UntagName}. The syntax is: -% \begin{quote}\small -% \cmd{\UntagName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} -% \end{quote} -% -% By using \cmd{\TagName} and \cmd{\UntagName}, one can disambiguate different people with the same name. For example: -% -% \begin{quote}\small\setstretch{1.1} -% \ttfamily This refers to |\Name*[John]{Smith}|.\\ -% Now another |\ForgetName[John]{Smith}%|\\ -% |\TagName[John]{Smith}{ (other)}\Name[John]{Smith}|.\\ -% Then a third |\ForgetName[John]{Smith}%|\\ -% |\TagName[John]{Smith}{ (third)}\Name[John]{Smith}|.\\ -% Then the first |\UntagName[John]{Smith}\Name*[John]{Smith}|. -% -% \normalfont This refers to \Name*[John]{Smith}.\hfill\emph{index}: Smith, John\\ -% Now another \ForgetName[John]{Smith}\TagName[John]{Smith}{* (other)\string|hyperpage}\Name[John]{Smith}.\hfill\emph{index}: Smith, John (second)\\ -% Then a third \ForgetName[John]{Smith}\TagName[John]{Smith}{* (third)\string|hyperpage}\Name[John]{Smith}.\hfill\emph{index}: Smith, John (third)\\ -% Then the first \TagName[John]{Smith}{*\string|hyperpage}\Name*[John]{Smith}.\hfill\emph{index}: Smith, John -% \end{quote} -% -% The tweaking macros \cmd{\ForgetName} and \cmd{\SubvertName} make it seem like you are dealing with three people who have the same name. The index tags will group together those entries with the same tag.\footnote{Since this document, unlike the example above, puts an asterisk by all fictional names in the index, it puts an asterisk at the beginning of the tags above and does not \cmd{\UntagName} \Name*[John]{Smith}, but retags him with an asterisk again.} -% -% \subsubsection{Global Name Exclusion} -% -% \DescribeMacro{\ExcludeName} -% \label{sec:exclude} -% This\marginpar{\small\raggedleft\dbend} macro globally prevents the indexing of a particular name or cross-reference. If you do not use it at the beginning of the document, you may not exclude any name or cross-reference that has been used already. The syntax is: -% \begin{quote}\small -% \cmd{\ExcludeName}\oarg{FNN}\marg{SNN}\oarg{Alternate names} -% \end{quote} -% -% Consider the following example, where you will see excluded names printed in the body text with all the formatting and other features: -% \begin{quote}\small\setstretch{1.1} -% |\ExcludeName[Kris]{Kringle}|\ExcludeName[Kris]{Kringle}\\ -% |\Name[Kris]{Kringle}| and |\Name[Kris]{Kringle}|:\\ -% \Name[Kris]{Kringle} and \Name[Kris]{Kringle}. -% \end{quote} -% -% Nevertheless, no matter how many times you use \Name[Kris]{Kringle} in the body text, the name will never appear in the index. Remember the \Name{Grinch} from Section~\ref{sec:tests}? He will not appear in the index either. -% -% \cmd{\ExcludeName} also prevents cross-references. You may see output in the body text, but no \emph{see}-reference will appear in the index: -% \begin{quote}\small\setstretch{1.1} -% |\ExcludeName[Santa]{Claus}|\ExcludeName[Santa]{Claus}\\ -% |\AKA[Kris]{Kringle}[Santa]{Claus}|\\ \AKA[Kris]{Kringle}[Santa]{Claus} -% \end{quote} -% -% Instead of using \cmd{\ExcludeName}, which basically prevents the indexing mechanism of the naming macros from doing anything with a particular name, it is far likelier that you would use the index control macros (Section~\ref{sec:SectionIndex}). +% The\marginpar{\small\raggedleft\dbend} form |\PName{William, I}[William]{the Conqueror}| will produce {\IndexInactive``\PName{William, I}[William]{the Conqueror}''} in the body text, but its index entry will be ``the Conqueror, William \emph{see} William I.'' This is a result of mixing medieval and Western forms. % \clearpage % % \subsection{Longer Examples} % % \subsubsection{Variant Spellings} +% \label{sec:DuBois} +% {\IndexRef[W.E.B.]{Du\-Bois}{Du Bois, W.E.B.}\def\NamesFormat{\bfseries}Some\marginpar{\small\raggedleft\dbend} issues can be a bit tricky to address. Here we show first uses of names in \textbf{boldface} to illustrate more clearly what is going on. For example, the problem of using \Name[W.E.B.]{Du Bois} and the alternate form \Name[W.E.B.]{Du\-Bois} illustrates a name collision for \textsf{nameauth} because the names differ only in terms of spaces. % -% This section illustrates why this package is called ``nameauth.'' Here we get to an example where the macros work together to implement a name authority. -% -% Handling variant name spellings can be complicated. For example, let us assume that you are editing a collection of essays. You might settle on the form \Name[W.E.B.]{Du Bois} in your name authority. An essay in that collection might use the alternate spelling \IndexInactive\Name*[W.E.B.]{DuBois}\IndexActive. The author or publisher who owns that work might not grant you permission to alter the spelling. In that case, you could add an alternate spelling. Using the simplified interface, it would be: +% Normally, that sort of collision helps the fault-tolerant aspects of this package and is a good thing. Here it is not useful. We need to disambiguate the name forms. We do that by inserting an optional hyphen into the alternate form: % \begin{nameauth} % \< DuBois & W.E.B. & Du Bois & > -% \< AltDuBois & W.E.B. & DuBois & > +% \< AltDuBois & W.E.B. & Du\-Bois & > % \end{nameauth} % \begin{quote}\small\setstretch{1.1} % |\begin{nameauth}|\\ % | \< DuBois & W.E.B. & Du Bois & >|\\ -% | \< AltDuBois & W.E.B. & DuBois & >|\\ +% | \< AltDuBois & W.E.B. & Du\-Bois & >|\\ % |\end{nameauth}| % \end{quote} +% We still can prevent either name from breaking by putting either \cmd{\DuBois} or \cmd{\AltDuBois} into an \cmd{\hbox}, and so on. % -% If you wanted to index the alternate spelling with its own entry, the trivial use of \cmd{\AltDuBois} allows that easily. All you need do is make cross-references to each variant in the index so that the reader is aware of them. -% -% Nevertheless, \DuBois\ and \IndexInactive\AltDuBois\IndexActive\ differ only by spaces. For several good reasons, such as fault tolerance in typing, the first/subsequent use mechanism ignores spaces and sees them as \emph{the same name}. Use |\ForgetName[W.E.B.]{Du Bois}| to trigger the first use of \cmd{\AltDuBois} in that section. +% Indexing\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut} both name forms would be trivial. One can use both at need to generate page references in the index. After all of the page references are done, one can create cross-references with \cmd{\SeeAlso}\cmd{\IndexRef}. % -% If you wanted to index the variants under only one name entry, it gets more complicated. You could do the following: -% -% \begin{enumerate}\small -% \item Use |\ForgetName[W.E.B.]{Du Bois}| at the start of the section. -% \item Wrap \cmd{\AltDuBois} between \cmd{\IndexInactive} and \cmd{\IndexActive}. -% \item Call \cmd{\IndexName} with the authoritative form right after \cmd{\IndexActive}. -% \item Create a cross-reference in the index. -% \end{enumerate} -% This can be automated at the start of the section with something like: +% Indexing with only the canonical name form \DuBois\ gets more complex. Before the first reference |\Name[W.E.B.]{Du\-Bois}| or |\AltDuBois| ``\AltDuBois'' occurs, we prevent the creation of any index entries for it by creating a \emph{see} reference, as we did at the start of this section: % \begin{quote}\small\setstretch{1.1} -% \ForgetName[W.E.B.]{DuBois}% -% \gdef\OtherDuBois{\IndexInactive\AltDuBois\IndexActive\IndexName[W.E.B.]{Du Bois}}% -% \index{DuBois, W.E.B.|see{Du Bois, W.E.B.}}% -% |\ForgetName[W.E.B.]{DuBois}|\\ -% |\gdef\OtherDuBois{\IndexInactive\AltDuBois\IndexActive%|\\| \IndexName[W.E.B.]{Du Bois}}|\\ -% \verb!\index{DuBois, W.E.B.|see{Du Bois, W.E.B.}}! +% |\IndexRef[W.E.B.]{Du\-Bois}{Du Bois, W.E.B.}| % \end{quote} +% You can see that first and subsequent name forms, as well as formatting, still work. |\ForgetName[W.E.B.]{Du\-Bois}|\ForgetName[W.E.B.]{Du\-Bois} produces \AltDuBois. We simply will not see index references generated for \AltDuBois. % -% The alternate section mentions \cmd{\OtherDuBois} starting with a first use: \OtherDuBois. Subsequent uses of \cmd{\OtherDuBois} print \OtherDuBois. Of course, one could get more complex than the example above. The index will only hold the standard entry for \Name*[W.E.B.]{Du Bois}: ``Du Bois, W.E.B.'' and a cross-reference from the variant ``DuBois, W.E.B.'' to the standard entry. +% In order to index under |\AltDuBois| as if it were |\DuBois|, we need a macro that will work with the punctuation detection in case we generate the short name W.E.B. We choose the following solution: +% \begin{quote}\small\setstretch{1.1} +% |\global\newcommand*\OtherDuBois|\\ +% | {\IndexName[W.E.B.]{Du Bois}%|\\ +% | \AltDuBois\IndexName[W.E.B.]{Du Bois}}|\\[1ex] +% |\global\newcommand*\SOtherDuBois|\\ +% | {\IndexName[W.E.B.]{Du Bois}\SAltDuBois}| +% \end{quote} +% \global\newcommand*\OtherDuBois{\IndexName[W.E.B.]{Du Bois}\AltDuBois\IndexName[W.E.B.]{Du Bois}}\global\newcommand*\SOtherDuBois{\IndexName[W.E.B.]{Du Bois}\SAltDuBois} +% If we want to ``forget'' \AltDuBois\ again via |\ForgetName[W.E.B.]{Du\-Bois}|\ForgetName[W.E.B.]{Du\-Bois} we get \cmd{\OtherDuBois}: \OtherDuBois\ and \OtherDuBois. With \cmd{\SOtherDuBois} we can mention \SOtherDuBois. The extra full stop at the end of the sentence was gobbled. We used \cmd{\global} to ensure that, regardless of scope, our macros would work wherever we want them to work.} % \clearpage % % \subsubsection{\texttt{\textbackslash LocalNames}} % \label{sec:LocalNames} % -% As mentioned previously in Section~\ref{sec:Tweaks}, both \cmd{\ForgetName} and \cmd{\SubvertName} usually affect both main-matter and front-matter names. This default behavior can be quite helpful. Nevertheless, there are cases where it is undesirable. This section shows \cmd{\Localnames} and \cmd{\Globalnames} in action, limiting the behavior of the ``tweaking macros'' to either the main or front matter. +% As mentioned previously in Section~\ref{sec:tweaks}, both \cmd{\ForgetName} and \cmd{\SubvertName} usually affect both main-matter and front-matter names. This default behavior can be quite helpful. Nevertheless, there are cases where it is undesirable. This section shows \cmd{\Localnames} and \cmd{\Globalnames} in action, limiting the behavior of the ``tweaking macros'' to either the main or front matter. % % We begin by defining a macro that will report to us whether a name exists in the main matter, front matter, both, or none: % \def\CheckChuck{\IfFrontName[Charlie]{Chaplin}% @@ -2306,36 +2489,10 @@ Running "make install" installs the files in the local TeX tree. % \end{quote} % \clearpage % -% \subsubsection{Tips for \texttt{\textbackslash AKA}} -% \label{sec:AKAtips} -% -% \begin{itemize}\small -% \item \oarg{FNN}\marg{SNN} is the main name. \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} is the cross-reference. Forgetting this may cause errors. -% \item The old syntax causes \cmd{\AKA} and \cmd{\AKA*} to fail:|\AKA{Louis}[XIV]{Sun| |King}| and |\AKA{Gregory}[I]{Gregory}[the| |Great]|. -% \item The \meta{Alt. SNN} field uses comma-delimited suffixes. -% \item The \meta{Alt. names} field does not use comma-delimited suffixes. -% \item Eastern names work as pseudonyms, with all that entails. One can refer to \Name[Lafcadio]{Hearn} as \CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}:\\\hbox{}\qquad|\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo}|. -% \item Particles work: \CapThis\AKA[Charles]{du Fresne}{du Cange} is the alternate name for \Name[Charles]{du Fresne}, which is capitalized via \cmd{\CapThis}\cmd{\AKA}. See also Section~\ref{sec:Particles}. -% \item Reversing works, \emph{e.g.},\\\hbox{}\qquad \cmd{\RevComma}\cmd{\AKA\dots}: \RevComma\AKA[Bob]{Hope}[Leslie Townes]{Hope}\\\hbox{}\qquad \cmd{\RevName}\cmd{\AKA\dots\ }: \RevName\CapName\AKA[Lafcadio]{Hearn}{Koizumi, Yakumo} -% \item The\marginpar{\small\raggedleft\dbend} name fields of \cmd{\PretagName} correspond with the \oarg{Alt. FNN}\marg{Alt. SNN}\oarg{Alt. names} fields of \cmd{\AKA}:\\[1ex]\hbox{}\qquad |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş}| matches\\\hbox{}\qquad |\PretagName{Vlad,| |Ţepeş}{Vlad| |Tepes}|\\[1ex] -% This form does not match: |\PretagName{Vlad}[Ţepeş]{Vlad| |Tepes}|. -% \item With\marginpar{\small\raggedleft\dbend} stage names like \Name[The Amazing]{Kreskin}, if you want them in the index, use |\Name[The| |Amazing]{Kreskin}| to get ``Kreskin, The Amazing.'' \IndexInactive Otherwise use something like |\Name[J.]{Kreskin}[The| |Amazing]| to get \Name[J.]{Kreskin}[The Amazing] in the text and ``Kreskin, J.'' in the index.\\[1ex] Using \cmd{\AKA} with such names looks like: |\AKA[The| |Amazing]{Kreskin}| |[Joseph]{Kresge}| and |\AKA[J.]{Kreskin}[Joseph]{Kresge}|.\IndexActive The results are \Name*[The Amazing]{Kreskin}, a.k.a. \AKA[The Amazing]{Kreskin}[Joseph]{Kresge}. -% \item Special\marginpar{\small\raggedleft\dbend} cases like ``Iron Mike'' Tyson as the nickname for \Name[Mike]{Tyson} may be handled in a number of ways. -% \begin{itemize}\small -% \item Follow |``Iron Mike''| with |\IndexName[Mike]{Tyson}| and do whatever you want in the text. This may be the easiest solution. -% \item Use |``\AKA[Mike]{Tyson}{Iron Mike}''| to create ``\AKA[Mike]{Tyson}{Iron Mike}'' in the text and a \emph{see}-type cross-reference to ``Tyson, Mike'' in the index. Be sure to have an occurrence of |\Name[Mike]{Tyson}| in the text. See also Section~\ref{sec:AKA}. This is the best solution in terms of how \textsf{nameauth} is designed. -% \item Always get ``Iron Mike Tyson'' with something like:\\[1ex] -% |\newcommand*\Iron{\SubvertName[Mike]{Tyson}%|\\ -% |\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}}|\\[1ex] -% \newcommand*\Iron{\SubvertName[Mike]{Tyson}\FName[Mike]{Tyson}[Iron Mike] \Name[Mike]{Tyson}} -% |``\Iron''| gives you ``\Iron.''\footnote{In typesetting this manual I defined the macro \cmd{\Iron} and others like it on one continuous line because defining a macro over multiple lines with comment characters ending them in \textsf{ltxdoc} and a \texttt{.dtx} file caused extra spaces to be inserted.} You are responsible for typesetting the first use and creating a cross-reference. This solution runs somewhat contrary to the design principles of \textsf{nameauth}, but it may be helpful if you want the invariant name ``\Iron'' to recur and you want to save typing. -% \end{itemize} -% \end{itemize} -% % \subsubsection{Unicode and NFSS} % \label{sec:Unicode} % -% The following subset of extended Latin Unicode characters are available ``out of the box'' using NFSS, \textsf{inputenc}, and \textsf{fontenc}: +% The following subset of active Unicode characters are available ``out of the box'' using NFSS, \textsf{inputenc}, and \textsf{fontenc}: % % \begin{center}\small\setstretch{1.1} % \begin{tabular}{llll}\toprule @@ -2356,7 +2513,7 @@ Running "make install" installs the files in the local TeX tree. % \end{tabular} % \end{center} % -% Some\marginpar{\small\raggedleft\dbend} of these characters expand differently, which can affect index sorting. For example, \texttt{ä} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\"a}\}} and \texttt{Æ} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\AE\textvisiblespace}\}.} Additional accents and glyphs can be used with Unicode input, NFSS, \textsf{inputenc}, and \textsf{fontenc} when using fonts with TS1 glyphs, \emph{e.g.}, |\usepackage{lmodern}| (per the table on pages 455--63 in \emph{The Latex Companion}). The following example lets you type, ``In Congreſs, July 4, 1776.'' +% Some\marginpar{\small\raggedleft\dbend} of these characters expand differently, which can affect index sorting. For example, \texttt{ä} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\"a}\}} and \texttt{Æ} becomes \texttt{\cmd{\IeC\textvisiblespace}\{\cmd{\AE\textvisiblespace}\}}. Additional accents and glyphs can be used with Unicode input, NFSS, \textsf{inputenc}, and \textsf{fontenc} when using fonts with TS1 glyphs, \emph{e.g.}, |\usepackage{lmodern}| (per the table on pages 455--63 in \emph{The Latex Companion}). The following example lets you type, ``In Congreſs, July 4, 1776.'' % \begin{quote}\small\setstretch{1.1} % |\usepackage{newunicodechar}|\\ % |\DeclareTextSymbolDefault{\textlongs}{TS1}|\\ @@ -2364,7 +2521,7 @@ Running "make install" installs the files in the local TeX tree. % |\newunicodechar{ſ}{\textlongs}| % \end{quote} % -% Although\marginpar{\small\raggedleft\dbend} |\newunicodechar{ā}{\=a}| allows |\Name{Ghazāli}| to generate \IndexInactive\Name{Ghaz\=ali}\IndexActive, one must be careful with control sequences like |\=a| fail when using \texttt{makeindex} and \texttt{gind.ist}. For example, the \textsf{ltxdoc} class, with \texttt{gind.ist}, turns the default ``actual'' character |@| into |=|. Using |\index{Gh{\=a}zali}| halts execution. Using |\index{Gh\=azali}| gives an ``azali'' entry sorted under ``Gh'' (thanks \Name[Dan]{Luecking}). This issue is not specific to \textsf{nameauth}. +% Although\marginpar{\small\raggedleft\dbend} |\newunicodechar{ā}{\=a}| allows |\Name{Ghazāli}| to generate {\IndexInactive\Name{Ghaz\=ali}}, one must be careful with control sequences like |\=a|. They fail when using \texttt{makeindex} and \texttt{gind.ist}. For example, the \textsf{ltxdoc} class, with \texttt{gind.ist}, turns the default ``actual'' character |@| into |=|. Using |\index{Gh{\=a}zali}| halts execution. Using |\index{Gh\=azali}| gives an ``azali'' entry sorted under ``Gh'' (thanks \Name[Dan]{Luecking}). This issue is not specific to \textsf{nameauth}. % % Such\marginpar{\small\raggedleft\dbend} issues with \texttt{gind.ist} are not the only concerns one must have about NFSS, \textsf{inputenc}, and \textsf{fontenc} when using Unicode. Although the manner in which glyphs are handled is quite powerful, it also is fragile. Any \TeX\ macro that partitions its argument without using delimiters can break Unicode under NFSS. Consider the following examples with |\def\foo#1#2#3\relax{<#1#2><#3>}|: % \begin{center}\setstretch{1.1} @@ -2389,11 +2546,25 @@ Running "make install" installs the files in the local TeX tree. % % In both \texttt{xelatex} and \texttt{lualatex} you get the same results as the previous table, where |c| is in |#3| and the first two glyphs are in |#1#2.| However, using \texttt{latex} or \texttt{pdflatex} with \textsf{inputenc} and \textsf{fontenc} causes |æ| by itself to use |#1#2|. % -% Without digging into the details of font encoding and NFSS, we can say in simple terms that |æ| is ``two arguments wide.'' Any macro where this |#1#2| pair gets split into |#1| and |#2| will produce either the error \texttt{Unicode char \dots not set up for LaTeX} or the error \texttt{Argument of \textbackslash UTFviii@two@ octets has an extra \}.} This is not just specific to \textsf{nameauth}. +% Without digging into the details of font encoding and NFSS, we can say in simple terms that |æ| is ``two arguments wide.'' Any macro where this |#1#2| pair gets split into |#1| and |#2| will produce either \texttt{Unicode char \dots not set up for LaTeX} or \texttt{Argument of \textbackslash UTFviii@two@octets has an extra \}}. Again, this is not just specific to \textsf{nameauth}. % -% Using \cmd{\CapThis} can trigger this kind of error when the \emph{first} character of the \meta{SNN} field is an extended-Latin or similarly accented or extended Unicode character. Using \cmd{\AccentCapThis} can trigger this kind of error when the \emph{second} character of the \meta{SNN} field is a similarly accented or extended character. +% \cmd{\CapThis}\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\strut\break\small\dbend} avoids these pitfalls by checking if the leading token of the argument to be capitalized is equivalent to the leading token of an active Unicode character. We chose \texttt{ß} as the test character somewhat at random. Page~\pageref{page:CapRoot} shows the test. Essentially, the following two expressions are equal under NFSS: +% \begin{quote}\small\setstretch{1.1} +% \cmd{\@car}\meta{$test_1$}\cmd{\@nil}, where \meta{$test_1$} expands to \cmd{\IeC} \marg{$test_1$}\\ +% \cmd{\@car}\meta{$test_2$}\cmd{\@nil}, where \meta{$test_2$} expands to \cmd{\IeC} \marg{$test_2$} +% \end{quote} +% If \meta{$test_2$} expands to the letter \meta{$test_2$}, then it will fail the equality. ``Active'' characters expand to ``two-argument wide'' values under NFSS: +% \begin{center}\footnotesize\setstretch{1.1}\makeatletter +% \begin{tabular}{lll}\toprule +% |\def\a|\marg{L} & |\protected@edef\a|\marg{L} & |\protected\edef\a|\marg{L}\\ +% A \def\a{A}\meaning\a & A \protected@edef\a{A}\meaning\a & A \protected\edef\a{A}\meaning\a\\ +% À \def\a{À}\meaning\a & À \protected@edef\a{À}\meaning\a & À \protected\edef\a{À}\meaning\a\\ +% ß \def\a{ß}\meaning\a & ß \protected@edef\a{ß}\meaning\a & ß \protected\edef\a{ß}\meaning\a\\\bottomrule +% \end{tabular} +% \end{center} +% The number of spaces inserted in the index file depends on the number of expansions that occur for a given active character. % -% \LaTeX\marginpar{\small\raggedleft\dbend} also removes spaces between macro arguments in a manner that one should remember: +% \LaTeX\marginpar{\small\raggedleft\dbend} also removes spaces between undelimited macro arguments, but not from the trailing undelimited argument. This is no longer an issue for name arguments in \textsf{nameauth}, but we include the information anyway: % \begin{center}\setstretch{1.1} % \def\foo#1#2#3\relax{<#1#2><#3>} % \begin{tabular}{lll}\toprule @@ -2404,9 +2575,7 @@ Running "make install" installs the files in the local TeX tree. % |abc| & |\foo abc\relax| & \foo abc\relax\\\bottomrule % \end{tabular} % \end{center} -% Notice that if a space exists between the first two arguments,the space gets gobbled between the first two arguments, but retained in the third. This pertains to the way that \LaTeX\ allows for spaces after control sequences and tries to fetch the undelimited |#1#2.| Since |#3| terminates the argument list, it gets ``everything else.'' Nor would using \cmd{\obeyspaces} and \cmd{\ignorespaces} always get the desired result without a certain degree of complexity. -% -% Here is why using explicit spacing macros with one-character particles when using \cmd{\CapThis} and \cmd{\AccentCapThis} helps fix the issue of gobbled spaces, and why non-breaking spaces are preferred:\footnote{Given that you would not want a bad break between a particle and a name.} +% Using explicit spacing macros prevents gobbled spaces: % \begin{center}\small\setstretch{1.1} % \def\foo#1#2#3\relax{<#1#2><#3>} % \begin{tabular}{lll}\toprule @@ -2416,7 +2585,6 @@ Running "make install" installs the files in the local TeX tree. % |a\space bc| & |\foo a\space bc\relax| & \foo a\space bc\relax\\\bottomrule % \end{tabular} % \end{center} -% % See also Sections~\ref{sec:standards} and~\ref{sec:accents}. % \clearpage % @@ -2469,7 +2637,7 @@ Running "make install" installs the files in the local TeX tree. % Before\marginpar{\small\raggedleft Margin\break Paragraphs} we get to the use of text tags and name conditionals in name formatting, we begin with an intermediate example to illustrate that something more complex can occur in \cmd{\NamesFormat}.\marginpar{\small\raggedleft\dbend} Here we put the first mention of a name in boldface, along with a marginal notation if possible:\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.} % \begin{quote}\small\setstretch{1.1} % |\let\OldFormat\NamesFormat%|\\ -% |\renewcommand*\NamesFormat[1]%|\\ +% |\renewcommand*\NamesFormat[1]|\\ % | {\textbf{#1}\ifinner\else|\\ % | \marginpar{\raggedleft\scriptsize #1}\fi}|\\ % \dots\\ @@ -2478,21 +2646,20 @@ Running "make install" installs the files in the local TeX tree. % Changes to \cmd{\NamesFormat} should not rely merely on scoping rules to keep them ``local'' but should be changed and reset explicitly, or else odd side effects can result, especially with more exotic changes to \cmd{\NamesFormat}. We now use the example above in a sample text: % \begin{quote}\small\setstretch{1.1} % \let\OldFormat\NamesFormat\ignorespaces% -% \renewcommand*\NamesFormat[1]% -% {\textbf{#1}\ifinner\else +% \renewcommand*\NamesFormat[1]{\textbf{#1}\ifinner\else % \marginpar{\raggedleft\scriptsize #1}\fi}% % |\PretagName{Vlad, Ţepeş}{Vlad Tepes}% for accented names|\\[2ex] -% {\small |\Name{Vlad| |III,| |Dracula},| |known| |as| |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş},| |``\AKA*{Vlad| |III,| |Dracula}{Vlad}[the| |Impaler]''| |after| |his| |death,| |was| |the| |son| |of| |\Name{Vlad| |II,| |Dracul},| |a| |member| |of| |the| |Order| |of| |the| |Dragon.| |Later| |references| |to| |``\Name{Vlad| |III,| |Dracula}''| |appear| |thus.|}\\[2ex] -% \Name{Vlad III, Dracula}, known as \AKA{Vlad III, Dracula}{Vlad, Ţepeş}, ``\AKA*{Vlad III, Dracula}{Vlad}[the Impaler]'' after his death, was the son of \Name{Vlad II, Dracul}, a member of the Order of the Dragon. Later references to ``\Name{Vlad III, Dracula}'' appear thus. +% {\small |\Name{Vlad| |III,| |Dracula},| |known| |as| |\AKA{Vlad| |III,| |Dracula}{Vlad,| |Ţepeş}| |(the| |Impaler)| |after| |his| |death,| |was| |the| |son| |of| |\Name{Vlad| |II,| |Dracul},| |a| |member| |of| |the| |Order| |of| |the| |Dragon.| |Later| |references| |to| |``\Name{Vlad| |III,| |Dracula}''| |appear| |thus.|}\\[2ex] +% \Name{Vlad III, Dracula}, known as \AKA{Vlad III, Dracula}{Vlad, Ţepeş} (the Impaler) after his death, was the son of \Name{Vlad II, Dracul}, a member of the Order of the Dragon. Later references to ``\Name{Vlad III, Dracula}'' appear thus. % \let\NamesFormat\OldFormat% % \end{quote} % -% Now again we have reverted to the original form of \cmd{\NamesFormat} and we get \ForgetName{Vlad III, Dracula}\Name{Vlad III, Dracula} and \Name{Vlad III, Dracula}. For references to ``Vlad'' instead of ``\Name{Vlad III, Dracula}'' one could use |\Name{Vlad, III Dracula}|. Do not mix these forms with each other and avoid the old syntax, lest errors bite! The simplified interface greatly helps one to avoid this. +% Now again we have reverted to the original form of \cmd{\NamesFormat} and we get \ForgetName{Vlad III, Dracula}\Name{Vlad III, Dracula} and \Name{Vlad III, Dracula}. For references to ``Vlad'' consider using |\Name{Vlad, III}| and use \cmd{\NameAddInfo} and \cmd{\NameQueryInfo} to handle ``\texttt{Dracula}.'' The simplified interface greatly helps one to avoid confusion and settle on specific name forms. % % \let\OldMainHook\MainNameHook% -% You\marginpar{\small\raggedleft\dbend} cannot re-enter \cmd{\Name} or \cmd{\AKA} by calling them within \cmd{\Namesformat,} \cmd{\FrontNameHook,} or \cmd{\MainNameHook,} as the next example shows: +% You\marginpar{\small\raggedleft\dbend} cannot re-enter \cmd{\Name} or \cmd{\AKA} by calling them within \cmd{\Namesformat}, \cmd{\FrontNameHook}, or \cmd{\MainNameHook}, as the next example shows: % \begin{quote}\small\setstretch{1.1} -% |\renewcommand*\MainNameHook[1]%|\\ +% |\renewcommand*\MainNameHook[1]|\\ % |{%|\\ % | {#1}%|\\ % | \IndexInactive%|\\ @@ -2501,17 +2668,17 @@ Running "make install" installs the files in the local TeX tree. % |}| % \end{quote} % \renewcommand*\MainNameHook[1]{{#1}\IndexInactive\Name{foo}\AKA{bar}{baz}\IndexActive}% -% Calling, \emph{e.g.}, |\Wash| produces \Wash, without foo, bar, or baz. \cmd{\Name} and \cmd{\AKA} expand to nothing. Version 2.4 of \textsf{nameauth} prevents stack-overflows both in this case and if you called the naming macros as their own arguments. |\Name{foo\Name{bar}}| would produce ``\textsc{foo}'' in the text and ``foo\textsc{bar}'' in the index. As you see, these cases are to be avoided. +% Calling,\marginpar{\large\raggedleft\textsf{\bfseries 2.4}\strut} \emph{e.g.}, |\Wash| produces \Wash, without foo, bar, or baz. \cmd{\Name} and \cmd{\AKA} expand to nothing. This prevents stack-overflows both in this case and if you called the naming macros as their own arguments. |\Name{foo\Name{bar}}| would produce ``foo'' in the text and ``foobar'' in the index. As you see, these cases are to be avoided. % \let\MainNameHook\OldMainHook % \clearpage % % \subsubsection{Hooks: Life Dates} % \label{sec:Hooksb} -% We\marginpar{\small\raggedleft\dbend} can use name conditionals (Section~\ref{sec:tests}) and text tags (Section~\ref{sec:tagtext}) to add life information to names when desired. +% We can use name conditionals (Section~\ref{sec:tests}) and text tags (Section~\ref{sec:tagtext}) to add life information to names when desired. % % \DescribeMacro{\if@nameauth@InName} % \DescribeMacro{\if@nameauth@InAKA} -% The example \cmd{\NamesFormat} below adds a text tag to the first occurrences of main-matter names. It uses internal macros of \cmd{\@nameauth@Name.} To prevent errors, the Boolean values \cmd{\@nameauth@InName} and \cmd{\@nameauth@InAKA} are true only within the scope of \cmd{\@nameauth@Name} and \cmd{\AKA} respectively. +% The example \cmd{\NamesFormat} below adds a text tag to the first occurrences of main-matter names. It uses internal macros of \cmd{\@nameauth@Name}. To prevent errors, the Boolean values \texttt{\textbackslash if@nameauth@InName} and \texttt{\textbackslash if@nameauth@InAKA} are true only within the scope of \cmd{\@nameauth@Name} and \cmd{\AKA} respectively. % % \DescribeMacro{\@nameauth@toksa} % \DescribeMacro{\@nameauth@toksb} @@ -2523,7 +2690,7 @@ Running "make install" installs the files in the local TeX tree. % |\newif\ifNoTextTag%|\hfill|allows us to work around \ForgetName|\\ % |\let\OldFormat\NamesFormat%|\hfill|save the format|\\ % |\makeatletter%|\hfill|access internals|\\ -% |\renewcommand*\NamesFormat[1]%|\\ +% |\renewcommand*\NamesFormat[1]|\\ % |{%|\\ % | \let\ex\expandafter%|\hfill|reduce typing|\\ % | \textbf{#1}%|\\ @@ -2563,13 +2730,19 @@ Running "make install" installs the files in the local TeX tree. % \NameAddInfo[George]{Washington}{ (1732--99)}% % \NameAddInfo[Mustafa]{Kemal}{ (1881--1938)}% % \NameAddInfo{Atatürk}{ (in 1934, a special surname)}% -% \NameAddInfo{\kern0pt Atatürk}{ (in 1934, a special surname)}% -% \NameAddInfo{Atatürk\kern0pt}{ (in 1934, a special surname)}% +% \NameAddInfo{Ata\-türk}{ (in 1934, a special surname)}% % We begin using the modified \cmd{\NamesFormat} under normal conditions: % \newif\ifNoTextTag% % \let\OldFormat\NamesFormat% % \let\OldFrontFormat\FrontNamesFormat% -% \makeatletter\renewcommand*\NamesFormat[1]{\let\ex\expandafter\textbf{#1}\if@nameauth@InName\ifNoTextTag\else\ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\fi\fi\if@nameauth@InAKA\ifNoTextTag\else\ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\fi\fi\global\NoTextTagfalse}\makeatother +% \makeatletter\renewcommand*\NamesFormat[1]{\let\ex\expandafter\ignorespaces% +% \textbf{#1}\ignorespaces% +% \if@nameauth@InName\ifNoTextTag\else +% \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\ignorespaces% +% \fi\fi +% \if@nameauth@InAKA\ifNoTextTag\else +% \ex\ex\ex\ex\ex\ex\ex\NameQueryInfo\ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@toksa\ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@toksb\ex}\ex[\the\@nameauth@toksc]\ignorespaces% +% \fi\fi\global\NoTextTagfalse}\makeatother % \ForgetName[George]{Washington}% % \begin{quote}\small\setstretch{1.1} % |\Wash| |held| |office| |1789--97.| |No| |tags| |appear| |with| |\Wash. %|\\ @@ -2582,40 +2755,28 @@ Running "make install" installs the files in the local TeX tree. % % \Wash\ held office 1789--97. No tags appear with \Wash. First use, dates suppressed: \NoTextTagtrue\ForgetName[George]{Washington}\Wash. % -% \Name[Mustafa]{Kemal} was granted the name \IndexInactive\AKA[Mustafa]{Kemal}{\kern0pt Atatürk}. We mention \AKA[Mustafa]{Kemal}{\kern0pt Atatürk} again\IndexActive. +% \Name[Mustafa]{Kemal} was granted the name {\IndexInactive\AKA[Mustafa]{Kemal}{Atatürk}. We mention \AKA[Mustafa]{Kemal}{Atatürk} again.} % \end{quote} % -% Notice\marginpar{\small\raggedleft\dbend} that the text tag for Atatürk did not print. That is because \cmd{\AKA} usually only calls the ``subsequent use'' hooks. Therefore we simulate the \texttt{formatAKA} option and \cmd{\ForgetName} \Wash\ and \Name[Mustafa]{Kemal}: +% Notice\marginpar{\small\raggedleft\dbend} that the text tag for \AKA[Mustafa]{Kemal}{Atatürk} did not print. That is because \cmd{\AKA} usually only calls the ``subsequent use'' hooks. Therefore we simulate the \texttt{formatAKA} option and \cmd{\ForgetName} \Wash\ and \Name[Mustafa]{Kemal}: % \begin{quote}\small\setstretch{1.1} % \makeatletter\@nameauth@AKAFormattrue\makeatother % \ForgetName[George]{Washington}% % \ForgetName[Mustafa]{Kemal}% % \Wash\ held office 1789--97. No tags appear with \Wash. First use, dates suppressed: \NoTextTagtrue\ForgetName[George]{Washington}\Wash. % -% \Name[Mustafa]{Kemal} was granted the name \IndexInactive\AKA[Mustafa]{Kemal}{Atatürk\kern0pt}. We mention \AKA[Mustafa]{Kemal}{Atatürk\kern0pt} again\IndexActive. +% \Name[Mustafa]{Kemal} was granted the name {\IndexInactive\AKA[Mustafa]{Kemal}{Ata\-türk}. We mention \AKA[Mustafa]{Kemal}{Ata\-türk} again.} % \end{quote} -% Here we see that the tag is printed because \texttt{formatAKA} allows \cmd{\NamesFormat} to be called for the first use of \AKA[Mustafa]{Kemal}{Atatürk\kern0pt}. +% Here we see that the tag is printed because \texttt{formatAKA} allows \cmd{\NamesFormat} to be called for the first use of {\IndexInactive\AKA[Mustafa]{Kemal}{Ata\-türk}}. % -% Now\marginpar{\small\raggedleft\dbend} we \cmd{\let} the first-use macro in the front matter be the same as that in the main matter and see what we get in the front matter via \cmd{\NamesInactive.} Again we simulate the \texttt{formatAKA} option and \cmd{\ForgetName} \Wash\ and \Name[Mustafa]{Kemal}: -% \begin{quote}\small\setstretch{1.1} -% \makeatletter\@nameauth@AKAFormattrue\makeatother\NamesInactive|\NamesInactive|\\ -% |\let\OldFrontFormat\FrontNamesFormat|\\ -% \let\FrontNamesFormat\NamesFormat|\let\FrontNamesFormat\NamesFormat| +% If we |\let\FrontNamesFormat\NamesFormat| we can get similar results in the front matter and its name system. % -% \ForgetName[George]{Washington}% -% \ForgetName[Mustafa]{Kemal}% -% \Wash\ held office 1789--97. No tags appear with \Wash. First use, dates suppressed: \NoTextTagtrue\ForgetName[George]{Washington}\Wash. -% -% \Name[Mustafa]{Kemal} was granted the name \AKA[Mustafa]{Kemal}{Atatürk}. We mention \AKA[Mustafa]{Kemal}{Atatürk} again. -% \end{quote} -% -% I have not been quite honest above. Since I wanted to simulate multiple first uses of \cmd{\AKA,} which can print a tag only once unless you use the \texttt{alwaysformat} option, I inserted kerns into the instances of |\AKA[Mustafa]{Kemal}{Atatürk}| in the example paragraphs above: +% I have not been quite honest above. Since I wanted to simulate multiple first uses of \cmd{\AKA}, which can print a tag only once unless you use the \texttt{alwaysformat} option, I inserted non-visible control sequences into some instances of |\AKA[Mustafa]{Kemal}{Atatürk}| in the example paragraphs above: % \begin{quote}\footnotesize\setstretch{1.1} -% |\NameAddInfo{\kern0pt| |Atatürk}{| |(a| |special| |surname| |granted| |1934)}|\\ -% |\NameAddInfo{Atatürk\kern0pt}{| |(a| |special| |surname| |granted| |1934)}|\\ -% |\NameAddInfo{Atatürk}{| |(a| |special| |surname| |granted| |1934)}| +% |\NameAddInfo{Atatürk}{| |(a| |special| |surname| |granted| |1934)}|\\ +% |\NameAddInfo{Ata\-türk}{| |(a| |special| |surname| |granted| |1934)}| % \end{quote} -% Because the names were different in each paragraph even though they looked the same, I prevented the names with kerns from appearing in the index via \cmd{\IndexInactive} and \cmd{\IndexActive.}\medskip +% In order to prevent multiple index entries, I prevented the form |{Ata\-türk}| from appearing in the index via \cmd{\IndexInactive} within a scope.\medskip % % Please remember to reset the formatting, if needed: % \begin{quote}\small\setstretch{1.1} @@ -2625,58 +2786,51 @@ Running "make install" installs the files in the local TeX tree. % \let\NamesFormat\OldFormat % \let\FrontNamesFormat\OldFrontFormat % -% Here is a summary of the general behavior within the naming and hook macros and the kinds of decisions you might consider: -% \begin{enumerate} -% \item In \cmd{\@nameauth@name} and \cmd{\AKA}: -% \begin{enumerate} -% \item Parse name arguments. Save an unexpanded copy of each relevant name argument in a token register. -% \item Check for a control sequence based on them. -% \item Enter a decision route based on the result. Yes means the name exists. No means it does not. The decision route engages the Boolean values governing formatting. -% \item Generate the index and print forms of the name. Create the index entry from the former and pass the latter onward to the format switching macro. Based on the Boolean values governing formatting, that macro calls either the first-use or subsequent-use hooks respectively in the main matter or the front matter. -% \end{enumerate} -% \item In the post-processing hooks: -% \begin{enumerate} -% \item Normally you do nothing and exit, or make a local font change and exit. You could do more complex tasks like discarding the text output of the naming macros, then parsing and displaying the name parameters differently, based on the token registers. -% \item You also can make more than one independent check for a control sequence based on the name arguments saved in the token registers. This permits some fairly complex actions based on both the Boolean values and the control sequences themselves. -% \item Thus your decision route could turn into a tree or a set of relationships among a number of names. -% \item Print the form of the name as it was passed, or possibly do something else altogether. -% \item \textbf{If you invoke \cmd{\@nameauth@name} and \cmd{\AKA} from within the hooks, they will do nothing.} -% \end{enumerate} -% \item In \cmd{\@nameauth@name} and \cmd{\AKA}: -% \begin{enumerate} -% \item Generate the control sequence that says the name exists. -% \item Make a second index entry in case of page breaks, clean up and reset any Boolean flags, and exit. -% \end{enumerate} -% \end{enumerate} +% See Section~\ref{sec:internal} and page~\pageref{page:parser} for the decision paths and the logic used by the package. Presently, writing hook macros is much simpler. % \clearpage % -% \subsubsection{Hooks: Continental and Caps} +% \subsubsection{Hooks: Advanced} % \label{sec:Hooksc} % -% \begin{center}\bfseries Continental Format\end{center} -% For\marginpar{\small\raggedleft\dbend} implementing Continental systems of name formatting, in addition to the basic methods already discussed, here we see how one can have the small caps consistently in the surnames for the first uses and the index, yet have a normal font for subsequent references in the body text. -% -% The big difference between this example and the optional caps is that here the font change is optional, while with the caps example, the font change is always present and the caps are optional. And yes, it is possible to do both an optional font change and optional caps. -% -% The literal text of this example goes in the document preamble. We add a Boolean value that turns small caps on or off, depending on the context. Please do not change this directly. +% \begin{center}\bfseries The Name Parser for Hooks\end{center} +% \noindent The\marginpar{\large\raggedleft\textsf{\bfseries 3.0}} current modular design of \textsf{nameauth} (Section~\ref{sec:internal} and page~\pageref{page:parser}) permits one to predict the state of the macros and Boolean flags in the locked path. This means we can use that available information to ``start from scratch'' and completely ignore the parsed and formatted argument of the formatting hooks. We do that by having the hook take an argument: +% \begin{quote}\small\setstretch{1.1} +% |\renewcommand*|\meta{Hook}|[1]{|\texttt{\dots}|}| +% \end{quote} % +% \DescribeMacro{\NameParser} +% There is a pared-down parser available to the package user called \cmd{\NameParser} that only can be used in a formatting hook, else it does nothing. Its sole purpose is to print a name how the regular \textsf{nameauth} parser does it, minus the capitalization extras. Reversing and commas are still usable. The way to use the parser is simple: % \begin{quote}\small\setstretch{1.1} -% |\newif\ifSC|\\ -% |\SCtrue%|\hfill |We want small caps in the index| +% |\renewcommand*|\meta{Hook}|[1]|\\| {|\meta{$cseq_1$\dots $cseq_m$}| \NameParser |\meta{$cseq_n$\dots}|}| % \end{quote} +% The notation \meta{$cseq_1$\dots $cseq_m$} and \meta{$cseq_n$\dots} means a number of control sequences that can change the way a name is parsed. The subsequent examples take advantage of this. % -% \cmd{\DoFormat} is the key to this approach. We want a control sequence that will expand differently, depending on the state of the Boolean value above. +% Also\marginpar{\small\raggedleft\dbend} be aware that if you designed your own hooks for versions of \textsf{nameauth} before 3.0, it remains highly likely that they still work, but without the newer features. Updating your custom hooks is strongly advised. +% +% \begin{center}\bfseries Continental Format\end{center} +% \noindent This implementation of Continental formatting prints surnames in small caps the first time they are used, then no small caps thereafter. Yet small caps are used consistently in the index. +% +% The font change from small caps to normal is generated only in the body text output. The way to handle that is by using \cmd{\noexpand}, since the name arguments in \textsf{nameauth} have to use \cmd{\protected@edef} to work right. +% +% In the document preamble, before defining any names, create the following boolean flag and macro: % % \begin{quote}\small\setstretch{1.1} -% \noindent|\def\DoFormat#1{%|\\ +% |\newif\ifSC|\\ +% |\SCtrue%|\hfill |We want small caps in the index|\\[1ex] +% |\def\DoFormat#1%|\\ +% |{%|\\ % | \ifSC \textsc{#1}%|\hfill |Format small caps if true|\\ % | \else #1%|\hfill |Do nothing if false|\\ -% | \fi}| +% | \fi|\\ +% |}| % \end{quote} % \def\DoFormat#1{\ifSC\textsc{#1}\else#1\fi}% % -% \cmd{\noexpand} is another vital piece of the solution. If one does not use this, all sorts of errors will arise. See how the formatting always is in the \meta{SNN} field. +% \cmd{\DoFormat} is the key to this approach. We want a control sequence that will expand differently, depending on the state of this Boolean flag. +% Using \cmd{\noexpand} is another vital piece of the solution. +% \clearpage % +% Since Continental formatting alters the surname, see how the formatting macro always appears in the \meta{SNN} field below as we start to define names: % \begin{quote}\small\setstretch{1.1} % {\noindent\footnotesize|\begin{nameauth}|\\ % | \< JQA & John Quincy & \noexpand\DoFormat{Adams} & >|\\ @@ -2689,7 +2843,6 @@ Running "make install" installs the files in the local TeX tree. % \end{quote} % % Now we must ensure that these names are sorted properly in the index. See again how the formatting must be present: -% % \begin{quote}\small\setstretch{1.1} % {\noindent\footnotesize|\PretagName[John Quincy]%|\\ % | {\noexpand\DoFormat{Adams}}{Adams, John Quincy}|\\ @@ -2702,7 +2855,6 @@ Running "make install" installs the files in the local TeX tree. % | {\noexpand\DoFormat{Davis}, \noexpand\DoFormat{Jr}.}%|\\ % | {Davis, Sammy, Jr.}|} % \end{quote} -% \clearpage % % We save the hook macros if we want to recall them. % \begin{quote}\small\setstretch{1.1} @@ -2716,223 +2868,15 @@ Running "make install" installs the files in the local TeX tree. % \let\OldFrontNamesFormat\FrontNamesFormat% % \let\OldFrontHook\FrontNameHook% % \let\OldMainHook\MainNameHook% -% We\marginpar{\small\raggedleft\dbend} do not need to redefine either \cmd{\NamesFormat} or \cmd{\FrontNamesFormat} because we already set the default to be small caps. We redefine \cmd{\MainNameHook} and \cmd{\FrontNameHook} in order to \emph{suppress} formatting in subsequent uses of names. -% -% The new implementation of \cmd{\MainNameHook} follows. We incorporate those parts of \cmd{\AKA} and \cmd{\@nameauth@Name} that print name arguments in the text.\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.} -% Please bear in mind that this example is quite long. -% -% \begin{quote}\small\setstretch{1.1} -% |\makeatletter%|\\ -% |\renewcommand*\MainNameHook[1]%|\\ -% |{%|\\ -% | \let\ex\expandafter%|\\ -% | \SCfalse%| -% \end{quote} -% -% Above we set the small caps Boolean to false. Now we have to ``redo'' name parsing in order to get the different format. We expand the naming macros from the token registers set by the parent naming macro. -% -% \begin{quote}\small\setstretch{1.1} -% {\noindent\footnotesize| \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}%|\\ -% | \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}%|\\ -% | \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}%|\\ -% | \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}%|} -% \end{quote} -% -% \cmd{\Space} (below) is defined by the parent naming macro. Before we print an appropriate version of the pseudonym or name in the text, we determine the removable suffix, if any, and the reversed forms. -% -% \begin{quote}\small\setstretch{1.1} -% | \ifx\argb\testb|\\ -% | \protected@edef\Suff{\@empty}%|\\ -% | \let\Reversed\argb%|\\ -% | \let\SNN\argb%|\\ -% | \let\Short\argb%|\\ -% | \else|\\ -% | \protected@edef\Suff{\ex\@nameauth@Suffix\ex{%|\\ -% | \the\@nameauth@toksb}}%|\\ -% | \protected@edef\Reversed{\Suff\Space\testb}%|\\ -% | \protected@edef\SNN{\testb\Space\Suff}%|\\ -% | \if@nameauth@RevThis|\\ -% | \let\Short\Suff%|\\ -% | \else|\\ -% | \let\Short\testb%|\\ -% | \fi|\\ -% | \fi| -% \end{quote} -% -% \cmd{\AllCapsActive}, \cmd{\CapName}, and the \texttt{allcaps} package option are ignored here because they are incompatible with the Continental approach. Only the reversing macros will be usable. -% \clearpage -% -% \noindent If the parent naming macro is \cmd{\AKA} and its variants, print an appropriate version of the pseudonym in the text. -% \begin{quote}\small\setstretch{1.1} -% | \if@nameauth@InAKA|\\ -% | \ifx\arga\@empty|\\ -% | \ifx\argc\@empty|\\ -% | \if@nameauth@RevThis \Reversed \else \SNN \fi|\\ -% | \else|\\ -% | \if@nameauth@AltAKA \argc%|\\ -% | \else|\\ -% | \if@nameauth@RevThis \ex\argc\ex\space\SNN%|\\ -% | \else \ex\SNN\ex\space\argc%|\\ -% | \fi \fi \fi|\\ -% | \else|\\ -% | \ifx\argc\@empty \let\FNN\arga%|\\ -% | \else \let\FNN\argc%|\\ -% | \fi|\\ -% | \if@nameauth@AltAKA \FNN%|\\ -% | \else|\\ -% | \if@nameauth@RevThis \ex\SNN\ex\Space\FNN%|\\ -% | \else \ex\FNN\ex\space\SNN%|\\ -% | \fi \fi \fi|\\ -% | \else| -% \end{quote} -% If the main naming engine is the parent macro, print an appropriate version of the name in the text. -% \begin{quote}\small\setstretch{1.1} -% | \ifx\arga\@empty|\\ -% | \ifx\argc\@empty|\\ -% | \if@nameauth@FullName|\\ -% | \if@nameauth@RevThis \Reversed \else \SNN \fi|\\ -% | \else \Short \fi|\\ -% | \else|\\ -% | \if@nameauth@FullName|\\ -% | \if@nameauth@RevThis \ex\argc\ex\space\SNN%|\\ -% | \else \ex\SNN\ex\space\argc%|\\ -% | \fi|\\ -% | \else|\\ -% | \if@nameauth@RevThis \argc \else \Short \fi|\\ -% | \fi \fi|\\ -% | \else|\\ -% | \ifx\argc\@empty \let\FNN\arga%|\\ -% | \else \let\FNN\argc%|\\ -% | \fi|\\ -% | \let\Short\FNN%|\\ -% | \if@nameauth@FullName|\\ -% | \if@nameauth@RevThis \ex\SNN\ex\Space\FNN%|\\ -% | \else \ex\FNN\ex\space\SNN%|\\ -% | \fi|\\ -% | \else|\\ -% | \if@nameauth@FirstName \Short \else \testb \fi|\\ -% | \fi \fi \fi|\\ -% |}| -% \end{quote} -% \makeatletter% -% \renewcommand*\MainNameHook[1]{\ignorespaces% -% \let\ex\expandafter\ignorespaces% -% \SCfalse\ignorespaces% -% \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}\ignorespaces% -% \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}\ignorespaces% -% \ifx\argb\testb -% \protected@edef\Suff{\@empty}\ignorespaces% -% \let\Reversed\argb\ignorespaces% -% \let\SNN\argb\ignorespaces% -% \let\Short\argb\ignorespaces% -% \else -% \protected@edef\Suff{\ex\@nameauth@Suffix\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\Reversed{\Suff\Space\testb}\ignorespaces% -% \protected@edef\SNN{\testb\Space\Suff}\ignorespaces% -% \if@nameauth@RevThis -% \let\Short\Suff% -% \else -% \let\Short\testb% -% \fi -% \fi -% \if@nameauth@InAKA -% \ifx\arga\@empty -% \ifx\argc\@empty -% \if@nameauth@RevThis -% \Reversed% -% \else -% \SNN% -% \fi -% \else -% \if@nameauth@AltAKA -% \argc% -% \else -% \if@nameauth@RevThis -% \ex\argc\ex\space\SNN% -% \else -% \ex\SNN\ex\space\argc% -% \fi -% \fi -% \fi -% \else -% \ifx\argc\@empty -% \let\FNN\arga% -% \else -% \let\FNN\argc% -% \fi -% \if@nameauth@AltAKA -% \FNN% -% \else -% \if@nameauth@RevThis -% \ex\SNN\ex\Space\FNN% -% \else -% \ex\FNN\ex\space\SNN% -% \fi -% \fi -% \fi -% \else -% \ifx\arga\@empty -% \ifx\argc\@empty -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \Reversed% -% \else -% \SNN% -% \fi -% \else -% \Short% -% \fi -% \else -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \ex\argc\ex\space\SNN% -% \else -% \ex\SNN\ex\space\argc% -% \fi -% \else -% \if@nameauth@RevThis -% \argc% -% \else -% \Short% -% \fi -% \fi -% \fi -% \else -% \ifx\argc\@empty -% \let\FNN\arga% -% \else -% \let\FNN\argc% -% \fi -% \let\Short\FNN% -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \ex\SNN\ex\Space\FNN% -% \else -% \ex\FNN\ex\space\SNN% -% \fi -% \else -% \if@nameauth@FirstName -% \Short% -% \else -% \testb% -% \fi -% \fi -% \fi -% \fi -% } -% \clearpage -% -% Now we let \cmd{\FrontNameHook} be the same as \cmd{\MainNameHook}, and we are ready to see the Continental approach in action. +% We\marginpar{\large\raggedleft\textsf{\bfseries 3.0}} do not need to redefine either \cmd{\NamesFormat} or \cmd{\FrontNamesFormat} because we already set the default to be small caps. We redefine \cmd{\MainNameHook} and \cmd{\FrontNameHook} in order to \emph{suppress} formatting in subsequent uses of names. Currently, this is fairly easy.\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.} % \begin{quote}\small\setstretch{1.1} -% |\let\FrontNameHok\MainNameHook|\\ -% |\makeatother| +% |\renewcommand*\MainNameHook[1]{\SCfalse\NameParser}|\\ +% |\let\FrontNameHook\MainNameHook| % \end{quote} -% \let\FrontNameHook\MainNameHook -% \makeatother +% \renewcommand*\MainNameHook[1]{\SCfalse\NameParser}% +% \let\FrontNameHook\MainNameHook% % -% \noindent{\bfseries Main Matter}\medskip +% Here we see the results for both main- and front-matter names. Not only did we get the formatting that we wanted, but we also retained many other features.\bigskip % % {\footnotesize\noindent\begin{tabular}{llll}\toprule % First & Next & Long & Short \\\midrule @@ -2941,21 +2885,14 @@ Running "make install" installs the files in the local TeX tree. % \Aeths & \Aeths & \LAeths & \SAeths\\ % \Chas & \Chas & \LChas & \SChas\\ % \Cao & \Cao & \LCao & \SCao\\\bottomrule -% \end{tabular}}\bigskip -% -% \noindent{\bfseries Front Matter}\medskip +% \end{tabular}} +% \clearpage % -% \NamesInactive{\footnotesize\noindent\begin{tabular}{llll}\toprule -% First & Next & Long & Short \\\midrule -% \JQA & \JQA & \LJQA & \SJQA\\ -% \JRIII & \JRIII & \LJRIII & \SJRIII\\ -% \Aeths & \Aeths & \LAeths & \SAeths\\ -% \Chas & \Chas & \LChas & \SChas\\ -% \Cao & \Cao & \LCao & \SCao\\\bottomrule -% \end{tabular}}\NamesActive % \begin{itemize}\small % \item Punctuation detection still works: \SDJR. Then we have \SDJR. % \item \cmd{\RevComma}\cmd{\LJQA} yields \RevComma\LJQA. All the reversing macros work. +% \item \cmd{\DropAffix}\cmd{\LJRIII} gives: \DropAffix\LJRIII. +% \item \cmd{\ForceFN}\cmd{\SChas} produces: ``\ForceFN\SChas'' instead of \cmd{\SChas} ``\SChas.'' This is, in fact, the correct result. % \item Using the main interface requires some extra typing. For example,\\ % |\ForgetName[John Quincy]{\noexpand\DoFormat{Adams}}\JQA|\\ % results in \ForgetName[John Quincy]{\noexpand\DoFormat{Adams}}\JQA. @@ -2969,57 +2906,52 @@ Running "make install" installs the files in the local TeX tree. % \end{quote} % \makeatletter\@nameauth@AKAFormatfalse\makeatother % -% \NamesInactive% -% If you want to suppress formatting altogether in the front matter, make the following change: -% |\let\FrontNamesFormat\MainNameHook|\medskip -% \let\FrontNamesFormat\MainNameHook% -% \ForgetName[John Quincy]{\noexpand\DoFormat{Adams}}% -% \ForgetName{\noexpand\DoFormat{Æþelstan}}% -% \ForgetName{\noexpand\DoFormat{Charles}, I}% -% \ForgetName{\noexpand\DoFormat{Cao}, Cao}% -% \ForgetName[John David]{\noexpand\DoFormat{Rockefeller}, III} - -% \noindent{\bfseries Front Matter (hooks changed; names forgotten)}\medskip -% -% {\footnotesize\noindent\begin{tabular}{llll}\toprule -% First & Next & Long & Short \\\midrule -% \JQA & \JQA & \LJQA & \SJQA\\ -% \JRIII & \JRIII & \LJRIII & \SJRIII\\ -% \Aeths & \Aeths & \LAeths & \SAeths\\ -% \Chas & \Chas & \LChas & \SChas\\ -% \Cao & \Cao & \LCao & \SCao\\\bottomrule -% \end{tabular}}\NamesActive\bigskip +% If you want to suppress formatting altogether in the front matter, make the following change: |\let\FrontNamesFormat\MainNameHook.| % % When needed, we can use \cmd{\let} to restore the hooks to their old values. Please note, however, that the index entries will contain small caps, regardless of how we change the hook macros for the document text. % \let\NamesFormat\OldNamesFormat% % \let\FrontNamesFormat\OldFrontNamesFormat% % \let\FrontNameHook\OldFrontHook% % \let\MainNameHook\OldMainHook% -% \clearpage % % \begin{center}\bfseries Caps within Formatting\end{center} -% This\marginpar{\small\raggedleft\dbend} method of redesigning the hooks must be used if you want to capitalize a name that is otherwise formatted in the index. All we need to do is modify the example above. We begin in similar fashion, but add a few extra bits:\footnote{A similar version of this example is in \texttt{examples.tex}, collocated with this manual.} +% \noindent This\marginpar{\small\raggedleft\dbend} method of redesigning the hooks must be used if you want to capitalize a name that is otherwise formatted in the index. All we need to do is modify the example above. We begin in similar fashion, but add a few extra bits. First come three Boolean flags that control the format changes. \texttt{\textbackslash ifItal} controls italics. \texttt{\textbackslash ifFirstCap} controls capitalization, and \texttt{\textbackslash ifInHook} is set true in a hook macro so that we do not capitalize outside of it.\footnote{One could use the internal flag \texttt{\textbackslash if@nameauth@InHook} to the same effect. A similar version of this example is in \texttt{examples.tex}, collocated with this manual.} % \begin{quote}\small\setstretch{1.1} % |\newif\ifItal%|\hfill |Flag to trigger italics|\\ % |\newif\ifFirstCap%|\hfill |Flag to trigger caps|\\ % |\newif\ifInHook%|\hfill |But only with a name in the body text|\\ -% |\Italtrue%|\hfill |We want italics in the index|\\ -% |\def\DoFormat#1{%|\\ -% | \ifItal\textit{#1}\else#1\fi|\\ -% |}|\\ -% |\def\CP#1{%|\\ +% |\Italtrue%|\hfill |We want italics in the index| +% \end{quote} +% +% This \cmd{\DoFormat} below is quite similar to the previous example. In fact, if you take the names from the previous example and use them here, this will change the appearance not only in the body text but also in the index, creating a separate set of entries (at least with \texttt{makeindex}). +% \begin{quote}\small\setstretch{1.1} +% |\def\DoFormat#1%|\\ +% |{%|\\ +% | \ifItal \textit{#1}%|\\ +% | \else #1%|\\ +% | \fi|\\ +% |}| +% \end{quote} +% \def\DoFormat#1{\ifItal\textit{#1}\else#1\fi}% +% \clearpage +% +% Here is the macro that achieves capitalization in the name. Please put its argument within braces to avoid breaking active Unicode characters in NFSS. We have to restrict the operation of this macro to a formatting hook via \texttt{\textbackslash ifInHook}. +% \begin{quote}\small\setstretch{1.1} +% |\def\CP#1%|\\ +% |{%|\\ % | \ifInHook|\\ -% | \ifFirstCap\uppercase{#1}\else#1\fi%|\\ -% | \else|\\ -% | #1%|\\ +% | \ifFirstCap \uppercase{#1}%|\\ +% | \else #1%|\\ +% | \fi|\\ +% | \else #1%|\\ % | \fi|\\ % |}|\\ % |\newcommand*\CapMe{\FirstCaptrue}| % \end{quote} -% -% \def\DoFormat#1{\ifItal\textit{#1}\else#1\fi}% % \def\CP#1{\ifInHook\ifFirstCap\uppercase{#1}\else#1\fi\else#1\fi}% -% Like\marginpar{\small\raggedleft\dbend} the previous example on Continental formatting, you would put the formatting in the naming macro arguments. \cmd{\CP} can fail using NFSS and Unicode, so take care! We have changed the meaning of \cmd{\DoFormat} in this section. If we were to use any of the names from the Continental example above, they would now be formatted italic and produce different index entries that also would be italicized instead of small caps. +% \newcommand*\CapMe{\FirstCaptrue} +% +% Like the previous example, you put the formatting in the naming macro arguments. Remember to ensure that \cmd{\CP} does not break active characters by putting its argument in braces. % \begin{quote}\footnotesize\setstretch{1.1} % |\PretagName[Pierre-Jean]{\noexpand\DoFormat{\noexpand\CP{d}e Smet}}%|\\ % | {de Smet, Pierre-Jean}|\\ @@ -3027,145 +2959,30 @@ Running "make install" installs the files in the local TeX tree. % | \<| |deSmet| |&| |Pierre-Jean| |&| |\noexpand\DoFormat{\noexpand\CP{d}e| |Smet}}| |&| |>|\\ % |\end{nameauth}| % \end{quote} -% -% We take the code of \cmd{\MainNameHook} above and redefine it to be \cmd{\NamesFormat}. We change the example above to read: -% \begin{quote}\small\setstretch{1.1} -% |\renewcommand*\MainNameHook[1]{%|\\ -% | \let\ex\expandafter%|\\ -% | \InHooktrue%|\hfill |cap in the text, not the index| -% \end{quote} -% Leave the rest of the example intact and change the last part of the macro: -% \begin{quote}\small\setstretch{1.1} -% | \InHookfalse\global\FirstCapfalse%|\\ -% |}\makeatother%| -% \end{quote} -% You need to have \cmd{\global} before \cmd{\FirstCapfalse} to ensure that the change persists beyond the scope. By design, the hooks occur within a group in the naming functions. -% \clearpage % -% If you want italics all the time, just \cmd{\let} all the hooks be \cmd{\NamesFormat}. If you want to follow the Continental style similar to the example above, you do: +% You need to have \cmd{\global} before \cmd{\FirstCapfalse} to ensure that the change persists beyond the scope of the hook. +% +% If you want to use italics all the time, just \cmd{\let} all the hooks be \cmd{\NamesFormat}. If you want to follow the style of the previous example above, you do: % \begin{quote}\small\setstretch{1.1} +% |\renewcommand*\NamesFormat[1]|\\ +% |{%|\\ +% | \InHooktrue\NameParser\InHookfalse%|\\ +% | \global\FirstCapfalse%|\\ +% |}|\\[1ex] +% |\renewcommand*\MainNameHook[1]|\\ +% |{%|\\ +% | \Italfalse\InHooktrue\NameParser\InHookfalse%|\\ +% | \global\FirstCapfalse\Italtrue%|\\ +% |}|\\[1ex] % |\let\FrontNamesFormat\NamesFormat|\\ -% |\renewcommand*\MainNameHook[1]%|\\ -% | {\Italfalse\NamesFormat{#1}\Italtrue}|\\ % |\let\FrontNameHook\MainNameHook| % \end{quote} -% \newcommand*\CapMe{\FirstCaptrue} -% \makeatletter% -% \renewcommand*\NamesFormat[1]{\ignorespaces% -% \let\ex\expandafter\ignorespaces% -% \InHooktrue\ignorespaces% -% \protected@edef\arga{\ex\trim@spaces\ex{\the\@nameauth@toksa}}\ignorespaces% -% \protected@edef\argb{\ex\trim@spaces\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\testb{\ex\@nameauth@Root\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\argc{\ex\trim@spaces\ex{\the\@nameauth@toksc}}\ignorespaces% -% \ifx\argb\testb -% \protected@edef\Suff{\@empty}\ignorespaces% -% \let\Reversed\argb\ignorespaces% -% \let\SNN\argb\ignorespaces% -% \let\Short\argb\ignorespaces% -% \else -% \protected@edef\Suff{\ex\@nameauth@Suffix\ex{\the\@nameauth@toksb}}\ignorespaces% -% \protected@edef\Reversed{\Suff\Space\testb}\ignorespaces% -% \protected@edef\SNN{\testb\Space\Suff}\ignorespaces% -% \if@nameauth@RevThis -% \let\Short\Suff% -% \else -% \let\Short\testb% -% \fi -% \fi -% \if@nameauth@InAKA -% \ifx\arga\@empty -% \ifx\argc\@empty -% \if@nameauth@RevThis -% \Reversed% -% \else -% \SNN% -% \fi -% \else -% \if@nameauth@AltAKA -% \argc% -% \else -% \if@nameauth@RevThis -% \ex\argc\ex\space\SNN% -% \else -% \ex\SNN\ex\space\argc% -% \fi -% \fi -% \fi -% \else -% \ifx\argc\@empty -% \let\FNN\arga% -% \else -% \let\FNN\argc% -% \fi -% \if@nameauth@AltAKA -% \FNN% -% \else -% \if@nameauth@RevThis -% \ex\SNN\ex\Space\FNN% -% \else -% \ex\FNN\ex\space\SNN% -% \fi -% \fi -% \fi -% \else -% \ifx\arga\@empty -% \ifx\argc\@empty -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \Reversed% -% \else -% \SNN% -% \fi -% \else -% \Short% -% \fi -% \else -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \ex\argc\ex\space\SNN% -% \else -% \ex\SNN\ex\space\argc% -% \fi -% \else -% \if@nameauth@RevThis -% \argc% -% \else -% \Short% -% \fi -% \fi -% \fi -% \else -% \ifx\argc\@empty -% \let\FNN\arga% -% \else -% \let\FNN\argc% -% \fi -% \let\Short\FNN% -% \if@nameauth@FullName -% \if@nameauth@RevThis -% \ex\SNN\ex\Space\FNN% -% \else -% \ex\FNN\ex\space\SNN% -% \fi -% \else -% \if@nameauth@FirstName -% \Short% -% \else -% \testb% -% \fi -% \fi -% \fi -% \fi -% \InHookfalse\global\FirstCapfalse} +% \renewcommand*\NamesFormat[1]{\InHooktrue\NameParser\InHookfalse\global\FirstCapfalse}% +% \renewcommand*\MainNameHook[1]{\Italfalse\InHooktrue\NameParser\InHookfalse\global\FirstCapfalse\Italtrue}% % \let\FrontNamesFormat\NamesFormat% -% \renewcommand*\MainNameHook[1]{\Italfalse\NamesFormat{#1}\Italtrue}% % \let\FrontNameHook\MainNameHook% -% % Now we show how the formatting hooks work in the body text. One can check the index to see that it is formatted with italics and is consistent.\medskip % -% \noindent{\bfseries Main Matter} -% % \begin{center}\footnotesize % \begin{tabular}{llll}\toprule % First & Next & Long & Short \\\midrule @@ -3174,19 +2991,7 @@ Running "make install" installs the files in the local TeX tree. % \end{tabular} % \end{center} % -% \noindent{\bfseries Front Matter} -% -% \begin{center}\NamesInactive\footnotesize -% \begin{tabular}{llll}\toprule -% First & Next & Long & Short \\\midrule -% |\deSmet| & |\deSmet| & |\LdeSmet| & |\SdeSmet|\\ -% \deSmet & \deSmet & \LdeSmet & \SdeSmet\\\bottomrule -% \end{tabular} -% \end{center} -% -% The capitalized version |\CapMe\deSmet| is \CapMe\deSmet. If we let \cmd{\MainNameHook} be the same as \cmd{\NamesFormat} we can get \let\MainNameHook\NamesFormat\CapMe\deSmet. The index entries will be consistent for all the variations in the text. -% -% Of course, one could go a step further and integrate this capitalizing mechanism with the \cmd{\CapThis} and \cmd{\AccentCapThis} macros. That, however, goes beyond the scope of this example. You would have to insert the capitalization bits from \cmd{\@nameauth@name}. Or you could test for the latex engine and do everything in the hook, and redefine \cmd{\CapThis}. +% The capitalized version |\CapMe\deSmet| is \CapMe\deSmet. This also works for a formatted use: \let\MainNameHook\NamesFormat\CapMe\deSmet. The index entries will be consistent for all the variations in the text. % % Also, remember to restore the macro hooks if they should not persist for the entire document, or else you will get unwanted results: % \begin{quote}\small\setstretch{1.1} @@ -3199,7 +3004,6 @@ Running "make install" installs the files in the local TeX tree. % \let\FrontNamesFormat\OldFrontNamesFormat% % \let\FrontNameHook\OldFrontHook% % \let\MainNameHook\OldMainHook% -% \clearpage % % \subsubsection{Full Redesign} % \label{sec:NewEngine} @@ -3209,14 +3013,14 @@ Running "make install" installs the files in the local TeX tree. % \DescribeMacro{\NameauthName} % \DescribeMacro{\NameauthLName} % \DescribeMacro{\NameauthFName} -% These macros are set by default to \cmd{\@nameauth@Name}, the internal name parser. The main and simplified interfaces call them as respective synonyms for \cmd{\Name,} \cmd{\Name*,} and \cmd{\FName.} Should you desire to create your own naming macros, you can redefine them. Here is the minimal working example: +% These macros are set by default to \cmd{\@nameauth@Name}, the internal name parser. The main and simplified interfaces call them as respective synonyms for \cmd{\Name}, \cmd{\Name*}, and \cmd{\FName}. Should you desire to create your own naming macros, you can redefine them. Here is the minimal working example: % \begin{quote}\small\setstretch{1.1} % |\makeatletter|\\ -% |\newcommandx*\MyName[3][1=\@empty, 3=\@empty]{|\meta{Name}|}%|\\ -% |\newcommandx*\MyLName[3][1=\@empty, 3=\@empty]%|\\ -% | {|\meta{Long name}|\@nameauth@FullNamefalse}%|\\ -% |\newcommandx*\MyFName[3][1=\@empty, 3=\@empty]%|\\ -% | {|\meta{Short name}|\@nameauth@FirstNamefalse}%|\\ +% |\newcommandx*\MyName[3][1=\@empty, 3=\@empty]{|\meta{Name}|}|\\ +% |\newcommandx*\MyLName[3][1=\@empty, 3=\@empty]|\\ +% | {|\meta{Long name}|\@nameauth@FullNamefalse}|\\ +% |\newcommandx*\MyFName[3][1=\@empty, 3=\@empty]|\\ +% | {|\meta{Short name}|\@nameauth@FirstNamefalse}|\\ % |\makeatother| % \end{quote} % @@ -3244,179 +3048,158 @@ Running "make install" installs the files in the local TeX tree. % \end{quote} % Like\marginpar{\small\raggedleft\cmd{\global}} \cmd{\NamesFormat}, the other hook macros, and many of the state-changing and triggering macros in this package, these naming macros can be redefined or used locally within a scope without making global changes to the document unless you specifically use \cmd{\global}. % -% Here we show that the macros \cmd{\NameauthName,} \cmd{\NameauthLName,} and \cmd{\NameauthFName} have reverted back to their original forms. Now \cmd{\Silly} and |\Name[No Particular]{Name}| produce \IndexInactive\Silly\ and \Name[No Particular]{Name}\IndexActive. +% Here we show that \cmd{\NameauthName}, \cmd{\NameauthLName}, and \cmd{\NameauthFName} have reverted back to their original forms. Now |\Name[No Particular]{Name}| and \cmd{\Silly} produce {\IndexInactive\Name[No Particular]{Name} and \Silly.} % \clearpage % % \subsection{Naming Pattern Reference} % \label{sec:PatRef} % -% \subsubsection{Basic Naming} -% \noindent{\bfseries Western Names}\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.42\textwidth}@{}p{0.53\textwidth}}\toprule -% \textit{First reference in the text}:\newline\hbox to 1em{\hfil}\ForgetName[John]{Smith}\Name[John]{Smith} & -% |\Name*[John]{Smith}|\newline |\Name[John]{Smith}|\newline |\FName[John]{Smith}|\\[1ex] -% \textit{Subsequent full}: \Name*[John]{Smith} & |\Name*[John]{Smith}|\\[1ex] -% \textit{Subsequent surname}: \Name[John]{Smith} & |\Name[John]{Smith}|\\[1ex] -% \textit{Subsequent forename}: \FName[John]{Smith} & |\FName[John]{Smith}|\\\midrule -% \textit{Long first reference}: \ForgetName[J.Q.]{Public}\newline\hbox to 1em{\hfil}\Name[J.Q.]{Public}[Jane Q.] & |\Name*[J.Q.]{Public}[Jane Q.]|\newline |\Name[J.Q.]{Public}[Jane Q.]|\newline |\FName[J.Q.]{Public}[Jane Q.]|\\[1ex] -% \textit{Subsequent full}: \Name*[J.Q.]{Public} & |\Name*[J.Q.]{Public}|\\[1ex] -% \textit{Alternate}: \Name*[J.Q.]{Public}[Jane Qetsiyah] & |\Name*[J.Q.]{Public}[Jane Qetsiyah]|\\[1ex] -% \textit{Alternate}: \FName[J.Q.]{Public}[Janie] & |\FName[J.Q.]{Public}[Janie]|\\\bottomrule -% \end{tabular}} -% \vfil -% -% \noindent{\bfseries Western Plus Affixes}\\[2ex] -% Always use a comma to delimit name/affix pairs.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.42\textwidth}@{}p{0.53\textwidth}}\toprule -% \textit{First reference}:\newline\hbox to 1em{\hfil}\ForgetName[George S.]{Patton, Jr.}\Name[George S.]{Patton, Jr.} & |\Name*[George S.]{Patton, Jr.}|\newline |\Name[George S.]{Patton, Jr.}|\newline |\FName[George S.]{Patton, Jr.}|\\[1ex] -% \textit{Subsequent}: \Name*[George S.]{Patton, Jr.} & |\Name*[George S.]{Patton, Jr.}|\\[1ex] -% \textit{Subsequent surname}: \Name[George S.]{Patton, Jr.} & |\Name[George S.]{Patton, Jr.}|\\[1ex] -% \textit{Subsequent forename}: \FName[George S.]{Patton, Jr.}[George] & |\FName[George S.]{Patton, Jr.}[George]|\\\bottomrule -% \end{tabular}} -% \vfil +% \noindent{\bfseries Western Names}\\[2ex] +% We set up a \texttt{nameauth} environment for each section below.\footnote{For those who observe that \cmd{\Lewis} as defined here is different than earlier in this manual, five stars to the boarding school house of your choice. The \texttt{nameauth} environment permists one to make successive global redefinitions. Yet this is done at your own risk.} +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ +% | \< Einstein & Albert & Einstein & >|\\ +% | \< Lewis & Clive Staples & Lewis & >|\\ +% |\end{nameauth}| +% \end{quote} +% \begin{nameauth} +% \< Lewis & Clive Staples & Lewis & > +% \end{nameauth} +% {\footnotesize\setstretch{1.1}\ForgetName[Albert]{Einstein}\ForgetName[Clive Staples]{Lewis} +% \begin{tabular}{p{0.33\textwidth}@{}p{0.19\textwidth}@{}p{0.42\textwidth}}\toprule +% \textit{First reference in the text}:\newline\hbox to 1em{\hfil} \Name [Albert]{Einstein} & \cmd{\Einstein} \cmd{\LEinstein} \cmd{\SEinstein}& |\Name [Albert]{Einstein}| |\Name*[Albert]{Einstein}| |\FName[Albert]{Einstein}|\\[1ex] +% \textit{Subseq. full}: \Name*[Albert]{Einstein} & \cmd{\LEinstein} & |\Name*[Albert]{Einstein}|\\[1ex] +% \textit{Subsequent surname}: \Name [Albert]{Einstein} & \cmd{\Einstein} & |\Name [Albert]{Einstein}|\\[1ex] +% \textit{Subsequent forename}: \FName[Albert]{Einstein} & \cmd{\SEinstein} & |\FName[Albert]{Einstein}|\\\midrule +% \textit{Long first reference}: \newline\hbox to 1em{\hfil}\Lewis & \cmd{\Lewis}\newline \cmd{\LLewis}\newline \cmd{\SLewis} & |\Name [Clive Staples]{Lewis}| |\Name*[Clive Staples]{Lewis}| |\FName[Clive Staples]{Lewis}|\\[1ex] +% \textit{Subsequent full}: \LLewis[C.S.] & \cmd{\LLewis[C.S.]} & |\Name*[Clive Staples]{Lewis}[C.S.]|\\[1ex] +% \textit{Subsequent surname}: \Lewis [C.S.] & \cmd{\Lewis\ [C.S.]} \cmd{\Lewis} & |\Name [Clive Staples]{Lewis}[C.S.]|\newline |\Name [Clive Staples]{Lewis}|\\[1ex] +% \textit{Alternate}: \SLewis[Jack] & \cmd{\SLewis[Jack]} & |\FName[Clive Staples]{Lewis}[Jack]|\\\bottomrule +% \end{tabular}}\bigskip % -% {\noindent |\begin{nameauth}|\\ -% | \< Smith & John & Smith & >|\\ -% | \< JQP & J.Q. & Public & >|\\ +% \noindent{\bfseries Western Plus Affixes}\\[2ex] +% Always use a comma to delimit name/affix pairs. +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ % | \< Patton & George S. & Patton, Jr. & >|\\ -% |\end{nameauth}|} -% \vfil -% -% {\setstretch{1.1}\ForgetName[John]{Smith}\ForgetName[J.Q.]{Public}\ForgetName[George S.]{Patton, Jr.}% -% \noindent |\Smith, \LSmith, \Smith, and \SSmith|:\\ -% \indent \Smith, \LSmith, \Smith, and \SSmith\\ -% |\JQP[Jane Q.],| |\LJQP[Jane Q.],| |and| |\JQP[Jane Q.]|:\\ -% \indent \JQP[Jane Q.], \LJQP[Jane Q.], and \JQP[Jane Q.]\\ -% |\LJQP[Jane| |Qetsiyah]\| |and| |\SJQP[Janie]|:\\ -% \indent \LJQP[Jane Qetsiyah]\ and \SJQP[Janie]\\ -% \noindent |\Patton,| |\LPatton,| |\Patton,| |and| |\SPatton|:\\ -% \indent \Patton, \LPatton, \Patton, and \SPatton.\\ -% |\SPatton[George]| prints \SPatton[George].} -% \clearpage -% -% \noindent{\bfseries New Syntax: Royal, Eastern, and Ancient}\\[2ex] -% Using |\Name{Demetrius, I Soter}| keeps the number with the affix. To keep the number with the name, use |\Name{Demetrius I, Soter}|. See also Section~\ref{sec:Affix}.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.53\textwidth}@{}p{0.42\textwidth}}\toprule -% \textit{First reference}: \ForgetName{Francis, I}\Name{Francis, I} & |\Name*{Francis, I}|\newline |\Name{Francis, I}|\newline |\FName{Francis, I}|\\[1ex] -% \textit{Subsequent full}: \Name*{Francis, I} & |\Name*{Francis, I}|\\[1ex] -% \textit{Subsequent name}: \Name{Francis, I} & |\Name{Francis, I}|\newline |\FName{Francis, I}|\\\midrule -% \textit{First reference}: \newline\hbox to 1em{\hfil}\ForgetName{Demetrius, I Soter}\Name{Demetrius, I Soter} & |\Name*{Demetrius, I Soter}|\newline |\Name{Demetrius, I Soter}|\newline |\FName{Demetrius, I Soter}|\\[1ex] -% \textit{Subsequent full}: \Name*{Demetrius, I Soter} & |\Name*{Demetrius, I Soter}|\\[1ex] -% \textit{Subsequent name}: \Name{Demetrius, I Soter} & |\Name{Demetrius, I Soter}|\newline |\FName{Demetrius, I Soter}|\\\midrule -% \textit{First reference}: \ForgetName{Sun, Yat-sen}\Name{Sun, Yat-sen} & |\Name*{Sun, Yat-sen}|\newline |\Name{Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\[1ex] -% \textit{Subsequent full}: \Name*{Sun, Yat-sen} & |\Name*{Sun, Yat-sen}|\\[1ex] -% \textit{Subsequent name}: \Name{Sun, Yat-sen} & |\Name{Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\\midrule -% \textit{First mononym reference}:\newline\hbox to 1em{\hfil}\ForgetName{Plato}\Name{Plato} & -% |\Name*{Plato}|\newline |\Name{Plato}|\newline |\FName{Plato}|\\[1ex] -% \textit{Subsequent}: \Name{Plato} & |\Name*{Plato}|\newline |\Name{Plato}|\newline |\FName{Plato}|\\\bottomrule +% |\end{nameauth}| +% \end{quote} +% {\footnotesize\setstretch{1.1}\ForgetName[George S.]{Patton, Jr.} +% \begin{tabular}{p{0.35\textwidth}@{}p{0.18\textwidth}@{}p{0.41\textwidth}}\toprule +% \textit{First reference}:\newline\hbox to 1em{\hfil}\Name [George S.]{Patton, Jr.} & \cmd{\Patton} \cmd{\LPatton} \cmd{\SPatton} & |\Name [George S.]{Patton, Jr.}|\newline |\Name*[George S.]{Patton, Jr.}|\newline |\FName[George S.]{Patton, Jr.}|\\[1ex] +% \textit{Subsequent full}:\newline\hbox to 1em{\hfil}\Name*[George S.]{Patton, Jr.} & \cmd{\LPatton} & |\Name*[George S.]{Patton, Jr.}|\newline\\[1ex] +% \textit{Subsequent surname}: \Name [George S.]{Patton, Jr.} & \cmd{\Patton} & |\Name [George S.]{Patton, Jr.}|\\[1ex] +% \textit{Subsequent forename}: \FName[George S.]{Patton, Jr.} & \cmd{\SPatton} & |\FName[George S.]{Patton, Jr.}|\\\midrule +% \end{tabular}\\ +% \begin{tabular}{p{0.35\textwidth}@{}p{0.59\textwidth}} +% \textit{Alternate forename}: \FName[George S.]{Patton, Jr.}[George] & \cmd{\SPatton[George]} \\ +% & |\FName[George S.]{Patton, Jr.}[George]|\\\bottomrule % \end{tabular}} -% \vfil +% \clearpage % -% \noindent |\begin{nameauth}|\\ +% \noindent{\bfseries New Syntax: Non-Western} +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ % | \< Francis & & Francis, I & >|\\ -% | \< Dem & & Demetrius, I Soter & >|\\ +% | \< Dem & & Demetrius, I & >|\\ % | \< Sun & & Sun, Yat-sen & >|\\ +% | \< Attil & & Attila, the Hun & >|\\ % | \< Plato & & Plato & >|\\ % |\end{nameauth}| -% \vfil -% -% {\setstretch{1.1}\ForgetName{Francis, I}\ForgetName{Demetrius, I Soter}\ForgetName{Sun, Yat-sen}\ForgetName{Plato}% -% \noindent |\Francis,| |\LFrancis,| |\Francis,| |and| |\SFrancis|:\\ -% \indent \Francis, \LFrancis, \Francis, and \SFrancis\\ -% |\Dem,| |\LDem,| |\Dem,| |and \SDem|:\\ -% \indent \Dem, \LDem, \Dem, and \SDem\\ -% |\Sun,| |\LSun,| |\Sun,| |and \SSun|:\\ -% \indent \Sun, \LSun, \Sun, and \SSun\\ -% |\Plato,| |\LPlato,| |\Plato,| |and \SPlato|:\\ -% \indent \Plato, \LPlato, \Plato, and \SPlato.} -% \vfil -% You also can ``stack'' \cmd{\CapThis}, \cmd{\CapName}, \cmd{\RevName}, \cmd{\KeepAffix}, and so on in front of these control sequences. |\CapName\LSun| generates \CapName\LSun. -% \clearpage +% \end{quote} +% For sobriquets, one could use |\Name{Demetrius, I Soter}| to keep the number with the affix or |\Name{Demetrius I, Soter}| to keep the number with the name. We recommend, however, that you use text tags and index tags for ``Soter'' (Sections~\ref{sec:indextag} and~\ref{sec:tagtext}). That is what we do below: +% \begin{quote}\small\setstretch{1.1} +% |\NameAddInfo{Demetrius, I}{Soter}|\\ +% |\def\Soter{\NameQueryInfo{Demetrius, I}}|\\ +% |\TagName{Demetrius, I}{ Soter}| +% \end{quote} +% \NameAddInfo{Demetrius, I}{Soter}\def\Soter{\NameQueryInfo{Demetrius, I}}\ignorespaces% +% {\footnotesize\setstretch{1.1}\ForgetName{Francis, I}\ForgetName{Demetrius, I Soter}\ForgetName{Sun, Yat-sen}\ForgetName{Attila, the Hun}\ForgetName{Plato}\ignorespaces% +% \begin{tabular}{p{0.34\textwidth}@{}p{0.21\textwidth}@{}p{0.39\textwidth}}\toprule +% \textit{First reference}: \Name{Francis, I} & \cmd{\Francis}\newline \cmd{\LFrancis}\newline \cmd{\SFrancis} & |\Name {Francis, I}|\newline |\Name*{Francis, I}|\newline |\FName{Francis, I}|\\[1ex] +% \textit{Subsequent full}: \Name*{Francis, I} & \cmd{\LFrancis} & |\Name*{Francis, I}|\\[1ex] +% \textit{Subsequent name}: \Name{Francis, I} & \cmd{\Francis}\newline \cmd{\SFrancis} & |\Name {Francis, I}|\newline |\FName{Francis, I}|\\\midrule +% \textit{First reference}: \newline\hbox to 1em{\hfil}\Name{Demetrius, I}\ \Soter & |\Dem\ \Soter|\newline|\LDem\ \Soter|\newline|\SDem\ \Soter| & |\Name {Demetrius, I}\ \Soter|\newline |\Name*{Demetrius, I}\ \Soter|\newline |\FName{Demetrius, I}\ \Soter|\\[1ex] +% \textit{Subsequent full}: \Name*{Demetrius, I} & |\LDem| & |\Name*{Demetrius, I}|\\[1ex] +% \textit{Subsequent name}: \Name{Demetrius, I}\ & |\Dem|\newline|\SDem| & |\Name {Demetrius, I}|\newline |\FName{Demetrius, I}|\\\midrule +% \textit{First reference}:\newline\hbox to 1em{\hfil}\Name{Sun, Yat-sen} & \cmd{\Sun}\newline\cmd{\LSun}\newline\cmd{\SSun} & |\Name {Sun, Yat-sen}|\newline |\Name*{Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\[1ex] +% \textit{Subsequent full}: \Name*{Sun, Yat-sen} & \cmd{\LSun} & |\Name*{Sun, Yat-sen}|\\[1ex] +% \textit{Subsequent name}: \Name{Sun, Yat-sen} & \cmd{\Sun}\newline\cmd{\SSun} & |\Name {Sun, Yat-sen}|\newline |\FName{Sun, Yat-sen}|\\[1ex] +% \textit{Personal name}: \ForceFN\SSun & \cmd{\ForceFN}\cmd{\SSun} & |\ForceFN\FName{Sun, Yat-sen}|\\\midrule +% \textit{All references}: \Name{Plato} & \cmd{\Plato}\newline\cmd{\LPlato}\newline\cmd{\SPlato} & |\Name {Plato}|\newline |\Name*{Plato}|\newline |\FName{Plato}|\\\bottomrule +% \end{tabular}}\bigskip % -% \noindent{\bfseries Old Syntax: Royal and Eastern}\\[2ex] -% |\Name{Ptolemy}[I Soter]| keeps the number with the affix. To keep the number with the name, use |\Name{Ptolemy I}[Soter]|. See also Section~\ref{sec:Affix}.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.53\textwidth}@{}p{0.42\textwidth}}\toprule -% \textit{First reference}: \ForgetName{Henry}[VIII]\Name{Henry}[VIII] & |\Name*{Henry}[VIII]|\newline |\Name{Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\[1ex] -% \textit{Subsequent full}: \Name*{Henry}[VIII] & |\Name*{Henry}[VIII]|\\[1ex] -% \textit{Subsequent name}: \Name{Henry}[VIII] & |\Name{Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\\midrule -% \textit{First reference}: \ForgetName{Ptolemy}[I Soter]\Name{Ptolemy}[I Soter] & |\Name*{Ptolemy}[I Soter]|\newline |\Name{Ptolemy}[I Soter]|\newline |\FName{Ptolemy}[I Soter]|\\[1ex] -% \textit{Subsequent full}: \Name*{Ptolemy}[I Soter] & |\Name*{Ptolemy}[I Soter]|\\[1ex] -% \textit{Subsequent name}: \Name{Ptolemy}[I Soter] & |\Name{Ptolemy}[I Soter]|\newline |\FName{Ptolemy}[I Soter]|\\\midrule -% \textit{First reference}:\newline \hbox to 1em{\hfil}\ForgetName{Mao}[Tse-tung]\Name{Mao}[Tse-tung] & |\Name*{Mao}[Tse-tung]|\newline |\Name{Mao}[Tse-tung]|\\[1ex] -% \textit{Subsequent full}: \Name*{Mao}[Tse-tung] & |\Name*{Mao}[Tse-tung]|\\[1ex] -% \textit{Subsequent name}: \Name{Mao}[Tse-tung] & |\Name{Mao}[Tse-tung]|\newline |\FName{Mao}[Tse-tung]|\\\bottomrule -% \end{tabular}} -% \vfil +% You also can ``stack'' \cmd{\CapThis}, \cmd{\CapName}, \cmd{\RevName}, \cmd{\KeepAffix}, and so on in front of these control sequences. |\CapName\LSun| generates \CapName\LSun. For a fuller listing, see Section~\ref{sec:start}. +% \clearpage % -% \noindent |\begin{nameauth}|\\ +% \noindent{\bfseries Old Syntax: Royal and Eastern} +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ % | \< Henry & & Henry & VIII >|\\ -% | \< Ptol & & Ptolemy & I Soter >|\\ +% | \< Ptol & & Ptolemy & I >|\\ % | \< Mao & & Mao & Tse-tung >|\\ -% |\end{nameauth}|\medskip -% -% {\setstretch{1.1}\ForgetName{Ptolemy}[I Soter]\ForgetName{Henry}[VIII]\ForgetName{Mao}[Tse-tung]% -% \noindent |\Henry, \LHenry, \Henry, and \SHenry|:\\ -% \indent \Henry, \LHenry, \Henry, and \SHenry\\ -% |\Ptol,| |\LPtol,| |\Ptol,| |and \SPtol|:\\ -% \indent \Ptol, \LPtol, \Ptol, and \SPtol\\ -% |\Mao, \LMao, \Mao, and \SMao|:\\ -% \indent \Mao, \LMao, \Mao, and \SMao} -% \vfil -% -% The old syntax |\Name{Antiochus}[IV Epi\-phanes]| is functionally equivalent to |\Name{Antiochus, IV Epi\-phanes}|. Consider also how you might handle affixes and sobriquets: +% |\end{nameauth}| +% \end{quote} +% For sobriquets, one could use |\Name{Ptolemy, I Soter}| to keep the number with the affix or |\Name{Ptolemy I, Soter}| to keep the number with the name. We recommend, however, that you use text tags and index tags for ``Soter'' (Sections~\ref{sec:indextag} and~\ref{sec:tagtext}). That is what we do below: +% \begin{quote}\small\setstretch{1.1} +% |\NameAddInfo{Ptolemy}[I]{Soter}|\\ +% |\def\Soter{\NameQueryInfo{Ptolemy}[I]}|\\ +% |\TagName{Ptolemy}[I]{ Soter}| +% \end{quote} +% \NameAddInfo{Ptolemy}[I]{Soter}\def\Soter{\NameQueryInfo{Ptolemy}[I]}\ignorespaces% +% {\footnotesize\setstretch{1.1}\ForgetName{Henry}[VIII]\ForgetName{Ptolemy}[I Soter]\ForgetName{Mao}[Tse-tung] +% \begin{tabular}{p{0.37\textwidth}@{}p{0.20\textwidth}@{}p{0.37\textwidth}}\toprule +% \textit{First reference}: \Name{Henry}[VIII]\ddag & \cmd{\Henry}\newline \cmd{\LHenry}\newline \cmd{\SHenry} & |\Name {Henry}[VIII]|\newline |\Name*{Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\[1ex] +% \textit{Subsequent full}: \Name*{Henry}[VIII]\ddag & \cmd{\LHenry} & |\Name*{Henry}[VIII]|\\[1ex] +% \textit{Subsequent name}: \Name{Henry}[VIII]\ddag & \cmd{\Henry}\newline \cmd{\SHenry} & |\Name {Henry}[VIII]|\newline |\FName{Henry}[VIII]|\\\midrule +% \textit{First reference}: \Name{Ptolemy}[I]\ \Soter\ddag & |\Ptol\ \Soter|\newline|\LPtol\ \Soter|\newline|\SPtol\ \Soter| & |\Name {Ptolemy}[I]\ \Soter|\newline |\Name*{Ptolemy}[I]\ \Soter|\newline |\FName{Ptolemy}[I]\ \Soter|\\[1ex] +% \textit{Subsequent full}: \Name*{Ptolemy}[I]\ddag & |\LPtol| & |\Name*{Ptolemy}[I]|\\[1ex] +% \textit{Subsequent name}: \Name{Ptolemy}[I]\ddag & |\Ptol|\newline|\SPtol| & |\Name {Ptolemy}[I]|\newline |\FName{Ptolemy}[I]|\\\midrule +% \textit{First reference}:\newline \hbox to 1em{\hfil}\Name{Mao}[Tse-tung]\ddag & \cmd{\Mao}\newline \cmd{\LMao}\newline \cmd{\SMao} & |\Name {Mao}[Tse-tung]|\newline |\Name*{Mao}[Tse-tung]|\newline |\FName{Mao}[Tse-tung]|\\[1ex] +% \textit{Subsequent full}: \Name*{Mao}[Tse-tung]\ddag & \cmd{\LMao} & |\Name*{Mao}[Tse-tung]|\\[1ex] +% \textit{Subsequent name}: \Name{Mao}[Tse-tung]\ddag & \cmd{\Mao}\newline \cmd{\SMao} & |\Name {Mao}[Tse-tung]|\newline |\FName{Mao}[Tse-tung]|\\[1ex] +% \textit{Personal name}: \ForceFN\SMao & \cmd{\ForceFN}\cmd{\SMao} & |\ForceFN\FName{Mao}[Tse-tung]|\\\bottomrule +% \end{tabular}}\bigskip % -% \begin{itemize}\small\IndexInactive -% \item |\Name{Antiochus, IV Epi\-phanes}| yields \Name{Antiochus, IV Epi\-phanes} and \Name{Antiochus, IV Epi\-phanes} in the body text; ``Antiochus IV Epi\-phanes'' in the index. +% There used to be\marginpar{\large\raggedleft\textsf{\bfseries 3.0}\break\small\raggedleft\dbend} more ambiguity between the new syntax and the old syntax. That has been cleared up in present versions. Now it is clear that the new syntax takes precedence. |\Name*{Æthelred, II}[the Unready]| prints ``\Name*{Æthelred, II}[the Unready]'' in the body text and ``Æthelred, II'' in the index. In former versions of this package it would have produced ``Æthelred, II the Unready'' in the text and in the index. \textbf{Since the older behavior was discouraged, it no longer will be supported and no backward compatibility will exist.} % -% \item |\Name{Antiochus~IV, Epi\-phanes}| yields \Name{Antiochus~IV, Epi\-phanes} and \Name{Antiochus~IV, Epi\-phanes} in the body text and ``Antiochus IV Epi\-phanes'' in the index.\IndexActive -% -% \item |\Name{Antiochus,| |IV}| yields \Name{Antiochus, IV} and \Name{Antiochus, IV} in the text. Use \cmd{\NameAddInfo}, \cmd{\NameQueryInfo}, and \cmd{\IndexTag} to handle ``Epi\-phanes.'' We prefer, use, and recommend this way. -% \end{itemize} +% Sections~\ref{sec:tagtext} and~\ref{sec:indextag}, as well as this section, show how one might use tags to handle ``the Unready'' in a more complex and more consistent manner. % \clearpage % -% \subsubsection{Particles} -% \label{sec:Particles} -% The following illustrate the American style of particulate names.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule -% \textit{First}: \ForgetName[Walter]{de la Mare}\Name[Walter]{de la Mare} & |\Name*[Walter]{de la Mare}|\newline |\Name[Walter]{de la Mare}|\newline |\FName[Walter]{de la Mare}|\\[1ex] -% \textit{Subsequent}: \Name[Walter]{de la Mare} & |\Name[Walter]{de la Mare}|\\[1ex] -% \textit{Start of sentence}: \CapThis\Name[Walter]{de la Mare} & |\CapThis\Name[Walter]{de la Mare}|\\[1ex] -% \textit{Forename}: \FName[Walter]{de la Mare} & |\FName[Walter]{de la Mare}|\\\bottomrule +% \noindent\textbf{Particles, American Style} +% \begin{quote}\small\setstretch{1.1} +% |\begin{nameauth}|\\ +% | \< DLM & Walter & de la Mare & >|\\ +% | \< JWG & J.W. von & Goethe & >|\\ +% | \< Harnack & Adolf & Harnack & >|\\ +% |\end{nameauth}| +% \end{quote} +% {\footnotesize\setstretch{1.1}\ForgetName[Walter]{de la Mare} +% \begin{tabular}{p{0.35\textwidth}@{}p{0.18\textwidth}@{}p{0.41\textwidth}}\toprule +% \textit{First}: \Name[Walter]{de la Mare} & \cmd{\DLM}\newline \cmd{\LDLM}\newline \cmd{\SDLM} & |\Name [Walter]{de la Mare}|\newline |\Name*[Walter]{de la Mare}|\newline |\FName[Walter]{de la Mare}|\\[1ex] +% \textit{Subsequent}: \Name[Walter]{de la Mare} & \cmd{\DLM} & |\Name [Walter]{de la Mare}|\\[1ex] +% \textit{Start of sentence}: \CapThis\Name[Walter]{de la Mare} & \cmd{\CapThis}\cmd{\DLM} & |\CapThis\Name[Walter]{de la Mare}|\\[1ex] +% \textit{Forename}: \FName[Walter]{de la Mare} & \cmd{\SDLM} & |\FName[Walter]{de la Mare}|\\\bottomrule % \end{tabular}}\\[2ex] % -% \noindent The Continental style differs slightly. These first three forms below put the particles in the index. Long macros are split for readability.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule -% \textit{The (admittedly long) first use}:\newline\small\Name[Johann Wolfgang von]{Goethe} & |\Name*[Johann Wolfgang von]{Goethe}|\newline |\Name[Johann Wolfgang von]{Goethe}|\newline |\FName[Johann Wolfgang von]{Goethe}|\\[1ex] -% \textit{Subsequent}: \Name[Johann Wolfgang von]{Goethe} & |\Name[Johann Wolfgang von]{Goethe}|\\[1ex] -% \textit{Forenames}: \FName[Johann Wolfgang von]{Goethe}[Johann Wolfgang] & |\FName[Johann Wolfgang von]{Goethe}%|\newline|[Johann Wolfgang]|\\\bottomrule +% \noindent\textbf{Particles, European Style, in the Index}\\[2ex] +% {\footnotesize\setstretch{1.1} +% \begin{tabular}{p{0.27\textwidth}@{ }p{0.33\textwidth}@{}p{0.34\textwidth}}\toprule +% \textit{First use}:\newline \hbox to 1em{\hfil}\Name[J.W. von]{Goethe}[Johann Wolfgang von] & |\JWG [Johann Wolfgang von]|\newline |\LJWG[Johann Wolfgang von]|\newline |\SJWG[Johann Wolfgang von]| & |\Name [J.W. von]{Goethe}%|\newline| [Johann Wolfgang von]|\newline |\Name*[J.W. von]{Goethe}%|\newline| [Johann Wolfgang von]|\newline |\FName[J.W. von]{Goethe}%|\newline| [Johann Wolfgang von]|\\[1ex] +% \textit{Subsequent}: \Name[J.W. von]{Goethe} & \cmd{\JWG} & |\Name [J.W. von]{Goethe}|\\[1ex] +% \textit{Forenames}: \FName[J.W. von]{Goethe}[Johann Wolfgang] & |\SJWG[Johann Wolfgang]| & |\FName[J.W. von]{Goethe}%|\newline|[Johann Wolfgang]|\\\bottomrule % \end{tabular}}\\[2ex] % -% \noindent These latter examples of the Continental style use the nickname feature to omit the particles from the index.\\[2ex]{\small\setstretch{1.1} -% \begin{tabular}{p{0.45\textwidth}@{}p{0.50\textwidth}}\toprule -% \textit{First}: \Name[Adolf]{Harnack}[Adolf von] & |\Name*[Adolf]{Harnack}[Adolf von]|\newline |\Name[Adolf]{Harnack}[Adolf von]|\newline |\FName[Adolf]{Harnack}[Adolf von]|\\[1ex] -% \textit{Subsequent full}: \Name*[Adolf]{Harnack}[Adolf von] & |\Name*[Adolf]{Harnack}[Adolf von]|\newline\\ -% \textit{Subsequent surname}: \Name[Adolf]{Harnack}[Adolf von] & |\Name[Adolf]{Harnack}[Adolf von]|\newline |\Name[Adolf]{Harnack}|\\[1ex] -% \textit{Subsequent forename}: \FName[Adolf]{Harnack} & |\FName[Adolf]{Harnack}|\\\bottomrule -% \end{tabular}} -% \vfil +% \noindent\textbf{Particles, European Style, Not in the Index}\\[2ex] +% {\footnotesize\setstretch{1.1} +% \begin{tabular}{p{0.26\textwidth}@{}p{0.27\textwidth}@{}p{0.41\textwidth}}\toprule +% \textit{First}:\newline \hbox to 1em{\hfil}\Name[Adolf]{Harnack}[Adolf von] & |\Harnack [Adolf von]|\newline |\LHarnack[Adolf von]|\newline |\SHarnack[Adolf von]| & |\Name [Adolf]{Harnack}[Adolf von]|\newline |\Name-[Adolf]{Harnack}[Adolf von]|\newline |\FName[Adolf]{Harnack}[Adolf von]|\\[1ex] +% \textit{Subsequent full}:\newline \hbox to 1em{\hfil}\Name*[Adolf]{Harnack}[Adolf von] & |\LHarnack[Adolf von]| & |\Name*[Adolf]{Harnack}[Adolf von]|\\ +% \textit{Subseq. last}: \Name[Adolf]{Harnack} & |\Harnack| & |\Name [Adolf]{Harnack}|\\[1ex] +% \textit{Subseq. first}: \FName[Adolf]{Harnack} & |\SHarnack| & |\FName[Adolf]{Harnack}|\\\bottomrule +% \end{tabular}}\bigskip % -% \noindent |\begin{nameauth}|\\ -% | \< DLM & Walter & de la Mare & >|\\ -% | \< JWG & Johann Wolfgang von & Goethe & >|\\ -% | \< Harnack & Adolf & Harnack & >|\\ -% |\end{nameauth}| -% \vfil -% -% \ForgetName[Walter]{de la Mare}\ForgetName[Johann Wolfgang von]{Goethe}\ForgetName[Adolf]{Harnack}% -% \noindent |\DLM\| |and| |\CapThis\DLM|:\\ -% \indent \DLM\ and \CapThis\DLM.\\[1ex] -% |\JWG\| |and| |\JWG|:\\ -% \indent \JWG\ and \JWG.\\[1ex] -% |\Harnack[Adolf von]\| |and| |\Harnack|:\\ -% \indent \Harnack[Adolf von]\ and \Harnack\\[1ex] % You will not see \Harnack's ``von'' in the index because it was used only in the alternate forenames field. -% \index{Maimonides|seealso{Rambam}} -% \index{Rambam|seealso{Maimonides}} % \clearpage % % \subsection{Errors and Warnings} @@ -3427,36 +3210,33 @@ Running "make install" installs the files in the local TeX tree. % \begin{itemize}\small % \item Keep it simple! Avoid unneeded macros and use the simplified interface. % \item Check braces and brackets with naming macros to avoid errors like ``Paragraph ended\dots'' and ``Missing \meta{grouping token} inserted.'' -% \item Do not apply a formatting macro to an entire comma-delimited \meta{SNN, affix} pair. |\Name[Oskar]{\textsc{Hammerstein, II}}| fails due to unbalanced braces because it gets split up. Format each part instead \emph{e.g.}, |\Name[Oskar]{\textsc{Hammerstein},\textsc{II}}.|\IndexName[Oskar]{Hammerstein, II} -% \item With \texttt{pdflatex} use \cmd{\CapThis} when the first letter of a surname particle is \texttt{a--z}, otherwise use \cmd{\AccentCapThis} if it is extended Unicode. Doing otherwise may cause unbalanced braces and related errors. -% \item Consider using \cmd{\PretagName} with all names containing control sequences or extended Unicode; see Section~\ref{sec:IndexSort}. -% \item One way to spot errors is to compare index entries with names in the body text. All macros that produce output also emit meaningful warnings. \cmd{\PName} produces warnings via \cmd{\Name} and \cmd{\AKA}. -% \item Please pay greater attention to the warnings produced by \cmd{\IndexName}, \cmd{\TagName}, \cmd{\UntagName}, and \cmd{\ExcludeName}. Many other warnings are FYI. +% \item Do not apply a formatting macro to an entire comma-delimited \meta{SNN, affix} pair. Format each part separately. +% \item Consider using \cmd{\PretagName} with all names containing control sequences or active Unicode; see Section~\ref{sec:IndexSort}. +% \item One way to spot errors is to compare index entries with names in the body text. All macros that produce output also emit meaningful warnings. % \end{itemize} % The older syntax presents its own group of potential errors: -% \begin{itemize}\small\IndexInactive +% \begin{itemize}\small{\IndexInactive % \item Erroneously typing |\Name[Henry]{VIII}| prints ``\Name*[Henry]{VIII}'' and ``\Name[Henry]{VIII},'' as well as producing a malformed index entry. -% \item Avoid forms like |\Name[Henry]{VIII}[Tudor]| which gives ``\Name*[Henry]{VIII}[Tudor]'' and ``\Name[Henry]{VIII}[Tudor].'' This is a Western name form, not an ancient form. -% \item The older syntax will not work with some macros. From the film \emph{Men in Black III}, |\AKA{Boris}[the Animal]{Just Boris}| fails. \cmd{\PName} fails for the same reasons. See also Section~\ref{sec:AKA} -% \item This form does work:\\ |\Name{Boris,| |the| |Animal}| |\AKA{Boris,| |the| |Animal}{Just| |Boris}|.\\ You get \Name{Boris, the Animal} being ``\AKA{Boris, the Animal}{Just Boris}.''\IndexActive +% \item Avoid forms like |\Name[Henry]{VIII}[Tudor]| which gives ``\Name*[Henry]{VIII}[Tudor]'' and ``\Name[Henry]{VIII}[Tudor].'' That is a Western alternate name form, which is incorrect.} +% \item The older syntax will not work with some macros. The comma-suffixed form does work with those macros. See Section~\ref{sec:AKA}. % \end{itemize} % Warnings result from the following: % \begin{itemize}\small -% \item Using an xref \oarg{Alternate names}\marg{Alternate SNN}\oarg{Alt. names} created by \cmd{\AKA} as a name reference in \cmd{\Name}, \cmd{\FName}, and \cmd{\PName}. They merely will print a name in the body text. -% \item Using a name reference \oarg{FNN}\marg{SNN}\oarg{Alternate names} created by \cmd{\Name}, \cmd{\FName}, and \cmd{\PName} as a cross-reference in \cmd{\AKA}. It merely will print a name in the body text. -% \item Using \cmd{\AKA} to create the same cross-reference multiple times or with a cross-reference created by \cmd{\ExcludeName}. It merely will print a name in the body text, but not the index. -% \item Using \cmd{\IndexName} to index a cross-reference made via \cmd{\AKA} or via the mechanism in \cmd{\ExcludeName} as a main entry. It will do nothing. -% \item Using \cmd{\TagName}, \cmd{\UntagName}, and \cmd{\PretagName} with cross-references. The first two will do nothing. However, \cmd{\PretagName} will ``pretag'' a cross-reference. This is the desired behavior. -% \item Using \cmd{\ExcludeName} with cross-references. It will do nothing. -% \item Using \cmd{\ExcludeName} to exclude a name that has already been used. Likewise, it will do nothing. -% \item Using \cmd{\Name}, \cmd{\FName}, \cmd{\PName}, and \cmd{\AKA} to refer to names and cross-references excluded by \cmd{\ExcludeName}. They merely will print a name in the body text. -% \item Using the |nameauth| environment to redefine shorthands, such as:\\[2ex] +% \item Using the \texttt{nameauth} environment to redefine shorthands or define shorthands that collide with extant macros generates warning because that could result in unwanted behavior like unexpected name forms and index entries. The following will create a warning for such reasons:\\[1ex] % |\PretagName[E.\,B.]{White}{White, E. B.}|\dots\\[1ex] % |\begin{nameauth}|\\\IndexName[E.\,B.]{White}\ignorespaces % | \< White & E.\,B. & White & >|\\ % | \< White & E. B. & White & >|\\ % |\end{nameauth}|\\[1ex] -% Such redefinitions could generate unwanted index entries. +% Sometimes dedefinition is harmless because it produces no unwanted results. It is up to the user to consider these warnings. +% \item Use the \texttt{verbose} option for warnings from the indexing macros. +% \item Using an index cross-reference name as a page entry. Nothing will happen. +% \item Creating the same cross-reference multiple times. Nothing will happen. +% \item Creating a page reference after a cross-reference has been created or after you have used \cmd{\ExcludeName}. Nothing will happen until you use a variant of \cmd{\Includename}. +% \item Using \cmd{\TagName} and \cmd{\UntagName} on cross-references. Nothing will happen. +% \item Using \cmd{\PretagName} with cross-references will create sorting tags for them, but also will generate ``informational warnings'' only if the \texttt{verbose} option is selected. +% \item Using \cmd{\ExcludeName} with cross-references. Nothing will happen. +% \item Using \cmd{\ExcludeName} to exclude a name that has already been excluded. Likewise, it will do nothing. % \end{itemize} % \clearpage % @@ -3471,18 +3251,42 @@ Running "make install" installs the files in the local TeX tree. %<*package> % \fi % \small -% \subsection{Boolean Values} +% \subsection{Flags and Registers} % -% \noindent{\large\bfseries Affix Commas}\\[0.5ex] -% The \texttt{comma} and |nocomma| options toggle the first value below. \cmd{\ShowComma} toggles the second and \cmd{\NoComma} toggles the third. Each instance of \cmd{\Name} and \cmd{\AKA} reset |\@nameauth@ShowComma|. +% The flags below are grouped according to general function. We begin with flow control\medskip +% +% \noindent{\large\bfseries Who Called Me?}\\[0.5ex] +% These values are used by the format hook dispatcher \cmd{\@nameauth@Hook} and the hook macros to determine if they have been called by either \cmd{\@nameauth@Name} or \cmd{\AKA}, respectively. Those macros set these flags. On their use, see Sections~\ref{sec:Hooksb} and ~\ref{sec:Hooksc}. % \begin{macrocode} -\newif\if@nameauth@AlwaysComma -\newif\if@nameauth@ShowComma -\newif\if@nameauth@NoComma -% \end{macrocode}\medskip +\newif\if@nameauth@InAKA +\newif\if@nameauth@InName +\newif\if@nameauth@Xref +% \end{macrocode} +% As an aside, \cmd{\AKA} will invoke \cmd{\NamesFormat} or \cmd{\FrontNamesFormat} if the \texttt{alwaysformat} option is set. Otherwise it will invoke \cmd{\MainNameHook} or \cmd{\FrontNameHook}.\medskip % -% \noindent{\large\bfseries Toggle Formatting}\\[0.5ex] -% \cmd{\NamesActive} and \cmd{\NamesInactive} or the |mainmatter| and |frontmatter| options make \cmd{\@nameauth@MainFormat} either true or false, which switches between the main and front matter hooks. \cmd{\@nameauth@AKAFormat} permits \cmd{\AKA} to call the first-use hooks. Otherwise it will call only the subsequent-use hooks. +% \noindent{\large\bfseries Core Macro Lock}\\[0.5ex] +% The macros \cmd{\@nameauth@Name} and \cmd{\AKA}, with some auxiliary macros, process names in a ``locked'' state. These flags prevent a stack overflow. See also Sections~\ref{sec:Hooksb} and ~\ref{sec:Hooksc}. +% \begin{macrocode} +\newif\if@nameauth@Lock +\newif\if@nameauth@InHook +% \end{macrocode}\smallskip +% +% \noindent{\large\bfseries Indexing}\\[0.5ex] +% As the naming macros have locks, so do the indexing macros. These locks permit or prevent both indexing and tags. \cmd{\IndexActive} and \cmd{\IndexInctive} or the \texttt{index} and \texttt{noindex} options toggle this flag: +% \begin{macrocode} +\newif\if@nameauth@DoIndex +% \end{macrocode} +% The \texttt{pretag} and \texttt{nopretag} options toggle the value below, which allows or prevents the insertion of sort keys. +% \begin{macrocode} +\newif\if@nameauth@Pretag +% \end{macrocode} +% Theis flag determines whether \cmd{\IndexRef} creates a \emph{see} reference or a \emph{see also} reference. +% \begin{macrocode} +\newif\if@nameauth@SeeAlso +% \end{macrocode}\smallskip +% +% \noindent{\large\bfseries Formatting}\\[0.5ex] +% \cmd{\NamesActive} and \cmd{\NamesInactive}, with the \texttt{mainmatter} and \texttt{frontmatter}, options toggle formatting hooks via \texttt{\textbackslash if@nameauth@MainFormat}. \texttt{\textbackslash if@nameauth@AKAFormat} permits \cmd{\AKA} to call the first-use hooks once. % \begin{macrocode} \newif\if@nameauth@MainFormat \newif\if@nameauth@AKAFormat @@ -3491,80 +3295,99 @@ Running "make install" installs the files in the local TeX tree. % \begin{macrocode} \newif\if@nameauth@LocalNames % \end{macrocode}\medskip +% \texttt{\textbackslash if@nameauth@FirstFormat} triggers the first-use hooks to be called; otherwise the second-use hooks are called. Additionally, \texttt{\textbackslash if@nameauth@AlwaysFormat} forces this true, except when \texttt{\textbackslash if@nameauth@AKAFormat} is false. +% \begin{macrocode} +\newif\if@nameauth@FirstFormat +\newif\if@nameauth@AlwaysFormat +% \end{macrocode}\clearpage % -% \noindent{\large\bfseries Indexing}\\[0.5ex] -% \cmd{\IndexActive} and \cmd{\IndexInctive} or the |index| and |noindex| options set this below: +% \noindent Next we move from general flow control to specific modification of name forms.\medskip +% +% \noindent{\large\bfseries Affix Commas}\\[0.5ex] +% The \texttt{comma} and \texttt{nocomma} options toggle the flag value below. \cmd{\ShowComma} and \cmd{\NoComma} respectively toggle the second and third. % \begin{macrocode} -\newif\if@nameauth@DoIndex -% \end{macrocode} -% The |pretag| and |nopretag| options toggle the value below. +\newif\if@nameauth@AlwaysComma +\newif\if@nameauth@ShowComma +\newif\if@nameauth@NoComma +% \end{macrocode}\medskip +% +% \noindent{\large\bfseries Name Breaking}\\[0.5ex] +% \cmd{\KeepAffix} toggles the flag below, which causes an \meta{SNN}-\meta{Affix} pair to have a non-breaking space between them. For ``native'' Eastern names this prevents the family name and personal name from breaking. % \begin{macrocode} -\newif\if@nameauth@Pretag +\newif\if@nameauth@NBSP +% \end{macrocode}\medskip +% +% \noindent{\large\bfseries Detect Punctuation}\\[0.5ex] +% This Boolean value is used to prevent double full stops at the end of a name in the text. +% \begin{macrocode} +\newif\if@nameauth@Punct % \end{macrocode}\medskip % -% \noindent{\large\bfseries Syntactic Formatting}\\[0.5ex] -% \cmd{\@nameauth@FullName} is true in any case where a long name reference is desired. \cmd{\@nameauth@FirstName} disables full-name references and causes only Western forenames to be displayed. |\@nameauth@AltAKA| is toggled respectively by \cmd{\AKA} and \cmd{\AKA*} to print a longer or shorter name. +% \noindent{\large\bfseries Long and Short Names}\\[0.5ex] +% \texttt{\textbackslash if@nameauth@FullName} is true in any case where a long name reference is desired. \texttt{\textbackslash if@nameauth@FirstName} disables full-name references and causes only Western forenames to be displayed. \texttt{\textbackslash if@nameauth@AltAKA} is toggled respectively by \cmd{\AKA} and \cmd{\AKA*} to print a longer or shorter name. \texttt{\textbackslash if@nameauth@OldAKA} forces the pre-3.0 behavior of \cmd{\AKA*}. \texttt{\textbackslash if@nameauth@ShortSNN} is used with \cmd{\DropAffix} to suppress the affix of a Western name. \texttt{\textbackslash if@nameauth@EastFN} toggles the forced printing of Eastern forenames. % \begin{macrocode} \newif\if@nameauth@FullName \newif\if@nameauth@FirstName \newif\if@nameauth@AltAKA -% \end{macrocode} -% The next Boolean values govern full name capitalization, name reversing, and name reversing with commas. +\newif\if@nameauth@OldAKA +\newif\if@nameauth@ShortSNN +\newif\if@nameauth@EastFN +% \end{macrocode}\medskip +% +% \noindent{\large\bfseries Eastern Names}\\[0.5ex] +% The next flags values govern name reversing and full surname capitalization. The first of each pair is a global state. The second of each pair is an individual state. % \begin{macrocode} -\newif\if@nameauth@AllCaps -\newif\if@nameauth@AllThis \newif\if@nameauth@RevAll \newif\if@nameauth@RevThis +\newif\if@nameauth@AllCaps +\newif\if@nameauth@AllThis +% \end{macrocode}\medskip +% +% \noindent{\large\bfseries Last-Comma-First}\\[0.5ex] +% This pair of flags deals with Western names reordered in a list according to surname. +% \begin{macrocode} \newif\if@nameauth@RevAllComma \newif\if@nameauth@RevThisComma -% \end{macrocode} -% This Boolean value is triggered by \cmd{\CapThis} and reset by \cmd{\Name} and \cmd{\AKA}. +% \end{macrocode}\medskip +% +% \noindent{\large\bfseries Capitalize First Letter}\\[0.5ex] +% The next three flags deal with first-letter capitalization. The first Boolean value is triggered by \cmd{\CapThis} and reset by \cmd{\Name} and \cmd{\AKA}. The second is triggered by \cmd{\@nameauth@UTFtest} when it encounters a Unicode character under NFSS. The third is an ``override switch'' triggered by \cmd{\AccentCapThis} as a fall-back in case there is a problem with the detection. % \begin{macrocode} \newif\if@nameauth@DoCaps -% \end{macrocode} -% This Boolean value is triggered by \cmd{\AccentCapThis} to handle special cases of extended Unicode particle caps. Each instance of \cmd{\Name} and \cmd{\AKA} reset it. -% \begin{macrocode} +\newif\if@nameauth@UTF \newif\if@nameauth@Accent -% \end{macrocode} -% \cmd{\KeepAffix} toggles the value below, which causes \cmd{\Name} and \cmd{\AKA} to use non-breaking spaces between a name and an affix, then reset the value. -% \begin{macrocode} -\newif\if@nameauth@NBSP -% \end{macrocode} -% This Boolean value is used for detection of double full stops at the end of a name. -% \begin{macrocode} -\newif\if@nameauth@Punct % \end{macrocode}\medskip % -% \noindent{\large\bfseries Hook Triggers}\\[0.5ex] -% |\@nameauth@FirstFormat| triggers the first-use hooks to be called; otherwise the second-use hooks are called. Additionally, |\@nameauth@AlwaysFormat| forces this true, except when \cmd{\@nameauth@AKAFormat} is false. +% \noindent{\large\bfseries Warning Levels}\\[0.5ex] +% This flag controls how many warnings you get. Defaults to few warnings. Verbose gives you plenty of warnings about cross-references in the index. % \begin{macrocode} -\newif\if@nameauth@FirstFormat -\newif\if@nameauth@AlwaysFormat +\newif\if@nameauth@Verbose % \end{macrocode}\medskip % -% \noindent{\large\bfseries Who Called Me?}\\[0.5ex] -% These values are true within \cmd{\Name} and \cmd{\AKA}, respectively. Otherwise they are false. They are used when one modifies the hook macros. See Sections~\ref{sec:Hooksb}ff. +% \noindent{\large\bfseries Name Argument Token Registers}\\[0.5ex] +% These three token registers contain the current values of the name arguments passed to \cmd{\Name}, its variants, and the cross-reference fields of \cmd{\AKA}. % \begin{macrocode} -\newif\if@nameauth@InAKA -\newif\if@nameauth@InName +\newtoks\@nameauth@toksa% +\newtoks\@nameauth@toksb% +\newtoks\@nameauth@toksc% % \end{macrocode} -% As an aside, \cmd{\AKA} will invoke \cmd{\NamesFormat} / \cmd{\FrontNamesFormat} if the \texttt{alwaysformat} option is set. Otherwise it will invoke \cmd{\MainNameHook} / \cmd{\FrontNameHook}.\medskip -% -% \noindent{\large\bfseries Stack Overflow Prevention}\\[0.5ex] -% Here is the locking mechanism that prevents a stack overflow via recursive calls to \cmd{\Name} and \cmd{\AKA}. See Sections~\ref{sec:Hooksb}ff. +% These three token registers contain the current values of the name arguments in each line of the \texttt{nameauth} environment. % \begin{macrocode} -\newif\if@nameauth@Lock +\newtoks\@nameauth@etoksb% +\newtoks\@nameauth@etoksc% +\newtoks\@nameauth@etoksd% % \end{macrocode} +% % \subsection{Hooks} % \begin{macro}{\NamesFormat} -% Post-process ``first'' instance of final complete name form in text. See Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. Called when both |\@nameauth@MainFormat| and |\@nameauth@FirstFormat| are true. +% Post-process ``first'' instance of final complete name form in text. See Sections~\ref{sec:formatting} and~\ref{sec:Hooksa}f. Called when both |\@nameauth@MainFormat| and |\@nameauth@FirstFormat| are true. % \begin{macrocode} \newcommand*\NamesFormat{} % \end{macrocode} % \end{macro} % \begin{macro}{\MainNameHook} % \changes{v2.4}{2016/03/15}{Added} -% Post-process subsequent instance of final complete name form in main-matter text. See Sections~\ref{sec:CustomHooks} and~\ref{sec:Hooksa}ff. Called when |\@nameauth@MainFormat| is true and |\@nameauth@FirstFormat| is false. +% Post-process subsequent instance of final complete name form in main-matter text. See Sections~\ref{sec:formatting} and~\ref{sec:Hooksa}f. Called when |\@nameauth@MainFormat| is true and the Boolean flag |\@nameauth@FirstFormat| is false. % \begin{macrocode} \newcommand*\MainNameHook{} % \end{macrocode} @@ -3604,20 +3427,7 @@ Running "make install" installs the files in the local TeX tree. \newcommand*\NameauthFName{\@nameauth@Name} % \end{macrocode} % \end{macro} -% \clearpage\noindent -% \noindent{\large\bfseries Name Argument Token Registers}\\[0.5ex] -% These three token registers contain the current values of the name arguments passed to \cmd{\Name}, its variants, and the cross-reference fields of \cmd{\AKA.} -% \begin{macrocode} -\newtoks\@nameauth@toksa% -\newtoks\@nameauth@toksb% -\newtoks\@nameauth@toksc% -% \end{macrocode} -% These three token registers contain the current values of the name arguments in each line of the \texttt{nameauth} environment. -% \begin{macrocode} -\newtoks\@nameauth@etoksb% -\newtoks\@nameauth@etoksc% -\newtoks\@nameauth@etoksd% -% \end{macrocode} +% % \subsection{Package Options} % The following package options interact with many of the prior Boolean values. % \begin{macrocode} @@ -3626,6 +3436,7 @@ Running "make install" installs the files in the local TeX tree. \DeclareOption{mainmatter}{\@nameauth@MainFormattrue} \DeclareOption{frontmatter}{\@nameauth@MainFormatfalse} \DeclareOption{formatAKA}{\@nameauth@AKAFormattrue} +\DeclareOption{oldAKA}{\@nameauth@oldAKAtrue} \DeclareOption{index}{\@nameauth@DoIndextrue} \DeclareOption{noindex}{\@nameauth@DoIndexfalse} \DeclareOption{pretag}{\@nameauth@Pretagtrue} @@ -3643,6 +3454,7 @@ Running "make install" installs the files in the local TeX tree. \DeclareOption{italic}{\renewcommand*\NamesFormat{\itshape}} \DeclareOption{boldface}{\renewcommand*\NamesFormat{\bfseries}} \DeclareOption{noformat}{\renewcommand*\NamesFormat{}} +\DeclareOption{verbose}{\@nameauth@Verbosetrue} \ExecuteOptions% {nocomma,% mainmatter,% @@ -3653,128 +3465,169 @@ Running "make install" installs the files in the local TeX tree. noformat} \ProcessOptions\relax % \end{macrocode} +% % Now we load the required packages. They facilitate the first/subsequent name uses, the parsing of arguments, and the implementation of starred forms. % \begin{macrocode} \RequirePackage{etoolbox} -\RequirePackage{ifluatex} -\RequirePackage{ifxetex} -\RequirePackage{trimspaces} \RequirePackage{suffix} +\RequirePackage{trimspaces} \RequirePackage{xargs} % \end{macrocode} % -% The \textsf{etoolbox} package is essential for bringing the modern functionality of $\epsilon$-\TeX\ in parsing and passing the name parameters, etc. Using \textsf{xargs} allows for the optional arguments to work in a fairly wide set of environments.\footnote{Early versions of this package used \LaTeX3 functionality that was powerful. Yet the naming macros broke in some cases, like in \cmd{\marginpar} and some other environments.} -% Using \textsf{suffix} facilitated macros like \cmd{\Name*}, although one might argue whether or not a ``starred form'' is the best approach, especially when \textsf{suffix} and \textsf{xargs} have some compatibility issues. Finally, \textsf{trimspaces} helps the fault tolerance of name arguments and \textsf{ifluatex/ifxetex} allow accented names to work on different \LaTeX\ engines. +% The \textsf{etoolbox} package is essential for processing name control sequences. Using \textsf{xargs} allows the optional arguments to work. Using \textsf{suffix} facilitated the starred form of macros. Finally, \textsf{trimspaces} helps the fault tolerance of name arguments. % % \subsection{Internal Macros} +% \label{sec:internal} % % \noindent{\large\bfseries Name Control Sequence: Who Am I?} % \begin{macro}{\@nameauth@Clean} -% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string, even using accented characters, based on the arguments of \cmd{\Name} and friends. With this we can construct a control sequence name and test for it to determine the existence of pseudonyms and the first or subsequent occurrences of a name. +% Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string used to make a (hopefully) unique control sequence for a name. We can test the existence of that control string to determine first occurrences of a name or cross-reference. % \begin{macrocode} -\newcommand*\@nameauth@Clean[1]% +\newcommand*\@nameauth@Clean[1] {\expandafter\zap@space\detokenize{#1} \@empty} % \end{macrocode} -% \end{macro} +% \end{macro}\medskip % -% \noindent{\large\bfseries Core Name Parsing Operations} +% \noindent{\large\bfseries Parsing: Root and Suffix} % \begin{macro}{\@nameauth@Root} -% \changes{v1.4}{2012/07/24}{Made more robust} -% The following two macros parse \meta{SNN} into a radix and a comma-delimited suffix, returning only the radix. They (and their arguments) are expandable in order to facilitate proper indexing functionality. They form the kernel of the suffix removal and comma suppression features. +% \changes{v1.4}{2012/07/24}{More robust} +% The following two macros return everything before a comma in \meta{SNN}. % \begin{macrocode} -\newcommand*\@nameauth@Root[1]% - {\@nameauth@TrimRoot#1,\@empty\relax} +\newcommand*\@nameauth@Root[1]{\@nameauth@TrimRoot#1,\\} % \end{macrocode} % \end{macro} % % \begin{macro}{\@nameauth@TrimRoot} -% \changes{v0.9}{2012/02/10}{Suffix handling expandable} -% \changes{v2.0}{2015/11/11}{trim spaces} +% \changes{v0.9}{2012/02/10}{Expandable} +% \changes{v2.0}{2015/11/11}{Trim spaces} +% \changes{v3.0}{2016/10/26}{Redesigned} % Throw out the comma and suffix, return the radix. % \begin{macrocode} -\def\@nameauth@TrimRoot#1,#2\relax{\trim@spaces{#1}} +\def\@nameauth@TrimRoot#1,#2\\{\trim@spaces{#1}} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@nameauth@CapRoot} -% \changes{v0.95}{2012/02/17}{Added} -% \changes{v2.1}{2015/11/24}{Handle Unicode better} -% The next two macros implement the particulate name capitalization mechanism by returning a radix where the first letter is capitalized. In \texttt{xelatex} and \texttt{lualatex} this is trivial and causes no problems. In \texttt{pdflatex} we have to account for ``double-wide'' accented Unicode characters. +% \begin{macro}{\@nameauth@TagRoot} +% \changes{v3.0}{2016/10/26}{Added} +% The following two macros return everything before a vertical bar (\verb+|+) in an index tag. % \begin{macrocode} -\newcommand*\@nameauth@CapRoot[1]% -{% - \ifxetex - \@nameauth@CRii#1\relax% - \else - \ifluatex - \@nameauth@CRii#1\relax% - \else - \if@nameauth@Accent - \@nameauth@CRiii#1\relax% - \else - \@nameauth@CRii#1\relax% - \fi - \fi - \fi -} +\newcommand*\@nameauth@TagRoot[1]{\@nameauth@TrimTag#1|\\} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@nameauth@CRii} -% \changes{v0.95}{2012/02/17}{Added} -% \changes{v1.26}{2012/04/24}{Fixed} -% Grab the first letter as one argument, and everything before \cmd{\relax} as the second. Capitalize the first and return it with the second. +% \begin{macro}{\@nameauth@TrimTag} +% \changes{v3.0}{2016/10/26}{Added} +% Throw out the bar and suffix, return the radix. % \begin{macrocode} -\def\@nameauth@CRii#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} +\def\@nameauth@TrimTag#1|#2\\{#1} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@nameauth@CRiii} -% \changes{v2.1}{2015/11/24}{added} -% This is called in \texttt{pdflatex} under \textsf{inputenc} where an accented Unicode character takes the first two arguments. Grab the first ``letter'' as two arguments and cap it, then everything before \cmd{\relax} as the third. Capitalize the first and return it with the second. +% \begin{macro}{\@nameauth@Suffix} +% \changes{v0.9}{2012/02/10}{Added} +% The following two macros parse \meta{SNN} into a radix and a comma-delimited suffix, returning only the suffix after a comma in the argument, or nothing. +% \begin{macrocode} +\newcommand*\@nameauth@Suffix[1]{\@nameauth@TrimSuffix#1,,\\} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@nameauth@TrimSuffix} +% \changes{v0.9}{2012/02/10}{Added} +% \changes{v1.5}{2013/02/22}{Trim spaces} +% \changes{v3.0}{2016/10/26}{New test} +% Throw out the radix; return the suffix with no leading spaces. % \begin{macrocode} -\def\@nameauth@CRiii#1#2#3\relax{\uppercase{#1#2}\@nameauth@Root{#3}} +\def\@nameauth@TrimSuffix#1,#2,#3\\{% + \ifx\\#2\\\@empty\else\trim@spaces{#2}\fi} % \end{macrocode} % \end{macro} % +% \noindent{\large\bfseries Parsing: Capitalization} % \begin{macro}{\@nameauth@AllCapRoot} % \changes{v1.5}{2013/02/22}{Added} -% This macro returns a fully-capitalized radix. It is used for generating capitalized Eastern family names in the body text. +% This macro returns a fully-capitalized radix. It is used for generating capitalized Eastern family names in the body text. It is also the trivial case. % \begin{macrocode} -\newcommand*\@nameauth@AllCapRoot[1]% +\newcommand*\@nameauth@AllCapRoot[1] {\uppercase{\@nameauth@Root{#1}}} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@nameauth@Suffix} -% \changes{v0.9}{2012/02/10}{Added} -% The following two macros parse \meta{SNN} into a radix and a comma-delimited suffix, returning only the suffix. Anything before a comma is stripped off by |\@nameauth@Suffix|, but a comma must be present in the argument. Leading spaces are removed to allow consistent formatting. +% \begin{macro}{\@nameauth@UTFtest} +% \phantomsection\label{page:CapRoot} +% \changes{v3.0}{2016/10/26}{Added} +% Before we attempt at capitalizing anything, we need to determine if we are running under \texttt{xelatex} or \texttt{lualatex} by testing for \cmd{\Umathchar}. Then we see if we are un the UTF-8 regime of NFSS. Then we can test if the leading token of our text is the same as the leading token of an active Unicode character. We run this test when we enter \cmd{\@nameauth@Name} and \cmd{\AKA}. +% \begin{macrocode} +\newcommand*\@nameauth@UTFtest[1] +{% + \ifdefined\Umathchar + \@nameauth@UTFfalse% + \else + \ifdefined\UTFviii@two@octets + \toks@\expandafter{\@car#1\@nil}% + \edef\one{\the\toks@}% + \toks@\expandafter{\@carß\@nil}% + \edef\two{\the\toks@}% + \ifx\one\two\@nameauth@UTFtrue\else\@nameauth@UTFfalse\fi + \if@nameauth@Accent + \@nameauth@UTFtrue% + \@nameauth@Accentfalse% + \fi + \else\@nameauth@UTFfalse\fi + \fi +} +% \end{macrocode} +% \end{macro} +% \clearpage +% +% \begin{macro}{\@nameauth@CapRoot} +% \changes{v0.95}{2012/02/17}{Added} +% \changes{v2.1}{2015/11/24}{Fix Unicode/NFSS} +% \changes{v3.0}{2016/10/26}{New UTF test} +% Use the NFSS Unicode version if the test is true, else use the regular version. % \begin{macrocode} -\newcommand*\@nameauth@Suffix[1]% - {\@nameauth@TrimSuffix#1\relax} +\newcommand*\@nameauth@CapRoot[1] +{% + \if@nameauth@UTF \@nameauth@CRiii#1\\% + \else \@nameauth@CRii#1\\% + \fi +} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@nameauth@TrimSuffix} -% \changes{v0.9}{2012/02/10}{Added} -% \changes{v1.5}{2013/02/22}{Trim spaces} -% Throw out the radix, comma, and \cmd{\relax}; return the suffix with no leading spaces. +% \begin{macro}{\@nameauth@CRii} +% \changes{v0.95}{2012/02/17}{Added} +% \changes{v1.26}{2012/04/24}{Fixed} +% \changes{v3.0}{2016/10/26}{Redesigned} +% Cap the first letter and return the rest as a radix stripped of its suffix. % \begin{macrocode} -\def\@nameauth@TrimSuffix#1,#2\relax{\trim@spaces{#2}} +\def\@nameauth@CRii#1#2\\{\@nameauth@Root{\uppercase{#1}#2}} % \end{macrocode} % \end{macro} % -% \noindent{\large\bfseries Punctuation Detection} +% \begin{macro}{\@nameauth@CRiii} +% \changes{v2.1}{2015/11/24}{Added} +% \changes{v3.0}{2016/10/26}{Redesigned} +% Cap the first letter and return the rest as a radix stripped of its suffix. This is called in \texttt{pdflatex} under \textsf{inputenc}/Unicode. +% \begin{macrocode} +\def\@nameauth@CRiii#1#2#3\\{\@nameauth@Root{\uppercase{#1#2}#3}} +% \end{macrocode} +% \end{macro} +% +% \noindent{\large\bfseries Parsing: Punctuation Detection} % \begin{macro}{\@nameauth@TestDot} % This macro, based on a snippet by \Name*[Uwe]{Lueck}, checks for a period at the end of its argument. It determines whether we need to call \cmd{\@nameauth@CheckDot} below. % \begin{macrocode} -\newcommand*\@nameauth@TestDot[1]% +\newcommand*\@nameauth@TestDot[1] {% - \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}% - \def\TestPunct##1% - {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% + \def\TestDot##1.\TestEnd##2\\{\TestPunct{##2}}% + \def\TestPunct##1{% + \ifx\TestPunct##1\TestPunct% + \else + \@nameauth@Puncttrue% + \fi + }% \@nameauth@Punctfalse% - \TestDot#1\TestEnd.\TestEnd\TestStop% + \TestDot#1\TestEnd.\TestEnd\\% } % \end{macrocode} % \end{macro} @@ -3791,517 +3644,437 @@ Running "make install" installs the files in the local TeX tree. % If \cmd{\@token} is a full stop, we gobble the token. % \begin{macrocode} \newcommand*\@nameauth@EvalDot% - {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} -% \end{macrocode} -% \end{macro} -% \clearpage -% -% \noindent{\large\bfseries Name Hook Dispatcher} -% \begin{macro}{\@nameauth@FmtName} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% \changes{v0.94}{2012/02/15}{Add particle caps} -% \changes{v0.95}{2012/02/17}{Works with \textsf{microtype}} -% \changes{v2.0}{2015/11/11}{One macro instead of two} -% \changes{v2.4}{2016/03/15}{Add hooks for non-formatted names} -% \changes{v2.5}{2016/04/06}{Add final formatting hooks and logic} -% The dispatcher invokes the appropriate formatting hooks, depending on the Boolean values for first use, subsequent use, and name type. The first set of tests enables or disables formatting within \cmd{\AKA}. The second set of tests handle all the other naming macros in the name and front matter. The hooks have a local scope. -% \begin{macrocode} -\newcommand*\@nameauth@FmtName[1]% {% - \if@nameauth@InAKA - \if@nameauth@AlwaysFormat - \@nameauth@FirstFormattrue% - \else - \if@nameauth@AKAFormat\else\@nameauth@FirstFormatfalse\fi - \fi - \@nameauth@TestDot{#1}% - \if@nameauth@MainFormat - \if@nameauth@FirstFormat - \bgroup\NamesFormat{#1}\egroup% - \else - \bgroup\MainNameHook{#1}\egroup% - \fi - \else - \if@nameauth@FirstFormat - \bgroup\FrontNamesFormat{#1}\egroup% - \else - \bgroup\FrontNameHook{#1}\egroup% - \fi - \fi - \else - \if@nameauth@AlwaysFormat\@nameauth@FirstFormattrue\fi - \@nameauth@TestDot{#1}% - \if@nameauth@MainFormat - \if@nameauth@FirstFormat - \bgroup\NamesFormat{#1}\egroup% - \else - \bgroup\MainNameHook{#1}\egroup% - \fi - \else - \if@nameauth@FirstFormat - \bgroup\FrontNamesFormat{#1}\egroup% - \else - \bgroup\FrontNameHook{#1}\egroup% - \fi - \fi - \fi + \let\@period=.% + \ifx\@token\@period\expandafter\@gobble \fi } % \end{macrocode} % \end{macro} -% \clearpage -% -% \noindent{\large\bfseries Core Indexing Operations} -% \begin{macro}{\@nameauth@Actual} -% This sets the ``actual'' character used by \textsf{nameauth} for index sorting. -% \begin{macrocode} -\newcommand*\@nameauth@Actual{@} -% \end{macrocode} -% \end{macro} % -% \begin{macro}{\@nameauth@Index} -% \changes{v0.94}{2012/02/15}{Added} -% \changes{v2.0}{2015/11/11}{Redesigned tagging} -% If the indexing flag is true, create an index entry, otherwise do nothing. +% \noindent{\large\bfseries Error Detection} +% \begin{macro}{\@nameauth@Error} +% \changes{v3.0}{2016/10/26}{Added} +% One can cause \textsf{nameauth} to halt with an error by leaving a required name argument empty, providing an argument that expands to empty, or creating a name root that is empty within a root/suffix pair. % \begin{macrocode} -\newcommand*\@nameauth@Index[2]% +\newcommand*\@nameauth@Error[2] {% - \def\cseq{#1}% - \ifcsname\cseq!TAG\endcsname - \ifcsname\cseq!PRE\endcsname - \if@nameauth@DoIndex - \index% - {\csname\cseq!PRE\endcsname#2\csname\cseq!TAG\endcsname}% - \fi - \else - \if@nameauth@DoIndex\index{#2\csname\cseq!TAG\endcsname}\fi - \fi + \edef\msg{#2}% + \edef\pkg{nameauth}% + \let\ex\expandafter% + \protected@edef\argb{\trim@spaces{#1}}% + \protected@edef\rootb{\@nameauth@Root{#1}}% + \ifx\argb\@empty + \ex\PackageError\ex{\ex\pkg\ex}\ex{\msg SNN field empty}% \else - \ifcsname\cseq!PRE\endcsname - \if@nameauth@DoIndex\index{\csname\cseq!PRE\endcsname#2}\fi - \else - \if@nameauth@DoIndex\index{#2}\fi + \ifx\rootb\@empty + \ex\PackageError\ex{\ex\pkg\ex}\ex{\msg SNN field malformed}% \fi \fi } % \end{macrocode} % \end{macro} % -% \noindent{\large\bfseries Core Name Management Engine} +% \noindent{\large\bfseries Core Name Engine} +% % \begin{macro}{\@nameauth@Name} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% \changes{v0.96}{2012/02/19}{Works w/ \textsf{microtype}, \textsf{memoir}} -% \changes{v1.5}{2013/02/22}{Add reversing and caps} +% \changes{v0.85}{2012/02/05}{Comma suppression} +% \changes{v1.5}{2013/02/22}{Reversing/caps} % \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging} % \changes{v2.1}{2015/11/24}{Isolate Unicode issues} -% \changes{v2.3}{2016/01/05}{Rename as internal macro} -% \changes{v2.4}{2016/03/15}{Define name CS after formatting; add token regs for hooks} +% \changes{v2.3}{2016/01/05}{Now internal} +% \changes{v2.4}{2016/03/15}{Add token regs for hooks} % \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}} -% \changes{v2.5}{2016/04/06}{Enable hooks better to query internal values} -% \changes{v2.6}{2016/09/19}{Modularize indexing; account for page breaks; fix old syntax} -% Here is the heart of the package. \Name*[Marc van]{Dongen} provided the basic structure. Parsing, indexing, and formatting are in discrete elements. +% \changes{v2.5}{2016/04/06}{Hooks query internal values} +% \changes{v2.6}{2016/09/19}{Improve indexing; fix old syntax} +% \changes{v3.0}{2016/10/26}{Redesigned} +% Here is the heart of the package. \Name*[Marc van]{Dongen} provided the original basic structure. Parsing, indexing, and formatting are more discrete than in earlier versions. % \begin{macrocode} -\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty]% +\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty] {% % \end{macrocode} -% Prevent entering \cmd{\@nameauth@Name} via itself or \cmd{\AKA}. Both \cmd{\@nameauth@Name} and \cmd{\AKA} engage the lock. Calling these macros in their own parameters will create malformed output but should not halt program execution or overflow the stack. Calling these macros within the hook macros will simply cause them to exit. +% Both \cmd{\@nameauth@Name} and \cmd{\AKA} engage the lock below, preventing a stack overflow. % \begin{macrocode} \if@nameauth@Lock\else \@nameauth@Locktrue% +% \end{macrocode} +% Tell the formatting mechanism that it is being called from \cmd{\@nameauth@Name}. Then test for malformed input. +% \begin{macrocode} \@nameauth@InNametrue% - \let\ex\expandafter% + \@nameauth@Error{#2}{macro \string\@nameauth@name}% % \end{macrocode} -% \clearpage\noindent -% Names occur in horizontal mode; we ensure that. Next we make copies of the arguments to test them and make parsing decisions. We also make token register copies of the current name args to be available for the hook macros. +% Ensure that names are printed in horizontal mode. Create an index entry. % \begin{macrocode} \leavevmode\hbox{}% - \protected@edef\testa{#1}% - \protected@edef\arga{\trim@spaces{#1}}% - \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% - \protected@edef\testc{#3}% - \protected@edef\argc{\trim@spaces{#3}}% - \def\csb{\@nameauth@Clean{#2}}% - \def\csbc{\@nameauth@Clean{#2,#3}}% - \def\csab{\@nameauth@Clean{#1!#2}}% - \@nameauth@toksa\expandafter{#1}% - \@nameauth@toksb\expandafter{#2}% - \@nameauth@toksc\expandafter{#3}% + \IndexName[#1]{#2}[#3]% + \if@nameauth@MainFormat + \@nameauth@Parse[#1]{#2}[#3]{!MN}% + \else + \@nameauth@Parse[#1]{#2}[#3]{!NF}% + \fi + \IndexName[#1]{#2}[#3]% % \end{macrocode} -% Test for malformed input. +% Reset all the ``per name'' Boolean values. +% \begin{macrocode} + \@nameauth@Lockfalse% + \@nameauth@InNamefalse% + \@nameauth@NBSPfalse% + \@nameauth@DoCapsfalse% + \@nameauth@Accentfalse% + \@nameauth@AllThisfalse% + \@nameauth@ShowCommafalse% + \@nameauth@NoCommafalse% + \@nameauth@RevThisfalse% + \@nameauth@RevThisCommafalse% + \@nameauth@ShortSNNfalse% + \@nameauth@EastFNfalse% +% \end{macrocode} +% Close the ``locked'' branch. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \Name: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \Name: Essential name malformed}% - \fi \fi % \end{macrocode} -% If global caps. reversing, and commas are true, set the local flags true. If reversing is true, print a full name. +% Call the full stop detection. % \begin{macrocode} - \if@nameauth@AllCaps\@nameauth@AllThistrue\fi - \if@nameauth@RevAll\@nameauth@RevThistrue\fi - \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi + \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi +} % \end{macrocode} -% Create an index entry before we print the name. +% \end{macro} +% +% \begin{macro}{\@nameauth@Parse} +% \changes{v3.0}{2016/10/26}{Added} +% Parse and print a name in the text. The final required argument is a ``mode designator'' that can be ``!MN'' (main name); ``!NF'' (was ``non-formatted,'' now ``name in front matter''); and ``!PN'' (pseudonym/cross-reference). Both \cmd{\@nameauth@Name} and \cmd{\AKA} call this parser to print their names in the text. % \begin{macrocode} - \IndexName[#1]{#2}[#3]% +\newcommandx*\@nameauth@Parse[4][1=\@empty, 3=\@empty] +{% + \if@nameauth@Lock % \end{macrocode} -% The code below handles non-breaking and regular spaces, as well as commas, in the text, which are inserted only for Western names. +% We want these arguments to expand to \cmd{\@empty} (or not) when we test them. % \begin{macrocode} - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \ifx\arga\@empty\else - \if@nameauth@AlwaysComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@ShowComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@NoComma - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \fi - \fi + \protected@edef\arga{\trim@spaces{#1}}% + \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% % \end{macrocode} -% \clearpage\noindent -% The section below parses any ``surnames'' into name/suffix pairs and figures out how to capitalize and reverse them as needed, storing the results for the main parser. +% If global caps. reversing, and commas are true, set the local flags true. +% \begin{macrocode} + \if@nameauth@AllCaps\@nameauth@AllThistrue\fi + \if@nameauth@RevAll\@nameauth@RevThistrue\fi + \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi +% \end{macrocode} +% Get the root name as a normal or capitalized form, according to the flags. % \begin{macrocode} - \protected@edef\RawShort{\@nameauth@Root{#2}}% - \if@nameauth@DoCaps - \protected@edef\CapShort{\@nameauth@CapRoot{#2}}% - \else - \let\CapShort\RawShort% - \fi - \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#2}}% - \ifx\testb\testbr - \let\Suff\@empty% - \let\Reversed\RawShort% - \let\SNN\RawShort% - \let\PrintShort\RawShort% \if@nameauth@DoCaps - \let\Reversed\CapShort% - \let\SNN\CapShort% - \let\PrintShort\CapShort% - \fi - \if@nameauth@AllThis - \let\Reversed\AllCapShort% - \let\SNN\AllCapShort% - \let\PrintShort\AllCapShort% - \fi - \else - \protected@edef\Suff{\@nameauth@Suffix{#2}}% - \protected@edef\Reversed{\Suff\Space\RawShort}% - \protected@edef\SNN{\RawShort\Space\Suff}% - \if@nameauth@RevThis - \let\PrintShort\Suff% + \@nameauth@UTFtest{#2}% + \protected@edef\rootb{\@nameauth@CapRoot{#2}}% \else - \let\PrintShort\RawShort% - \fi - \if@nameauth@DoCaps - \protected@edef\Reversed{\Suff\Space\CapShort}% - \protected@edef\SNN{\CapShort\Space\Suff}% - \if@nameauth@RevThis - \let\PrintShort\Suff% - \else - \let\PrintShort\CapShort% - \fi - \fi - \if@nameauth@AllThis - \protected@edef\Reversed{\Suff\Space\AllCapShort}% - \protected@edef\SNN{\AllCapShort\Space\Suff}% - \if@nameauth@RevThis - \let\PrintShort\Suff% + \if@nameauth@AllThis + \protected@edef\rootb{\@nameauth@AllCapRoot{#2}}% \else - \let\PrintShort\AllCapShort% + \protected@edef\rootb{\@nameauth@Root{#2}}% \fi \fi - \fi -% \end{macrocode} -% Now we begin to format names. -% \begin{macrocode} - \ifx\testa\@empty - \ifx\testc\@empty -% \end{macrocode} -% \clearpage\noindent -% This is the section for momonyms, royal name/suffix pairs, and native Eastern names where comma-delimited suffixes are used. If formatting is active, we handle the main matter names (code !MN). First we handle subsequent uses. We need \cmd{\expandafter} to enable the punctuation detection. -% \begin{macrocode} - \if@nameauth@MainFormat - \ifcsname\csb!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% - \else % \end{macrocode} -% Here we handle first uses. +% Make (usually) unique control sequence values from the name arguments. % \begin{macrocode} - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \csgdef{\csb!MN}{}% - \@nameauth@FullNamefalse% - \fi - \else + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% \noindent -% If formatting is inactive we process names in the front matter (code !NF for non-formatted). First handle subsequent uses. +% Make token register copies of the current name args to be available for the hook macros. % \begin{macrocode} - \ifcsname\csb!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% - \else + \@nameauth@toksa\expandafter{#1}% + \@nameauth@toksb\expandafter{#2}% + \@nameauth@toksc\expandafter{#3}% % \end{macrocode} -% \clearpage\noindent -% Handle first uses of front-matter names. +% The code below handles non-breaking and regular spaces (\cmd{\KeepAffix}). It also handles the use of commas before affixes in Western names. % \begin{macrocode} - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \csgdef{\csb!NF}{}% - \@nameauth@FullNamefalse% - \fi + \edef\Space{\space}% + \if@nameauth@NBSP\edef\Space{\nobreakspace}\fi + \ifx\arga\@empty\else + \if@nameauth@AlwaysComma + \edef\Space{,\space}% + \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi \fi - \else + \if@nameauth@ShowComma + \edef\Space{,\space}% + \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi + \fi + \if@nameauth@NoComma + \edef\Space{\space}% + \if@nameauth@NBSP\edef\Space{\nobreakspace}\fi + \fi + \fi % \end{macrocode} -% This is the section that handles the old syntax for royal names and native Eastern names. If formatting is active, we handle first and subsequent formatting of names in the main matter (code !MN for main matter name). First we handle subsequent uses. +% The section below parses names. It ``attaches meaning'' to the macro arguments via \cmd{\FNN} and \cmd{\SNN}, wich is all the name printing macros know. Call the name printing macros, based on the optional arguments. Then create a second index entry. % \begin{macrocode} - \if@nameauth@MainFormat - \ifcsname\csbc!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\argc}% - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% - \else + \let\SNN\rootb% + \ifx\arga\@empty + \ifx\argc\@empty % \end{macrocode} -% Handle first uses. +% When \cmd{\arga}, \cmd{\argc}, and \cmd{\suffb} are empty, we have a mononym. When \cmd{\suffb} is not empty, we have a native Eastern name or non-Western name. % \begin{macrocode} - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \csgdef{\csbc!MN}{}% - \@nameauth@FullNamefalse% - \fi + \let\FNN\suffb% + \let\SNN\rootb% + \@nameauth@NonWest{\csb#4}% \else % \end{macrocode} -% \clearpage\noindent -% Take care of names in the front matter (code !NF for non-formatted). First handle subsequent uses. +% When \cmd{\arga} and \cmd{\suffb} are empty, but \cmd{\argc} is not, we have the old syntax. When \cmd{\arga} is empty, but \cmd{\argc} and \cmd{\suffb} are not, we have alternate names for non-Western names. % \begin{macrocode} - \ifcsname\csbc!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\argc}% - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \ifx\suffb\@empty + \let\FNN\argc% + \let\SNN\rootb% + \@nameauth@NonWest{\csbc#4}% \else + \let\FNN\argc% + \let\SNN\rootb% + \@nameauth@NonWest{\csb#4}% + \fi + \fi + \else % \end{macrocode} -% Handle first uses. +% When \cmd{\arga} is not empty, we have either a Western name or a non-native Eastern name. When \cmd{\argc} is not empty, we use alternate names. When \cmd{\suffb} is not empty we use suffixed forms. % \begin{macrocode} - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \csgdef{\csbc!NF}{}% - \@nameauth@FullNamefalse% - \fi + \ifx\argc\@empty + \let\FNN\arga% + \else + \let\FNN\argc% \fi + \ifx\suffb\@empty + \else + \protected@edef\SNN{\rootb\Space\suffb}% + \if@nameauth@ShortSNN\let\SNN\rootb\fi + \fi + \@nameauth@West{\csab#4}% \fi - \else + \fi +} % \end{macrocode} -% This is the section that handles Western names and non-native Eastern names. The first pair of conditionals handle the \texttt{comma} option, \cmd{\RevThisComma}, and alternate forenames. +% \end{macro} +% +% \begin{macro}{\@nameauth@NonWest} +% \changes{v3.0}{2016/10/26}{Added} +% Print non-Western names from \cmd{\@nameauth@name} and \cmd{\AKA}. We inherit internal control sequences from the naming macros and do nothing if called outside them. % \begin{macrocode} - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi +\newcommand*\@nameauth@NonWest[1] +{% + \if@nameauth@Lock + \ifcsname#1\endcsname\else + \@nameauth@FirstFormattrue% \fi - \ifx\testc\@empty - \let\FNN\arga% + \if@nameauth@InAKA + \if@nameauth@AltAKA + \if@nameauth@OldAKA\@nameauth@EastFNtrue\fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNametrue% + \else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi \else - \let\FNN\argc% + \ifcsname#1\endcsname\else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi \fi -% \end{macrocode} -% \clearpage\noindent -% If formatting is active, we handle first and subsequent formatting of names in the main matter (code !MN for main matter name). First we handle subsequent uses. -% \begin{macrocode} - \if@nameauth@MainFormat - \ifcsname\csab!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \let\PrintShort\FNN% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% - \fi + \if@nameauth@FirstName + \@nameauth@FullNamefalse% + \fi + \ifx\FNN\@empty + \@nameauth@Hook{\SNN}% + \else + \if@nameauth@FullName + \if@nameauth@RevThis + \@nameauth@Hook{\FNN\Space\SNN}% \else - \ex\@nameauth@FmtName\ex{\PrintShort}% + \@nameauth@Hook{\SNN\Space\FNN}% \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% \else + \if@nameauth@EastFN + \@nameauth@Hook{\FNN}% + \else + \@nameauth@Hook{\SNN}% + \fi + \fi + \fi + \ifcsname#1\endcsname\else + \if@nameauth@InAKA\else\csgdef{#1}{}\fi% + \fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi +} % \end{macrocode} -% Handle first uses. +% \end{macro} +% +% \begin{macro}{\@nameauth@West} +% \changes{v3.0}{2016/10/26}{Added} +% Print Western names and ``non-native'' Eastern names from \cmd{\@nameauth@name} and \cmd{\AKA}. We inherit internal control sequences from the naming macros and do nothing if called outside them. % \begin{macrocode} - \@nameauth@FirstFormattrue% +\newcommand*\@nameauth@West[1] +{% + \if@nameauth@Lock + \ifcsname#1\endcsname\else + \@nameauth@FirstFormattrue% + \fi + \if@nameauth@InAKA + \if@nameauth@AltAKA + \@nameauth@FullNamefalse% + \@nameauth@FirstNametrue% + \else \@nameauth@FullNametrue% \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% + \fi + \else + \ifcsname#1\endcsname\else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi + \fi + \if@nameauth@FirstName + \@nameauth@FullNamefalse% + \fi + \if@nameauth@FullName + \if@nameauth@RevThis + \@nameauth@Hook{\SNN\space\FNN}% + \else + \if@nameauth@RevThisComma + \edef\RevSpace{,\space}% + \@nameauth@Hook{\SNN\RevSpace\FNN}% \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% + \@nameauth@Hook{\FNN\space\SNN}% \fi - \csgdef{\csab!MN}{}% - \@nameauth@FullNamefalse% \fi \else + \if@nameauth@FirstName + \@nameauth@Hook{\FNN}% + \else + \@nameauth@Hook{\rootb}% + \fi + \fi + \ifcsname#1\endcsname\else + \if@nameauth@InAKA\else\csgdef{#1}{}\fi% + \fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% + \fi +} % \end{macrocode} -% Take care of names in the front matter (code !NF for non-formatted). First handle subsequent uses. +% \end{macro} +% +% \noindent{\large\bfseries Format Hook Dispatcher} +% \begin{macro}{\@nameauth@Hook} +% \changes{v0.94}{2012/02/15}{Particle caps} +% \changes{v0.95}{2012/02/17}{Works with \textsf{microtype}} +% \changes{v2.4}{2016/03/15}{Add hooks} +% \changes{v2.5}{2016/04/06}{Improve hooks} +% \changes{v3.0}{2016/10/26}{Better punctuation detection} +% Flags help the dispatcher invoke the correct formatting hooks. The flags control which hook is called (first/subsequent use, name type). The first set of tests handles formatting within \cmd{\AKA}. The second set of tests handles regular name formatting. The hooks have a local scope (and are defined as empty) by default. % \begin{macrocode} - \ifcsname\csab!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \let\PrintShort\FNN% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% - \fi +\newcommand*\@nameauth@Hook[1] +{% + \if@nameauth@Lock + \@nameauth@InHooktrue% + \protected@edef\test{#1}% + \expandafter\@nameauth@TestDot\expandafter{\test}% + \if@nameauth@InAKA + \if@nameauth@AlwaysFormat + \@nameauth@FirstFormattrue% + \else + \if@nameauth@AKAFormat\else + \@nameauth@FirstFormatfalse\fi + \fi + \if@nameauth@MainFormat + \if@nameauth@FirstFormat + \bgroup\NamesFormat{#1}\egroup% \else - \ex\@nameauth@FmtName\ex{\PrintShort}% + \bgroup\MainNameHook{#1}\egroup% \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% \else -% \end{macrocode} -% \clearpage\noindent -% Handle first uses. -% \begin{macrocode} + \if@nameauth@FirstFormat + \bgroup\FrontNamesFormat{#1}\egroup% + \else + \bgroup\FrontNameHook{#1}\egroup% + \fi + \fi + \else + \if@nameauth@AlwaysFormat \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% + \fi + \if@nameauth@MainFormat + \if@nameauth@FirstFormat + \bgroup\NamesFormat{#1}\egroup% \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% + \bgroup\MainNameHook{#1}\egroup% + \fi + \else + \if@nameauth@FirstFormat + \bgroup\FrontNamesFormat{#1}\egroup% + \else + \bgroup\FrontNameHook{#1}\egroup% \fi - \csgdef{\csab!NF}{}% - \@nameauth@FullNamefalse% \fi \fi + \@nameauth@FirstFormatfalse% + \@nameauth@InHookfalse% \fi +} % \end{macrocode} -% Make another index entry. -% \begin{macrocode} - \IndexName[#1]{#2}[#3]% -% \end{macrocode} -% Reset all the ``per name'' Boolean values. -% \begin{macrocode} - \@nameauth@Lockfalse% - \@nameauth@InNamefalse% - \@nameauth@FirstFormatfalse% - \@nameauth@NBSPfalse% - \@nameauth@DoCapsfalse% - \@nameauth@Accentfalse% - \@nameauth@AllThisfalse% - \@nameauth@ShowCommafalse% - \@nameauth@NoCommafalse% - \@nameauth@RevThisfalse% - \@nameauth@RevThisCommafalse% -% \end{macrocode} -% Close the ``locked'' branch. +% \end{macro} +% +% \noindent{\large\bfseries Indexing Internals} +% \begin{macro}{\@nameauth@Index} +% \changes{v0.94}{2012/02/15}{Added} +% \changes{v2.0}{2015/11/11}{New tagging} +% If the indexing flag is true, create an index entry, otherwise do nothing. Add tags automatically if they exist. % \begin{macrocode} +\newcommand*\@nameauth@Index[2] +{% + \def\cseq{#1}% + \let\ex\expandafter% + \ifcsname\cseq!TAG\endcsname + \protected@edef\Tag{\csname#1!TAG\endcsname}% + \ex\def\ex\ShortTag\ex{\ex\@nameauth@TagRoot\ex{\Tag}}% + \fi + \if@nameauth@DoIndex + \ifcsname\cseq!TAG\endcsname + \ifcsname\cseq!PRE\endcsname + \if@nameauth@Xref% + \index% + {\csname\cseq!PRE\endcsname#2\ShortTag}% + \else + \index% + {\csname\cseq!PRE\endcsname#2\csname\cseq!TAG\endcsname}% + \fi + \else + \if@nameauth@Xref + \index{#2\ShortTag}% + \else + \index{#2\csname\cseq!TAG\endcsname}% + \fi + \fi + \else + \ifcsname\cseq!PRE\endcsname + \index{\csname\cseq!PRE\endcsname#2}% + \else + \index{#2}% + \fi + \fi \fi +} % \end{macrocode} -% Call the full stop detection. +% \end{macro} +% +% \begin{macro}{\@nameauth@Actual} +% \changes{v2.0}{2015/11/11}{Added} +% This sets the ``actual'' character used by \textsf{nameauth} for index sorting. % \begin{macrocode} - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi -} +\newcommand*\@nameauth@Actual{@} % \end{macrocode} % \end{macro} -% \clearpage % % \subsection{User Interface Macros} -% % \noindent{\large\bfseries Syntactic Formatting\,---\,Capitalization} % \begin{macro}{\CapThis} % \changes{v0.94}{2012/02/15}{Added} -% Tells the root capping macro to cap an unaccented first character. +% Tells the root capping macro to cap the first character. % \begin{macrocode} \newcommand*\CapThis{\@nameauth@DoCapstrue} % \end{macrocode} @@ -4309,7 +4082,7 @@ Running "make install" installs the files in the local TeX tree. % % \begin{macro}{\AccentCapThis} % \changes{v2.1}{2015/11/24}{Added} -% Tells the root capping macro to cap an accented first Unicode character. +% Overrides the automatic test for active Unicode characters. This is a fall-back in case the automatic test for active Unicode characters fails. % \begin{macrocode} \newcommand*\AccentCapThis% {\@nameauth@Accenttrue\@nameauth@DoCapstrue} @@ -4318,7 +4091,7 @@ Running "make install" installs the files in the local TeX tree. % % \begin{macro}{\CapName} % \changes{v1.5}{2013/02/22}{Added} -% Capitalize entire name. +% Capitalize entire required name. % \begin{macrocode} \newcommand*\CapName{\@nameauth@AllThistrue} % \end{macrocode} @@ -4365,13 +4138,21 @@ Running "make install" installs the files in the local TeX tree. % \end{macrocode} % \end{macro} % +% \begin{macro}{\ForceFN} +% Force the printing of an Eastern forename in the text. +% \changes{v3.0}{2016/10/26}{Added} +% \begin{macrocode} +\newcommand*\ForceFN{\@nameauth@EastFNtrue} +% \end{macrocode} +% \end{macro} +% % \noindent{\large\bfseries Syntactic Formatting\,---\,Reversing with Commas} % \begin{macro}{\RevComma} % \changes{v1.5}{2013/02/22}{Added} % Last name, comma, first name. % \begin{macrocode} \newcommand*\RevComma% - {\@nameauth@RevThistrue\@nameauth@RevThisCommatrue} + {\@nameauth@RevThisCommatrue} % \end{macrocode} % \end{macro} % @@ -4380,7 +4161,7 @@ Running "make install" installs the files in the local TeX tree. % \changes{v1.5}{2013/02/22}{Added} % \begin{macrocode} \newcommand*\ReverseCommaInactive% - {\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse} + {\@nameauth@RevAllCommafalse} % \end{macrocode} % \end{macro} % @@ -4389,7 +4170,7 @@ Running "make install" installs the files in the local TeX tree. % \changes{v1.5}{2013/02/22}{Added} % \begin{macrocode} \newcommand*\ReverseCommaActive% - {\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue} + {\@nameauth@RevAllCommatrue} % \end{macrocode} % \end{macro} % @@ -4404,12 +4185,19 @@ Running "make install" installs the files in the local TeX tree. % % \begin{macro}{\NoComma} % \changes{v2.6}{2016/09/19}{Added} -% Remove comma between name and suffix one time (with \texttt{comma} option).. +% Remove comma between name and suffix one time (with \texttt{comma} option). % \begin{macrocode} \newcommand*\NoComma{\@nameauth@NoCommatrue} % \end{macrocode} % \end{macro} -% \clearpage +% +% \begin{macro}{\DropAffix} +% \changes{v3.0}{2016/10/26}{Added} +% Suppress the affix in a long Western name. +% \begin{macrocode} +\newcommand*\DropAffix{\@nameauth@ShortSNNtrue} +% \end{macrocode} +% \end{macro} % % \noindent{\large\bfseries Typographic Formatting\,---\,Affixes} % \begin{macro}{\KeepAffix} @@ -4462,7 +4250,7 @@ Running "make install" installs the files in the local TeX tree. \newcommand*\IndexInactive{\@nameauth@DoIndexfalse} % \end{macrocode} % \end{macro} -% +% % \begin{macro}{\IndexActive} % \changes{v0.94}{2012/02/15}{Added} % turn on global indexing of names. @@ -4475,660 +4263,631 @@ Running "make install" installs the files in the local TeX tree. % \changes{v2.0}{2015/11/11}{Added} % Change the ``actual'' character from the default. % \begin{macrocode} -\newcommand*\IndexActual[1]% +\newcommand*\IndexActual[1] {\global\renewcommand*\@nameauth@Actual{#1}} % \end{macrocode} % \end{macro} % +% \begin{macro}{\SeeAlso} +% \changes{v3.0}{2016/10/26}{Added} +% Change the type of cross-reference from a \emph{see} reference to a \emph{see also} reference. Works once per name. +% \begin{macrocode} +\newcommand*\SeeAlso{\@nameauth@SeeAlsotrue} +% \end{macrocode} +% \end{macro} +% +% \noindent{\large\bfseries Hook Macro Name Parser} +% \phantomsection\label{page:parser} +% \begin{macro}{\NameParser} +% \changes{v3.0}{2016/10/26}{Added} +% Generate a name form based on the current state of the \textsf{nameauth} macros in the locked path. Available for use only in the hook macros. +% \begin{macrocode} +\newcommand*\NameParser +{% + \if@nameauth@InHook + \let\SNN\rootb% + \ifx\arga\@empty + \ifx\argc\@empty + \let\FNN\suffb% + \else + \let\FNN\argc% + \fi + \ifx\suffb\@empty + \SNN% + \else + \if@nameauth@FullName + \if@nameauth@RevThis + \FNN\Space\SNN% + \else + \SNN\Space\FNN% + \fi + \else + \if@nameauth@EastFN + \FNN% + \else + \SNN% + \fi + \fi + \fi + \else + \ifx\argc\@empty + \let\FNN\arga% + \else + \let\FNN\argc% + \fi + \ifx\suffb\@empty + \else + \protected@edef\SNN{\rootb\Space\suffb}% + \if@nameauth@ShortSNN\let\SNN\rootb\fi% + \fi + \if@nameauth@FullName + \if@nameauth@RevThis + \SNN\space\FNN% + \else + \if@nameauth@RevThisComma + \SNN\RevSpace\FNN% + \else + \FNN\space\SNN% + \fi + \fi + \else + \if@nameauth@FirstName + \FNN% + \else + \protected@edef\SNN{\rootb}% + \SNN% + \fi + \fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% % \noindent{\large\bfseries Main Naming Interface} % \begin{macro}{\Name} -% \changes{v2.3}{2016/01/05}{Change to interface macro} -% \cmd{\Name} calls \cmd{\NameauthName,} the interface hook. +% \changes{v2.3}{2016/01/05}{Interface macro} +% \cmd{\Name} calls \cmd{\NameauthName}, the interface hook. % \begin{macrocode} -\def\Name{\NameauthName} +\newcommand\Name{\NameauthName} % \end{macrocode} % \end{macro} % % \begin{macro}{\Name*} -% \changes{v1.4}{2012/07/24}{Refactored} -% \cmd{\Name*} sets up a long name reference and calls \cmd{\NameauthLName,} the interface hook. +% \changes{v2.3}{2016/01/05}{Interface macro} +% \cmd{\Name*} sets up a long name reference and calls \cmd{\NameauthLName}, the interface hook. % \begin{macrocode} -\WithSuffix\def\Name*{\@nameauth@FullNametrue\NameauthLName} +\WithSuffix{\newcommand*}\Name*% + {\@nameauth@FullNametrue\NameauthLName} % \end{macrocode} % \end{macro} % % \begin{macro}{\FName} % \changes{v0.9}{2012/02/10}{Added} -% \changes{v1.4}{2012/07/24}{Refactored} -% \cmd{\FName} sets up a short name reference and calls \cmd{\NameauthFName,} the interface hook. +% \changes{v2.3}{2016/01/05}{Interface macro} +% \cmd{\FName} sets up a short name reference and calls \cmd{\NameauthFName}, the interface hook. % \begin{macrocode} -\def\FName{\@nameauth@FirstNametrue\NameauthFName} +\newcommand\FName{\@nameauth@FirstNametrue\NameauthFName} % \end{macrocode} % \end{macro} % % \begin{macro}{\FName*} -% \changes{v1.4}{2012/07/24}{Refactored} +% \changes{v2.3}{2016/01/05}{Interface macro} % \cmd{\FName} and \cmd{\FName*} are identical. % \begin{macrocode} -\WithSuffix\def\FName*{\@nameauth@FirstNametrue\NameauthFName} +\WithSuffix{\newcommand*}\FName*% + {\@nameauth@FirstNametrue\NameauthFName} % \end{macrocode} % \end{macro} -% \clearpage % -% \noindent{\large\bfseries Alternate Names} -% \begin{macro}{\AKA} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% \changes{v0.9}{2012/02/10}{Add starred mode; redesigned} -% \changes{v1.26}{2012/04/24}{Fix sorting of name suffixes} -% \changes{v1.5}{2013/02/22}{Add reversing and caps} +% \noindent{\large\bfseries Index Operations} +% \begin{macro}{\IndexName} +% \changes{v0.75}{2012/01/19}{Current arguments} +% \changes{v0.85}{2012/02/05}{Comma suppression} +% \changes{v1.26}{2012/04/24}{Fix name suffix sorting} % \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging} -% \changes{v2.1}{2015/11/24}{Isolate Unicode issues} -% \changes{v2.3}{2016/01/05}{Expand starred mode} -% \changes{v2.4}{2016/03/15}{Define name CS after formatting; add token regs for hooks} -% \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}} -% \changes{v2.6}{2016/09/19}{Fix index commas, old syntax} -% \cmd{\AKA} prints an alternate name and creates index cross-references. It prevents multiple generation of cross-references and suppresses double periods. +% \changes{v2.6}{2016/09/19}{Fix commas, old syntax} +% \changes{v3.0}{2016/10/26}{Redesigned} +% This creates a ``main'' index entry with page references. It issues warnings if the \texttt{verbose} option is selected and if a cross-reference or exclusion exists. It prints nothing. First we make copies of the arguments to test them and make parsing decisions. % \begin{macrocode} -\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]% +\newcommandx*\IndexName[3][1=\@empty, 3=\@empty] {% -% \end{macrocode} -% Prevent entering \cmd{\AKA} via itself or \cmd{\@nameauth@Name}. -% \begin{macrocode} - \if@nameauth@Lock\else - \@nameauth@Locktrue% - \@nameauth@InAKAtrue% - \let\ex\expandafter% -% \end{macrocode} -% Names occur in horizontal mode; we ensure that. Next we make copies of the arguments to test them and make parsing decisions. We also make token register copies of the current name args to be available for use within the hook macros. -% \begin{macrocode} - \leavevmode\hbox{}% \protected@edef\testa{#1}% \protected@edef\arga{\trim@spaces{#1}}% \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% + \protected@edef\rootb{\@nameauth@Root{#2}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \protected@edef\testc{#3}% \protected@edef\argc{\trim@spaces{#3}}% - \def\argd{\trim@spaces{#3}}% - \protected@edef\testd{\trim@spaces{#4}}% - \protected@edef\testdr{\@nameauth@Root{#4}}% - \protected@edef\teste{#5}% - \protected@edef\arge{\trim@spaces{#5}}% - \def\csd{\@nameauth@Clean{#4}}% - \def\csde{\@nameauth@Clean{#4,#5}}% - \def\cscd{\@nameauth@Clean{#3!#4}}% - \@nameauth@toksa\expandafter{#3}% - \@nameauth@toksb\expandafter{#4}% - \@nameauth@toksc\expandafter{#5}% -% \end{macrocode} -% \clearpage\noindent -% Test for malformed input. -% \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name malformed}% - \fi - \fi - \ifx\testd\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name missing}% - \else - \ifx\csd\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name malformed}% - \fi - \fi -% \end{macrocode} -% If global caps. reversing, and commas are true, set the local flags true. -% \begin{macrocode} - \if@nameauth@AllCaps\@nameauth@AllThistrue\fi - \if@nameauth@RevAll\@nameauth@RevThistrue\fi - \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% The code below handles non-breaking and regular spaces, as well as commas, in the text, which are inserted only for Western names. +% Test for malformed input. % \begin{macrocode} - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \ifx\argc\@empty\else - \if@nameauth@AlwaysComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@ShowComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@NoComma - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \fi - \fi + \@nameauth@Error{#2}{macro \string\IndexName}% % \end{macrocode} -% -% \clearpage\noindent -% The section below parses any ``surnames'' into name/suffix pairs and figures out how to capitalize and reverse them as needed, storing the results for the main parser. We have to handle several more combinations here than with \cmd{\@nameauth@Name} above. +% Now we deal with suffixes, and whether to handle them for Western or Eastern names. % \begin{macrocode} - \protected@edef\Shortb{\@nameauth@Root{#2}}% - \protected@edef\Shortd{\@nameauth@Root{#4}}% - \if@nameauth@DoCaps - \protected@edef\CapShort{\@nameauth@CapRoot{#4}}% - \else - \let\CapShort\Shortd - \fi - \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#4}}% - \ifx\testb\testbr - \let\SNNb\Shortb% - \let\Suffb\@empty% - \else - \protected@edef\Suffb{\@nameauth@Suffix{#2}}% - \protected@edef\SNNb{\Shortb\space\Suffb}% - \fi - \ifx\testd\testdr - \let\Suffd\@empty% - \let\ISNNd\Shortd% - \let\Reversed\Shortd% - \let\SNNd\Shortd% - \if@nameauth@DoCaps - \let\SNNd\CapShort% - \let\Reversed\CapShort% - \fi - \if@nameauth@AllThis - \let\SNNd\AllCapShort% - \let\Reversed\AllCapShort% - \fi + \let\Short\rootb% + \ifx\suffb\@empty + \let\SNN\rootb% \else - \protected@edef\Suffd{\@nameauth@Suffix{#4}}% - \protected@edef\ISNNd{\Shortd\space\Suffd}% - \protected@edef\Reversed{\Suffd\Space\Shortd}% - \protected@edef\SNNd{\Shortd\Space\Suffd}% - \if@nameauth@DoCaps - \protected@edef\Reversed{\Suffd\Space\CapShort}% - \protected@edef\SNNd{\CapShort\Space\Suffd}% - \fi - \if@nameauth@AllThis - \protected@edef\Reversed{\Suffd\Space\AllCapShort}% - \protected@edef\SNNd{\AllCapShort\Space\Suffd}% - \fi + \protected@edef\SNN{\rootb\space\suffb}% \fi % \end{macrocode} -% \clearpage\noindent -% Here we begin to index and format names. -% \begin{macrocode} - \ifx\testc\@empty - \ifx\teste\@empty -% \end{macrocode} -% For mononyms and name/suffix pairs: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index. +% +% We create the appropriate index entries, calling \cmd{\@nameauth@Index} to handle sorting and tagging. We do not create an index entry for a cross-reference (code !PN for pseudonym), used by \cmd{\IndexRef}, \cmd{\Excludename}, \cmd{\Includename}, \cmd{\AKA}, and \cmd{\PName}. % \begin{macrocode} - \ifcsname\csd!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #4 exists}% - \else - \ifcsname\csd!MN\endcsname + \ifx\testa\@empty + \ifx\testc\@empty + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 exists; no xref}% + {macro \IndexName: XRef: #2 exists}% + \fi + \else + \@nameauth@Index{\csb}{\SNN}% + \fi + \else + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 #3 exists}% + \fi \else - \ifcsname\csd!NF\endcsname + \@nameauth@Index{\csbc}{\SNN\space\argc}% + \fi + \else + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 exists; no xref}% - \else - \ifx\testa\@empty - \@nameauth@Index{\csd}% - {\ISNNd|see{\SNNb}}% - \else - \ifx\Suffb\@empty - \@nameauth@Index{\csd}% - {\ISNNd|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\csd}% - {\ISNNd|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi + {macro \IndexName: XRef: #2 exists}% \fi + \else + \@nameauth@Index{\csb}{\SNN}% \fi \fi -% \end{macrocode} -% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index. Again, \cmd{\expandafter} is used for the punctuation detection. -% \begin{macrocode} - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP - \protected@edef\Space{,\nobreakspace}% - \fi + \fi + \else + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #1 #2 exists}% \fi - \ifcsname\csd!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% + \else + \ifx\suffb\@empty + \@nameauth@Index{\csab}% + {\Short,\space\arga}% \else - \ex\@nameauth@FmtName\ex{\SNNd}% + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb}% \fi - \ifcsname\csd!PN\endcsname\else\csgdef{\csd!PN}{}\fi - \else + \fi + \fi +} % \end{macrocode} -% \clearpage\noindent -% For name/affix using the old syntax: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index. +% \end{macro} +% +% \begin{macro}{\IndexRef} +% \changes{v3.0}{2016/10/26}{Added} +% This creates an index cross-reference that is not already a pseudonym. It prints nothing. First we make copies of the arguments to test them and make parsing decisions. % \begin{macrocode} - \ifcsname\csde!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #4 #5 exists}% - \else - \ifcsname\csde!MN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 #5 exists; no xref}% - \else - \ifcsname\csde!NF\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 #5 exists; no xref}% - \else - \ifx\testa\@empty - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\SNNb}}% - \else - \ifx\Suffb\@empty - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi - \fi - \fi - \fi +\newcommandx*\IndexRef[4][1=\@empty, 3=\@empty] +{% + \protected@edef\testa{#1}% + \protected@edef\arga{\trim@spaces{#1}}% + \protected@edef\rootb{\@nameauth@Root{#2}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% + \protected@edef\testc{#3}% + \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\target{#4}% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% + \let\ex\expandafter% +% \end{macrocode} +% Test for malformed input. +% \begin{macrocode} + \@nameauth@Error{#2}{macro \string\IndexRef}% + \@nameauth@Xreftrue% +% \end{macrocode} +% Now we deal with suffixes, and whether to handle them for Western or Eastern names. +% \begin{macrocode} + \let\Short\rootb% + \ifx\suffb\@empty + \let\SNN\rootb% + \else + \protected@edef\SNN{\rootb\space\suffb}% + \fi % \end{macrocode} -% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index. +% We create either \emph{see also} entries or \emph{see} entries. The former are unrestricted. The latter are only created if they do not already exist as main entries. % \begin{macrocode} - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP - \protected@edef\Space{,\nobreakspace}% + \ifx\testa\@empty + \ifx\testc\@empty + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #2 exists}% \fi - \fi - \ifcsname\csde!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@AltAKA - \ex\@nameauth@FmtName\ex{\arge}% \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\arge\ex\Space\SNNd}% + \if@nameauth@SeeAlso + \@nameauth@Index{\csb}{\SNN|seealso{\target}}% \else - \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\Space\arge}% + \@nameauth@Index{\csb}{\SNN|see{\target}}% \fi + \csgdef{\csb!PN}{}% \fi - \ifcsname\csde!PN\endcsname\else\csgdef{\csde!PN}{}\fi - \fi - \else -% \end{macrocode} -% \clearpage\noindent -% For Western names and affixes: If a pseudonym has not been generated by \cmd{\AKA} or \cmd{\ExcludeName}, and if the proposed pseudonym is not already a mainmatter or frontmatter name, then generate a \textit{see} reference from the pseudonym to a name that will appear in the index. -% \begin{macrocode} - \ifcsname\cscd!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #3 #4 exists}% \else - \ifcsname\cscd!MN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #3 #4 exists; no xref}% + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #2 #3 exists}% + \fi + \else + \if@nameauth@SeeAlso + \@nameauth@Index{\csbc}% + {\SNN\space\argc|seealso{\target}}% + \else + \@nameauth@Index{\csbc}% + {\SNN\space\argc|see{\target}}% + \fi + \csgdef{\csbc!PN}{}% + \fi \else - \ifcsname\cscd!NF\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #3 #4 exists; no xref}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #2 exists}% + \fi \else - \ifx\testa\@empty - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\SNNb}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\SNNb}}% - \fi + \if@nameauth@SeeAlso + \@nameauth@Index{\csb}% + {\SNN|seealso{\target}}% \else - \ifx\Suffb\@empty - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\SNNb,\space\arga}}% - \fi - \else - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\Shortb,\space\arga,\space\Suffb}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi + \@nameauth@Index{\csb}% + {\SNN|see{\target}}% \fi + \csgdef{\csb!PN}{}% \fi \fi \fi -% \end{macrocode} -% \clearpage\noindent -% Print an appropriate version of the pseudonym (capped, reversed, etc.) in the text with no special formatting even if no cross-reference was generated in the index. -% \begin{macrocode} - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \ifx\teste\@empty - \let\FNN\argc% - \else - \let\FNN\arge% - \fi - \ifcsname\cscd!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@AltAKA - \ex\@nameauth@FmtName\ex{\FNN}% + \else + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #1 #2 exists}% + \fi \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\Space\FNN}% + \ifx\suffb\@empty + \if@nameauth@SeeAlso + \@nameauth@Index{\csab}% + {\Short,\space\arga|seealso{\target}}% + \else + \@nameauth@Index{\csab}% + {\Short,\space\arga|see{\target}}% + \fi \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNNd}% + \if@nameauth@SeeAlso + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb|seealso{\target}}% + \else + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb|see{\target}}% + \fi \fi + \csgdef{\csab!PN}{}% \fi - \ifcsname\cscd!PN\endcsname\else\csgdef{\cscd!PN}{}\fi - \fi -% \end{macrocode} -% Reset all the ``per name'' Boolean values. -% \begin{macrocode} - \@nameauth@Lockfalse% - \@nameauth@InAKAfalse% - \@nameauth@FirstFormatfalse% - \@nameauth@NBSPfalse% - \@nameauth@AltAKAfalse% - \@nameauth@DoCapsfalse% - \@nameauth@Accentfalse% - \@nameauth@AllThisfalse% - \@nameauth@ShowCommafalse% - \@nameauth@NoCommafalse% - \@nameauth@RevThisfalse% - \@nameauth@RevThisCommafalse% -% \end{macrocode} -% Close the ``locked'' branch. -% \begin{macrocode} \fi -% \end{macrocode} -% Call the full stop detection. -% \begin{macrocode} - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\AKA*} -% \changes{v0.9}{2012/02/10}{Added} -% This starred form sets a Boolean to print only the alternate name argument, if that exists, and calls \cmd{\AKA}. -% \begin{macrocode} -\WithSuffix\def\AKA*{\@nameauth@AltAKAtrue\AKA} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\PName} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% \changes{v2.3}{2016/01/05}{Work directly with hooks} -% \cmd{\PName} is a convenience macro that calls \cmd{\NameauthName}, then \cmd{\AKA}. -% \begin{macrocode} -\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty]% -{% - \NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% + \@nameauth@SeeAlsofalse% + \@nameauth@Xreffalse% } % \end{macrocode} % \end{macro} % -% \begin{macro}{\PName*} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% This sets up a long name reference and calls \cmd{\PName}. -% \begin{macrocode} -\WithSuffix\def\PName*{\@nameauth@FullNametrue\PName} -% \end{macrocode} -% \end{macro} -% -% \noindent{\large\bfseries Name Info Database: ``Text Tags''} -% \begin{macro}{\NameAddInfo} -% \changes{v2.4}{2016/03/15}{Added} +% \begin{macro}{\ExcludeName} +% \changes{v0.94}{2012/02/15}{Added} +% \changes{v2.0}{2015/11/11}{Isolate malformed input} +% \changes{v2.3}{2016/01/05}{Make special xref type} % \changes{v2.6}{2016/09/19}{Fix old syntax} -% This creates a control sequence and information associated with a given name, similar to an index tag, but usable in the body text. +% \changes{v3.0}{2016/10/26}{Redesigned} +% This macro prevents a name from being indexed. % \begin{macrocode} -\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty]% +\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences. +% Below we parse the name arguments and create a non-empty pseudonym macro. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\ExcludeName}% \ifx\testa\@empty \ifx\testc\@empty - \csgdef{\csb!DB}{#4}% + \if@nameauth@Verbose + \ifcsname\csb!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \ifcsname\csb!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \fi + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csb!PN}{!}% + \fi \else - \csgdef{\csbc!DB}{#4}% + \ifx\suffb\@empty + \if@nameauth@Verbose + \ifcsname\csbc!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 exists}% + \fi + \ifcsname\csbc!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 exists}% + \fi + \fi + \csgdef{\csbc!PN}{!}% + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csbc!PN}{!}% + \fi + \else + \if@nameauth@Verbose + \ifcsname\csb!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \ifcsname\csb!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \fi + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csb!PN}{!}% + \fi + \fi \fi \else - \csgdef{\csab!DB}{#4}% + \if@nameauth@Verbose + \ifcsname\csab!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #1 #2 exists}% + \fi + \ifcsname\csab!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #1 #2 exists}% + \fi + \fi + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csab!PN}{!}% + \fi \fi } % \end{macrocode} % \end{macro} % -% \begin{macro}{\NameQueryInfo} -% \changes{v2.4}{2016/03/15}{Added} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This prints the information created by \cmd{\NameAddInfo} if it exists. +% \begin{macro}{\IncludeName} +% \changes{v3.0}{2016/10/26}{Added} +% This macro allows a name to be indexed. % \begin{macrocode} -\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty]% +\newcommandx*\IncludeName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% \clearpage\noindent -% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences. +% Below we parse the name arguments undefine a pseudonym control sequence if it is not excluded (non-empty). % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IncludeName}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi + \fi \else - \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \edef\testex{\csname\csbc!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csbc!PN}\fi + \fi + \else + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi + \fi + \fi \fi \else - \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi + \ifcsname\csab!PN\endcsname + \edef\testex{\csname\csab!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csab!PN}\fi + \fi \fi } % \end{macrocode} % \end{macro} % -% \begin{macro}{\NameClearInfo} -% \changes{v2.4}{2016/03/15}{Added} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This deletes a text tag. It has the same structure as \cmd{\UntagName.} +% \begin{macro}{\IncludeName*} +% \changes{v3.0}{2016/10/26}{Added} +% This macro allows a name to be indexed. % \begin{macrocode} -\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty]% +\WithSuffix{\newcommandx*}\IncludeName*[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% + \edef\testa{!}% % \end{macrocode} -% We make copies of the arguments to test them and then we parse the arguments, undefining the tag control sequences. +% Below we parse the name arguments and undefine a pseudonym control sequence. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IncludeName*}% \ifx\testa\@empty \ifx\testc\@empty - \global\csundef{\csb!DB}% + \global\csundef{\csb!PN}% \else - \global\csundef{\csbc!DB}% + \ifx\suffb\@empty + \global\csundef{\csbc!PN}% + \else + \global\csundef{\csb!PN}% + \fi \fi \else - \global\csundef{\csab!DB}% + \global\csundef{\csab!PN}% \fi } % \end{macrocode} % \end{macro} % \clearpage\noindent % -% \noindent{\large\bfseries Index Operations} -% \begin{macro}{\IndexName} -% \changes{v0.75}{2012/01/19}{Current arguments} -% \changes{v0.85}{2012/02/05}{Add comma suppression} -% \changes{v1.26}{2012/04/24}{Fix name suffix sorting} -% \changes{v2.0}{2015/11/11}{Isolate malformed input; trim spaces; redesign tagging} -% \changes{v2.6}{2016/09/19}{No unwanted commas; fix old syntax} -% This creates an index entry that is not already a pseudonym. It prints nothing. It does ensure consistent formatting. First we make copies of the arguments to test them and make parsing decisions. +% \begin{macro}{\PretagName} +% \changes{v2.0}{2015/11/11}{Added} +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This creates an index entry tag that is applied before a name. % \begin{macrocode} -\newcommandx*\IndexName[3][1=\@empty, 3=\@empty]% +\newcommandx*\PretagName[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\arga{\trim@spaces{#1}}% - \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% \protected@edef\testc{#3}% - \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% Test for malformed input. -% \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IndexName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IndexName: Essential name malformed}% - \fi - \fi -% \end{macrocode} -% Now we deal with suffixes, and whether to handle them for Western or Eastern names. -% \begin{macrocode} - \let\Short\testbr% - \ifx\testb\testbr - \let\SNN\Short% - \let\Suff\@empty% - \else - \protected@edef\Suff{\@nameauth@Suffix{#2}}% - \protected@edef\SNN{\Short\space\Suff}% - \fi -% \end{macrocode} -% \clearpage\noindent -% We create the appropriate index entries with tags, letting the internal indexing macro sort that out. We do not create an index entry for a ``pseudonym'' control sequence (code !PN) created by \cmd{\AKA} or \cmd{\ExcludeName}. +% We parse the arguments, defining the sort tag control sequences used by\newline \cmd{\@nameauth@Index}. % \begin{macrocode} + \@nameauth@Error{#2}{macro \string\PretagName}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #2 exists}% - \else - \@nameauth@Index{\csb}{\SNN}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2}% + \fi \fi + \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #2 #3 exists}% + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2 #3}% + \fi + \fi + \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi \else - \@nameauth@Index{\csbc}{\SNN\space\argc}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2}% + \fi + \fi + \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi \fi \fi \else \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #1 #2 exists}% - \else - \ifx\Suff\@empty - \@nameauth@Index{\csab}{\Short,\space\arga}% - \else - \@nameauth@Index{\csab}{\Short,\space\arga,\space\Suff}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #1 #2}% \fi \fi + \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi \fi } % \end{macrocode} % \end{macro} -% % \clearpage\noindent +% % \begin{macro}{\TagName} % \changes{v1.2}{2012/02/25}{Added} % \changes{v1.9}{2015/07/09}{Fix cs collisions} % \changes{v2.0}{2015/11/11}{Isolate malformed input; redesign tagging} -% \changes{v2.6}{2016/09/19}{fix old syntax} +% \changes{v2.6}{2016/09/19}{Fix old syntax} % This creates an index entry tag that is applied to a name that is not already used as a \emph{see} reference. % \begin{macrocode} -\newcommandx*\TagName[4][1=\@empty, 3=\@empty]% +\newcommandx*\TagName[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences. +% We parse the arguments, defining the index tag control sequences used by\newline \cmd{\@nameauth@Index}. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\TagName}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #2}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2}% + \fi \else \csgdef{\csb!TAG}{#4}% \fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #2 #3}% + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2 #3}% + \fi + \else + \csgdef{\csbc!TAG}{#4}% + \fi \else - \csgdef{\csbc!TAG}{#4}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2}% + \fi + \else + \csgdef{\csb!TAG}{#4}% + \fi \fi \fi \else \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #1 #2}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #1 #2}% + \fi \else \csgdef{\csab!TAG}{#4}% \fi @@ -5137,39 +4896,34 @@ Running "make install" installs the files in the local TeX tree. % \end{macrocode} % \end{macro} % -% \clearpage\noindent % \begin{macro}{\UntagName} % \changes{v1.2}{2012/02/25}{Added} % \changes{v1.9}{2015/07/09}{Ensure global undef, fix cs collisions} % \changes{v2.0}{2015/11/11}{Isolate malformed input; redesign tagging} -% \changes{v2.6}{2016/09/19}{fix old syntax} +% \changes{v2.6}{2016/09/19}{Fix old syntax} % This deletes an index tag. % \begin{macrocode} -\newcommandx*\UntagName[3][1=\@empty, 3=\@empty]% +\newcommandx*\UntagName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and then we parse the arguments, undefining the tag control sequences. +% We parse the arguments, undefining the index tag control sequences. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\UntagName}% \ifx\testa\@empty \ifx\testc\@empty \global\csundef{\csb!TAG}% \else - \global\csundef{\csbc!TAG}% + \ifx\suffb\@empty + \global\csundef{\csbc!TAG}% + \else + \global\csundef{\csb!TAG}% + \fi \fi \else \global\csundef{\csab!TAG}% @@ -5178,306 +4932,247 @@ Running "make install" installs the files in the local TeX tree. % \end{macrocode} % \end{macro} % -% \clearpage\noindent -% \begin{macro}{\PretagName} -% \changes{v2.0}{2015/11/11}{Added} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This creates an index entry tag that is applied before a name. +% \noindent{\large\bfseries Name Info Database: ``Text Tags''} +% \begin{macro}{\NameAddInfo} +% \changes{v2.4}{2016/03/15}{Added} +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This creates a control sequence and information associated with a given name, similar to an index tag, but usable in the body text. % \begin{macrocode} -\newcommandx*\PretagName[4][1=\@empty, 3=\@empty]% +\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and then we parse the arguments, defining the tag control sequences. +% We parse the arguments, defining the text tag control sequences. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\NameAddInfo}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #2}% - \fi - \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi + \csgdef{\csb!DB}{#4}% \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #2 #3}% + \ifx\Suff\@empty + \csgdef{\csbc!DB}{#4}% + \else + \csgdef{\csb!DB}{#4}% \fi - \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi \fi \else - \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #1 #2}% - \fi - \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi + \csgdef{\csab!DB}{#4}% \fi } % \end{macrocode} % \end{macro} % -% \begin{macro}{\ExcludeName} -% \changes{v0.94}{2012/02/15}{Added} -% \changes{v2.0}{2015/11/11}{Isolate malformed input} -% \changes{v2.3}{2016/01/05}{Distinguish excluded names from regular aliases} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This macro prevents a name from being formatted or indexed, making \cmd{\Name} and friends print their arguments, emit a warning, and continue. +% \begin{macro}{\NameQueryInfo} +% \changes{v2.4}{2016/03/15}{Added} +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This prints the information created by \cmd{\NameAddInfo} if it exists. % \begin{macrocode} -\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty]% +\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% \clearpage\noindent -% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist. +% We parse the arguments, invoking the tag control sequences to expand to their contents. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \ExcludeName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \ExcludeName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\NameQueryInfo}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Xref: #2 already exists}% - \else - \ifcsname\csb!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 exists; no exclusion}% - \else - \ifcsname\csb!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 exists; no exclusion}% - \else - \csgdef{\csb!PN}{!}% - \fi - \fi - \fi + \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Xref: #2 #3 already exists}% + \ifx\Suff\@empty + \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi \else - \ifcsname\csbc!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}% - \else - \ifcsname\csbc!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}% - \else - \csgdef{\csbc!PN}{!}% - \fi - \fi + \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi \fi \fi + \else + \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi + \fi +} % \end{macrocode} -% \clearpage\noindent +% \end{macro} +% +% \begin{macro}{\NameClearInfo} +% \changes{v2.4}{2016/03/15}{Added} +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This deletes a text tag. It has the same structure as \cmd{\UntagName}. % \begin{macrocode} - \else - \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: XRef: #1 #2 already exists}% +\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty] +{% + \protected@edef\testa{#1}% + \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% +% \end{macrocode} +% We parse the arguments, undefining the text tag control sequences. +% \begin{macrocode} + \@nameauth@Error{#2}{macro \string\NameClearInfo}% + \ifx\testa\@empty + \ifx\testc\@empty + \global\csundef{\csb!DB}% \else - \ifcsname\csab!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}% + \ifx\Suff\@empty + \global\csundef{\csbc!DB}% \else - \ifcsname\csab!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}% - \else - \csgdef{\csab!PN}{!}% - \fi + \global\csundef{\csb!DB}% \fi \fi + \else + \global\csundef{\csab!DB}% \fi } % \end{macrocode} % \end{macro} +% \clearpage % % \noindent{\large\bfseries Name Decisions} -% \begin{macro}{\IfFrontName} +% \begin{macro}{\IfMainName} % \changes{v2.3}{2016/01/05}{Added} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This macro expands one path if a front matter name exists, or else the other if it does not exist. +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This macro expands one path if a main matter name exists, or else the other if it does not exist. % \begin{macrocode} -\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty]% +\newcommandx\IfMainName[5][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist. +% Below we parse the name arguments and choose the path. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfFrontName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfFrontName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IfMainName}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi + \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi \else - \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi + \ifx\suffb\@empty + \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi + \else + \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi + \fi \fi \else - \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi + \ifcsname\csab!MN\endcsname{#4}\else{#5}\fi \fi } % \end{macrocode} % \end{macro} % -% \clearpage\noindent -% \begin{macro}{\IfMainName} +% \begin{macro}{\IfFrontName} % \changes{v2.3}{2016/01/05}{Added} -% \changes{v2.6}{2016/09/19}{fix old syntax} -% This macro expands one path if a main matter name exists, or else the other if it does not exist. +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% This macro expands one path if a front matter name exists, the other if it does not exist. % \begin{macrocode} -\newcommandx\IfMainName[5][1=\@empty, 3=\@empty]% +\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} -% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist. +% Below we parse the name arguments and choose the path. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfMainName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfMainName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IfFrontName}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi + \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi \else - \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi + \ifx\suffb\@empty + \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi + \else + \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi + \fi \fi \else - \ifcsname\csab!MN\endcsname{#4}\else{#5}\fi + \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi \fi } % \end{macrocode} % \end{macro} % -% \clearpage\noindent % \begin{macro}{\IfAKA} % \changes{v2.3}{2016/01/05}{Added} -% \changes{v2.4}{2016/03/15}{Redesign exclusion test} -% \changes{v2.6}{2016/09/19}{fix old syntax} +% \changes{v2.4}{2016/03/15}{New exclusion test} +% \changes{v2.6}{2016/09/19}{Fix old syntax} +% \changes{v3.0}{2016/10/26}{Redesigned} % This macro expands one path if a see-reference name exists, another if it does not exist, and a third if it is excluded. % \begin{macrocode} -\newcommandx\IfAKA[6][1=\@empty, 3=\@empty]% +\newcommandx\IfAKA[6][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \def\test{!}% % \end{macrocode} -% We make copies of the arguments to test them and make parsing decisions. Below we parse the name arguments and create a pseudonym control sequence if it does not exist. +% Fore each class of name we test first if a cross-reference exists, then if it is excluded. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfAKA: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfAKA: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IfAKA}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \edef\testa{\csname\csb!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi \else{#5}\fi \else - \ifcsname\csbc!PN\endcsname - \edef\testa{\csname\csbc!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi - \else{#5}\fi + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \edef\testex{\csname\csbc!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi + \else{#5}\fi + \else + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi + \else{#5}\fi + \fi \fi \else \ifcsname\csab!PN\endcsname - \edef\testa{\csname\csab!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi + \edef\testex{\csname\csab!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi \else{#5}\fi \fi } % \end{macrocode} % \end{macro} % -% \clearpage\noindent % \noindent{\large\bfseries Changing Name Decisions} % \begin{macro}{\ForgetName} % \changes{v0.75}{2012/01/19}{New argument added} % \changes{v1.9}{2015/07/09}{Ensure global undef} % \changes{v2.0}{2015/11/11}{Isolate malformed input} -% \changes{v2.3}{2016/01/05}{Changed to allow global or local behavior} -% \changes{v2.6}{2016/09/19}{fix old syntax} +% \changes{v2.3}{2016/01/05}{Global or local} +% \changes{v2.6}{2016/09/19}{Fix old syntax} % This undefines a control sequence to force the ``first use'' option of \cmd{\Name}. % \begin{macrocode} -\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty]% +\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% + \@nameauth@Error{#2}{macro \string\ForgetName}% % \end{macrocode} -% We make copies of the arguments to test them. -% \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \ForgetName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \ForgetName: Essential name malformed}% - \fi - \fi -% \end{macrocode} -% Now we parse the arguments, undefining the control sequences either locally by section type or globally. |@nameauth@LocalNames| toggles the local or global behavior, while |@nameauth@MainFormat| selects the type of name. +% Now we parse the arguments, undefining the control sequences either by current name type (via |@nameauth@MainFormat|) or completely (toggled by |@nameauth@LocalNames|). % \begin{macrocode} \ifx\testa\@empty \ifx\testc\@empty @@ -5492,15 +5187,28 @@ Running "make install" installs the files in the local TeX tree. \global\csundef{\csb!NF}% \fi \else - \if@nameauth@LocalNames - \if@nameauth@MainFormat - \global\csundef{\csbc!MN}% + \ifx\suffb\@empty + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \global\csundef{\csbc!MN}% + \else + \global\csundef{\csbc!NF}% + \fi \else + \global\csundef{\csbc!MN}% \global\csundef{\csbc!NF}% \fi \else - \global\csundef{\csbc!MN}% - \global\csundef{\csbc!NF}% + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \global\csundef{\csb!MN}% + \else + \global\csundef{\csb!NF}% + \fi + \else + \global\csundef{\csb!MN}% + \global\csundef{\csb!NF}% + \fi \fi \fi \else @@ -5510,9 +5218,6 @@ Running "make install" installs the files in the local TeX tree. \else \global\csundef{\csab!NF}% \fi -% \end{macrocode} -% \clearpage\noindent -% \begin{macrocode} \else \global\csundef{\csab!MN}% \global\csundef{\csab!NF}% @@ -5525,30 +5230,22 @@ Running "make install" installs the files in the local TeX tree. % \begin{macro}{\SubvertName} % \changes{v0.9}{2012/02/10}{Added} % \changes{v2.0}{2015/11/11}{Isolate malformed input} -% \changes{v2.3}{2016/01/05}{Changed to allow global or local behavior} -% \changes{v2.6}{2016/09/19}{fix old syntax} +% \changes{v2.3}{2016/01/05}{Global or local} +% \changes{v2.6}{2016/09/19}{Fix old syntax} % This defines a control sequence to suppress the ``first use'' of \cmd{\Name}. % \begin{macrocode} -\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty]% +\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% % \end{macrocode} % We make copies of the arguments to test them. % \begin{macrocode} - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \SubvertName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \SubvertName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\SubvertName}% % \end{macrocode} % Now we parse the arguments, defining the control sequences either locally by section type or globally. |@nameauth@LocalNames| toggles the local or global behavior, while |@nameauth@MainFormat| selects the type of name. % \begin{macrocode} @@ -5565,20 +5262,30 @@ Running "make install" installs the files in the local TeX tree. \csgdef{\csb!NF}{}% \fi \else + \ifx\suffb\@empty + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \csgdef{\csbc!MN}{}% + \else + \csgdef{\csbc!NF}{}% + \fi + \else + \csgdef{\csbc!MN}{}% + \csgdef{\csbc!NF}{}% + \fi + \fi + \else \if@nameauth@LocalNames \if@nameauth@MainFormat - \csgdef{\csbc!MN}{}% + \csgdef{\csb!MN}{}% \else - \csgdef{\csbc!NF}{}% + \csgdef{\csb!NF}{}% \fi \else - \csgdef{\csbc!MN}{}% - \csgdef{\csbc!NF}{}% + \csgdef{\csb!MN}{}% + \csgdef{\csb!NF}{}% \fi \fi -% \end{macrocode} -% \clearpage\noindent -% \begin{macrocode} \else \if@nameauth@LocalNames \if@nameauth@MainFormat @@ -5595,6 +5302,110 @@ Running "make install" installs the files in the local TeX tree. % \end{macrocode} % \end{macro} % +% \noindent{\large\bfseries Alternate Names} +% \begin{macro}{\AKA} +% \changes{v0.85}{2012/02/05}{Comma suppression} +% \changes{v1.26}{2012/04/24}{Fix name suffixes} +% \changes{v1.5}{2013/02/22}{Reversing and caps} +% \changes{v2.0}{2015/11/11}{Fix malformed input; trim spaces; fix tagging} +% \changes{v2.1}{2015/11/24}{Fix Unicode issues} +% \changes{v2.3}{2016/01/05}{Expand starred mode} +% \changes{v2.4}{2016/03/15}{Fix formatting; add token regs} +% \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}} +% \changes{v2.6}{2016/09/19}{Fix index commas, old syntax} +% \changes{v3.0}{2016/10/26}{Redesigned} +% \cmd{\AKA} prints an alternate name and creates index cross-references. It prevents multiple generation of cross-references and suppresses double periods. +% \begin{macrocode} +\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty] +{% +% \end{macrocode} +% Prevent entering \cmd{\AKA} via itself or \cmd{\@nameauth@Name}. +% \begin{macrocode} + \if@nameauth@Lock\else + \@nameauth@Locktrue% +% \end{macrocode} +% Tell the formatting system that \cmd{\AKA} is running. Test for malformed input. +% \begin{macrocode} + \@nameauth@InAKAtrue% + \@nameauth@Error{#2}{macro \string\AKA}% + \@nameauth@Error{#4}{macro \string\AKA}% +% \end{macrocode} +% Names occur in horizontal mode; we ensure that. Next we make copies of the target name arguments and we parse and print the cross-reference name. +% \begin{macrocode} + \leavevmode\hbox{}% + \protected@edef\testi{#1}% + \protected@edef\argi{\trim@spaces{#1}}% + \protected@edef\rooti{\@nameauth@Root{#2}}% + \protected@edef\suffi{\@nameauth@Suffix{#2}}% + \@nameauth@Parse[#3]{#4}[#5]{!PN}% +% \end{macrocode} +% Create an index cross-reference based on the arguments. +% \begin{macrocode} + \ifx\testi\@empty + \ifx\suffi\@empty + \IndexRef[#3]{#4}[#5]{\rooti}% + \else + \IndexRef[#3]{#4}[#5]{\rooti\space\suffi}% + \fi + \else + \ifx\suffi\@empty + \IndexRef[#3]{#4}[#5]{\rooti,\space\argi}% + \else + \IndexRef[#3]{#4}[#5]{\rooti,\space\argi,\space\suffi}% + \fi + \fi +% \end{macrocode} +% Reset all the ``per name'' Boolean values. +% \begin{macrocode} + \@nameauth@Lockfalse% + \@nameauth@InAKAfalse% + \@nameauth@AltAKAfalse% + \@nameauth@NBSPfalse% + \@nameauth@DoCapsfalse% + \@nameauth@Accentfalse% + \@nameauth@AllThisfalse% + \@nameauth@ShowCommafalse% + \@nameauth@NoCommafalse% + \@nameauth@RevThisfalse% + \@nameauth@RevThisCommafalse% + \@nameauth@ShortSNNfalse% + \@nameauth@EastFNfalse% +% \end{macrocode} +% Close the ``locked'' branch. +% \begin{macrocode} + \fi +% \end{macrocode} +% Call the full stop detection. +% \begin{macrocode} + \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AKA*} +% \changes{v0.9}{2012/02/10}{Added} +% This starred form sets a Boolean to print only the alternate name argument, if that exists, and calls \cmd{\AKA}. +% \begin{macrocode} +\WithSuffix{\newcommand*}\AKA*{\@nameauth@AltAKAtrue\AKA} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PName} +% \changes{v2.3}{2016/01/05}{Work directly with hooks} +% \cmd{\PName} is a convenience macro that calls \cmd{\NameauthName}, then \cmd{\AKA}. +% \begin{macrocode} +\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty] +{\NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PName*} +% This sets up a long name reference and calls \cmd{\PName}. +% \begin{macrocode} +\WithSuffix{\newcommand*}\PName*{\@nameauth@FullNametrue\PName} +% \end{macrocode} +% \end{macro} +% % \noindent{\large\bfseries Simplified Interface} % \begin{environment}{nameauth} % \changes{v1.6}{2013/03/10}{Environment added} @@ -5602,7 +5413,7 @@ Running "make install" installs the files in the local TeX tree. % \changes{v2.0}{2015/11/11}{Redesigned argument handling} % \changes{v2.11}{2015/11/29}{Bugfix} % \changes{v2.41}{2016/03/17}{No local \cmd{\newtoks}} -% The |nameauth| environment provides a means to implement shorthand references to names in a document. +% The \texttt{nameauth} environment creares macro shorthands. % \begin{macrocode} \newenvironment{nameauth}{% \begingroup% @@ -5610,7 +5421,6 @@ Running "make install" installs the files in the local TeX tree. \csdef{<}##1&##2&##3&##4>{% \protected@edef\@arga{\trim@spaces{##1}}% \protected@edef\@testb{\trim@spaces{##2}}% - \protected@edef\@testc{\trim@spaces{##3}}% \protected@edef\@testd{\trim@spaces{##4}}% \@nameauth@etoksb\expandafter{##2}% \@nameauth@etoksc\expandafter{##3}% @@ -5618,79 +5428,71 @@ Running "make install" installs the files in the local TeX tree. \ifx\@arga\@empty \PackageError{nameauth}% {environment nameauth: Control sequence missing}% + \fi + \@nameauth@Error{##3}{environment nameauth}% + \ifcsname\@arga\endcsname + \PackageWarning{nameauth}% + {environment nameauth: Shorthand macro already exists}% + \fi + \ifx\@testd\@empty + \ifx\@testb\@empty + \ex\csgdef\ex{\ex\@arga\ex}\ex{\ex\NameauthName\ex{% + \the\@nameauth@etoksc}}% + \ex\csgdef\ex{\ex L\ex\@arga\ex}\ex{% + \ex\@nameauth@FullNametrue% + \ex\NameauthLName\ex{\the\@nameauth@etoksc}}% + \ex\csgdef\ex{\ex S\ex\@arga\ex}\ex{% + \ex\@nameauth@FirstNametrue% + \ex\NameauthFName\ex{\the\@nameauth@etoksc}}% + \else + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% + \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\NameauthLName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\NameauthFName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \fi \else - \ifx\@testc\@empty - \PackageError{nameauth}% - {environment nameauth: Essential name missing}% + \ifx\@testb\@empty + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% + \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\NameauthLName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\NameauthFName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% \else - \ifcsname\@arga\endcsname - \PackageWarning{nameauth}% - {environment nameauth: Redefinition of shorthands}% - \fi - \ifx\@testd\@empty - \ifx\@testb\@empty - \ex\csgdef\ex{\ex\@arga\ex}\ex{\ex\NameauthName\ex{% - \the\@nameauth@etoksc}}% - \ex\csgdef\ex{\ex L\ex\@arga\ex}\ex{% - \ex\@nameauth@FullNametrue% - \ex\NameauthLName\ex{\the\@nameauth@etoksc}}% - \ex\csgdef\ex{\ex S\ex\@arga\ex}\ex{% - \ex\@nameauth@FirstNametrue% - \ex\NameauthFName\ex{\the\@nameauth@etoksc}}% -% \end{macrocode} -% \clearpage\noindent -% \begin{macrocode} - \else - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% - \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\NameauthLName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\NameauthFName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \fi - \else - \ifx\@testb\@empty - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% - \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\NameauthLName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\NameauthFName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \else - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@arga\ex\ex\ex\ex\ex\ex\ex}% - \ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName% - \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% - \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\@arga% - \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\ex\ex\ex\ex\NameauthLName\ex\ex\ex\ex\ex\ex\ex[% - \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% - \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\@arga% - \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\ex\ex\ex\ex\NameauthFName\ex\ex\ex\ex\ex\ex\ex[% - \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb\ex\ex\ex]% - \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \fi - \fi + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@arga\ex\ex\ex\ex\ex\ex\ex}% + \ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName% + \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% + \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\@arga% + \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\ex\ex\ex\ex\NameauthLName\ex\ex\ex\ex\ex\ex\ex[% + \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% + \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\@arga% + \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\ex\ex\ex\ex\NameauthFName\ex\ex\ex\ex\ex\ex\ex[% + \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb\ex\ex\ex]% + \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% \fi \fi \ignorespaces% diff --git a/Master/texmf-dist/source/latex/nameauth/nameauth.ins b/Master/texmf-dist/source/latex/nameauth/nameauth.ins index 69fce5cd641..e6f0d9e00b7 100644 --- a/Master/texmf-dist/source/latex/nameauth/nameauth.ins +++ b/Master/texmf-dist/source/latex/nameauth/nameauth.ins @@ -7,7 +7,7 @@ %% nameauth.dtx (with options: `install') %% %% --------:| ---------------------------------------------------------------- -%% nameauth:| Name authority mechanism for consistency in text and index +%% nameauth:| Name authority management for consistency in text and index %% Author:| Charles P. Schaum %% E-mail:| charles dot schaum at comcast dot net %% License:| Released under the LaTeX Project Public License v1.3c or later @@ -19,7 +19,7 @@ \preamble --------:| ---------------------------------------------------------------- -nameauth:| Name authority mechanism for consistency in text and index +nameauth:| Name authority management for consistency in text and index Author:| Charles P. Schaum E-mail:| charles dot schaum at comcast dot net License:| Released under the LaTeX Project Public License v1.3c or later @@ -41,8 +41,8 @@ This work is "maintained" (as per LPPL maintenance status) by Charles P. Schaum. This work consists of the files nameauth.dtx, examples.tex, and a Makefile. -Running "make" generates the derived files README, nameauth.pdf and nameauth.sty. -Running "make inst" installs the files in the user's TeX tree. +Running "make" generates the derived files README, nameauth.pdf and +nameauth.sty. Running "make inst" installs the files in the user's TeX tree. Running "make install" installs the files in the local TeX tree. \endpostamble @@ -52,7 +52,6 @@ Running "make install" installs the files in the local TeX tree. \file{\jobname.sty}{\from{\jobname.dtx}{package}} } \endbatchfile - %% %% Copyright (C) 2016 by Charles P. Schaum <charles dot schaum at comcast dot net> %% @@ -67,8 +66,8 @@ Running "make install" installs the files in the local TeX tree. %% Charles P. Schaum. %% %% This work consists of the files nameauth.dtx, examples.tex, and a Makefile. -%% Running "make" generates the derived files README, nameauth.pdf and nameauth.sty. -%% Running "make inst" installs the files in the user's TeX tree. +%% Running "make" generates the derived files README, nameauth.pdf and +%% nameauth.sty. Running "make inst" installs the files in the user's TeX tree. %% Running "make install" installs the files in the local TeX tree. %% %% diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index f01e7f486ff..1af86456999 100644 --- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty +++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty @@ -7,7 +7,7 @@ %% nameauth.dtx (with options: `package') %% %% --------:| ---------------------------------------------------------------- -%% nameauth:| Name authority mechanism for consistency in text and index +%% nameauth:| Name authority management for consistency in text and index %% Author:| Charles P. Schaum %% E-mail:| charles dot schaum at comcast dot net %% License:| Released under the LaTeX Project Public License v1.3c or later @@ -15,34 +15,47 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{nameauth} - [2016/09/19 v2.6 Name authority mechanism for consistency in text and index] - -\newif\if@nameauth@AlwaysComma -\newif\if@nameauth@ShowComma -\newif\if@nameauth@NoComma + [2016/10/26 v3.0 Name authority management for consistency in text and index] +\newif\if@nameauth@InAKA +\newif\if@nameauth@InName +\newif\if@nameauth@Xref +\newif\if@nameauth@Lock +\newif\if@nameauth@InHook +\newif\if@nameauth@DoIndex +\newif\if@nameauth@Pretag +\newif\if@nameauth@SeeAlso \newif\if@nameauth@MainFormat \newif\if@nameauth@AKAFormat \newif\if@nameauth@LocalNames -\newif\if@nameauth@DoIndex -\newif\if@nameauth@Pretag +\newif\if@nameauth@FirstFormat +\newif\if@nameauth@AlwaysFormat +\newif\if@nameauth@AlwaysComma +\newif\if@nameauth@ShowComma +\newif\if@nameauth@NoComma +\newif\if@nameauth@NBSP +\newif\if@nameauth@Punct \newif\if@nameauth@FullName \newif\if@nameauth@FirstName \newif\if@nameauth@AltAKA -\newif\if@nameauth@AllCaps -\newif\if@nameauth@AllThis +\newif\if@nameauth@OldAKA +\newif\if@nameauth@ShortSNN +\newif\if@nameauth@EastFN \newif\if@nameauth@RevAll \newif\if@nameauth@RevThis +\newif\if@nameauth@AllCaps +\newif\if@nameauth@AllThis \newif\if@nameauth@RevAllComma \newif\if@nameauth@RevThisComma \newif\if@nameauth@DoCaps +\newif\if@nameauth@UTF \newif\if@nameauth@Accent -\newif\if@nameauth@NBSP -\newif\if@nameauth@Punct -\newif\if@nameauth@FirstFormat -\newif\if@nameauth@AlwaysFormat -\newif\if@nameauth@InAKA -\newif\if@nameauth@InName -\newif\if@nameauth@Lock +\newif\if@nameauth@Verbose +\newtoks\@nameauth@toksa% +\newtoks\@nameauth@toksb% +\newtoks\@nameauth@toksc% +\newtoks\@nameauth@etoksb% +\newtoks\@nameauth@etoksc% +\newtoks\@nameauth@etoksd% \newcommand*\NamesFormat{} \newcommand*\MainNameHook{} \newcommand*\FrontNamesFormat{} @@ -50,17 +63,12 @@ \newcommand*\NameauthName{\@nameauth@Name} \newcommand*\NameauthLName{\@nameauth@Name} \newcommand*\NameauthFName{\@nameauth@Name} -\newtoks\@nameauth@toksa% -\newtoks\@nameauth@toksb% -\newtoks\@nameauth@toksc% -\newtoks\@nameauth@etoksb% -\newtoks\@nameauth@etoksc% -\newtoks\@nameauth@etoksd% \DeclareOption{comma}{\@nameauth@AlwaysCommatrue} \DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse} \DeclareOption{mainmatter}{\@nameauth@MainFormattrue} \DeclareOption{frontmatter}{\@nameauth@MainFormatfalse} \DeclareOption{formatAKA}{\@nameauth@AKAFormattrue} +\DeclareOption{oldAKA}{\@nameauth@oldAKAtrue} \DeclareOption{index}{\@nameauth@DoIndextrue} \DeclareOption{noindex}{\@nameauth@DoIndexfalse} \DeclareOption{pretag}{\@nameauth@Pretagtrue} @@ -78,6 +86,7 @@ \DeclareOption{italic}{\renewcommand*\NamesFormat{\itshape}} \DeclareOption{boldface}{\renewcommand*\NamesFormat{\bfseries}} \DeclareOption{noformat}{\renewcommand*\NamesFormat{}} +\DeclareOption{verbose}{\@nameauth@Verbosetrue} \ExecuteOptions% {nocomma,% mainmatter,% @@ -88,421 +97,361 @@ noformat} \ProcessOptions\relax \RequirePackage{etoolbox} -\RequirePackage{ifluatex} -\RequirePackage{ifxetex} -\RequirePackage{trimspaces} \RequirePackage{suffix} +\RequirePackage{trimspaces} \RequirePackage{xargs} -\newcommand*\@nameauth@Clean[1]% +\newcommand*\@nameauth@Clean[1] {\expandafter\zap@space\detokenize{#1} \@empty} -\newcommand*\@nameauth@Root[1]% - {\@nameauth@TrimRoot#1,\@empty\relax} -\def\@nameauth@TrimRoot#1,#2\relax{\trim@spaces{#1}} -\newcommand*\@nameauth@CapRoot[1]% +\newcommand*\@nameauth@Root[1]{\@nameauth@TrimRoot#1,\\} +\def\@nameauth@TrimRoot#1,#2\\{\trim@spaces{#1}} +\newcommand*\@nameauth@TagRoot[1]{\@nameauth@TrimTag#1|\\} +\def\@nameauth@TrimTag#1|#2\\{#1} +\newcommand*\@nameauth@Suffix[1]{\@nameauth@TrimSuffix#1,,\\} +\def\@nameauth@TrimSuffix#1,#2,#3\\{% + \ifx\\#2\\\@empty\else\trim@spaces{#2}\fi} +\newcommand*\@nameauth@AllCapRoot[1] + {\uppercase{\@nameauth@Root{#1}}} +\newcommand*\@nameauth@UTFtest[1] {% - \ifxetex - \@nameauth@CRii#1\relax% + \ifdefined\Umathchar + \@nameauth@UTFfalse% \else - \ifluatex - \@nameauth@CRii#1\relax% - \else + \ifdefined\UTFviii@two@octets + \toks@\expandafter{\@car#1\@nil}% + \edef\one{\the\toks@}% + \toks@\expandafter{\@carß\@nil}% + \edef\two{\the\toks@}% + \ifx\one\two\@nameauth@UTFtrue\else\@nameauth@UTFfalse\fi \if@nameauth@Accent - \@nameauth@CRiii#1\relax% - \else - \@nameauth@CRii#1\relax% + \@nameauth@UTFtrue% + \@nameauth@Accentfalse% \fi - \fi + \else\@nameauth@UTFfalse\fi \fi } -\def\@nameauth@CRii#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} -\def\@nameauth@CRiii#1#2#3\relax{\uppercase{#1#2}\@nameauth@Root{#3}} -\newcommand*\@nameauth@AllCapRoot[1]% - {\uppercase{\@nameauth@Root{#1}}} -\newcommand*\@nameauth@Suffix[1]% - {\@nameauth@TrimSuffix#1\relax} -\def\@nameauth@TrimSuffix#1,#2\relax{\trim@spaces{#2}} -\newcommand*\@nameauth@TestDot[1]% +\newcommand*\@nameauth@CapRoot[1] +{% + \if@nameauth@UTF \@nameauth@CRiii#1\\% + \else \@nameauth@CRii#1\\% + \fi +} +\def\@nameauth@CRii#1#2\\{\@nameauth@Root{\uppercase{#1}#2}} +\def\@nameauth@CRiii#1#2#3\\{\@nameauth@Root{\uppercase{#1#2}#3}} +\newcommand*\@nameauth@TestDot[1] {% - \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}% - \def\TestPunct##1% - {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% + \def\TestDot##1.\TestEnd##2\\{\TestPunct{##2}}% + \def\TestPunct##1{% + \ifx\TestPunct##1\TestPunct% + \else + \@nameauth@Puncttrue% + \fi + }% \@nameauth@Punctfalse% - \TestDot#1\TestEnd.\TestEnd\TestStop% + \TestDot#1\TestEnd.\TestEnd\\% } \newcommand*\@nameauth@CheckDot% {\futurelet\@token\@nameauth@EvalDot} \newcommand*\@nameauth@EvalDot% - {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} -\newcommand*\@nameauth@FmtName[1]% {% - \if@nameauth@InAKA - \if@nameauth@AlwaysFormat - \@nameauth@FirstFormattrue% - \else - \if@nameauth@AKAFormat\else\@nameauth@FirstFormatfalse\fi + \let\@period=.% + \ifx\@token\@period\expandafter\@gobble \fi +} +\newcommand*\@nameauth@Error[2] +{% + \edef\msg{#2}% + \edef\pkg{nameauth}% + \let\ex\expandafter% + \protected@edef\argb{\trim@spaces{#1}}% + \protected@edef\rootb{\@nameauth@Root{#1}}% + \ifx\argb\@empty + \ex\PackageError\ex{\ex\pkg\ex}\ex{\msg SNN field empty}% + \else + \ifx\rootb\@empty + \ex\PackageError\ex{\ex\pkg\ex}\ex{\msg SNN field malformed}% \fi - \@nameauth@TestDot{#1}% - \if@nameauth@MainFormat - \if@nameauth@FirstFormat - \bgroup\NamesFormat{#1}\egroup% - \else - \bgroup\MainNameHook{#1}\egroup% - \fi + \fi +} +\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty] +{% + \if@nameauth@Lock\else + \@nameauth@Locktrue% + \@nameauth@InNametrue% + \@nameauth@Error{#2}{macro \string\@nameauth@name}% + \leavevmode\hbox{}% + \IndexName[#1]{#2}[#3]% + \if@nameauth@MainFormat + \@nameauth@Parse[#1]{#2}[#3]{!MN}% + \else + \@nameauth@Parse[#1]{#2}[#3]{!NF}% + \fi + \IndexName[#1]{#2}[#3]% + \@nameauth@Lockfalse% + \@nameauth@InNamefalse% + \@nameauth@NBSPfalse% + \@nameauth@DoCapsfalse% + \@nameauth@Accentfalse% + \@nameauth@AllThisfalse% + \@nameauth@ShowCommafalse% + \@nameauth@NoCommafalse% + \@nameauth@RevThisfalse% + \@nameauth@RevThisCommafalse% + \@nameauth@ShortSNNfalse% + \@nameauth@EastFNfalse% + \fi + \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi +} +\newcommandx*\@nameauth@Parse[4][1=\@empty, 3=\@empty] +{% + \if@nameauth@Lock + \protected@edef\arga{\trim@spaces{#1}}% + \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% + \if@nameauth@AllCaps\@nameauth@AllThistrue\fi + \if@nameauth@RevAll\@nameauth@RevThistrue\fi + \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi + \if@nameauth@DoCaps + \@nameauth@UTFtest{#2}% + \protected@edef\rootb{\@nameauth@CapRoot{#2}}% \else - \if@nameauth@FirstFormat - \bgroup\FrontNamesFormat{#1}\egroup% + \if@nameauth@AllThis + \protected@edef\rootb{\@nameauth@AllCapRoot{#2}}% \else - \bgroup\FrontNameHook{#1}\egroup% + \protected@edef\rootb{\@nameauth@Root{#2}}% \fi \fi - \else - \if@nameauth@AlwaysFormat\@nameauth@FirstFormattrue\fi - \@nameauth@TestDot{#1}% - \if@nameauth@MainFormat - \if@nameauth@FirstFormat - \bgroup\NamesFormat{#1}\egroup% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% + \@nameauth@toksa\expandafter{#1}% + \@nameauth@toksb\expandafter{#2}% + \@nameauth@toksc\expandafter{#3}% + \edef\Space{\space}% + \if@nameauth@NBSP\edef\Space{\nobreakspace}\fi + \ifx\arga\@empty\else + \if@nameauth@AlwaysComma + \edef\Space{,\space}% + \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi + \fi + \if@nameauth@ShowComma + \edef\Space{,\space}% + \if@nameauth@NBSP\edef\Space{,\nobreakspace}\fi + \fi + \if@nameauth@NoComma + \edef\Space{\space}% + \if@nameauth@NBSP\edef\Space{\nobreakspace}\fi + \fi + \fi + \let\SNN\rootb% + \ifx\arga\@empty + \ifx\argc\@empty + \let\FNN\suffb% + \let\SNN\rootb% + \@nameauth@NonWest{\csb#4}% \else - \bgroup\MainNameHook{#1}\egroup% + \ifx\suffb\@empty + \let\FNN\argc% + \let\SNN\rootb% + \@nameauth@NonWest{\csbc#4}% + \else + \let\FNN\argc% + \let\SNN\rootb% + \@nameauth@NonWest{\csb#4}% + \fi \fi \else - \if@nameauth@FirstFormat - \bgroup\FrontNamesFormat{#1}\egroup% + \ifx\argc\@empty + \let\FNN\arga% \else - \bgroup\FrontNameHook{#1}\egroup% + \let\FNN\argc% \fi + \ifx\suffb\@empty + \else + \protected@edef\SNN{\rootb\Space\suffb}% + \if@nameauth@ShortSNN\let\SNN\rootb\fi + \fi + \@nameauth@West{\csab#4}% \fi \fi } -\newcommand*\@nameauth@Actual{@} -\newcommand*\@nameauth@Index[2]% +\newcommand*\@nameauth@NonWest[1] {% - \def\cseq{#1}% - \ifcsname\cseq!TAG\endcsname - \ifcsname\cseq!PRE\endcsname - \if@nameauth@DoIndex - \index% - {\csname\cseq!PRE\endcsname#2\csname\cseq!TAG\endcsname}% + \if@nameauth@Lock + \ifcsname#1\endcsname\else + \@nameauth@FirstFormattrue% + \fi + \if@nameauth@InAKA + \if@nameauth@AltAKA + \if@nameauth@OldAKA\@nameauth@EastFNtrue\fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNametrue% + \else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% \fi \else - \if@nameauth@DoIndex\index{#2\csname\cseq!TAG\endcsname}\fi + \ifcsname#1\endcsname\else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi \fi - \else - \ifcsname\cseq!PRE\endcsname - \if@nameauth@DoIndex\index{\csname\cseq!PRE\endcsname#2}\fi + \if@nameauth@FirstName + \@nameauth@FullNamefalse% + \fi + \ifx\FNN\@empty + \@nameauth@Hook{\SNN}% \else - \if@nameauth@DoIndex\index{#2}\fi + \if@nameauth@FullName + \if@nameauth@RevThis + \@nameauth@Hook{\FNN\Space\SNN}% + \else + \@nameauth@Hook{\SNN\Space\FNN}% + \fi + \else + \if@nameauth@EastFN + \@nameauth@Hook{\FNN}% + \else + \@nameauth@Hook{\SNN}% + \fi + \fi + \fi + \ifcsname#1\endcsname\else + \if@nameauth@InAKA\else\csgdef{#1}{}\fi% \fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% \fi } -\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty]% +\newcommand*\@nameauth@West[1] {% - \if@nameauth@Lock\else - \@nameauth@Locktrue% - \@nameauth@InNametrue% - \let\ex\expandafter% - \leavevmode\hbox{}% - \protected@edef\testa{#1}% - \protected@edef\arga{\trim@spaces{#1}}% - \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% - \protected@edef\testc{#3}% - \protected@edef\argc{\trim@spaces{#3}}% - \def\csb{\@nameauth@Clean{#2}}% - \def\csbc{\@nameauth@Clean{#2,#3}}% - \def\csab{\@nameauth@Clean{#1!#2}}% - \@nameauth@toksa\expandafter{#1}% - \@nameauth@toksb\expandafter{#2}% - \@nameauth@toksc\expandafter{#3}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \Name: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \Name: Essential name malformed}% - \fi - \fi - \if@nameauth@AllCaps\@nameauth@AllThistrue\fi - \if@nameauth@RevAll\@nameauth@RevThistrue\fi - \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi - \IndexName[#1]{#2}[#3]% - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \ifx\arga\@empty\else - \if@nameauth@AlwaysComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@ShowComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@NoComma - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \fi - \fi - \protected@edef\RawShort{\@nameauth@Root{#2}}% - \if@nameauth@DoCaps - \protected@edef\CapShort{\@nameauth@CapRoot{#2}}% - \else - \let\CapShort\RawShort% - \fi - \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#2}}% - \ifx\testb\testbr - \let\Suff\@empty% - \let\Reversed\RawShort% - \let\SNN\RawShort% - \let\PrintShort\RawShort% - \if@nameauth@DoCaps - \let\Reversed\CapShort% - \let\SNN\CapShort% - \let\PrintShort\CapShort% - \fi - \if@nameauth@AllThis - \let\Reversed\AllCapShort% - \let\SNN\AllCapShort% - \let\PrintShort\AllCapShort% + \if@nameauth@Lock + \ifcsname#1\endcsname\else + \@nameauth@FirstFormattrue% \fi - \else - \protected@edef\Suff{\@nameauth@Suffix{#2}}% - \protected@edef\Reversed{\Suff\Space\RawShort}% - \protected@edef\SNN{\RawShort\Space\Suff}% - \if@nameauth@RevThis - \let\PrintShort\Suff% + \if@nameauth@InAKA + \if@nameauth@AltAKA + \@nameauth@FullNamefalse% + \@nameauth@FirstNametrue% + \else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi \else - \let\PrintShort\RawShort% + \ifcsname#1\endcsname\else + \@nameauth@FullNametrue% + \@nameauth@FirstNamefalse% + \fi \fi - \if@nameauth@DoCaps - \protected@edef\Reversed{\Suff\Space\CapShort}% - \protected@edef\SNN{\CapShort\Space\Suff}% + \if@nameauth@FirstName + \@nameauth@FullNamefalse% + \fi + \if@nameauth@FullName \if@nameauth@RevThis - \let\PrintShort\Suff% + \@nameauth@Hook{\SNN\space\FNN}% \else - \let\PrintShort\CapShort% + \if@nameauth@RevThisComma + \edef\RevSpace{,\space}% + \@nameauth@Hook{\SNN\RevSpace\FNN}% + \else + \@nameauth@Hook{\FNN\space\SNN}% + \fi \fi - \fi - \if@nameauth@AllThis - \protected@edef\Reversed{\Suff\Space\AllCapShort}% - \protected@edef\SNN{\AllCapShort\Space\Suff}% - \if@nameauth@RevThis - \let\PrintShort\Suff% + \else + \if@nameauth@FirstName + \@nameauth@Hook{\FNN}% \else - \let\PrintShort\AllCapShort% + \@nameauth@Hook{\rootb}% \fi \fi + \ifcsname#1\endcsname\else + \if@nameauth@InAKA\else\csgdef{#1}{}\fi% + \fi + \@nameauth@FullNamefalse% + \@nameauth@FirstNamefalse% \fi - \ifx\testa\@empty - \ifx\testc\@empty +} +\newcommand*\@nameauth@Hook[1] +{% + \if@nameauth@Lock + \@nameauth@InHooktrue% + \protected@edef\test{#1}% + \expandafter\@nameauth@TestDot\expandafter{\test}% + \if@nameauth@InAKA + \if@nameauth@AlwaysFormat + \@nameauth@FirstFormattrue% + \else + \if@nameauth@AKAFormat\else + \@nameauth@FirstFormatfalse\fi + \fi \if@nameauth@MainFormat - \ifcsname\csb!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \if@nameauth@FirstFormat + \bgroup\NamesFormat{#1}\egroup% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \csgdef{\csb!MN}{}% - \@nameauth@FullNamefalse% + \bgroup\MainNameHook{#1}\egroup% \fi \else - \ifcsname\csb!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \if@nameauth@FirstFormat + \bgroup\FrontNamesFormat{#1}\egroup% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% - \else - \ex\@nameauth@FmtName\ex{\SNN}% - \fi - \csgdef{\csb!NF}{}% - \@nameauth@FullNamefalse% + \bgroup\FrontNameHook{#1}\egroup% \fi \fi \else + \if@nameauth@AlwaysFormat + \@nameauth@FirstFormattrue% + \fi \if@nameauth@MainFormat - \ifcsname\csbc!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\argc}% - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \if@nameauth@FirstFormat + \bgroup\NamesFormat{#1}\egroup% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \csgdef{\csbc!MN}{}% - \@nameauth@FullNamefalse% + \bgroup\MainNameHook{#1}\egroup% \fi \else - \ifcsname\csbc!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\argc}% - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \if@nameauth@FirstFormat + \bgroup\FrontNamesFormat{#1}\egroup% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\argc\ex\Space\SNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\argc}% - \fi - \csgdef{\csbc!NF}{}% - \@nameauth@FullNamefalse% + \bgroup\FrontNameHook{#1}\egroup% \fi \fi \fi - \else - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \ifx\testc\@empty - \let\FNN\arga% - \else - \let\FNN\argc% - \fi - \if@nameauth@MainFormat - \ifcsname\csab!MN\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \let\PrintShort\FNN% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% - \fi + \@nameauth@FirstFormatfalse% + \@nameauth@InHookfalse% + \fi +} +\newcommand*\@nameauth@Index[2] +{% + \def\cseq{#1}% + \let\ex\expandafter% + \ifcsname\cseq!TAG\endcsname + \protected@edef\Tag{\csname#1!TAG\endcsname}% + \ex\def\ex\ShortTag\ex{\ex\@nameauth@TagRoot\ex{\Tag}}% + \fi + \if@nameauth@DoIndex + \ifcsname\cseq!TAG\endcsname + \ifcsname\cseq!PRE\endcsname + \if@nameauth@Xref% + \index% + {\csname\cseq!PRE\endcsname#2\ShortTag}% \else - \ex\@nameauth@FmtName\ex{\PrintShort}% + \index% + {\csname\cseq!PRE\endcsname#2\csname\cseq!TAG\endcsname}% \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% + \if@nameauth@Xref + \index{#2\ShortTag}% \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% + \index{#2\csname\cseq!TAG\endcsname}% \fi - \csgdef{\csab!MN}{}% - \@nameauth@FullNamefalse% \fi \else - \ifcsname\csab!NF\endcsname - \if@nameauth@FirstName - \@nameauth@FullNamefalse% - \let\PrintShort\FNN% - \fi - \if@nameauth@FullName - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% - \fi - \else - \ex\@nameauth@FmtName\ex{\PrintShort}% - \fi - \@nameauth@FullNamefalse% - \@nameauth@FirstNamefalse% + \ifcsname\cseq!PRE\endcsname + \index{\csname\cseq!PRE\endcsname#2}% \else - \@nameauth@FirstFormattrue% - \@nameauth@FullNametrue% - \@nameauth@FirstNamefalse% - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNN\ex\Space\FNN}% - \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNN}% - \fi - \csgdef{\csab!NF}{}% - \@nameauth@FullNamefalse% + \index{#2}% \fi \fi \fi - \IndexName[#1]{#2}[#3]% - \@nameauth@Lockfalse% - \@nameauth@InNamefalse% - \@nameauth@FirstFormatfalse% - \@nameauth@NBSPfalse% - \@nameauth@DoCapsfalse% - \@nameauth@Accentfalse% - \@nameauth@AllThisfalse% - \@nameauth@ShowCommafalse% - \@nameauth@NoCommafalse% - \@nameauth@RevThisfalse% - \@nameauth@RevThisCommafalse% - \fi - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi } +\newcommand*\@nameauth@Actual{@} \newcommand*\CapThis{\@nameauth@DoCapstrue} \newcommand*\AccentCapThis% {\@nameauth@Accenttrue\@nameauth@DoCapstrue} @@ -512,14 +461,16 @@ \newcommand*\RevName{\@nameauth@RevThistrue} \newcommand*\ReverseInactive{\@nameauth@RevAllfalse} \newcommand*\ReverseActive{\@nameauth@RevAlltrue} +\newcommand*\ForceFN{\@nameauth@EastFNtrue} \newcommand*\RevComma% - {\@nameauth@RevThistrue\@nameauth@RevThisCommatrue} + {\@nameauth@RevThisCommatrue} \newcommand*\ReverseCommaInactive% - {\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse} + {\@nameauth@RevAllCommafalse} \newcommand*\ReverseCommaActive% - {\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue} + {\@nameauth@RevAllCommatrue} \newcommand*\ShowComma{\@nameauth@ShowCommatrue} \newcommand*\NoComma{\@nameauth@NoCommatrue} +\newcommand*\DropAffix{\@nameauth@ShortSNNtrue} \newcommand*\KeepAffix{\@nameauth@NBSPtrue} \newcommand*\NamesInactive{\@nameauth@MainFormatfalse} \newcommand*\NamesActive{\@nameauth@MainFormattrue} @@ -527,714 +478,673 @@ \newcommand*\GlobalNames{\global\@nameauth@LocalNamesfalse} \newcommand*\IndexInactive{\@nameauth@DoIndexfalse} \newcommand*\IndexActive{\@nameauth@DoIndextrue} -\newcommand*\IndexActual[1]% +\newcommand*\IndexActual[1] {\global\renewcommand*\@nameauth@Actual{#1}} -\def\Name{\NameauthName} -\WithSuffix\def\Name*{\@nameauth@FullNametrue\NameauthLName} -\def\FName{\@nameauth@FirstNametrue\NameauthFName} -\WithSuffix\def\FName*{\@nameauth@FirstNametrue\NameauthFName} -\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty]% +\newcommand*\SeeAlso{\@nameauth@SeeAlsotrue} +\newcommand*\NameParser {% - \if@nameauth@Lock\else - \@nameauth@Locktrue% - \@nameauth@InAKAtrue% - \let\ex\expandafter% - \leavevmode\hbox{}% - \protected@edef\testa{#1}% - \protected@edef\arga{\trim@spaces{#1}}% - \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% - \protected@edef\testc{#3}% - \protected@edef\argc{\trim@spaces{#3}}% - \def\argd{\trim@spaces{#3}}% - \protected@edef\testd{\trim@spaces{#4}}% - \protected@edef\testdr{\@nameauth@Root{#4}}% - \protected@edef\teste{#5}% - \protected@edef\arge{\trim@spaces{#5}}% - \def\csd{\@nameauth@Clean{#4}}% - \def\csde{\@nameauth@Clean{#4,#5}}% - \def\cscd{\@nameauth@Clean{#3!#4}}% - \@nameauth@toksa\expandafter{#3}% - \@nameauth@toksb\expandafter{#4}% - \@nameauth@toksc\expandafter{#5}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name malformed}% - \fi - \fi - \ifx\testd\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name missing}% - \else - \ifx\csd\@empty - \PackageError{nameauth}% - {macro \AKA: Essential name malformed}% - \fi - \fi - \if@nameauth@AllCaps\@nameauth@AllThistrue\fi - \if@nameauth@RevAll\@nameauth@RevThistrue\fi - \if@nameauth@RevAllComma\@nameauth@RevThisCommatrue\fi - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \ifx\argc\@empty\else - \if@nameauth@AlwaysComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@ShowComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \if@nameauth@NoComma - \protected@edef\Space{\space}% - \if@nameauth@NBSP\protected@edef\Space{\nobreakspace}\fi - \fi - \fi - \protected@edef\Shortb{\@nameauth@Root{#2}}% - \protected@edef\Shortd{\@nameauth@Root{#4}}% - \if@nameauth@DoCaps - \protected@edef\CapShort{\@nameauth@CapRoot{#4}}% - \else - \let\CapShort\Shortd - \fi - \protected@edef\AllCapShort{\@nameauth@AllCapRoot{#4}}% - \ifx\testb\testbr - \let\SNNb\Shortb% - \let\Suffb\@empty% - \else - \protected@edef\Suffb{\@nameauth@Suffix{#2}}% - \protected@edef\SNNb{\Shortb\space\Suffb}% - \fi - \ifx\testd\testdr - \let\Suffd\@empty% - \let\ISNNd\Shortd% - \let\Reversed\Shortd% - \let\SNNd\Shortd% - \if@nameauth@DoCaps - \let\SNNd\CapShort% - \let\Reversed\CapShort% - \fi - \if@nameauth@AllThis - \let\SNNd\AllCapShort% - \let\Reversed\AllCapShort% - \fi - \else - \protected@edef\Suffd{\@nameauth@Suffix{#4}}% - \protected@edef\ISNNd{\Shortd\space\Suffd}% - \protected@edef\Reversed{\Suffd\Space\Shortd}% - \protected@edef\SNNd{\Shortd\Space\Suffd}% - \if@nameauth@DoCaps - \protected@edef\Reversed{\Suffd\Space\CapShort}% - \protected@edef\SNNd{\CapShort\Space\Suffd}% - \fi - \if@nameauth@AllThis - \protected@edef\Reversed{\Suffd\Space\AllCapShort}% - \protected@edef\SNNd{\AllCapShort\Space\Suffd}% - \fi - \fi - \ifx\testc\@empty - \ifx\teste\@empty - \ifcsname\csd!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #4 exists}% + \if@nameauth@InHook + \let\SNN\rootb% + \ifx\arga\@empty + \ifx\argc\@empty + \let\FNN\suffb% \else - \ifcsname\csd!MN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 exists; no xref}% + \let\FNN\argc% + \fi + \ifx\suffb\@empty + \SNN% + \else + \if@nameauth@FullName + \if@nameauth@RevThis + \FNN\Space\SNN% + \else + \SNN\Space\FNN% + \fi \else - \ifcsname\csd!NF\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 exists; no xref}% + \if@nameauth@EastFN + \FNN% \else - \ifx\testa\@empty - \@nameauth@Index{\csd}% - {\ISNNd|see{\SNNb}}% - \else - \ifx\Suffb\@empty - \@nameauth@Index{\csd}% - {\ISNNd|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\csd}% - {\ISNNd|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi + \SNN% \fi \fi \fi - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP - \protected@edef\Space{,\nobreakspace}% - \fi - \fi - \ifcsname\csd!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\Reversed}% + \else + \ifx\argc\@empty + \let\FNN\arga% \else - \ex\@nameauth@FmtName\ex{\SNNd}% + \let\FNN\argc% \fi - \ifcsname\csd!PN\endcsname\else\csgdef{\csd!PN}{}\fi - \else - \ifcsname\csde!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #4 #5 exists}% + \ifx\suffb\@empty \else - \ifcsname\csde!MN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 #5 exists; no xref}% + \protected@edef\SNN{\rootb\Space\suffb}% + \if@nameauth@ShortSNN\let\SNN\rootb\fi% + \fi + \if@nameauth@FullName + \if@nameauth@RevThis + \SNN\space\FNN% \else - \ifcsname\csde!NF\endcsname - \PackageWarning{nameauth}% - {macro \AKA: Name reference: #4 #5 exists; no xref}% + \if@nameauth@RevThisComma + \SNN\RevSpace\FNN% \else - \ifx\testa\@empty - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\SNNb}}% - \else - \ifx\Suffb\@empty - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\csde}% - {\ISNNd\space\arge|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi + \FNN\space\SNN% \fi \fi + \else + \if@nameauth@FirstName + \FNN% + \else + \protected@edef\SNN{\rootb}% + \SNN% + \fi \fi - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP - \protected@edef\Space{,\nobreakspace}% + \fi + \fi +} +\newcommand\Name{\NameauthName} +\WithSuffix{\newcommand*}\Name*% + {\@nameauth@FullNametrue\NameauthLName} +\newcommand\FName{\@nameauth@FirstNametrue\NameauthFName} +\WithSuffix{\newcommand*}\FName*% + {\@nameauth@FirstNametrue\NameauthFName} +\newcommandx*\IndexName[3][1=\@empty, 3=\@empty] +{% + \protected@edef\testa{#1}% + \protected@edef\arga{\trim@spaces{#1}}% + \protected@edef\testb{\trim@spaces{#2}}% + \protected@edef\rootb{\@nameauth@Root{#2}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% + \protected@edef\testc{#3}% + \protected@edef\argc{\trim@spaces{#3}}% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% + \@nameauth@Error{#2}{macro \string\IndexName}% + \let\Short\rootb% + \ifx\suffb\@empty + \let\SNN\rootb% + \else + \protected@edef\SNN{\rootb\space\suffb}% + \fi + \ifx\testa\@empty + \ifx\testc\@empty + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 exists}% \fi + \else + \@nameauth@Index{\csb}{\SNN}% \fi - \ifcsname\csde!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@AltAKA - \ex\@nameauth@FmtName\ex{\arge}% + \else + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 #3 exists}% + \fi + \else + \@nameauth@Index{\csbc}{\SNN\space\argc}% + \fi \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\arge\ex\Space\SNNd}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexName: XRef: #2 exists}% + \fi \else - \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\Space\arge}% + \@nameauth@Index{\csb}{\SNN}% \fi \fi - \ifcsname\csde!PN\endcsname\else\csgdef{\csde!PN}{}\fi \fi \else - \ifcsname\cscd!PN\endcsname - \PackageWarning{nameauth}% - {macro \AKA: XRef: #3 #4 exists}% - \else - \ifcsname\cscd!MN\endcsname + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose \PackageWarning{nameauth}% - {macro \AKA: Name reference: #3 #4 exists; no xref}% + {macro \IndexName: XRef: #1 #2 exists}% + \fi + \else + \ifx\suffb\@empty + \@nameauth@Index{\csab}% + {\Short,\space\arga}% \else - \ifcsname\cscd!NF\endcsname + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb}% + \fi + \fi + \fi +} +\newcommandx*\IndexRef[4][1=\@empty, 3=\@empty] +{% + \protected@edef\testa{#1}% + \protected@edef\arga{\trim@spaces{#1}}% + \protected@edef\rootb{\@nameauth@Root{#2}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% + \protected@edef\testc{#3}% + \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\target{#4}% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% + \let\ex\expandafter% + \@nameauth@Error{#2}{macro \string\IndexRef}% + \@nameauth@Xreftrue% + \let\Short\rootb% + \ifx\suffb\@empty + \let\SNN\rootb% + \else + \protected@edef\SNN{\rootb\space\suffb}% + \fi + \ifx\testa\@empty + \ifx\testc\@empty + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose \PackageWarning{nameauth}% - {macro \AKA: Name reference: #3 #4 exists; no xref}% + {macro \IndexRef: XRef: #2 exists}% + \fi + \else + \if@nameauth@SeeAlso + \@nameauth@Index{\csb}{\SNN|seealso{\target}}% \else - \ifx\testa\@empty - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\SNNb}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\SNNb}}% - \fi + \@nameauth@Index{\csb}{\SNN|see{\target}}% + \fi + \csgdef{\csb!PN}{}% + \fi + \else + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #2 #3 exists}% + \fi + \else + \if@nameauth@SeeAlso + \@nameauth@Index{\csbc}% + {\SNN\space\argc|seealso{\target}}% \else - \ifx\Suffb\@empty - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\SNNb,\space\arga}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\SNNb,\space\arga}}% - \fi - \else - \ifx\Suffd\@empty - \@nameauth@Index{\cscd}% - {\ISNNd,\space\argc|see{\Shortb,\space\arga,\space\Suffb}}% - \else - \@nameauth@Index{\cscd}% - {\Shortd,\space\argc,\space\Suffd|see{\Shortb,\space\arga,\space\Suffb}}% - \fi - \fi + \@nameauth@Index{\csbc}% + {\SNN\space\argc|see{\target}}% \fi + \csgdef{\csbc!PN}{}% + \fi + \else + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #2 exists}% + \fi + \else + \if@nameauth@SeeAlso + \@nameauth@Index{\csb}% + {\SNN|seealso{\target}}% + \else + \@nameauth@Index{\csb}% + {\SNN|see{\target}}% + \fi + \csgdef{\csb!PN}{}% \fi \fi \fi - \if@nameauth@RevThisComma - \protected@edef\Space{,\space}% - \if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi - \fi - \ifx\teste\@empty - \let\FNN\argc% - \else - \let\FNN\arge% - \fi - \ifcsname\cscd!PN\endcsname\else\@nameauth@FirstFormattrue\fi - \if@nameauth@AltAKA - \ex\@nameauth@FmtName\ex{\FNN}% + \else + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \IndexRef: XRef: #1 #2 exists}% + \fi \else - \if@nameauth@RevThis - \ex\@nameauth@FmtName\ex{\ex\SNNd\ex\Space\FNN}% + \ifx\suffb\@empty + \if@nameauth@SeeAlso + \@nameauth@Index{\csab}% + {\Short,\space\arga|seealso{\target}}% + \else + \@nameauth@Index{\csab}% + {\Short,\space\arga|see{\target}}% + \fi \else - \ex\@nameauth@FmtName\ex{\ex\FNN\ex\space\SNNd}% + \if@nameauth@SeeAlso + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb|seealso{\target}}% + \else + \@nameauth@Index{\csab}% + {\Short,\space\arga,\space\suffb|see{\target}}% + \fi \fi + \csgdef{\csab!PN}{}% \fi - \ifcsname\cscd!PN\endcsname\else\csgdef{\cscd!PN}{}\fi - \fi - \@nameauth@Lockfalse% - \@nameauth@InAKAfalse% - \@nameauth@FirstFormatfalse% - \@nameauth@NBSPfalse% - \@nameauth@AltAKAfalse% - \@nameauth@DoCapsfalse% - \@nameauth@Accentfalse% - \@nameauth@AllThisfalse% - \@nameauth@ShowCommafalse% - \@nameauth@NoCommafalse% - \@nameauth@RevThisfalse% - \@nameauth@RevThisCommafalse% \fi - \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi + \@nameauth@SeeAlsofalse% + \@nameauth@Xreffalse% } -\WithSuffix\def\AKA*{\@nameauth@AltAKAtrue\AKA} -\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty]% -{% - \NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])% -} -\WithSuffix\def\PName*{\@nameauth@FullNametrue\PName} -\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty]% +\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\ExcludeName}% \ifx\testa\@empty \ifx\testc\@empty - \csgdef{\csb!DB}{#4}% + \if@nameauth@Verbose + \ifcsname\csb!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \ifcsname\csb!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \fi + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csb!PN}{!}% + \fi \else - \csgdef{\csbc!DB}{#4}% + \ifx\suffb\@empty + \if@nameauth@Verbose + \ifcsname\csbc!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 exists}% + \fi + \ifcsname\csbc!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 #3 exists}% + \fi + \fi + \csgdef{\csbc!PN}{!}% + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csbc!PN}{!}% + \fi + \else + \if@nameauth@Verbose + \ifcsname\csb!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \ifcsname\csb!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #2 exists}% + \fi + \fi + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csb!PN}{!}% + \fi + \fi \fi \else - \csgdef{\csab!DB}{#4}% + \if@nameauth@Verbose + \ifcsname\csab!MN\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #1 #2 exists}% + \fi + \ifcsname\csab!NF\endcsname + \PackageWarning{nameauth}% + {macro \ExcludeName: Reference: #1 #2 exists}% + \fi + \fi + \ifcsname\csab!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \ExcludeName: Xref: #2 exists}% + \fi + \else + \csgdef{\csab!PN}{!}% + \fi \fi } -\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty]% +\newcommandx*\IncludeName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \NameInfo: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IncludeName}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi + \fi \else - \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \edef\testex{\csname\csbc!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csbc!PN}\fi + \fi + \else + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csb!PN}\fi + \fi + \fi \fi \else - \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi + \ifcsname\csab!PN\endcsname + \edef\testex{\csname\csab!PN\endcsname}% + \ifx\testex\@empty\else\global\csundef{\csab!PN}\fi + \fi \fi } -\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty]% +\WithSuffix{\newcommandx*}\IncludeName*[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name malformed}% - \fi - \fi + \edef\testa{!}% + \@nameauth@Error{#2}{macro \string\IncludeName*}% \ifx\testa\@empty \ifx\testc\@empty - \global\csundef{\csb!DB}% + \global\csundef{\csb!PN}% \else - \global\csundef{\csbc!DB}% + \ifx\suffb\@empty + \global\csundef{\csbc!PN}% + \else + \global\csundef{\csb!PN}% + \fi \fi \else - \global\csundef{\csab!DB}% + \global\csundef{\csab!PN}% \fi } -\newcommandx*\IndexName[3][1=\@empty, 3=\@empty]% +\newcommandx*\PretagName[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\arga{\trim@spaces{#1}}% - \protected@edef\testb{\trim@spaces{#2}}% - \protected@edef\testbr{\@nameauth@Root{#2}}% \protected@edef\testc{#3}% - \protected@edef\argc{\trim@spaces{#3}}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IndexName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IndexName: Essential name malformed}% - \fi - \fi - \let\Short\testbr% - \ifx\testb\testbr - \let\SNN\Short% - \let\Suff\@empty% - \else - \protected@edef\Suff{\@nameauth@Suffix{#2}}% - \protected@edef\SNN{\Short\space\Suff}% - \fi + \@nameauth@Error{#2}{macro \string\PretagName}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #2 exists}% - \else - \@nameauth@Index{\csb}{\SNN}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2}% + \fi \fi + \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #2 #3 exists}% + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2 #3}% + \fi + \fi + \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi \else - \@nameauth@Index{\csbc}{\SNN\space\argc}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #2}% + \fi + \fi + \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi \fi \fi \else \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \IndexName: XRef: #1 #2 exists}% - \else - \ifx\Suff\@empty - \@nameauth@Index{\csab}{\Short,\space\arga}% - \else - \@nameauth@Index{\csab}{\Short,\space\arga,\space\Suff}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \PretagName: tagging xref: #1 #2}% \fi \fi + \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi \fi } -\newcommandx*\TagName[4][1=\@empty, 3=\@empty]% +\newcommandx*\TagName[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\TagName}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #2}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2}% + \fi \else \csgdef{\csb!TAG}{#4}% \fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #2 #3}% + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2 #3}% + \fi + \else + \csgdef{\csbc!TAG}{#4}% + \fi \else - \csgdef{\csbc!TAG}{#4}% + \ifcsname\csb!PN\endcsname + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #2}% + \fi + \else + \csgdef{\csb!TAG}{#4}% + \fi \fi \fi \else \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \TagName: not tagging xref: #1 #2}% + \if@nameauth@Verbose + \PackageWarning{nameauth}% + {macro \TagName: not tagging xref: #1 #2}% + \fi \else \csgdef{\csab!TAG}{#4}% \fi \fi } -\newcommandx*\UntagName[3][1=\@empty, 3=\@empty]% +\newcommandx*\UntagName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \UntagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\UntagName}% \ifx\testa\@empty \ifx\testc\@empty \global\csundef{\csb!TAG}% \else - \global\csundef{\csbc!TAG}% + \ifx\suffb\@empty + \global\csundef{\csbc!TAG}% + \else + \global\csundef{\csb!TAG}% + \fi \fi \else \global\csundef{\csab!TAG}% \fi } -\newcommandx*\PretagName[4][1=\@empty, 3=\@empty]% +\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \TagName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\NameAddInfo}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #2}% - \fi - \if@nameauth@Pretag\csgdef{\csb!PRE}{#4\@nameauth@Actual}\fi + \csgdef{\csb!DB}{#4}% \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #2 #3}% + \ifx\Suff\@empty + \csgdef{\csbc!DB}{#4}% + \else + \csgdef{\csb!DB}{#4}% \fi - \if@nameauth@Pretag\csgdef{\csbc!PRE}{#4\@nameauth@Actual}\fi \fi \else - \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \PretagName: tagging xref: #1 #2}% - \fi - \if@nameauth@Pretag\csgdef{\csab!PRE}{#4\@nameauth@Actual}\fi + \csgdef{\csab!DB}{#4}% \fi } -\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty]% +\newcommandx\NameQueryInfo[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \ExcludeName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \ExcludeName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\NameQueryInfo}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Xref: #2 already exists}% - \else - \ifcsname\csb!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 exists; no exclusion}% - \else - \ifcsname\csb!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 exists; no exclusion}% - \else - \csgdef{\csb!PN}{!}% - \fi - \fi - \fi + \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi \else - \ifcsname\csbc!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Xref: #2 #3 already exists}% + \ifx\Suff\@empty + \ifcsname\csbc!DB\endcsname\csname\csbc!DB\endcsname\fi \else - \ifcsname\csbc!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}% - \else - \ifcsname\csbc!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #2 #3 exists; no exclusion}% - \else - \csgdef{\csbc!PN}{!}% - \fi - \fi + \ifcsname\csb!DB\endcsname\csname\csb!DB\endcsname\fi \fi \fi \else - \ifcsname\csab!PN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: XRef: #1 #2 already exists}% - \else - \ifcsname\csab!MN\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}% - \else - \ifcsname\csab!NF\endcsname - \PackageWarning{nameauth}% - {macro \ExcludeName: Reference: #1 #2 exists; no exclusion}% - \else - \csgdef{\csab!PN}{!}% - \fi - \fi - \fi + \ifcsname\csab!DB\endcsname\csname\csab!DB\endcsname\fi \fi } -\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty]% +\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\Suff{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfFrontName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfFrontName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\NameClearInfo}% \ifx\testa\@empty \ifx\testc\@empty - \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi + \global\csundef{\csb!DB}% \else - \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi + \ifx\Suff\@empty + \global\csundef{\csbc!DB}% + \else + \global\csundef{\csb!DB}% + \fi \fi \else - \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi + \global\csundef{\csab!DB}% \fi } -\newcommandx\IfMainName[5][1=\@empty, 3=\@empty]% +\newcommandx\IfMainName[5][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfMainName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfMainName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\IfMainName}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi \else - \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi + \ifx\suffb\@empty + \ifcsname\csbc!MN\endcsname{#4}\else{#5}\fi + \else + \ifcsname\csb!MN\endcsname{#4}\else{#5}\fi + \fi \fi \else \ifcsname\csab!MN\endcsname{#4}\else{#5}\fi \fi } -\newcommandx\IfAKA[6][1=\@empty, 3=\@empty]% +\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \def\test{!}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \IfAKA: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \IfAKA: Essential name malformed}% + \@nameauth@Error{#2}{macro \string\IfFrontName}% + \ifx\testa\@empty + \ifx\testc\@empty + \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi + \else + \ifx\suffb\@empty + \ifcsname\csbc!NF\endcsname{#4}\else{#5}\fi + \else + \ifcsname\csb!NF\endcsname{#4}\else{#5}\fi + \fi \fi + \else + \ifcsname\csab!NF\endcsname{#4}\else{#5}\fi \fi +} +\newcommandx\IfAKA[6][1=\@empty, 3=\@empty] +{% + \protected@edef\testa{#1}% + \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% + \def\csb{\@nameauth@Clean{#2}}% + \def\csbc{\@nameauth@Clean{#2,#3}}% + \def\csab{\@nameauth@Clean{#1!#2}}% + \@nameauth@Error{#2}{macro \string\IfAKA}% \ifx\testa\@empty \ifx\testc\@empty \ifcsname\csb!PN\endcsname - \edef\testa{\csname\csb!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi \else{#5}\fi \else - \ifcsname\csbc!PN\endcsname - \edef\testa{\csname\csbc!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi - \else{#5}\fi + \ifx\suffb\@empty + \ifcsname\csbc!PN\endcsname + \edef\testex{\csname\csbc!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi + \else{#5}\fi + \else + \ifcsname\csb!PN\endcsname + \edef\testex{\csname\csb!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi + \else{#5}\fi + \fi \fi \else \ifcsname\csab!PN\endcsname - \edef\testa{\csname\csab!PN\endcsname}% - \ifx\testa\test{#6}\else{#4}\fi + \edef\testex{\csname\csab!PN\endcsname}% + \ifx\testex\@empty{#4}\else{#6}\fi \else{#5}\fi \fi } -\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty]% +\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \ForgetName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \ForgetName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\ForgetName}% \ifx\testa\@empty \ifx\testc\@empty \if@nameauth@LocalNames @@ -1248,15 +1158,28 @@ \global\csundef{\csb!NF}% \fi \else - \if@nameauth@LocalNames - \if@nameauth@MainFormat - \global\csundef{\csbc!MN}% + \ifx\suffb\@empty + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \global\csundef{\csbc!MN}% + \else + \global\csundef{\csbc!NF}% + \fi \else + \global\csundef{\csbc!MN}% \global\csundef{\csbc!NF}% \fi \else - \global\csundef{\csbc!MN}% - \global\csundef{\csbc!NF}% + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \global\csundef{\csb!MN}% + \else + \global\csundef{\csb!NF}% + \fi + \else + \global\csundef{\csb!MN}% + \global\csundef{\csb!NF}% + \fi \fi \fi \else @@ -1272,23 +1195,15 @@ \fi \fi } -\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty]% +\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty] {% \protected@edef\testa{#1}% - \protected@edef\testb{\trim@spaces{#2}}% \protected@edef\testc{#3}% + \protected@edef\suffb{\@nameauth@Suffix{#2}}% \def\csb{\@nameauth@Clean{#2}}% \def\csbc{\@nameauth@Clean{#2,#3}}% \def\csab{\@nameauth@Clean{#1!#2}}% - \ifx\testb\@empty - \PackageError{nameauth}% - {macro \SubvertName: Essential name missing}% - \else - \ifx\csb\@empty - \PackageError{nameauth}% - {macro \SubvertName: Essential name malformed}% - \fi - \fi + \@nameauth@Error{#2}{macro \string\SubvertName}% \ifx\testa\@empty \ifx\testc\@empty \if@nameauth@LocalNames @@ -1302,15 +1217,28 @@ \csgdef{\csb!NF}{}% \fi \else + \ifx\suffb\@empty + \if@nameauth@LocalNames + \if@nameauth@MainFormat + \csgdef{\csbc!MN}{}% + \else + \csgdef{\csbc!NF}{}% + \fi + \else + \csgdef{\csbc!MN}{}% + \csgdef{\csbc!NF}{}% + \fi + \fi + \else \if@nameauth@LocalNames \if@nameauth@MainFormat - \csgdef{\csbc!MN}{}% + \csgdef{\csb!MN}{}% \else - \csgdef{\csbc!NF}{}% + \csgdef{\csb!NF}{}% \fi \else - \csgdef{\csbc!MN}{}% - \csgdef{\csbc!NF}{}% + \csgdef{\csb!MN}{}% + \csgdef{\csb!NF}{}% \fi \fi \else @@ -1326,13 +1254,58 @@ \fi \fi } +\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty] +{% + \if@nameauth@Lock\else + \@nameauth@Locktrue% + \@nameauth@InAKAtrue% + \@nameauth@Error{#2}{macro \string\AKA}% + \@nameauth@Error{#4}{macro \string\AKA}% + \leavevmode\hbox{}% + \protected@edef\testi{#1}% + \protected@edef\argi{\trim@spaces{#1}}% + \protected@edef\rooti{\@nameauth@Root{#2}}% + \protected@edef\suffi{\@nameauth@Suffix{#2}}% + \@nameauth@Parse[#3]{#4}[#5]{!PN}% + \ifx\testi\@empty + \ifx\suffi\@empty + \IndexRef[#3]{#4}[#5]{\rooti}% + \else + \IndexRef[#3]{#4}[#5]{\rooti\space\suffi}% + \fi + \else + \ifx\suffi\@empty + \IndexRef[#3]{#4}[#5]{\rooti,\space\argi}% + \else + \IndexRef[#3]{#4}[#5]{\rooti,\space\argi,\space\suffi}% + \fi + \fi + \@nameauth@Lockfalse% + \@nameauth@InAKAfalse% + \@nameauth@AltAKAfalse% + \@nameauth@NBSPfalse% + \@nameauth@DoCapsfalse% + \@nameauth@Accentfalse% + \@nameauth@AllThisfalse% + \@nameauth@ShowCommafalse% + \@nameauth@NoCommafalse% + \@nameauth@RevThisfalse% + \@nameauth@RevThisCommafalse% + \@nameauth@ShortSNNfalse% + \@nameauth@EastFNfalse% + \fi + \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi +} +\WithSuffix{\newcommand*}\AKA*{\@nameauth@AltAKAtrue\AKA} +\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty] +{\NameauthName[#1]{#2}\space(\AKA[#1]{#2}[#3]{#4}[#5])} +\WithSuffix{\newcommand*}\PName*{\@nameauth@FullNametrue\PName} \newenvironment{nameauth}{% \begingroup% \let\ex\expandafter% \csdef{<}##1&##2&##3&##4>{% \protected@edef\@arga{\trim@spaces{##1}}% \protected@edef\@testb{\trim@spaces{##2}}% - \protected@edef\@testc{\trim@spaces{##3}}% \protected@edef\@testd{\trim@spaces{##4}}% \@nameauth@etoksb\expandafter{##2}% \@nameauth@etoksc\expandafter{##3}% @@ -1340,76 +1313,71 @@ \ifx\@arga\@empty \PackageError{nameauth}% {environment nameauth: Control sequence missing}% + \fi + \@nameauth@Error{##3}{environment nameauth}% + \ifcsname\@arga\endcsname + \PackageWarning{nameauth}% + {environment nameauth: Shorthand macro already exists}% + \fi + \ifx\@testd\@empty + \ifx\@testb\@empty + \ex\csgdef\ex{\ex\@arga\ex}\ex{\ex\NameauthName\ex{% + \the\@nameauth@etoksc}}% + \ex\csgdef\ex{\ex L\ex\@arga\ex}\ex{% + \ex\@nameauth@FullNametrue% + \ex\NameauthLName\ex{\the\@nameauth@etoksc}}% + \ex\csgdef\ex{\ex S\ex\@arga\ex}\ex{% + \ex\@nameauth@FirstNametrue% + \ex\NameauthFName\ex{\the\@nameauth@etoksc}}% + \else + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% + \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\NameauthLName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\NameauthFName\ex\ex\ex[% + \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% + \fi \else - \ifx\@testc\@empty - \PackageError{nameauth}% - {environment nameauth: Essential name missing}% + \ifx\@testb\@empty + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% + \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\NameauthLName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% + \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% + \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\NameauthFName\ex\ex\ex{% + \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% \else - \ifcsname\@arga\endcsname - \PackageWarning{nameauth}% - {environment nameauth: Redefinition of shorthands}% - \fi - \ifx\@testd\@empty - \ifx\@testb\@empty - \ex\csgdef\ex{\ex\@arga\ex}\ex{\ex\NameauthName\ex{% - \the\@nameauth@etoksc}}% - \ex\csgdef\ex{\ex L\ex\@arga\ex}\ex{% - \ex\@nameauth@FullNametrue% - \ex\NameauthLName\ex{\the\@nameauth@etoksc}}% - \ex\csgdef\ex{\ex S\ex\@arga\ex}\ex{% - \ex\@nameauth@FirstNametrue% - \ex\NameauthFName\ex{\the\@nameauth@etoksc}}% - \else - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% - \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\NameauthLName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\NameauthFName\ex\ex\ex[% - \ex\the\ex\@nameauth@etoksb\ex]\ex{\the\@nameauth@etoksc}}% - \fi - \else - \ifx\@testb\@empty - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex\@arga\ex\ex\ex}% - \ex\ex\ex{\ex\ex\ex\NameauthName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex L\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\NameauthLName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \ex\ex\ex\csgdef\ex\ex\ex{\ex\ex\ex S\ex\ex\ex\@arga% - \ex\ex\ex}\ex\ex\ex{\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\NameauthFName\ex\ex\ex{% - \ex\the\ex\@nameauth@etoksc\ex}\ex[\the\@nameauth@etoksd]}% - \else - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@arga\ex\ex\ex\ex\ex\ex\ex}% - \ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName% - \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% - \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\@arga% - \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue% - \ex\ex\ex\ex\ex\ex\ex\NameauthLName\ex\ex\ex\ex\ex\ex\ex[% - \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% - \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\@arga% - \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% - \ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue% - \ex\ex\ex\ex\ex\ex\ex\NameauthFName\ex\ex\ex\ex\ex\ex\ex[% - \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb\ex\ex\ex]% - \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% - \the\@nameauth@etoksd]}% - \fi - \fi + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@arga\ex\ex\ex\ex\ex\ex\ex}% + \ex\ex\ex\ex\ex\ex\ex{\ex\ex\ex\ex\ex\ex\ex\NameauthName% + \ex\ex\ex\ex\ex\ex\ex[\ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% + \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex L\ex\ex\ex\ex\ex\ex\ex\@arga% + \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@nameauth@FullNametrue% + \ex\ex\ex\ex\ex\ex\ex\NameauthLName\ex\ex\ex\ex\ex\ex\ex[% + \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb% + \ex\ex\ex]\ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% + \ex\ex\ex\ex\ex\ex\ex\csgdef\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex S\ex\ex\ex\ex\ex\ex\ex\@arga% + \ex\ex\ex\ex\ex\ex\ex}\ex\ex\ex\ex\ex\ex\ex{% + \ex\ex\ex\ex\ex\ex\ex\@nameauth@FirstNametrue% + \ex\ex\ex\ex\ex\ex\ex\NameauthFName\ex\ex\ex\ex\ex\ex\ex[% + \ex\ex\ex\the\ex\ex\ex\@nameauth@etoksb\ex\ex\ex]% + \ex\ex\ex{\ex\the\ex\@nameauth@etoksc\ex}\ex[% + \the\@nameauth@etoksd]}% \fi \fi \ignorespaces% @@ -1429,8 +1397,8 @@ %% Charles P. Schaum. %% %% This work consists of the files nameauth.dtx, examples.tex, and a Makefile. -%% Running "make" generates the derived files README, nameauth.pdf and nameauth.sty. -%% Running "make inst" installs the files in the user's TeX tree. +%% Running "make" generates the derived files README, nameauth.pdf and +%% nameauth.sty. Running "make inst" installs the files in the user's TeX tree. %% Running "make install" installs the files in the local TeX tree. %% %% |