summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-27 22:05:40 +0000
committerKarl Berry <karl@freefriends.org>2020-02-27 22:05:40 +0000
commitb935377fd30c635540c07c093f3715e2dc29d1c5 (patch)
treee2a0e7e1ddf01f3ba845772dda978f1d361c14c1
parent4d7993d55cbb38c06a220e7ce46c92d8a3f234b4 (diff)
nameauth (27feb20)
git-svn-id: svn://tug.org/texlive/trunk@53940 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/nameauth/examples.tex100
-rw-r--r--Master/texmf-dist/doc/latex/nameauth/nameauth.pdfbin1048607 -> 1049659 bytes
-rw-r--r--Master/texmf-dist/source/latex/nameauth/nameauth.dtx31
-rw-r--r--Master/texmf-dist/tex/latex/nameauth/nameauth.sty2
4 files changed, 98 insertions, 35 deletions
diff --git a/Master/texmf-dist/doc/latex/nameauth/examples.tex b/Master/texmf-dist/doc/latex/nameauth/examples.tex
index 2a71bd75bee..105403ef84e 100644
--- a/Master/texmf-dist/doc/latex/nameauth/examples.tex
+++ b/Master/texmf-dist/doc/latex/nameauth/examples.tex
@@ -1,14 +1,34 @@
-%% This is an example file used with the nameauth package.
-%% See README and nameauth.pdf for copyright info.
-%%
+%--------:| ----------------------------------------------------------------
+%nameauth:| Name authority mechanism for consistency in text and index
+% Author:| Charles P. Schaum
+% E-mail:| charles dot schaum@comcast.net
+% License:| Released under the LaTeX Project Public License 1.3c or later
+% See:| http://www.latex-project.org/lppl.txt
+%
+% This is an example file used with the nameauth package.
+% See README and nameauth.pdf for copyright info.
+%
\documentclass[11pt]{article}
+%
+% This part of the document preamble exists only for backward compatibility in older
+% distributions of LaTeX. It includes the iftex package only if it exists.
+% If the iftex package is older than 2019, it includes the older packages
+% that aid using multiple engines.
+
\IfFileExists{iftex.sty}{\usepackage{iftex}}{}
\unless\ifdefined\RequireTUTeX
\usepackage{ifxetex}
\usepackage{ifluatex}
\usepackage{ifpdf}
\fi
-% Used to create both dvi and pdf output
+%
+% This template can be used when creating both dvi and pdf output. We
+% do not actually use the tikz package in this example file. We set
+% the condition for using tikz with a Boolean flag.
+%
+% If compatibility with specific dvi viewers is not an issue, then
+% one might ignore the use of \ifDoTikZ altogether.
+%
\newif\ifDoTikZ
\ifxetex
\usepackage{fontspec}
@@ -30,7 +50,10 @@
\usepackage[TS1,T1]{fontenc}
\usepackage[american]{babel} % Use own language
\usepackage{lmodern}
- % Perhaps add \usepackage{tikz}
+%
+% There may be a need to include tikz using luatex in dvi mode;
+% that goes beyond the scope of the nameauth package.
+%
\fi
\else
\IfFileExists{utf8-2018.def}{}
@@ -44,18 +67,28 @@
\fi
\fi
\fi
+%
+% Below are the remainder of package inclusions.
+%
\usepackage{booktabs}
\usepackage[textwidth=137mm,textheight=237mm,right=30mm,marginparwidth=30mm,nohead]{geometry}
+\usepackage{makeidx}
\usepackage{nameauth}
\usepackage{verbatim}
-\usepackage{makeidx}
-\usepackage{hyperref}
-
+\usepackage[colorlinks=true]{hyperref}
+%
+% We set up indexing, put margin paragraphs on the left, set up the counter for
+% line numbering in verbatim environments, and set up \ifNoTag for use in the
+% life dates text tagging example.
+%
\makeindex
\reversemarginpar
\newcounter{VerbLine}
\newif\ifNoTag
-
+%
+% We establish name shorthands. Note the heavy use of \noexpand in the macro arguments
+% below. This is intrinsic to the proper function of such arguments.
+%
\begin{nameauth}
\< Adams & John & \noexpand\textSC{Adams} & >
\< SDJR & Sammy & \noexpand\textSC{Davis}, \noexpand\textSC{Jr}. & >
@@ -70,9 +103,13 @@
\< Sutorius & Quintus & \noexpand\SUTOR & >
\< Wash & George & Washington & >
\end{nameauth}
-
+%
+% We set up a text tag here, but we will set more up in the body text.
+%
\NameAddInfo{Demetrius, I}{ Soter}
-
+%
+% Below we establish sort tags for names. Note again the consistent use of \noexpand.
+%
\PretagName[John]{\noexpand\textSC{Adams}}{Adams, John}
\PretagName[Sammy]{\noexpand\textSC{Davis}, \noexpand\textSC{Jr}.}{Davis, Sammy, Jr.}
\PretagName{Demetrius, I}{Demetrius 1}
@@ -93,24 +130,35 @@
\TagName[Martin]{Van Buren}{, president}
\TagName[Ulysses S.]{Grant}{, president}
\TagName[George]{Washington}{, president}
-
+%
+% We set up line numbering in verbatim environments.
+%
\makeatletter
\newcommand*\ClearNum{\def\verbatim@processline{\the\verbatim@line\par}}
\newcommand*\StartNum{\setcounter{VerbLine}{0}\def\verbatim@processline{\stepcounter{VerbLine}\leavevmode\llap{\footnotesize\normalfont\theVerbLine\quad}\the\verbatim@line\par}}
\newcommand*\ContinueNum{\def\verbatim@processline{\stepcounter{VerbLine}\leavevmode\llap{\footnotesize\normalfont\theVerbLine\quad}\the\verbatim@line\par}}
\makeatother
-
+%
+% The default verbatim format is no line numbers.
+% We add title, author, and date.
+%
\ClearNum
\title{\bfseries Longer Examples}
\author{Charles P. Schaum}
-\date{2020/02/20}
+\date{2020/02/26}
\begin{document}
\maketitle
+\tableofcontents
+\bigskip
+
+{\large\bfseries\hyperlink{Index}{Index}}
+\newpage
+
\section{Particles}
-First we use variants with the \(\langle alternate\rangle\) argument:
+First we use variants with the \(\langle Alternate\rangle\) argument:
\begin{quote}\small
\StartNum
\begin{verbatim}
@@ -165,8 +213,9 @@ First we use variants with the \(\langle alternate\rangle\) argument:
\endgroup
\newpage
+\section{Roman Names}
\begingroup
-We want all names in the index, so we define macros that expand one or two components: \textit{praenomen} and \textit{nomen}, \textit{cognomen} and \textit{agnomen}. We begin by defining a name with macros using \verb+\noexpand+ to prevent error:
+We want all names in the index, so we define two macros that expand to be one or two components: \textit{praenomen} and \textit{nomen}; \textit{cognomen} and \textit{agnomen}. Below we want to index under the \textit{cognomen}. We begin by defining a name with macros using \verb+\noexpand+ to prevent error:
\newif\ifSkipGens
\newif\ifNoGens
\newif\ifSkipAgnomen
@@ -176,9 +225,17 @@ We want all names in the index, so we define macros that expand one or two compo
\newcommand*\SCIPii{\ifNoAgnomen Scipio\else
Scipio Africanus\fi}
\newcommand*\ScipioOnly{\SkipAgnomentrue\Scipio}
+%
+% This form of \NamesFormat produces the longest possible name form in the first mention.
+%
\renewcommand*\NamesFormat[1]%
{\ifSkipGens\NoGenstrue\fi\ifSkipAgnomen\NoAgnomentrue\fi#1%
\global\SkipGensfalse\global\SkipAgnomenfalse}
+%
+% If we always wanted to skip the nomen or agnomen in subsequent references, we could
+% force either \NoGenstrue or \NoAgnomentrue in \MainNameHook. The form below is
+% neutral to such preferences and thus, one must set them manually.
+%
\renewcommand*\MainNameHook[1]%
{\ifSkipGens\NoGenstrue\fi\ifSkipAgnomen\NoAgnomentrue\fi#1%
\global\SkipGensfalse\global\SkipAgnomenfalse}
@@ -217,10 +274,14 @@ We want all names in the index, so we define macros that expand one or two compo
\end{quote}
The index entry is fairly lengthy by necessity, governed by the global state of the Boolean flags, and expanding to:
- \begin{quote}
+\begin{quote}
\texttt{\ShowIdxPageref[\noexpand\SCIPi]{\noexpand\SCIPii}}
- \end{quote}
+\end{quote}
+%
+% We can keep the redefined formatting macros above.
+%
+If we want to index under the \textit{nomen}, we take a slightly different approach:
\begin{quote}\small
\StartNum
\begin{verbatim}
@@ -254,7 +315,7 @@ We want all names in the index, so we define macros that expand one or two compo
\section{Alternate Formatting: Inflections}
-In this section we use a scope to contain \verb+\AltFormatActive+ as we show how to implement a simple grammatical inflection.
+In this section we use a scope to contain \verb+\AltFormatActive+ as we show how to implement a simple grammatical inflection. Notice the similarities between handling the Roman names above and the grammatical inflections below this points to a general method when introducing variations into the name macro arguments, while keeping index entries consistent.
\begingroup\AltFormatActive
\newif\ifGenitive
@@ -1371,6 +1432,7 @@ The following equivalent conditional statements can help a macro or just the bod
\end{verbatim}
\end{quote}
+\def\indexname{\hypertarget{Index}{Index}}
\newpage
\printindex
diff --git a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf
index c7eacbb6533..d33860b49ed 100644
--- a/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf
+++ b/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
index 7efca1df6c4..b523a087773 100644
--- a/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
+++ b/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
@@ -207,7 +207,7 @@ the README.txt or README for more information.
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{nameauth}
%<*package>
- [2020/02/20 3.3 Name authority mechanism for consistency in text and index]
+ [2020/02/26 3.4 Name authority mechanism for consistency in text and index]
%</package>
%<*driver>
\documentclass[11pt]{ltxdoc}
@@ -269,7 +269,7 @@ the README.txt or README for more information.
%^^A Set up initial page layout to fit both letter and DIN A4.
\usepackage[textwidth=137mm,textheight=237mm,right=25mm,marginparwidth=40mm,nohead]{geometry}
%^^A Include only this version of the package.
-\usepackage{\jobname}[2020/02/20]
+\usepackage{\jobname}[2020/02/26]
%^^A Set up all tabular information.
\usepackage{booktabs}
\usepackage{colortbl}
@@ -589,6 +589,7 @@ the README.txt or README for more information.
% \changes{2.0}{2015/11/11}{Use dtxgen; prevent bad args}
% \changes{2.5}{2016/04/06}{No default format}
% \changes{3.3}{2020/02/20}{Update manual}
+% \changes{3.4}{2020/02/26}{Update manual, \texttt{examples.tex}}
%
% \GetFileInfo{\jobname.dtx}
%
@@ -619,7 +620,7 @@ the README.txt or README for more information.
% \fi
% \fi
% \fi
-%
+%
% \ClearNum
% \ifDoTikZ
% \tcbset{fonttitle=\bfseries\sffamily,box align=top,lower separated=false}
@@ -2207,12 +2208,12 @@ the README.txt or README for more information.
% \end{tabular}
% \end{quote}
%
-% The Roman naming\Info{Roman names} system does present some challenges. As long as we do not use \cmd{\CapThis}, we do not need alternate formatting (Section~\ref{sec:AltFormat}). Earlier we treated \LCicero[Marcus Tullius] as a Western name. Now we handle Roman names more properly.
+% The Roman naming\Info{Roman names} system does present some challenges. As long as we do not use \cmd{\CapThis}, we do not need alternate formatting (Section~\ref{sec:AltFormat}). Earlier we treated \LCicero[Marcus Tullius] as a Western name. Now we show how to handle Roman names more properly.
%
-% We have a \textit{praenomen}, a personal name. Then we have a \textit{nomen}, a clan name. Finally, we would have a \textit{cognomen}, a nickname, except it became hereditary to denote clan branches. Added to that are \textit{agnomina}, affixed names.
+% Roman names have a \textit{praenomen}, a personal name, then a \textit{nomen}, a clan name, followed by a \textit{cognomen}, a ``nickname,'' except it could be inherited from one's father to denote clan branches. Added to that are \textit{agnomina}, affixed names.
%
% Popular\Info{popular works} sources tend to treat the \textit{cognomen} as we might a surname, with the indexed form: \ShowIdxPageref*[\meta{praenomen} \meta{nomen}]{\meta{cognomen} \meta{agnomen}}.\footnote{See Geiss, \textit{Geschichte Griffbereit}; Kinder and Hilgemann, \textit{dtv-Atlas zur Weltgeschichte}, 2 vols., 29th printing (1964; Munich: Deutscher Taschenbuch Verlag, 1993). For further resources see: \url{http://books.infotoday.com/books/Indexing-names.shtml}. See also \url{https://en.wikipedia.org/wiki/Roman_naming_conventions}.}
-% We want all names in the index, so we define macros in \meta{FNN} and \meta{SNN} that expand one or two components: \textit{praenomen} and \textit{nomen}, \textit{cognomen} and \textit{agnomen}. We begin by defining a name with macros using \cmd{\noexpand} to prevent error:
+% We want all names in the index, so we define macros in \meta{FNN} and \meta{SNN} that expand to become one or two components: \textit{praenomen} and \textit{nomen}; \textit{cognomen} and \textit{agnomen}. We begin by defining a name with macros using \cmd{\noexpand} to prevent error:
%\newif\ifSkipGens
%\newif\ifNoGens
%\newif\ifSkipAgnomen
@@ -2268,7 +2269,7 @@ the README.txt or README for more information.
% The\Info{scholarly works} \textit{Oxford Classical Dictionary} and other scholarly sources index under the \textit{nomen}. That requires a similar approach, but it moves the \textit{nomen} from \meta{FNN} to \meta{SNN}. Although we will not index the name, we will show how to set up \SkipGenstrue\Scipio\ to work in that alternate configuration.
% \newpage
%
-% We keep the Boolean flags as previously created. We redefine the name in the following manner:
+% We keep the Boolean flags and formatting hooks from above. We redefine the name in the following manner:
% \begin{quote}\small
% \StartNum
% \begin{verbatim}
@@ -3444,7 +3445,7 @@ the README.txt or README for more information.
% \bfseries Defaults & \bfseries Name Length & \bfseries Format Hooks & \bfseries Test Path\\\midrule
% \bfseries Pre-First Use & Long & First & False\\
% \rowcolor{black!7!white}\bfseries Subsequent Use\quad\hbox{} & Long or short & Subsequent & True\\\bottomrule
-% \end{tabular}\bigskip\\
+% \end{tabular}\medskip\\
%
% \begin{tabular}{lll}\toprule
% \bfseries Modifications & \bfseries Form & \bfseries Function\\\midrule
@@ -3460,18 +3461,18 @@ the README.txt or README for more information.
% \end{center}
%
% \DescribeMacro{\ForgetName}
-% This macro takes the same arguments as \cmd{\Name}. It ``forgets'' a name, forcing a ``pre-first use'' case. The syntax is:
-% \begin{quote}\small
-% \cmd{\ForgetName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
+% This macro takes the same arguments as \cmd{\Name}. It ``forgets'' a name, forcing a ``pre-first use'' state that will trigger a first-time name use:
+% \begin{quote}
+% \fbox{\mystrut\ \cmd{\ForgetName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\ }
% \end{quote}
%
% \DescribeMacro{\ForgetThis}
% This prefix macro causes the next instance of a naming macro or shorthand to ``forget'' a name before printing it.\Version{3.1} After knowing |\Einstein| ``\Einstein'' we forget him and again have a first reference: |\ForgetThis\Einstein| ``\ForgetThis\Einstein.''\medskip
%
% \DescribeMacro{\SubvertName}
-% This macro takes the same arguments as \cmd{\Name}. It ``subverts'' a name, forcing a ``subsequent use'' case. The syntax is:
+% This macro takes the same arguments as \cmd{\Name}. It ``subverts'' a name, creating a name pattern control sequence and forcing a ``subsequent use'' case:
% \begin{quote}\small
-% \cmd{\SubvertName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}
+% \fbox{\mystrut\ \cmd{\SubvertName}\oarg{FNN}\marg{SNN|,| Affix}\oarg{Alternate}\ }
% \end{quote}
%
% \DescribeMacro{\SubvertThis}
@@ -3785,8 +3786,8 @@ the README.txt or README for more information.
% These convenience macros (an early feature) print a main name and a cross-reference in parentheses:
% \DescribeMacro{\PName*}
% \begin{quote}\small
-% \fbox{\vbox{\hbox{\mystrut\cmd{\PName\ }\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg{xref\,SAFX}\oarg{xref\,Alternate}}\par
-% \hbox{\mystrut\cmd{\PName*}\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg{xref\,SAFX}\oarg{xref\,Alternate}}}}
+% \fbox{\vbox{\hbox{\mystrut\ \cmd{\PName\ }\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg{xref\,SAFX}\oarg{xref\,Alternate}\ }\par
+% \hbox{\mystrut\ \cmd{\PName*}\oarg{FNN}\marg{SAFX}\oarg{xref\,FNN}\marg{xref\,SAFX}\oarg{xref\,Alternate}\ }}}
% \end{quote}
% The starred form \cmd{\PName*} is like the starred form \cmd{\Name*} to the extent that it prints a long form of \meta{FNN}\meta{SAFX}. It does not affect the cross-reference arguments \meta{xref FNN}\meta{xref SAFX}\meta{xref Alternate}.
%
diff --git a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
index eb8220eee73..d780a123dc1 100644
--- a/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
+++ b/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
@@ -15,7 +15,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nameauth}
- [2020/02/20 3.3 Name authority mechanism for consistency in text and index]
+ [2020/02/26 3.4 Name authority mechanism for consistency in text and index]
\newif\if@nameauth@InAKA
\newif\if@nameauth@InName
\newif\if@nameauth@Xref