texlive[50814] Master: keyindex (6apr19)

commits+karl at tug.org commits+karl at tug.org
Sat Apr 6 23:12:39 CEST 2019


Revision: 50814
          http://tug.org/svn/texlive?view=revision&revision=50814
Author:   karl
Date:     2019-04-06 23:12:39 +0200 (Sat, 06 Apr 2019)
Log Message:
-----------
keyindex (6apr19)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/keyindex/
    trunk/Master/texmf-dist/doc/latex/keyindex/README.md
    trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
    trunk/Master/texmf-dist/doc/latex/keyindex/makenameindex
    trunk/Master/texmf-dist/source/latex/keyindex/
    trunk/Master/texmf-dist/source/latex/keyindex/keyindex.dtx
    trunk/Master/texmf-dist/source/latex/keyindex/keyindex.ins
    trunk/Master/texmf-dist/tex/latex/keyindex/
    trunk/Master/texmf-dist/tex/latex/keyindex/keyindex.sty
    trunk/Master/tlpkg/tlpsrc/keyindex.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/keyindex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keyindex/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/keyindex/README.md	2019-04-06 21:12:39 UTC (rev 50814)
@@ -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


Property changes on: trunk/Master/texmf-dist/doc/latex/keyindex/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf	2019-04-06 21:11:50 UTC (rev 50813)
+++ trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf	2019-04-06 21:12:39 UTC (rev 50814)

Property changes on: trunk/Master/texmf-dist/doc/latex/keyindex/keyindex.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/keyindex/makenameindex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keyindex/makenameindex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/keyindex/makenameindex	2019-04-06 21:12:39 UTC (rev 50814)
@@ -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 at indexentry 
+echo
+echo key\|last name, first name is used to disambiguate people with the same 
+echo last name. key at indexentry is used to typeset \<key\> in the text
+echo but index indexentry, e.g., Euklid at 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


Property changes on: trunk/Master/texmf-dist/doc/latex/keyindex/makenameindex
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/keyindex/keyindex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/keyindex/keyindex.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/keyindex/keyindex.dtx	2019-04-06 21:12:39 UTC (rev 50814)
@@ -0,0 +1,206 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2019 by Richard Zach <rzach at 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+ at +\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 at e@\detokenize{#1}}{%
+    \PackageWarning{keyindex}{Index key \detokenize{#1}
+      undefined}%
+    \missingkeyindexformat{#1}}{%
+    \keyindexformat{\@nameuse{kix at e@\detokenize{#1}}}}}
+\newcommand*{\keyindexonly}[2][]{\@ifundefined{kix at e@\detokenize{#2}}{%
+    \PackageWarning{keyindex}{Index key \detokenize{#2}
+      undefined}}{%
+    \ifthenelse{\equal{#1}{}}{%
+      \keyindexcommand{\@nameuse{kix at i@\detokenize{#2}}}}{%
+      \keyindexcommand{\@nameuse{kix at 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 at e@|\meta{key} and |\kix at 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 at e@\detokenize{#1}}{%
+    \@namedef{kix at e@\detokenize{#1}}{#2}%
+    \@namedef{kix at i@\detokenize{#1}}{#3}}{%
+    \PackageWarning{keyindex}{Duplicate definition for keyindex key
+      \detokenize{#1} ignored}}}
+%    \end{macrocode}
+% \Finale
+% \PrintChanges
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/keyindex/keyindex.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/keyindex/keyindex.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/keyindex/keyindex.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/keyindex/keyindex.ins	2019-04-06 21:12:39 UTC (rev 50814)
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2019 by Richard Zach <rzach at 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 at 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

Added: trunk/Master/texmf-dist/tex/latex/keyindex/keyindex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keyindex/keyindex.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/keyindex/keyindex.sty	2019-04-06 21:12:39 UTC (rev 50814)
@@ -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 at 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 at e@\detokenize{#1}}{%
+    \PackageWarning{keyindex}{Index key \detokenize{#1}
+      undefined}%
+    \missingkeyindexformat{#1}}{%
+    \keyindexformat{\@nameuse{kix at e@\detokenize{#1}}}}}
+\newcommand*{\keyindexonly}[2][]{\@ifundefined{kix at e@\detokenize{#2}}{%
+    \PackageWarning{keyindex}{Index key \detokenize{#2}
+      undefined}}{%
+    \ifthenelse{\equal{#1}{}}{%
+      \keyindexcommand{\@nameuse{kix at i@\detokenize{#2}}}}{%
+      \keyindexcommand{\@nameuse{kix at i@\detokenize{#2}}|#1}}}}
+\newcommand{\keyindex}[2][]{\keyindexprint{#2}\keyindexonly[#1]{#2}}
+\newcommand*{\keyindexentry}[3]{%
+  \@ifundefined{kix at e@\detokenize{#1}}{%
+    \@namedef{kix at e@\detokenize{#1}}{#2}%
+    \@namedef{kix at i@\detokenize{#1}}{#3}}{%
+    \PackageWarning{keyindex}{Duplicate definition for keyindex key
+      \detokenize{#1} ignored}}}
+\endinput
+%%
+%% End of file `keyindex.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/keyindex/keyindex.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-04-06 21:11:50 UTC (rev 50813)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-04-06 21:12:39 UTC (rev 50814)
@@ -368,7 +368,8 @@
     jura juraabbrev jurabib juramisc jurarsp js-misc jvlisting
   kalendarium kanaparser kantlipsum karnaugh karnaugh-map karnaughmap kastrup
     kdgdocs kerkis kerntest ketcindy
-    keycommand keyfloat keyreader keystroke keyval2e keyvaltable kix kixfont
+    keycommand keyfloat keyindex keyreader keystroke
+    keyval2e keyvaltable kix kixfont
     knitting knittingpattern knowledge knuth knuth-lib knuth-local
     koma-moderncvclassic koma-script koma-script-examples koma-script-sfs
     komacv komacv-rg kotex-oblivoir kotex-plain kotex-utf kotex-utils

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2019-04-06 21:11:50 UTC (rev 50813)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2019-04-06 21:12:39 UTC (rev 50814)
@@ -602,6 +602,7 @@
 depend keycommand
 depend keyfloat
 depend keyreader
+depend keyindex
 depend keystroke
 depend keyval2e
 depend keyvaltable

Added: trunk/Master/tlpkg/tlpsrc/keyindex.tlpsrc
===================================================================


More information about the tex-live-commits mailing list