summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth/nameauth.sty')
-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%