diff options
author | Karl Berry <karl@freefriends.org> | 2012-02-17 23:54:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-02-17 23:54:19 +0000 |
commit | 2c51d4366d5206ebba144908f8dcdba97683494b (patch) | |
tree | 0e897057bfef860394320cd04a98fee370ec60d3 /Master/texmf-dist | |
parent | c1b648ea672270d1244a279ead7604d9655d8ea8 (diff) |
nameauth (17feb12)
git-svn-id: svn://tug.org/texlive/trunk@25421 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nameauth/nameauth.pdf | bin | 640907 -> 642510 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/nameauth/nameauth.dtx | 181 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 141 |
4 files changed, 174 insertions, 150 deletions
diff --git a/Master/texmf-dist/doc/latex/nameauth/README b/Master/texmf-dist/doc/latex/nameauth/README index 01df2cec6aa..3b009698461 100644 --- a/Master/texmf-dist/doc/latex/nameauth/README +++ b/Master/texmf-dist/doc/latex/nameauth/README @@ -1,7 +1,7 @@ The nameauth package Charles P. Schaum charles dot schaum at att dot net -v0.94 from 2012/02/15 +v0.95 from 2012/02/17 Abstract diff --git a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf Binary files differindex d111dea0a6e..9941149f7fd 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 c81664fdf4a..7ec95e9f1a9 100644 --- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx +++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx @@ -26,7 +26,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] %<package>\ProvidesPackage{nameauth} %<*package> - [2012/02/15 v0.94 name authority macros to aid consistent display and indexing of names] + [2012/02/17 v0.95 name authority macros to aid consistent display and indexing of names] %</package> % %<*driver> @@ -56,7 +56,7 @@ \fi \fi \usepackage{makeidx} -\usepackage{nameauth}[2012/02/15] +\usepackage{nameauth}[2012/02/17] \usepackage{hyperref} \begingroup\lccode`!=`\\\lowercase{\endgroup\def\bsc{!}} \makeindex @@ -72,7 +72,7 @@ %</driver> % \fi % -% \CheckSum{922} +% \CheckSum{920} % % \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 @@ -99,6 +99,7 @@ % \changes{v0.9}{2012/02/10}{Added first name formatting, comma and suffix handling expandable} % \changes{v0.92}{2012/02/12}{Build with all major \LaTeX{} engines} % \changes{v0.94}{2012/02/15}{Added index suppression, error checking, better particle handling} +% \changes{v0.95}{2012/02/17}{Fixed occasional incompatibility with \textsf{microtype}.} % % \DoNotIndex{\newcommand, \newenvironment, \@empty, \@gobble, \bfseries, \bgroup, \def, \egroup, \else, \endcsname, \endinput, \ExecuteOptions, \fi, \if, \ifx, \IfBooleanTF, \IfValueTF, \itshape, \let, \newif, \relax, \renewcommand, \RequirePackage, \scshape, \space, \DeclareDocumentCommand, \DeclareOption, \ProcessOptions, \@token, \@period, \csgdef, \csundef, \detokenize, \expandafter, \Forenames, \futurelet, \if@nameauth@DoComma, \if@nameauth@DoFormat, \if@nameauth@Punct, \ifcsname, \index, \PackageWarning, \Surnames, \Surnamesi, \Surnamesii, \TestDot, \TestEnd, \TestPunct, \TestStop, \zap@space, \edef, \if@nameauth@DoIndex, \if@nameauth@Comma, \Test, \bsc, \uppercase, \Input, \Output, \if@nameauth@DoCaps, \Cap, \@Cap} % @@ -280,19 +281,19 @@ % As long as the ``main'' \emph{FNN} are constant, the ``alternate names'' field can vary, yet the index entries will be constant. All references below refer to ``De Wette, Wilhelm M.L.'' in the index: % % \begin{quote}\small -% \texttt{\bsc Name[Wilhelm M.L.]\{De Wette\}[Wilhelm Martin Leberecht]}\\ +% |\Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht]|\\ % \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, first occurrence)\\ % \Name[Wilhelm M.L.]{De Wette}[Wilhelm Martin Leberecht] (text, second occurrence)\\ % % \ForgetName[Wilhelm M.L.]{De Wette}% -% \texttt{\bsc Name*[Wilhelm M.L.]\{De Wette\}}\\ -% \Name*[Wilhelm M.L.]{De Wette} (text, first occurrence)\\ -% \Name*[Wilhelm M.L.]{De Wette} (text, second occurrence) +% |\Name[Wilhelm M.L.]{De Wette}|\\ +% \Name[Wilhelm M.L.]{De Wette} (text, first occurrence)\\ +% \Name[Wilhelm M.L.]{De Wette} (text, second occurrence) % \end{quote} % % \noindent Alternate forenames only get printed in subsequent occurrences of \cmd{\Name*}. The surname argument is \emph{always} printed. % -% Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \texttt{\bsc AKA} and \texttt{\bsc PName} cannot refer to these forms, although they can use these forms in the \emph{second} name argument to construct a cross-reference. A workaround is discussed in Section \ref{sec:suffix}. The following method is the only one that works with the \texttt{comma} option. Valid ``sobriquet'' forms are:\\ +% Another option employs a ``sobriquet'' feature for royal names and basic Eastern names. \cmd{\AKA} and \cmd{\PName} cannot refer to these forms, although they can use these forms in the \emph{second} name argument to construct a cross-reference. A workaround is discussed in Section \ref{sec:suffix}. The following method is the only one that works with the \texttt{comma} option. Valid ``sobriquet'' forms are:\\ % % \bgroup\footnotesize % \begin{tabular}{llp{1.2cm}ll}\hline @@ -390,7 +391,7 @@ % \label{sec:suffix} % \changes{v0.85}{2012/02/05}{New suffix removal features} % -% \cmd{\Name}---not \cmd{\Name*}---truncates comma-delimited suffixes from last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. One must always use a comma to activate this, e.g., \texttt{\bsc Name[Oskar]\{Hammerstein, II\}}. The space after the comma is literal, but not manipulated by the package in case one wants to use a thin space. +% \cmd{\Name}---not \cmd{\Name*}---truncates comma-delimited suffixes from last names. For example, it prints the name \Name[Oskar]{Hammerstein, II} the first time and \Name[Oskar]{Hammerstein, II} thereafter. One must always use a comma to activate this, e.g., |\Name[Oskar]{Hammerstein, II}|. The space after the comma is literal, but not manipulated by the package in case one wants to use a thin space. % % Again, \textbf{the comma is not optional with suffixes}. It is how this feature works. More than one comma in the \emph{SNN} argument of \cmd{\Name} and friends will cause unwanted results. Fortunately, that is unlikely. % @@ -735,7 +736,9 @@ % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \begin{macrocode} \newcommand*{\@nameauth@CleanName}[1]% - {\expandafter\zap@space\detokenize{#1} \@empty} +{% + \expandafter\zap@space\detokenize{#1} \@empty% +} % \end{macrocode} % \end{macro} % Thanks to \Name*[Heiko]{Oberdiek}, this macro produces a ``sanitized'' string based on the forename/surname parameters of \cmd{\Name} and friends. With this we can construct a control sequence name. Testing for the presence of that control sequence determines the existence of pseudonyms and the first occurrence of a name.\bigskip\hrule\bigskip @@ -745,7 +748,8 @@ % \changes{v0.85}{2012/02/05}{Revise suffix handling} % \changes{v0.9}{2012/02/10}{renamed macro; suffix handling expandable} % \begin{macrocode} -\newcommand*{\@nameauth@Root}[1]{% +\newcommand*{\@nameauth@Root}[1]% +{% \@nameauth@TrimRoot#1\relax% } % \end{macrocode} @@ -764,7 +768,8 @@ % \begin{macro}{\@nameauth@Suffix} % \changes{v0.9}{2012/02/10}{added macro} % \begin{macrocode} -\newcommand*{\@nameauth@Suffix}[1]{% +\newcommand*{\@nameauth@Suffix}[1]% +{% \@nameauth@TrimSuffix#1\relax% } % \end{macrocode} @@ -783,7 +788,8 @@ % \changes{v0.85}{2012/02/05}{Add suffix handling functionality} % \changes{v0.9}{2012/02/10}{Fix comma checking, now expandable} % \begin{macrocode} -\newcommand*{\@nameauth@CheckComma}[1]{% +\newcommand*{\@nameauth@CheckComma}[1]% +{% \@nameauth@CheckSuffix#1,\relax% } % \end{macrocode} @@ -793,7 +799,8 @@ % \begin{macro}{\@nameauth@CheckSuffix} % \changes{v0.9}{2012/02/10}{Added macro} % \begin{macrocode} -\def\@nameauth@CheckSuffix#1,#2\relax{% +\def\@nameauth@CheckSuffix#1,#2\relax% +{% \def\Test{#2}% \ifx\Test\@empty\@nameauth@Commafalse\else\@nameauth@Commatrue\fi% } @@ -805,7 +812,8 @@ % \changes{v0.85}{2012/02/05}{Revise suffix handling} % \changes{v0.9}{2012/02/10}{Redesigned macro} % \begin{macrocode} -\newcommand*{\@nameauth@NoComma}[1]{% +\newcommand*{\@nameauth@NoComma}[1]% +{% \@nameauth@Root{#1}\@nameauth@Suffix{#1}% } % \end{macrocode} @@ -825,7 +833,9 @@ % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \begin{macrocode} \def\@nameauth@EvalDot% - {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} +{% + \let\@period=.\ifx\@token\@period\expandafter\@gobble \fi% +} % \end{macrocode} % \end{macro} % \cmd{\@nameauth@EvalDot} checks if \cmd{\@token} is a period. If so it gobbles it by using \cmd{\expandafter} to get past the grouping. Another \cmd{\expandafter} occurs immediately before the invocation of \cmd{\@nameauth@CheckDot} in \cmd{\Name}, \cmd{\FName}, and \cmd{\AKA}. @@ -833,7 +843,8 @@ % \begin{macro}{\@nameauth@TestDot} % \changes{v0.8}{2012/01/29}{Renamed macro to help compatibility} % \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}% @@ -851,48 +862,48 @@ % \changes{v0.85}{2012/02/05}{Add comma suppression} % \changes{v0.9}{2012/02/10}{Redesigned macro} % \changes{v0.94}{2012/02/15}{Added particle caps} +% \changes{v0.95}{2012/02/17}{Fixed incompatibility with \textsf{microtype}} % \begin{macrocode} \DeclareDocumentCommand\@nameauth@FmtName{s m}% {% - \edef\Input{#2}% - \def\Cap##1{\@Cap##1}% - \def\@Cap##1##2{\uppercase{##1}##2}% - \if@nameauth@DoCaps% - \expandafter\def\expandafter\Output\expandafter{% - \expandafter\Cap\expandafter{\Input}}% - \else\let\Output\Input\fi% - \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% - {\Output}% + \@nameauth@DoCapsfalse% + \@nameauth@TestDot{#2}% + \IfBooleanTF{#1}% + {#2}% {\bgroup\NamesFormat{#2}\egroup}% } % \end{macrocode} % \end{macro} % \cmd{\@nameauth@FmtName} is where the first occurrences of a name are formatted. Notice how \cmd{\NamesFormat} sits between a \cmd{\bgroup} and an \cmd{\egroup} to localize the font change. The \cmd{\NamesFormat} hook has been discussed above. The main reason for making this a separate macro was to offer a means of adding features in modular fashion. % -% \begin{macro}{\@nameauth@FmtFName} +% \begin{macro}{\@nameauth@Index} % \changes{v0.94}{2012/02/15}{Added macro} % \begin{macrocode} -\DeclareDocumentCommand\@nameauth@FmtFName{s m}% -{% - \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% - {#2}% - {\bgroup\NamesFormat{#2}\egroup}% +\newcommand{\@nameauth@Index}[1]{% + \if@nameauth@DoIndex\index{#1}\fi% } % \end{macrocode} % \end{macro} -% This formatting macro is called from \cmd{\FName} because the particle caps mechanism is incompatible with forenames. +% If the indexing flag is true, create an index entry, otherwise do nothing % -% \begin{macro}{\@nameauth@Index} -% \changes{v0.94}{2012/02/15}{Added macro} +% \begin{macro}{\@nameauth@CapRoot} +% \changes{v0.95}{2012/02/17}{Added macro} % \begin{macrocode} -\newcommand{\@nameauth@Index}[1]{% - \if@nameauth@DoIndex\index{#1}\fi% +\newcommand*{\@nameauth@CapRoot}[1]% +{% + \@nameauth@CR#1\relax% } % \end{macrocode} % \end{macro} -% If the indexing flag is true, create an index entry, otherwise do nothing +% This macro implements the particulate name capitalization mechanism. It is done on entry to \cmd{\Name} in order that certain accents that generate control sequences do not cause incompatibility with the \textsf{microtype} package. +% +% \begin{macro}{\@nameauth@CR} +% \changes{v0.95}{2012/02/17}{Added macro} +% \begin{macrocode} +\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} +% \end{macrocode} +% \end{macro} +% This delimited-parameter macro caps the first parameter and strips suffixes on the second. % % \subsection{User Interface Macros} % @@ -910,10 +921,16 @@ % \changes{v0.85}{2012/02/05}{Add comma suppression to indexing} % \changes{v0.9}{2012/02/10}{Redesigned macro} % \changes{v0.94}{2012/02/15}{Error checking expanded} +% \changes{v0.95}{2012/02/17}{Fixed incompatibility with \textsf{microtype}} % \begin{macrocode} \DeclareDocumentCommand\Name{s o m o}% {% \def\Surnames{#3}% + \if@nameauth@DoCaps% + \def\Shortnames{\@nameauth@CapRoot{#3,}}% + \else% + \def\Shortnames{\@nameauth@Root{#3,}}% + \fi% \if@nameauth@DoComma\else% \@nameauth@CheckComma{#3}% \if@nameauth@Comma% @@ -927,7 +944,7 @@ \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #2 #3 cannot be a page reference.}% + { \bsc Name Cross-reference: #2 #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% @@ -935,7 +952,7 @@ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #2}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% @@ -949,7 +966,7 @@ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #2}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% @@ -964,7 +981,7 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #3 #4 cannot be a page reference.}% + { \bsc Name Cross-reference: #3 #4 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% @@ -972,7 +989,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \@nameauth@Index{\Surnames\space#4}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% @@ -986,7 +1003,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \@nameauth@Index{\Surnames\space#4}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% @@ -1000,7 +1017,7 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #3 cannot be a page reference.}% + { \bsc Name Cross-reference: #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% @@ -1008,7 +1025,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\@nameauth@FmtName*{\Shortnames}% \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!MN!}}{}% @@ -1021,7 +1038,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\@nameauth@FmtName*{\Shortnames}% \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!NF!}}{}% @@ -1082,30 +1099,30 @@ \IfValueTF{#1}% {\IfValueTF{#3}{\edef\Forenames{#3}}{\edef\Forenames{#1}}% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #1 #2 cannot be a page reference.}% + { \bsc FName Cross-reference: #1 #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% - \expandafter\@nameauth@FmtFName\expandafter{% + \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #1}% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #1}% \fi% @@ -1113,55 +1130,55 @@ \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#3}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #2 #3 cannot be a page reference.}% + { \bsc FName Cross-reference: #2 #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtFName% + \expandafter\@nameauth@FmtName% \expandafter{\Surnames\space#3}% \@nameauth@Index{\Surnames\space#3}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#3}% \@nameauth@Index{\Surnames\space#3}% \fi% \fi% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #2 cannot be a page reference.}% + { \bsc FName Cross-reference: #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtFName\expandafter{\Surnames}% + \expandafter\@nameauth@FmtName\expandafter{\Surnames}% \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}% \fi% @@ -1201,15 +1218,15 @@ \expandafter\Forenames\expandafter\space\Surnamesii}% \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA XRef: #1 #2 exists.}% + { \bsc AKA XRef: #1 #2 exists.}% \else% \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + { \bsc AKA Name reference: #4 #5 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + { \bsc AKA Name reference: #4 #5 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% \IfValueTF{#2}% @@ -1227,11 +1244,11 @@ \else% \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + { \bsc AKA Name reference: #5 #6 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + { \bsc AKA Name reference: #5 #6 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% \IfValueTF{#2}% @@ -1245,11 +1262,11 @@ \else% \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 already exists; no see ref.}% + { \bsc AKA Name reference: #5 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 already exists; no see ref.}% + { \bsc AKA Name reference: #5 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#5!PN!}}{}% \IfValueTF{#2}% @@ -1321,17 +1338,17 @@ {% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName XRef: #1 #2 exists.}% + { \bsc ExcludeName XRef: #1 #2 exists.}% \else% \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}<HOOT>% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% \fi% \fi% \fi}% @@ -1340,11 +1357,11 @@ \else% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% \else% \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% \fi% @@ -1354,11 +1371,11 @@ \else% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 already exists; no exclusion.}% \else% \csgdef{\@nameauth@CleanName{#2!PN!}}{}% \fi% diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index 156a8e79862..59d78f55211 100644 --- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty +++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{nameauth} - [2012/02/15 v0.94 name authority macros to aid consistent display and indexing of names] + [2012/02/17 v0.95 name authority macros to aid consistent display and indexing of names] %% \DescribeMacro{\IndexActive} \newif\if@nameauth@DoFormat \newif\if@nameauth@DoComma @@ -45,29 +45,39 @@ \RequirePackage{etoolbox} \RequirePackage{xparse} \newcommand*{\@nameauth@CleanName}[1]% - {\expandafter\zap@space\detokenize{#1} \@empty} -\newcommand*{\@nameauth@Root}[1]{% +{% + \expandafter\zap@space\detokenize{#1} \@empty% +} +\newcommand*{\@nameauth@Root}[1]% +{% \@nameauth@TrimRoot#1\relax% } \def\@nameauth@TrimRoot#1,#2\relax{#1} -\newcommand*{\@nameauth@Suffix}[1]{% +\newcommand*{\@nameauth@Suffix}[1]% +{% \@nameauth@TrimSuffix#1\relax% } \def\@nameauth@TrimSuffix#1,#2\relax{#2} -\newcommand*{\@nameauth@CheckComma}[1]{% +\newcommand*{\@nameauth@CheckComma}[1]% +{% \@nameauth@CheckSuffix#1,\relax% } -\def\@nameauth@CheckSuffix#1,#2\relax{% +\def\@nameauth@CheckSuffix#1,#2\relax% +{% \def\Test{#2}% \ifx\Test\@empty\@nameauth@Commafalse\else\@nameauth@Commatrue\fi% } -\newcommand*{\@nameauth@NoComma}[1]{% +\newcommand*{\@nameauth@NoComma}[1]% +{% \@nameauth@Root{#1}\@nameauth@Suffix{#1}% } \def\@nameauth@CheckDot{\futurelet\@token\@nameauth@EvalDot} \def\@nameauth@EvalDot% - {\let\@period=.\ifx\@token\@period\expandafter\@gobble \fi} -\newcommand*{\@nameauth@TestDot}[1]{% +{% + \let\@period=.\ifx\@token\@period\expandafter\@gobble \fi% +} +\newcommand*{\@nameauth@TestDot}[1]% +{% \def\TestDot##1.\TestEnd##2\TestStop{\TestPunct{##2}}% \def\TestPunct##1% {\ifx\TestPunct##1\TestPunct\else\@nameauth@Puncttrue\fi}% @@ -76,32 +86,29 @@ } \DeclareDocumentCommand\@nameauth@FmtName{s m}% {% - \edef\Input{#2}% - \def\Cap##1{\@Cap##1}% - \def\@Cap##1##2{\uppercase{##1}##2}% - \if@nameauth@DoCaps% - \expandafter\def\expandafter\Output\expandafter{% - \expandafter\Cap\expandafter{\Input}}% - \else\let\Output\Input\fi% - \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% - {\Output}% - {\bgroup\NamesFormat{#2}\egroup}% -} -\DeclareDocumentCommand\@nameauth@FmtFName{s m}% -{% - \@nameauth@DoCapsfalse\@nameauth@TestDot{#2}% - \IfBooleanTF{#1}% + \@nameauth@DoCapsfalse% + \@nameauth@TestDot{#2}% + \IfBooleanTF{#1}% {#2}% {\bgroup\NamesFormat{#2}\egroup}% } \newcommand{\@nameauth@Index}[1]{% \if@nameauth@DoIndex\index{#1}\fi% } +\newcommand*{\@nameauth@CapRoot}[1]% +{% + \@nameauth@CR#1\relax% +} +\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}} \newcommand{\CapThis}{\@nameauth@DoCapstrue} \DeclareDocumentCommand\Name{s o m o}% {% \def\Surnames{#3}% + \if@nameauth@DoCaps% + \def\Shortnames{\@nameauth@CapRoot{#3,}}% + \else% + \def\Shortnames{\@nameauth@Root{#3,}}% + \fi% \if@nameauth@DoComma\else% \@nameauth@CheckComma{#3}% \if@nameauth@Comma% @@ -115,7 +122,7 @@ \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #2 #3 cannot be a page reference.}% + { \bsc Name Cross-reference: #2 #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% @@ -123,7 +130,7 @@ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #2}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% @@ -137,7 +144,7 @@ {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #2}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames, #2}}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% @@ -152,7 +159,7 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #3 #4 cannot be a page reference.}% + { \bsc Name Cross-reference: #3 #4 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3#4!MN!}\endcsname% @@ -160,7 +167,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \@nameauth@Index{\Surnames\space#4}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!MN!}}{}% @@ -174,7 +181,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#4}% \@nameauth@Index{\Surnames\space#4}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% \@nameauth@Index{\Surnames\space#4}}% \else% \csgdef{\@nameauth@CleanName{#3#4!NF!}}{}% @@ -188,7 +195,7 @@ \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {\bsc Name Cross-reference: #3 cannot be a page reference.}% + { \bsc Name Cross-reference: #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#3!MN!}\endcsname% @@ -196,7 +203,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\@nameauth@FmtName*{\Shortnames}% \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!MN!}}{}% @@ -209,7 +216,7 @@ {\expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}}% - {\@nameauth@FmtName*{\@nameauth@Root{#3,}}% + {\@nameauth@FmtName*{\Shortnames}% \@nameauth@Index{\Surnames}}% \else% \csgdef{\@nameauth@CleanName{#3!NF!}}{}% @@ -234,30 +241,30 @@ \IfValueTF{#1}% {\IfValueTF{#3}{\edef\Forenames{#3}}{\edef\Forenames{#1}}% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #1 #2 cannot be a page reference.}% + { \bsc FName Cross-reference: #1 #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% - \expandafter\@nameauth@FmtFName\expandafter{% + \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #1}% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% \@nameauth@Index{\Surnames, #1}% \else% \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames\expandafter\space\Surnames}% \@nameauth@Index{\Surnames, #1}% \fi% @@ -265,55 +272,55 @@ \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#3}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #2 #3 cannot be a page reference.}% + { \bsc FName Cross-reference: #2 #3 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% - \expandafter\@nameauth@FmtFName% + \expandafter\@nameauth@FmtName% \expandafter{\Surnames\space#3}% \@nameauth@Index{\Surnames\space#3}% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames\space#3}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames\space#3}% \@nameauth@Index{\Surnames\space#3}% \fi% \fi% \fi}% {\ifcsname\@nameauth@CleanName{#2!PN!}\endcsname% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \PackageWarning{nameauth}% - {\bsc FName Cross-reference: #2 cannot be a page reference.}% + { \bsc FName Cross-reference: #2 cannot be a page reference.}% \else% \if@nameauth@DoFormat% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!MN!}}{}% - \expandafter\@nameauth@FmtFName\expandafter{\Surnames}% + \expandafter\@nameauth@FmtName\expandafter{\Surnames}% \@nameauth@Index{\Surnames}% \fi% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% - \@nameauth@FmtFName*{\@nameauth@Root{#2,}}% + \@nameauth@FmtName*{\@nameauth@Root{#2,}}% \@nameauth@Index{\Surnames}% \else% \csgdef{\@nameauth@CleanName{#2!NF!}}{}% - \expandafter\@nameauth@FmtFName\expandafter*% + \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Surnames}% \@nameauth@Index{\Surnames}% \fi% @@ -343,15 +350,15 @@ \expandafter\Forenames\expandafter\space\Surnamesii}% \ifcsname\@nameauth@CleanName{#4#5!PN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA XRef: #1 #2 exists.}% + { \bsc AKA XRef: #1 #2 exists.}% \else% \ifcsname\@nameauth@CleanName{#4#5!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + { \bsc AKA Name reference: #4 #5 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#4#5!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA: Name reference: #4 #5 already exists; no see ref.}% + { \bsc AKA Name reference: #4 #5 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% \IfValueTF{#2}% @@ -369,11 +376,11 @@ \else% \ifcsname\@nameauth@CleanName{#5#6!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + { \bsc AKA Name reference: #5 #6 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#5#6!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 #6 already exists; no see ref.}% + { \bsc AKA Name reference: #5 #6 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% \IfValueTF{#2}% @@ -387,11 +394,11 @@ \else% \ifcsname\@nameauth@CleanName{#5!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 already exists; no see ref.}% + { \bsc AKA Name reference: #5 already exists; no see ref.}% \else% \ifcsname\@nameauth@CleanName{#5!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc AKA Name reference: #5 already exists; no see ref.}% + { \bsc AKA Name reference: #5 already exists; no see ref.}% \else% \csgdef{\@nameauth@CleanName{#5!PN!}}{}% \IfValueTF{#2}% @@ -439,17 +446,17 @@ {% \ifcsname\@nameauth@CleanName{#1#2!PN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName XRef: #1 #2 exists.}% + { \bsc ExcludeName XRef: #1 #2 exists.}% \else% \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #1 #2 already exists; no exclusion.}% \else% - \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}<HOOT>% + \csgdef{\@nameauth@CleanName{#1#2!PN!}}{}% \fi% \fi% \fi}% @@ -458,11 +465,11 @@ \else% \ifcsname\@nameauth@CleanName{#2#3!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 #3 already exists; no exclusion.}% \else% \csgdef{\@nameauth@CleanName{#2#3!PN!}}{}% \fi% @@ -472,11 +479,11 @@ \else% \ifcsname\@nameauth@CleanName{#2!MN!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 already exists; no exclusion.}% \else% \ifcsname\@nameauth@CleanName{#2!NF!}\endcsname% \PackageWarning{nameauth}% - {\bsc ExcludeName Reference: #2 already exists; no exclusion.}% + { \bsc ExcludeName Reference: #2 already exists; no exclusion.}% \else% \csgdef{\@nameauth@CleanName{#2!PN!}}{}% \fi% |