summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-06 21:12:39 +0000
committerKarl Berry <karl@freefriends.org>2019-04-06 21:12:39 +0000
commita214e25aa35703933434387c49111d827d19ebca (patch)
tree12e128e6b383b8cbc114c088360f88206345187f /Master/texmf-dist
parentcb80c8476ad28cf03650f087acc7062a148268a6 (diff)
keyindex (6apr19)
git-svn-id: svn://tug.org/texlive/trunk@50814 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/keyindex/README.md10
-rw-r--r--Master/texmf-dist/doc/latex/keyindex/keyindex.pdfbin0 -> 144968 bytes
-rwxr-xr-xMaster/texmf-dist/doc/latex/keyindex/makenameindex31
-rw-r--r--Master/texmf-dist/source/latex/keyindex/keyindex.dtx206
-rw-r--r--Master/texmf-dist/source/latex/keyindex/keyindex.ins55
-rw-r--r--Master/texmf-dist/tex/latex/keyindex/keyindex.sty60
6 files changed, 362 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/keyindex/README.md b/Master/texmf-dist/doc/latex/keyindex/README.md
new file mode 100644
index 00000000000..8a2d6f821b5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/keyindex/README.md
@@ -0,0 +1,10 @@
+keyindex
+========
+
+A LaTeX package that functionality for producing an index without
+directly entering index entries into the text using the \index
+command, but instead by looking up short keys and printing a
+predefined string in the main text and adding a corresponding index
+entry. The standard use case is the production of an index of names.
+
+It is distributed under the terms of the LPPL 1.3c
diff --git a/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf b/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
new file mode 100644
index 00000000000..c60d626560e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/keyindex/makenameindex b/Master/texmf-dist/doc/latex/keyindex/makenameindex
new file mode 100755
index 00000000000..32e70da4199
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/keyindex/makenameindex
@@ -0,0 +1,31 @@
+if [ -z $1 ]; then
+echo usage: makenameindex infile
+echo
+echo Produces a file infile.kix, suitable for importing in the preamble of
+echo a LaTeX file, which provides the command \name\<key\>. Usually, \<key\>
+echo will be a last name, and \name\<key\> will insert the last name in the
+echo text as well as an index entry of the form last name, first name. The
+echo file is generated from infile.txt, which contains lines of the form
+echo
+echo last name, first name
+echo key\|last name, first name
+echo key@indexentry
+echo
+echo key\|last name, first name is used to disambiguate people with the same
+echo last name. key@indexentry is used to typeset \<key\> in the text
+echo but index indexentry, e.g., Euklid@Euclid.
+else
+echo makenameindex $1.txt, writing to $1.kix
+for key in `grep -o '^[^|@,]*' $1.txt` ; do
+if [ `grep -c "^$key[|@,]" $1.txt` -gt 1 ]; then
+ echo "Key $key defined more than once!"
+fi
+done
+echo "% $1.kix" > $1.kix
+echo "% Generated from $1.txt on `date`" >> $1.kix
+grep '|' $1.txt | sed 's/^\([^|]*\)|\([^,]*\), *\(.*\)/\\keyindexentry{\1}{\2}{\2, \3}/' >>$1.kix
+grep '@' $1.txt | grep -v '@.*@' | sed 's/^\([^@]*\)@\(.*\)/\\keyindexentry{\1}{\1}{\2}/' >>$1.kix
+grep '@' $1.txt | grep '@.*@' | sed 's/^\([^@]*\)@\([^@]*\)@\(.*\)/\\keyindexentry{\1}{\2}{\3}/' >>$1.kix
+grep -v '[|@]' $1.txt | sed 's/^\([^,]*\), *\(.*\)/\\keyindexentry{\1}{\1}{\1, \2}/' >>$1.kix
+sort -o $1.kix $1.kix
+fi \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/keyindex/keyindex.dtx b/Master/texmf-dist/source/latex/keyindex/keyindex.dtx
new file mode 100644
index 00000000000..0a14a9035ef
--- /dev/null
+++ b/Master/texmf-dist/source/latex/keyindex/keyindex.dtx
@@ -0,0 +1,206 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2019 by Richard Zach <rzach@ucalgary.ca>
+% -------------------------------------------------------
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{keyindex.sty}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{keyindex}
+%<*package>
+ [2019/04/05 1.0 Index entries by key lookup]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{keyindex}
+\usepackage[hidelinks]{hyperref}
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{keyindex.dtx}
+ \PrintChanges
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{61}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+%
+% \changes{v1.0}{2019/04/05}{Initial version}
+%
+% \GetFileInfo{keyindex.sty}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+% \title{The \textsf{keyindex} package\thanks{This document
+% corresponds to \textsf{keyindex}~\fileversion, dated \filedate.}}
+% \author{\href{http://richardzach.org/}{Richard Zach}}
+% \date{}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% The |keyindex| package provides functionality for producing an index
+% without directly entering index entries into the text using the
+% |\index| command, but instead by looking up short keys and printing a
+% predefined string in the main text and adding a corresponding index
+% entry. The standard use case is the production of an index of names:
+% Rather than having to write in the text, e.g.,
+% ``|Einstein\index{Einstein, Albert}|'' every time, write
+% ``|\keyindex{Einstein}|,'' which produces ``Einstein'' in the text
+% and an index entry under ``Einstein, Albert''. Of course, the
+% correct index entries must be collected somewhere.
+%
+% The package distribution also includes a bash script |makenameindex|
+% which produces a key index file for use with |keyindex| from a text
+% file with entries of the form
+% \begin{quote}
+% \meta{last name}, \meta{first name}\\
+% \meta{key}\verb+|+\meta{last name}, \meta{first name}\\
+% \meta{key}\verb+@+\meta{indexentry}
+% \end{quote}
+%
+% \section{Interactions}
+%
+% |keyindex| requires the |ifthen| package.
+%
+% \section{Usage}
+%
+% \DescribeMacro{\keyindex}
+% |\keyindex|\oarg{index option}\marg{key}
+% prints the text associated with index key \meta{key} (using the hooks
+% |\keyindexformat| and |\missingkeyindexformat|) followed by an index
+% entry for \meta{key}. The
+% index entry is generated using the hook |\keyindexcommand| and the
+% optional argument \meta{index option} is added to the argument of
+% |\keyindexcommand| after a \verb+|+. For instance,
+% |\keyindex[(]{Einstein}| might produce the same as \begin{center}
+% \verb+Einstein\index{Einstein, Albert|(}+.\end{center}
+% \DescribeMacro{\keyindexprint}
+% \DescribeMacro{\keyindexonly}
+% |\keyindexprint|\marg{key} prints only the text corresponding to
+% \meta{key}, but doesn't add anything to the index.
+% |\keyindexonly|\marg{key}\oarg{index option} only adds the index entry
+% but doesn't print anything in the text.
+%
+% \DescribeMacro{\keyindexfile} |\keyindexfile|\marg{file} will load
+% the index key definitions from \meta{file}|.kix|, which is assumed to
+% contain only a list of lines of the form \begin{center}|\keyindexentry|
+% \marg{key}\marg{print text}\marg{index text}\end{center}
+% If it is not called, |keyindex| will use
+% |\jobname.kix| as default. This must be used in the preamble.
+%
+% \DescribeMacro{\keyindexformat}
+% \DescribeMacro{\missingkeyindexformat}
+% \DescribeMacro{\keyindexcommand}
+% These are hooks to carry out the formatting in the text of the text
+% corresponding to an index entry, or adding the entry to the index.
+% They can be redefined using |\renewcommand|. By default,
+% |\keyindexformat|\marg{text} just adds \meta{text} to the document,
+% |\missingkeyindexformat|\marg{text} adds |\textbf|\marg{text}, and
+% |\keyindexcommand|\marg{text} issues |\index|\marg{text}.
+% \StopEventually{}
+% \section{Implementation}
+% \subsection{Setup}
+% \begin{macrocode}
+\RequirePackage{ifthen}
+% \end{macrocode}
+% |\keyindexfile| sets |\@keyindexfile| to its argument; we set
+% |\@keyindexfile| to default to |\jobname.kix|
+% \begin{macrocode}
+\newcommand*{\keyindexfile}[1]{%
+ \renewcommand*{\@keyindexfile}{#1}}
+\newcommand*{\@keyindexfile}{\jobname.kix}
+% \end{macrocode}
+% |\keyindexformat| formats index text;
+% default: just prints argument.
+% \begin{macrocode}
+\newcommand*{\keyindexformat}[1]{#1}
+% \end{macrocode}
+% |\missingkeyindexformat| prints index key when not defined;
+% by default, |\textbf|.
+% \begin{macrocode}
+\newcommand*{\missingkeyindexformat}[1]{%
+ \textbf{#1}}
+% \end{macrocode}
+% |\keyindexcommand|\marg{index text} adds \marg{index text} to the
+% index; by default, it does |\index|\marg{index text} but can be redefined.
+% \begin{macrocode}
+\newcommand*{\keyindexcommand}[1]{\index{#1}}
+% \end{macrocode}
+% At the beginning of the document, we read the index key definition file
+% \begin{macrocode}
+\AtBeginDocument{%
+ \InputIfFileExists{\@keyindexfile}{%
+ \PackageInfo{keyindex}{Using index key definition file
+ \@keyindexfile.}}{%
+ \PackageWarning{keyindex}{No index key definition file
+ \@keyindexfile!}}}
+% \end{macrocode}
+% |\keyindex|\oarg{index option}\marg{key} prints text for key \meta{key}, and indexes it (with
+% \verb+|+\meta{index option}, if present). Printing is done by |\keyindexprint|,
+% indexing by |\keyindexonly|. If the key is undefined, we issue a
+% warning and print the key (using |\missingkeyindexformat|), not its replacement text.
+% \begin{macrocode}
+\newcommand*{\keyindexprint}[1]{\@ifundefined{kix@e@\detokenize{#1}}{%
+ \PackageWarning{keyindex}{Index key \detokenize{#1}
+ undefined}%
+ \missingkeyindexformat{#1}}{%
+ \keyindexformat{\@nameuse{kix@e@\detokenize{#1}}}}}
+\newcommand*{\keyindexonly}[2][]{\@ifundefined{kix@e@\detokenize{#2}}{%
+ \PackageWarning{keyindex}{Index key \detokenize{#2}
+ undefined}}{%
+ \ifthenelse{\equal{#1}{}}{%
+ \keyindexcommand{\@nameuse{kix@i@\detokenize{#2}}}}{%
+ \keyindexcommand{\@nameuse{kix@i@\detokenize{#2}}|#1}}}}
+\newcommand{\keyindex}[2][]{\keyindexprint{#2}\keyindexonly[#1]{#2}}
+% \end{macrocode}
+% The file |\@keyindexfile| must contain lines of the form
+% |\keyindexentry|\marg{key}\marg{text}\marg{index entry}. It is read at
+% the beginning of the document and for each key, defines commands
+% |\kix@e@|\meta{key} and |\kix@i@|\meta{key} which evaluate to \meta{text}
+% and \meta{index entry}, respectively. Duplicate definitions are
+% ignored but generate a warning.
+% \begin{macrocode}
+\newcommand*{\keyindexentry}[3]{%
+ \@ifundefined{kix@e@\detokenize{#1}}{%
+ \@namedef{kix@e@\detokenize{#1}}{#2}%
+ \@namedef{kix@i@\detokenize{#1}}{#3}}{%
+ \PackageWarning{keyindex}{Duplicate definition for keyindex key
+ \detokenize{#1} ignored}}}
+% \end{macrocode}
+% \Finale
+% \PrintChanges
+\endinput
diff --git a/Master/texmf-dist/source/latex/keyindex/keyindex.ins b/Master/texmf-dist/source/latex/keyindex/keyindex.ins
new file mode 100644
index 00000000000..0004ebe4366
--- /dev/null
+++ b/Master/texmf-dist/source/latex/keyindex/keyindex.ins
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2019 by Richard Zach <rzach@ucalgary.ca>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/keyindex}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2019 by Richard Zach <rzach@ucalgary.ca>
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c of this license
+or (at your option) any later version. The latest version of this
+license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX version
+2005/12/01 or later.
+
+\endpreamble
+
+\generate{\file{keyindex.sty}{\from{keyindex.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* keyindex.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file keyindex.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/tex/latex/keyindex/keyindex.sty b/Master/texmf-dist/tex/latex/keyindex/keyindex.sty
new file mode 100644
index 00000000000..eec7d13372a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/keyindex/keyindex.sty
@@ -0,0 +1,60 @@
+%%
+%% This is file `keyindex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% keyindex.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2019 by Richard Zach <rzach@ucalgary.ca>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{keyindex}
+ [2019/04/05 1.0 Index entries by key lookup]
+\RequirePackage{ifthen}
+\newcommand*{\keyindexfile}[1]{%
+ \renewcommand*{\@keyindexfile}{#1}}
+\newcommand*{\@keyindexfile}{\jobname.kix}
+\newcommand*{\keyindexformat}[1]{#1}
+\newcommand*{\missingkeyindexformat}[1]{%
+ \textbf{#1}}
+\newcommand*{\keyindexcommand}[1]{\index{#1}}
+\AtBeginDocument{%
+ \InputIfFileExists{\@keyindexfile}{%
+ \PackageInfo{keyindex}{Using index key definition file
+ \@keyindexfile.}}{%
+ \PackageWarning{keyindex}{No index key definition file
+ \@keyindexfile!}}}
+\newcommand*{\keyindexprint}[1]{\@ifundefined{kix@e@\detokenize{#1}}{%
+ \PackageWarning{keyindex}{Index key \detokenize{#1}
+ undefined}%
+ \missingkeyindexformat{#1}}{%
+ \keyindexformat{\@nameuse{kix@e@\detokenize{#1}}}}}
+\newcommand*{\keyindexonly}[2][]{\@ifundefined{kix@e@\detokenize{#2}}{%
+ \PackageWarning{keyindex}{Index key \detokenize{#2}
+ undefined}}{%
+ \ifthenelse{\equal{#1}{}}{%
+ \keyindexcommand{\@nameuse{kix@i@\detokenize{#2}}}}{%
+ \keyindexcommand{\@nameuse{kix@i@\detokenize{#2}}|#1}}}}
+\newcommand{\keyindex}[2][]{\keyindexprint{#2}\keyindexonly[#1]{#2}}
+\newcommand*{\keyindexentry}[3]{%
+ \@ifundefined{kix@e@\detokenize{#1}}{%
+ \@namedef{kix@e@\detokenize{#1}}{#2}%
+ \@namedef{kix@i@\detokenize{#1}}{#3}}{%
+ \PackageWarning{keyindex}{Duplicate definition for keyindex key
+ \detokenize{#1} ignored}}}
+\endinput
+%%
+%% End of file `keyindex.sty'.