summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-01-20 23:04:22 +0000
committerKarl Berry <karl@freefriends.org>2012-01-20 23:04:22 +0000
commit7b65dfa5cfd0d667cf9e9c4ff0b035e1c112c4a8 (patch)
treee129c0174fd56fcaac6c9b4efe7f5bd88a08366a /Master/texmf-dist/tex/latex/nameauth
parent411bf10c075b9fa52d7ec8d6804cf60bf47bde16 (diff)
nameauth (20jan12)
git-svn-id: svn://tug.org/texlive/trunk@25165 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty127
1 files changed, 89 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
index 2955483ddd9..8f493db568f 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}
- [2011/12/26 v0.7 name authority macros to aid consistent display and indexing of names]
+ [2012/01/19 v0.75 name authority macros to aid consistent display and indexing of names]
\newif\if@nameauth@DoFormat
\newif\if@nameauth@Punct
\DeclareOption{mainmatter}{\@nameauth@DoFormattrue}
@@ -78,27 +78,50 @@
\fi%
\fi%
\fi}%
- {\ifcsname\@CleanName{#2!PN!}\endcsname%
- \@FmtName*{#1 #2}%
- \PackageWarning{nameauth}%
- {You cannot create a page reference from the pen name: #1 #2.}%
- \else%
- \if@nameauth@DoFormat%
- \ifcsname\@CleanName{#2!MN!}\endcsname%
- \@FmtName*{#2}\index{#2}%
+ {\IfValueTF{#3}
+ {\ifcsname\@CleanName{#2#3!PN!}\endcsname%
+ \@FmtName*{#2 #3}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the pen name: #2 #3.}%
+ \else%
+ \if@nameauth@DoFormat%
+ \ifcsname\@CleanName{#2#3!MN!}\endcsname%
+ \@FmtName*{#2 #3}\index{#2 #3}%
+ \else%
+ \csgdef{\@CleanName{#2#3!MN!}}{}%
+ \@FmtName{#2 #3}\index{#2 #3}%
+ \fi%
\else%
- \csgdef{\@CleanName{#2!MN!}}{}%
- \@FmtName{#2}\index{#2}%
+ \ifcsname\@CleanName{#2#3!NF!}\endcsname%
+ \@FmtName*{#2 #3}\index{#2 #3}%
+ \else%
+ \csgdef{\@CleanName{#2#3!NF!}}{}%
+ \@FmtName*{#2 #3}\index{#2 #3}%
+ \fi%
\fi%
+ \fi}%
+ {\ifcsname\@CleanName{#2!PN!}\endcsname%
+ \@FmtName*{#2}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the pen name: #2.}%
\else%
- \ifcsname\@CleanName{#2!NF!}\endcsname%
- \@FmtName*{#2}\index{#2}%
+ \if@nameauth@DoFormat%
+ \ifcsname\@CleanName{#2!MN!}\endcsname%
+ \@FmtName*{#2}\index{#2}%
+ \else%
+ \csgdef{\@CleanName{#2!MN!}}{}%
+ \@FmtName{#2}\index{#2}%
+ \fi%
\else%
- \csgdef{\@CleanName{#2!NF!}}{}%
- \@FmtName*{#2}\index{#2}%
+ \ifcsname\@CleanName{#2!NF!}\endcsname%
+ \@FmtName*{#2}\index{#2}%
+ \else%
+ \csgdef{\@CleanName{#2!NF!}}{}%
+ \@FmtName*{#2}\index{#2}%
+ \fi%
\fi%
- \fi%
- \fi}%
+ \fi}%
+ }%
}
\DeclareDocumentCommand\@LName{o m o}%
{%
@@ -125,27 +148,50 @@
\fi%
\fi%
\fi}%
- {\ifcsname\@CleanName{#2!PN!}\endcsname%
- \@FmtName*{#1 #2}%
- \PackageWarning{nameauth}%
- {You cannot create a page reference from the pen name: #1 #2.}
- \else%
- \if@nameauth@DoFormat%
- \ifcsname\@CleanName{#2!MN!}\endcsname%
- \@FmtName*{\@Zapsuffix{#2}}\index{#2}%
+ {\IfValueTF{#3}
+ {\ifcsname\@CleanName{#2#3!PN!}\endcsname%
+ \@FmtName*{#2 #3}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the pen name: #2 #3.}%
+ \else%
+ \if@nameauth@DoFormat%
+ \ifcsname\@CleanName{#2#3!MN!}\endcsname%
+ \@FmtName*{\@Zapsuffix{#2}}\index{#2 #3}%
+ \else%
+ \csgdef{\@CleanName{#2#3!MN!}}{}%
+ \@FmtName{#2 #3}\index{#2 #3}%
+ \fi%
\else%
- \csgdef{\@CleanName{#2!MN!}}{}%
- \@FmtName{#2}\index{#2}%
+ \ifcsname\@CleanName{#2#3!NF!}\endcsname%
+ \@FmtName*{\@Zapsuffix{#2}}\index{#2 #3}%
+ \else%
+ \csgdef{\@CleanName{#2#3!NF!}}{}%
+ \@FmtName*{#2 #3}\index{#2 #3}%
+ \fi%
\fi%
+ \fi}%
+ {\ifcsname\@CleanName{#2!PN!}\endcsname%
+ \@FmtName*{#2}%
+ \PackageWarning{nameauth}%
+ {You cannot create a page reference from the pen name: #2.}%
\else%
- \ifcsname\@CleanName{#2!NF!}\endcsname%
- \@FmtName*{\@Zapsuffix{#2}}\index{#2}%
+ \if@nameauth@DoFormat%
+ \ifcsname\@CleanName{#2!MN!}\endcsname%
+ \@FmtName*{\@Zapsuffix{#2}}\index{#2}%
+ \else%
+ \csgdef{\@CleanName{#2!MN!}}{}%
+ \@FmtName{#2}\index{#2}%
+ \fi%
\else%
- \csgdef{\@CleanName{#2!NF!}}{}%
- \@FmtName*{#2}\index{#2}%
+ \ifcsname\@CleanName{#2!NF!}\endcsname%
+ \@FmtName*{\@Zapsuffix{#2}}\index{#2}%
+ \else%
+ \csgdef{\@CleanName{#2!NF!}}{}%
+ \@FmtName*{#2}\index{#2}%
+ \fi%
\fi%
- \fi%
- \fi}%
+ \fi}%
+ }%
}
\DeclareDocumentCommand\Name{s o m o}%
{%
@@ -176,18 +222,23 @@
\fi}%
\if@nameauth@Punct\expandafter\@CheckDot\fi%
}
-\DeclareDocumentCommand\IndexName{o m m}%
+\DeclareDocumentCommand\IndexName{o m o}%
{%
\IfValueTF{#1}%
{\ifcsname\@CleanName{#1#2!PN!}\endcsname\else\index{#2,{\space}#1}\fi}%
- {\ifcsname\@CleanName{#2!PN!}\endcsname\else\index{#2}\fi}%
- {#3}%
+ {\IfValueTF{#3}
+ {\ifcsname\@CleanName{#2#3!PN!}\endcsname\else\index{#2 #3}\fi}
+ {\ifcsname\@CleanName{#2!PN!}\endcsname\else\index{#2}\fi}%
+ }%
}
-\DeclareDocumentCommand\ForgetName{o m}%
+\DeclareDocumentCommand\ForgetName{o m o}%
{%
\IfValueTF{#1}%
{\csundef{\@CleanName{#1#2!MN!}}\csundef{\@CleanName{#1#2!NF!}}}%
- {\csundef{\@CleanName{#2!MN!}}\csundef{\@CleanName{#2!NF!}}}%
+ {\IfValueTF{#3}%
+ {\csundef{\@CleanName{#2#3!MN!}}\csundef{\@CleanName{#2#3!NF!}}}%
+ {\csundef{\@CleanName{#2!MN!}}\csundef{\@CleanName{#2!NF!}}}%
+ }%
}
\newcommand{\NamesInactive}{\@nameauth@DoFormatfalse}
\newcommand{\NamesActive}{\@nameauth@DoFormattrue}