%%
%% 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'.
