texlive[53940] Master/texmf-dist: nameauth (27feb20)
commits+karl at tug.org
commits+karl at tug.org
Thu Feb 27 23:05:40 CET 2020
Revision: 53940
http://tug.org/svn/texlive?view=revision&revision=53940
Author: karl
Date: 2020-02-27 23:05:40 +0100 (Thu, 27 Feb 2020)
Log Message:
-----------
nameauth (27feb20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/nameauth/examples.tex
trunk/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf
trunk/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
trunk/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
Modified: trunk/Master/texmf-dist/doc/latex/nameauth/examples.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nameauth/examples.tex 2020-02-27 22:05:11 UTC (rev 53939)
+++ trunk/Master/texmf-dist/doc/latex/nameauth/examples.tex 2020-02-27 22:05:40 UTC (rev 53940)
@@ -1,7 +1,20 @@
-%% 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 at 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}
@@ -8,7 +21,14 @@
\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 at processline{\the\verbatim at line\par}}
\newcommand*\StartNum{\setcounter{VerbLine}{0}\def\verbatim at processline{\stepcounter{VerbLine}\leavevmode\llap{\footnotesize\normalfont\theVerbLine\quad}\the\verbatim at line\par}}
\newcommand*\ContinueNum{\def\verbatim at processline{\stepcounter{VerbLine}\leavevmode\llap{\footnotesize\normalfont\theVerbLine\quad}\the\verbatim at 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 @@
\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 @@
\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 @@
\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 @@
\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 @@
\end{verbatim}
\end{quote}
+\def\indexname{\hypertarget{Index}{Index}}
\newpage
\printindex
Modified: trunk/Master/texmf-dist/doc/latex/nameauth/nameauth.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/nameauth/nameauth.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/nameauth/nameauth.dtx 2020-02-27 22:05:11 UTC (rev 53939)
+++ trunk/Master/texmf-dist/source/latex/nameauth/nameauth.dtx 2020-02-27 22:05:40 UTC (rev 53940)
@@ -207,7 +207,7 @@
%<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 @@
%^^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 @@
% \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 @@
% \fi
% \fi
% \fi
-%
+%
% \ClearNum
% \ifDoTikZ
% \tcbset{fonttitle=\bfseries\sffamily,box align=top,lower separated=false}
@@ -2207,12 +2208,12 @@
% \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\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 @@
% \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,9 +3461,9 @@
% \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}
@@ -3469,9 +3470,9 @@
% 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 @@
% 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}.
%
Modified: trunk/Master/texmf-dist/tex/latex/nameauth/nameauth.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nameauth/nameauth.sty 2020-02-27 22:05:11 UTC (rev 53939)
+++ trunk/Master/texmf-dist/tex/latex/nameauth/nameauth.sty 2020-02-27 22:05:40 UTC (rev 53940)
@@ -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 at nameauth@InAKA
\newif\if at nameauth@InName
\newif\if at nameauth@Xref
More information about the tex-live-commits
mailing list.