summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-11-25 21:21:06 +0000
committerKarl Berry <karl@freefriends.org>2015-11-25 21:21:06 +0000
commitb7b4df92aeaba973d21a929ac2955b935b5e731b (patch)
tree356a36f2c4ad0d1b7eb340afef45e33b42e4daf7 /Master/texmf-dist/tex/latex/nameauth
parent26be434501c62161ec104b333bbdf3eb49696093 (diff)
nameauth (25nov15)
git-svn-id: svn://tug.org/texlive/trunk@38944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth')
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty84
1 files changed, 56 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
index a78b978c695..dc05889dff7 100644
--- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
+++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
@@ -14,35 +14,36 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nameauth}
- [2015/11/11 v2.0 Name authority mechanism for consistency in text and index]
-\newif\if@nameauth@FullName
-\newif\if@nameauth@FirstName
-\newif\if@nameauth@AltAKA
-\newif\if@nameauth@DoFormat
-\newif\if@nameauth@FirstFormat
-\newif\if@nameauth@AlwaysFormat
+ [2015/11/24 v2.1 Name authority mechanism for consistency in text and index]
\newif\if@nameauth@AlwaysComma
\newif\if@nameauth@ShowComma
-\newif\if@nameauth@NBSP
+\newif\if@nameauth@DoFormat
\newif\if@nameauth@DoIndex
\newif\if@nameauth@Pretag
-\newif\if@nameauth@Punct
-\newif\if@nameauth@DoCaps
\newif\if@nameauth@AllCaps
\newif\if@nameauth@AllThis
\newif\if@nameauth@RevAll
\newif\if@nameauth@RevThis
\newif\if@nameauth@RevAllComma
\newif\if@nameauth@RevThisComma
-\newcommand{\NamesFormat}{}
+\newif\if@nameauth@FirstFormat
+\newif\if@nameauth@AlwaysFormat
+\newif\if@nameauth@FullName
+\newif\if@nameauth@FirstName
+\newif\if@nameauth@AltAKA
+\newif\if@nameauth@NBSP
+\newif\if@nameauth@Punct
+\newif\if@nameauth@DoCaps
+\newif\if@nameauth@Accent
\def\@nameauth@Actual{@}
+\DeclareOption{comma}{\@nameauth@AlwaysCommatrue}
+\DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse}
\DeclareOption{mainmatter}{\@nameauth@DoFormattrue}
\DeclareOption{frontmatter}{\@nameauth@DoFormatfalse}
-\DeclareOption{smallcaps}{\renewcommand{\NamesFormat}{\scshape}}
-\DeclareOption{italic}{\renewcommand{\NamesFormat}{\itshape}}
-\DeclareOption{boldface}{\renewcommand{\NamesFormat}{\bfseries}}
-\DeclareOption{noformat}{\renewcommand{\NamesFormat}{}}
-\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue}
+\DeclareOption{index}{\@nameauth@DoIndextrue}
+\DeclareOption{noindex}{\@nameauth@DoIndexfalse}
+\DeclareOption{pretag}{\@nameauth@Pretagtrue}
+\DeclareOption{nopretag}{\@nameauth@Pretagfalse}
\DeclareOption{allcaps}{\@nameauth@AllCapstrue}
\DeclareOption{normalcaps}{\@nameauth@AllCapsfalse}
\DeclareOption{allreversed}%
@@ -51,12 +52,11 @@
{\@nameauth@RevAlltrue\@nameauth@RevAllCommatrue}
\DeclareOption{notreversed}%
{\@nameauth@RevAllfalse\@nameauth@RevAllCommafalse}
-\DeclareOption{comma}{\@nameauth@AlwaysCommatrue}
-\DeclareOption{nocomma}{\@nameauth@AlwaysCommafalse}
-\DeclareOption{index}{\@nameauth@DoIndextrue}
-\DeclareOption{noindex}{\@nameauth@DoIndexfalse}
-\DeclareOption{pretag}{\@nameauth@Pretagtrue}
-\DeclareOption{nopretag}{\@nameauth@Pretagfalse}
+\DeclareOption{alwaysformat}{\@nameauth@AlwaysFormattrue}
+\DeclareOption{smallcaps}{\newcommand*{\NamesFormat}{\scshape}}
+\DeclareOption{italic}{\newcommand*{\NamesFormat}{\itshape}}
+\DeclareOption{boldface}{\newcommand*{\NamesFormat}{\bfseries}}
+\DeclareOption{noformat}{\newcommand*{\NamesFormat}{}}
\ExecuteOptions%
{nocomma,%
mainmatter,%
@@ -67,8 +67,10 @@
smallcaps}
\ProcessOptions\relax
\RequirePackage{etoolbox}
-\RequirePackage{trimspaces}
+\RequirePackage{ifluatex}
+\RequirePackage{ifxetex}
\RequirePackage{suffix}
+\RequirePackage{trimspaces}
\RequirePackage{xargs}
\newcommand*{\@nameauth@Clean}[1]%
{\expandafter\zap@space\detokenize{#1} \@empty}
@@ -76,8 +78,23 @@
{\@nameauth@TrimRoot#1,\@empty\relax}
\def\@nameauth@TrimRoot#1,#2\relax{\trim@spaces{#1}}
\newcommand*{\@nameauth@CapRoot}[1]%
- {\@nameauth@CR#1\relax}
-\def\@nameauth@CR#1#2\relax{\uppercase{#1}\@nameauth@Root{#2}}
+{%
+ \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
+}
+\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]%
@@ -129,6 +146,7 @@
\fi
}
\newcommand*{\CapThis}{\@nameauth@DoCapstrue}
+\newcommand*{\AccentCapThis}{\@nameauth@Accenttrue\@nameauth@DoCapstrue}
\newcommand*{\CapName}{\@nameauth@AllThistrue}
\newcommand*{\RevName}{\@nameauth@RevThistrue}
\newcommand*{\RevComma}%
@@ -167,7 +185,7 @@
\else
\ifx\csb\@empty
\PackageError{nameauth}%
- {macro \AKA: Essential name malformed}%
+ {macro \Name: Essential name malformed}%
\fi
\fi
\if@nameauth@AllCaps\@nameauth@AllThistrue\fi
@@ -187,7 +205,11 @@
\if@nameauth@NBSP\protected@edef\Space{,\nobreakspace}\fi
\fi
\protected@edef\RawShort{\@nameauth@Root{#2}}%
- \protected@edef\CapShort{\@nameauth@CapRoot{#2}}%
+ \if@nameauth@DoCaps
+ \protected@edef\CapShort{\@nameauth@CapRoot{#2}}%
+ \else
+ \let\CapShort\RawShort%
+ \fi
\protected@edef\AllCapShort{\@nameauth@AllCapRoot{#2}}%
\let\IndexShort\RawShort%
\ifx\testb\testbr
@@ -448,6 +470,7 @@
\@nameauth@FirstFormatfalse%
\@nameauth@NBSPfalse%
\@nameauth@DoCapsfalse%
+ \@nameauth@Accentfalse%
\@nameauth@AllThisfalse%
\@nameauth@ShowCommafalse%
\@nameauth@RevThisfalse%
@@ -510,7 +533,11 @@
\fi
\protected@edef\Shortb{\@nameauth@Root{#2}}%
\protected@edef\Shortd{\@nameauth@Root{#4}}%
- \protected@edef\CapShort{\@nameauth@CapRoot{#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%
@@ -697,6 +724,7 @@
\@nameauth@NBSPfalse%
\@nameauth@AltAKAfalse%
\@nameauth@DoCapsfalse%
+ \@nameauth@Accentfalse%
\@nameauth@AllThisfalse%
\@nameauth@ShowCommafalse%
\@nameauth@RevThisfalse%