summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-02-17 23:54:19 +0000
committerKarl Berry <karl@freefriends.org>2012-02-17 23:54:19 +0000
commit2c51d4366d5206ebba144908f8dcdba97683494b (patch)
tree0e897057bfef860394320cd04a98fee370ec60d3 /Master/texmf-dist/tex/latex/nameauth
parentc1b648ea672270d1244a279ead7604d9655d8ea8 (diff)
nameauth (17feb12)
git-svn-id: svn://tug.org/texlive/trunk@25421 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty141
1 files changed, 74 insertions, 67 deletions
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%