diff options
author | Karl Berry <karl@freefriends.org> | 2012-04-30 23:33:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-04-30 23:33:06 +0000 |
commit | beaaa685fbb168a83aa48252c3be8dcee461a64e (patch) | |
tree | 201cb4617f744875adfc33491136a31985d592d3 /Master/texmf-dist/tex/latex/nameauth | |
parent | 7ec5d00f29a58da3fda317de7ba27b155efa8f7c (diff) |
nameauth 1.26 (25apr12)
git-svn-id: svn://tug.org/texlive/trunk@26166 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 80 |
1 files changed, 64 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index ce7022ec3f0..8a85de3f081 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/04/21 v1.24 name authority macros to aid consistent display and indexing of names] + [2012/04/24 v1.26 name authority macros to aid consistent display and indexing of names] \newif\if@nameauth@DoFormat \newif\if@nameauth@DoIndex @@ -110,6 +110,7 @@ \DeclareDocumentCommand\Name{s o m o}% {% \protected@edef\Surnames{#3}% + \protected@edef\Suffix{\@empty}% \if@nameauth@DoCaps% \protected@edef\Shortnames{\@nameauth@CapRoot{#3,}}% \else% @@ -119,6 +120,7 @@ \@nameauth@CheckComma{#3}% \if@nameauth@Comma% \protected@edef\Surnames{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% + \protected@edef\Suffix{\@nameauth@Suffix{#3}}% \fi% \fi% \IfValueTF{#2}% @@ -135,28 +137,34 @@ \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]}% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]}% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% \else% \csgdef{\@nameauth@CleanName{#2#3!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% \fi% \else% \ifcsname\@nameauth@CleanName{#2#3!NF!}\endcsname% \IfBooleanTF{#1}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]}% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% {\expandafter\@nameauth@FmtName\expandafter*\expandafter{\Shortnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]}% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi}% \else% \csgdef{\@nameauth@CleanName{#2#3!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #2}[\@nameauth@CleanName{#2#3}]% + \else \@nameauth@Index{\Shortnames, #2, \Suffix}[\@nameauth@CleanName{#2#3}]\fi% \fi% \fi% \fi}% @@ -238,10 +246,13 @@ \DeclareDocumentCommand\FName{o m o}% {% \protected@edef\Surnames{#2}% + \protected@edef\Shortnames{\@nameauth@Root{#2,}}% + \protected@edef\Suffix{\@empty}% \if@nameauth@DoComma\else% \@nameauth@CheckComma{#2}% \if@nameauth@Comma% \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% + \protected@edef\Suffix{\@nameauth@Suffix{#2}}% \fi% \fi% \IfValueTF{#1}% @@ -256,23 +267,27 @@ \ifcsname\@nameauth@CleanName{#1#2!MN!}\endcsname% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% - \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \else% \csgdef{\@nameauth@CleanName{#1#2!MN!}}{}% \expandafter\@nameauth@FmtName\expandafter{% \expandafter\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \fi% \else% \ifcsname\@nameauth@CleanName{#1#2!NF!}\endcsname% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames}% - \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \else% \csgdef{\@nameauth@CleanName{#1#2!NF!}}{}% \expandafter\@nameauth@FmtName\expandafter*% \expandafter{\Forenames\expandafter\space\Surnames}% - \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Shortnames, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \fi% \fi% \fi}% @@ -339,14 +354,20 @@ {% \protected@edef\Surnamesi{#3}% \protected@edef\Surnamesii{#5}% + \protected@edef\Shortnamesi{\@nameauth@Root{#3,}}% + \protected@edef\Shortnamesii{\@nameauth@Root{#5,}}% + \protected@edef\Suffixi{\@empty}% + \protected@edef\Suffixii{\@empty}% \if@nameauth@DoComma\else% \@nameauth@CheckComma{#3}% \if@nameauth@Comma% \protected@edef\Surnamesi{\@nameauth@Root{#3}\@nameauth@Suffix{#3}}% + \protected@edef\Suffixi{\@nameauth@Suffix{#3}}% \fi% \@nameauth@CheckComma{#5}% \if@nameauth@Comma% \protected@edef\Surnamesii{\@nameauth@Root{#5}\@nameauth@Suffix{#5}}% + \protected@edef\Suffixii{\@nameauth@Suffix{#5}}% \fi% \fi% \IfValueTF{#4}% @@ -368,8 +389,25 @@ \else% \csgdef{\@nameauth@CleanName{#4#5!PN!}}{}% \IfValueTF{#2}% - {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}}% - {\@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}}% + {% + \ifx\Suffixi\@empty% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi, #2}}% + \else% + \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi, #2}}% + \fi% + \else% + \ifx\Suffixii\@empty% + \@nameauth@Index{\Surnamesii, #4|see{\Shortnamesi, #2, \Suffixi}}% + \else% + \@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Shortnamesi, #2, \Suffixi}}% + \fi% + \fi% + }% + {% + \ifx\Suffixii\@empty \@nameauth@Index{\Surnamesii, #4|see{\Surnamesi}}% + \else\@nameauth@Index{\Shortnamesii, #4, \Suffixii|see{\Surnamesi}}\fi% + }% \fi% \fi% \fi}% @@ -392,7 +430,10 @@ \else% \csgdef{\@nameauth@CleanName{#5#6!PN!}}{}% \IfValueTF{#2}% - {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}}% + {% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi, #2}}% + \else\@nameauth@Index{\Surnamesii\space#6|see{\Shortnamesi, #2, \Suffixi}}\fi% + }% {\@nameauth@Index{\Surnamesii\space#6|see{\Surnamesi}}}% \fi% \fi% @@ -412,7 +453,10 @@ \else% \csgdef{\@nameauth@CleanName{#5!PN!}}{}% \IfValueTF{#2}% - {\@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}}% + {% + \ifx\Suffixi\@empty \@nameauth@Index{\Surnamesii|see{\Surnamesi, #2}}% + \else\@nameauth@Index{\Surnamesii|see{\Shortnamesi, #2, \Suffixi}}\fi% + }% {\@nameauth@Index{\Surnamesii|see{\Surnamesi}}}% \fi% \fi% @@ -461,10 +505,13 @@ \DeclareDocumentCommand\IndexName{o m o}% {% \protected@edef\Surnames{#2}% + \protected@edef\Short{\@nameauth@Root{#2,}}% + \protected@edef\Suffix{\@empty}% \if@nameauth@DoComma\else% \@nameauth@CheckComma{#2}% \if@nameauth@Comma% \protected@edef\Surnames{\@nameauth@Root{#2}\@nameauth@Suffix{#2}}% + \protected@edef\Suffix{\@nameauth@Suffix{#2}}% \fi% \fi% \IfValueTF{#1}% @@ -472,7 +519,8 @@ \PackageWarning{nameauth}% {macro IndexName XRef: #1 #2 exists.}% \else% - \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \ifx\Suffix\@empty \@nameauth@Index{\Surnames, #1}[\@nameauth@CleanName{#1#2}]% + \else \@nameauth@Index{\Short, #1, \Suffix}[\@nameauth@CleanName{#1#2}]\fi% \fi}% {\IfValueTF{#3} {\ifcsname\@nameauth@CleanName{#2#3!PN!}\endcsname% |