diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-09 22:07:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-09 22:07:42 +0000 |
commit | 4c2acc4b5fba61a4dd1e116e1e40358dfaadeeae (patch) | |
tree | d787d79766a5d933ec8638d9fe4cbc800e902932 /Master/texmf-dist/tex/latex/nameauth/nameauth.sty | |
parent | da75399fa67dfc3762a412343ca661ea0ac74952 (diff) |
nameauth (9feb24)
git-svn-id: svn://tug.org/texlive/trunk@69758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nameauth/nameauth.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/nameauth/nameauth.sty | 188 |
1 files changed, 98 insertions, 90 deletions
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty index 219f26b5959..0e1f6a07cc8 100644 --- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty +++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2023 by Charles P. Schaum <charles[dot]schaum@comcast.net> +%% Copyright (C) 2024 by Charles P. Schaum <charles[dot]schaum@comcast.net> %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{nameauth} - [2023/02/03 3.7 Name authority mechanism for consistency in text and index] + [2024/02/09 4.0 Name authority mechanism for consistency in text and index] \newif\if@nameauth@InAKA \newif\if@nameauth@InName \newif\if@nameauth@Lock @@ -73,6 +73,7 @@ \newif\if@nameauth@OldReset \newif\if@nameauth@OldPass \newif\if@nameauth@OldToks +\newif\if@nameauth@OldArgs \newtoks\@nameauth@toksa \newtoks\@nameauth@toksb \newtoks\@nameauth@toksc @@ -122,14 +123,18 @@ \DeclareOption{oldpass}{\@nameauth@OldPasstrue} \DeclareOption{oldtoks}{\@nameauth@OldTokstrue} \DeclareOption{oldsee}{\@nameauth@OldSeetrue} +\DeclareOption{oldargs}{\@nameauth@OldArgstrue} \ExecuteOptions {nocomma,mainmatter,index,pretag, normalcaps,notreversed,noformat} \ProcessOptions\relax \RequirePackage{etoolbox} \RequirePackage{trimspaces} -\RequirePackage{suffix} -\RequirePackage{xargs} +\RequirePackage{xparse} +\if@nameauth@OldArgs + \RequirePackage{xargs} + \RequirePackage{suffix} +\fi \newcommand*\@nameauth@Clean[1] {\expandafter\zap@space\detokenize{#1} \@empty} \newcommand*\@nameauth@MakeCS[1] @@ -420,7 +425,7 @@ \endgroup% \global\@nameauth@LongIdxDebugfalse% } -\newcommandx*\@nameauth@Name[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\@nameauth@Name}{O{} m O{}} {% \if@nameauth@BigLock \@nameauth@Locktrue\fi \unless\if@nameauth@Lock @@ -705,15 +710,12 @@ {\@nameauth@DoIndexfalse\@nameauth@BigLocktrue} \newcommand*\NamesInactive{\@nameauth@MainFormatfalse} \newcommand*\NamesActive{\@nameauth@MainFormattrue} -\newcommand*\AltFormatActive +\NewDocumentCommand{\AltFormatActive}{s} {% \global\@nameauth@AltFormattrue% - \global\@nameauth@DoAlttrue% -} -\WithSuffix{\newcommand*}\AltFormatActive* -{% - \global\@nameauth@AltFormattrue% - \global\@nameauth@DoAltfalse% + \IfBooleanTF{#1} + {\global\@nameauth@DoAltfalse} + {\global\@nameauth@DoAlttrue}% } \newcommand*\AltFormatInactive {\global\@nameauth@AltFormatfalse\global\@nameauth@DoAltfalse} @@ -805,12 +807,14 @@ }% \fi } -\newcommand\Name{\NameauthName} -\WithSuffix{\newcommand*}\Name* - {\@nameauth@FullNametrue\NameauthLName} -\newcommand\FName +\NewDocumentCommand{\Name}{s} +{% + \IfBooleanTF{#1} + {\@nameauth@FullNametrue\NameauthLName} + {\NameauthName}% +} +\NewDocumentCommand{\FName}{s} {\@nameauth@FirstNametrue\NameauthFName} -\WithSuffix{\newcommand*}\FName*{\FName} \newenvironment{nameauth} {% \begingroup% @@ -907,26 +911,28 @@ }\ignorespaces% } {\endgroup\ignorespaces} -\newcommandx*\ShowPattern[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ShowPattern}{O{} m O{}} {% \@nameauth@Error{#2}{macro: \string\ShowPattern}% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Choice{}{}{}\NameauthPattern% } -\newcommandx*\ShowIdxPageref[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ShowIdxPageref}{s O{} m O{}} {% - \@nameauth@Error{#2}{macro: \string\ShowIdxPageref}% - \@nameauth@LoadArgs{#1}{#2}{#3}% - \global\@nameauth@LongIdxDebugtrue% - \@nameauth@IdxPageref{#1}{#2}{#3}% -} -\WithSuffix{\newcommandx*}\ShowIdxPageref*[3][1=\@empty, 3=\@empty] -{% - \@nameauth@Error{#2}{macro: \string\ShowIdxPageref*}% - \@nameauth@LoadArgs{#1}{#2}{#3}% - \@nameauth@IdxPageref{#1}{#2}{#3}% + \IfBooleanTF {#1}% + {% + \@nameauth@Error{#3}{macro: \string\ShowIdxPageref*}% + \@nameauth@LoadArgs{#2}{#3}{#4}% + \@nameauth@IdxPageref{#2}{#3}{#4}% + }% + {% + \@nameauth@Error{#3}{macro: \string\ShowIdxPageref}% + \@nameauth@LoadArgs{#2}{#3}{#4}% + \global\@nameauth@LongIdxDebugtrue% + \@nameauth@IdxPageref{#2}{#3}{#4}% + }% } -\newcommandx*\ShowNameInfo[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ShowNameInfo}{O{} m O{}} {% \@nameauth@Error{#2}{macro: \string\ShowNameInfo}% \@nameauth@LoadArgs{#1}{#2}{#3}% @@ -934,7 +940,7 @@ {% (SNN: \expandafter\detokenize\expandafter{\@nameauth@B})% \unless\ifx\@nameauth@SB\@empty - \ (Affix [FNN, other]: + \ (Affix*: \expandafter\detokenize\expandafter{\@nameauth@SB})% \fi \unless\ifx\@nameauth@C\@empty @@ -945,7 +951,7 @@ {% (SNN: \expandafter\detokenize\expandafter{\@nameauth@B})% \unless\ifx\@nameauth@C\@empty - \ (Alt [FNN, other]: + \ (Alt*: \expandafter\detokenize\expandafter{\@nameauth@C})% \fi }% @@ -962,7 +968,7 @@ \fi }% } -\newcommandx\ShowNameState[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ShowNameState}{O{} m O{}} {% \begingroup% \@nameauth@Error{#2}{macro: \string\NamePatterns}% @@ -1033,7 +1039,7 @@ \ifdefined \@nameauth@db\ \@nameauth@db \fi \endgroup% } -\newcommandx*\IndexName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IndexName}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\IndexName}% @@ -1119,7 +1125,7 @@ \fi }% } -\newcommandx*\IndexRef[4][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IndexRef}{O{} m O{} m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \protected@edef\@nameauth@Target{#4}% @@ -1367,7 +1373,7 @@ \global\@nameauth@SeeAlsofalse% \fi } -\newcommandx*\ExcludeName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ExcludeName}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\ExcludeName}% @@ -1401,35 +1407,37 @@ \csxdef{\NameauthPattern!PN}{\@nameauth@Exclude}% \fi } -\newcommandx*\IncludeName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IncludeName}{s O{} m O{}} {% - \@nameauth@LoadArgs{#1}{#2}{#3}% - \@nameauth@Error{#2}{macro \string\IncludeName}% - \@nameauth@Choice - {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2}}} - {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}} - {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#1 #2}}}% - \ifcsname\NameauthPattern!PN\endcsname - \edef\@nameauth@testex - {\csname\NameauthPattern!PN\endcsname}% - \ifx\@nameauth@testex\@nameauth@Exclude - \global\csundef{\NameauthPattern!PN}% - \else - \if@nameauth@Verbose - \PackageWarning{nameauth} - {\string\IncludeName: extant xref \@nameauth@Temp}% + \IfBooleanTF {#1}% + {% + \@nameauth@LoadArgs{#2}{#3}{#4}% + \@nameauth@Error{#3}{macro \string\IncludeName*}% + \@nameauth@Choice{}{}{}% + \global\csundef{\NameauthPattern!PN}% + }% + {% + \@nameauth@LoadArgs{#2}{#3}{#4}% + \@nameauth@Error{#3}{macro \string\IncludeName}% + \@nameauth@Choice + {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#3}}} + {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#3 #4}}} + {\def\@nameauth@Temp{\expandafter\detokenize\expandafter{#2 #3}}}% + \ifcsname\NameauthPattern!PN\endcsname + \edef\@nameauth@testex + {\csname\NameauthPattern!PN\endcsname}% + \ifx\@nameauth@testex\@nameauth@Exclude + \global\csundef{\NameauthPattern!PN}% + \else + \if@nameauth@Verbose + \PackageWarning{nameauth} + {\string\IncludeName: extant xref \@nameauth@Temp}% + \fi \fi \fi - \fi -} -\WithSuffix{\newcommandx*}\IncludeName*[3][1=\@empty, 3=\@empty] -{% - \@nameauth@LoadArgs{#1}{#2}{#3}% - \@nameauth@Error{#2}{macro \string\IncludeName*}% - \@nameauth@Choice{}{}{}% - \global\csundef{\NameauthPattern!PN}% + }% } -\newcommandx*\PretagName[4][1=\@empty, 3=\@empty] +\NewDocumentCommand{\PretagName}{O{} m O{} m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\PretagName}% @@ -1455,7 +1463,7 @@ {\string\PretagName: deactivated}% \fi } -\newcommandx*\TagName[4][1=\@empty, 3=\@empty] +\NewDocumentCommand{\TagName}{O{} m O{} m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\TagName}% @@ -1479,21 +1487,21 @@ \csgdef{\NameauthPattern!TAG}{#4}% \fi } -\newcommandx*\UntagName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\UntagName}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\UntagName}% \@nameauth@Choice{}{}{}% \global\csundef{\NameauthPattern!TAG}% } -\newcommandx\NameAddInfo[4][1=\@empty, 3=\@empty] +\NewDocumentCommand{\NameAddInfo}{O{} m O{} +m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\NameAddInfo}% \@nameauth@Choice{}{}{}% \csgdef{\NameauthPattern!DB}{#4}% } -\newcommandx*\NameQueryInfo[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\NameQueryInfo}{O{} m O{}} {% \unless\if@nameauth@BigLock \@nameauth@LoadArgs{#1}{#2}{#3}% @@ -1504,14 +1512,14 @@ \fi \fi } -\newcommandx*\NameClearInfo[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\NameClearInfo}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\NameClearInfo}% \@nameauth@Choice{}{}{}% \global\csundef{\NameauthPattern!DB}% } -\newcommandx\IfMainName[5][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IfMainName}{O{} m O{} +m +m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\IfMainName}% @@ -1522,7 +1530,7 @@ \if@nameauth@GlobalScope #5\else {#5}\fi \fi }% -\newcommandx\IfFrontName[5][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IfFrontName}{O{} m O{} +m +m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\IfFrontName}% @@ -1533,7 +1541,7 @@ \if@nameauth@GlobalScope #5\else {#5}\fi \fi } -\newcommandx\IfAKA[6][1=\@empty, 3=\@empty] +\NewDocumentCommand{\IfAKA}{O{} m O{} +m +m +m} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\IfAKA}% @@ -1550,7 +1558,7 @@ \if@nameauth@GlobalScope #5\else {#5}\fi \fi } -\newcommandx*\ForgetName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\ForgetName}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\ForgetName}% @@ -1566,7 +1574,7 @@ \global\csundef{\NameauthPattern!NF}% \fi } -\newcommandx*\SubvertName[3][1=\@empty, 3=\@empty] +\NewDocumentCommand{\SubvertName}{O{} m O{}} {% \@nameauth@LoadArgs{#1}{#2}{#3}% \@nameauth@Error{#2}{macro \string\SubvertName}% @@ -1582,11 +1590,12 @@ \csgdef{\NameauthPattern!NF}{}% \fi } -\newcommandx*\AKA[5][1=\@empty, 3=\@empty, 5=\@empty] +\NewDocumentCommand{\AKA}{s O{} m O{} m O{}} {% \if@nameauth@BigLock \@nameauth@Locktrue% \fi + \IfBooleanTF {#1}{\@nameauth@AltAKAtrue}{}% \unless\if@nameauth@Lock \@nameauth@Locktrue% \@nameauth@InAKAtrue% @@ -1595,27 +1604,27 @@ \else \global\@nameauth@JustIndexfalse% \fi - \@nameauth@Error{#2}{macro \string\AKA}% - \@nameauth@Error{#4}{macro \string\AKA}% + \@nameauth@Error{#3}{macro \string\AKA}% + \@nameauth@Error{#5}{macro \string\AKA}% \leavevmode\hbox{}% - \protected@edef\@nameauth@Ai{\trim@spaces{#1}}% - \protected@edef\@nameauth@Bi{\@nameauth@Root{#2}}% - \protected@edef\@nameauth@Si{\@nameauth@Suffix{#2}}% - \@nameauth@Parse{#3}{#4}{#5}{!PN}% + \protected@edef\@nameauth@Ai{\trim@spaces{#2}}% + \protected@edef\@nameauth@Bi{\@nameauth@Root{#3}}% + \protected@edef\@nameauth@Si{\@nameauth@Suffix{#3}}% + \@nameauth@Parse{#4}{#5}{#6}{!PN}% \unless\if@nameauth@SkipIndex \ifx\@nameauth@Ai\@empty \ifx\@nameauth@Si\@empty - \IndexRef[#3]{#4}[#5]{\@nameauth@Bi}% + \IndexRef[#4]{#5}[#6]{\@nameauth@Bi}% \else - \IndexRef[#3]{#4}[#5] + \IndexRef[#4]{#5}[#6] {\@nameauth@Bi\@nameauth@space\@nameauth@Si}% \fi \else \ifx\@nameauth@Si\@empty - \IndexRef[#3]{#4}[#5] + \IndexRef[#4]{#5}[#6] {\@nameauth@Bi,\@nameauth@space\@nameauth@Ai}% \else - \IndexRef[#3]{#4}[#5] + \IndexRef[#4]{#5}[#6] {\@nameauth@Bi,\@nameauth@space \@nameauth@Ai,\@nameauth@space\@nameauth@Si}% \fi @@ -1627,9 +1636,9 @@ \fi \if@nameauth@Punct\expandafter\@nameauth@CheckDot\fi } -\WithSuffix{\newcommand*}\AKA*{\@nameauth@AltAKAtrue \AKA} -\newcommandx*\PName[5][1=\@empty,3=\@empty,5=\@empty] +\NewDocumentCommand{\PName}{s O{} m O{} m O{}} {% + \IfBooleanTF {#1}{\@nameauth@FullNametrue}{}% \if@nameauth@OldReset \@nameauth@JustIndexfalse% \else @@ -1639,14 +1648,14 @@ \unless\if@nameauth@OldReset \global\@nameauth@SeeAlsofalse% \fi - \NameauthName[#1]{#2} (\SkipIndex\AKA[#1]{#2}[#3]{#4}[#5])% + \NameauthName[#2]{#3} (\SkipIndex\AKA[#2]{#3}[#4]{#5}[#6])% \else \if@nameauth@SeeAlso - \@nameauth@SeeAlsofalse\NameauthName[#1]{#2} - \@nameauth@SeeAlsotrue(\AKA[#1]{#2}[#3]{#4}[#5])% + \@nameauth@SeeAlsofalse\NameauthName[#2]{#3} + \@nameauth@SeeAlsotrue(\AKA[#2]{#3}[#4]{#5}[#6])% \else - \NameauthName[#1]{#2} - (\AKA[#1]{#2}[#3]{#4}[#5])% + \NameauthName[#2]{#3} + (\AKA[#2]{#3}[#4]{#5}[#6])% \fi \fi \if@nameauth@SkipIndex @@ -1654,7 +1663,6 @@ {\string\SkipIndex still active after \string\PName; check}% \fi } -\WithSuffix{\newcommand*}\PName*{\@nameauth@FullNametrue \PName} \endinput %% %% End of file `nameauth.sty'. |