%%
%% This is file `docindex.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% docindex.dtx  (with options: `pkg,template')
%% 
%% This file may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%% 
%% This file may only be distributed together with a copy of the source
%% file from which it was generated. You may distribute that source file
%% without this generated file.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
   {docindex}
   [2001/04/11 v1.00 doc index formatting package]
\RequirePackage{multicol}
\RequirePackage{xdoc2}[2001/03/26]
\DeclareOption{oldkeywords}{}
\DeclareOption{usedocindexps}{}
\ProcessOptions\relax
\newcommand\indexitem{%
   \relax
   \expandafter\DI@indexitem \expandafter{\DI@last@level}%
}%
\def\DI@indexitem#1#2#3#4{%
   \edef\DI@last@level{\number#2\expandafter}%
   \ifnum #4=9
      \expandafter\expandafter \expandafter\DI@indexitem@
   \fi
   \csname DI@indexitem@\romannumeral#2\expandafter\endcsname
      {#1}{#4}{#3}\NoValue
}
\def\DI@indexitem@#1#2#3#4#5#6#7{#1{#2}{#7}{#4}{#6}}
\def\DI@last@level{0}
\@ifundefined{indexnewletter}{}{%
   \PackageInfo
      {docindex}
      {Command \protect\indexnewletter\space redefined}
}
\outer\def\indexnewletter#1#2#3{%
   \DI@item@nojoin
   \ifnum #1=\z@ \vspace{\DI@letter@skip}\fi
   \DI@letter@format{#2}%
   \def\DI@last@level{0}%
   \let\DI@item@join\@firstofone
   \let\DI@item@nojoin\@empty
}
\@ifpackagewith
   {docindex}
   {oldkeywords}{}{
   \edef\XD@index@keyword{\@backslashchar xdocindexentry}
   \let\XD@glossary@keyword\XD@index@keyword
   \def\XD@page@compositor{\@backslashchar +}
}
\def\DI@ind@setup{\bgroup
   \def\docindexguard##1{\egroup}%
   \def\begin##1{%
      \egroup
      \PackageWarningNoLine
         {docindex}%
         {Ignoring old style index file}
      \endinput
   }%
}
\RequirePackage{xhj,galley2}
\DeclareInstance{justification}{indexitem1}{single}{
   leftskip=30pt, rightskip=15pt, startskip=-30pt, parfillskip=-15pt,
   linefillskip=0pt plus 1fil, parindent=0pt
}
\DeclareInstance{justification}{indexitem2}{single}{
   leftskip=30pt, rightskip=15pt, startskip=-15pt, parfillskip=-15pt,
   linefillskip=0pt plus 1fil, parindent=0pt
}
\DeclareInstance{justification}{indexitem3}{single}{
   leftskip=30pt, rightskip=15pt, startskip=-5pt, parfillskip=-15pt,
   linefillskip=0pt plus 1fil, parindent=0pt
}
\DeclareTemplateType{indexitem}{4}
\let\DI@item@join=\@firstofone
\let\DI@item@nojoin=\@empty
\DeclareTemplate{indexitem}{fixed}{4}{
   justification-setup =i{justification}      \DI@item@justification,
   pre-join      =b
                                               DI@prejoin@,
   nofig-action  =f1
                                              \DI@nofig,
   fig-action    =f2
                                              \DI@hasfig,
   post-join     =b
                                               DI@postjoin@,
   nojoin-extra    =f0
                                              \DI@nojoin@extra,
   join-extra    =f0
                                              \DI@join@extra,
   offjoin-extra =f0
                                              \DI@offjoin@extra
}{%
   \let\ifDI@prejoin@\iffalse
   \let\DI@nofig\@firstofone
   \def\DI@hasfig##1##2{##1\pfill##2}%
   \let\ifDI@postjoin@\iffalse
   \def\DI@nojoin@extra{%
      \hspace*{\justification@g}\protect\nopagebreak[2]%
   }%
   \def\DI@join@extra{,\space}%
   \def\DI@offjoin@extra{%
      \hspace*{\justification@g}\protect\nopagebreak[4]%
   }%
   \DoParameterAssignments
   \ifDI@prejoin@
      \DI@item@join{\DI@item@justification}%
   \else
      \DI@item@nojoin\DI@item@justification
   \fi
   \let\DI@item@join\@firstofone
   \let\DI@item@nojoin\@empty
   \IfNoValueTF{#4}{%
      \DI@nofig{#3}%
      \ifDI@postjoin@
         \protected@edef\DI@item@join##1{\DI@join@extra}%
         \protected@edef\DI@item@nojoin{\DI@offjoin@extra\protect\par}%
      \else
         \DI@nojoin@extra\par
      \fi
   }{%
      \DI@hasfig{#3}{#4}%
      \par
   }%
   \ignorespaces
}
\DeclareInstance{indexitem}{fixed1}{fixed}
   {justification-setup = indexitem1}
\DeclareInstance{indexitem}{fixed2}{fixed}
   {justification-setup = indexitem2}
\DeclareInstance{indexitem}{fixed3}{fixed}
   {justification-setup = indexitem3}
\DeclareInstance{indexitem}{fixed-r1a}{fixed}
   {justification-setup = indexitem1, post-join = true}
\DeclareInstance{indexitem}{fixed-r2a-nocomma}{fixed}
   {justification-setup = indexitem2,
    post-join = true, join-extra = {\space}}
\DeclareInstance{indexitem}{fixed-a3r}{fixed}
   {justification-setup = indexitem3, pre-join = true}
\DeclareTemplate{indexitem}{aloneaccept}{4}{
   justification-setup =i{justification}      \DI@item@justification,
   ownlevel      =C
                                              \DI@this@level,
   nofig-action  =f1
                                              \DI@nofig,
   fig-action    =f2
                                              \DI@hasfig,
   post-join     =b
                                               DI@postjoin@,
   nojoin-extra    =f0
                                              \DI@nojoin@extra,
   join-extra    =f0
                                              \DI@join@extra,
   offjoin-extra =f0
                                              \DI@offjoin@extra
}{%
   \def\DI@this@level{2}%
   \let\DI@nofig\@firstofone
   \def\DI@hasfig##1##2{##1\pfill##2}%
   \let\ifDI@postjoin@\iffalse
   \def\DI@nojoin@extra{\hspace*{\justification@g}}%
   \def\DI@join@extra{,\space}%
   \def\DI@offjoin@extra{\DI@nojoin@extra\protect\nopagebreak[4]}%
   \DoParameterAssignments
   \ifnum \DI@this@level=#1
      \DI@item@nojoin \DI@item@justification
   \else\ifnum \DI@this@level=#2
      \DI@item@nojoin \DI@item@justification
   \else
      \DI@item@join{\DI@item@justification}%
   \fi\fi
   \let\DI@item@join\@firstofone
   \let\DI@item@nojoin\@empty
   \IfNoValueTF{#4}{%
      \DI@nofig{#3}%
      \ifDI@postjoin@
         \protected@edef\DI@item@join##1{\DI@join@extra}%
         \protected@edef\DI@item@nojoin{\DI@offjoin@extra\protect\par}%
      \else
         \DI@nojoin@extra \par
      \fi
   }{%
      \DI@hasfig{#3}{#4}%
      \par
   }%
   \ignorespaces
}
\DeclareInstance{indexitem}{aloneaccept2}{aloneaccept}
   {justification-setup = indexitem2, ownlevel = 2}
\DeclareInstance{indexitem}{aloneaccept3}{aloneaccept}
   {justification-setup = indexitem3, ownlevel = 3}
\DeclareTemplateType{docindex}{2}
\DeclareTemplate{docindex}{std}{2}{
   file-name        =n
                                                    \DI@file@name,
   file-extension   =n
                                                    \DI@file@ext,
   item1            =i{indexitem}
                                                    \DI@indexitem@i,
   item2            =i{indexitem}
                                                    \DI@indexitem@ii,
   item3            =i{indexitem}
                                                    \DI@indexitem@iii,
   reserved-height  =L
                                                    \DI@reserved@height,
   columns          =C
                                                    \DI@columns,
   column-sep       =l
                                                    \columnsep,
   prologue-setup    =f0
                                                    \DI@prologue@setup,
   body-setup        =f0
                                                    \DI@body@setup,
   epilogue-setup    =f0
                                                    \DI@epilogue@setup,
   letter-skip      =L
                                                    \DI@letter@skip,
   letter-format    =f1
                                                    \DI@letter@format,
   pagestyle        =n
                                                    \DI@pagestyle,
   parskip          =l
                                                    \parskip,
   page-compositor  =f0
                                                    \+
}{%
   \begingroup
   \def\DI@file@name{\jobname}%
   \def\DI@file@ext{ind}%
   \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
   \@letinstance\DI@indexitem@ii{indexitem}{fixed2}%
   \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
   \def\DI@reserved@height{80pt}%
   \def\DI@columns{3}%
   \columnsep=10pt%
   \let\DI@prologue@setup\@empty
   \def\DI@body@setup{\small}%
   \def\DI@epilogue@setup{\normalsize}%
   \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
   \def\DI@letter@format##1{%
      \UseInstance{justification}{center}%
      \textbf{##1}\nopagebreak\par
   }%
   \parskip=\z@\@plus\p@
   \let\DI@pagestyle\@empty
   \def\+{-}%
   \DoParameterAssignments
   \IfFileExists{\DI@file@name.\DI@file@ext}{%
      \ifnum \DI@columns>\@ne
         \begin{multicols}{\DI@columns}%
            [\DI@prologue@setup #1][\DI@reserved@height]%
      \else
         \enough@room{\DI@reserved@height}%
         \DI@prologue@setup #1\par
         \addvspace\multicolsep
      \fi
      \ifx \DI@pagestyle\@empty \else \pagestyle{\DI@pagestyle}\fi
      \DI@body@setup
      \DI@ind@setup
      \input{\DI@file@name.\DI@file@ext}%
      \DI@item@nojoin
      \ifx \DI@pagestyle\@empty \else
         \expandafter\thispagestyle \expandafter{\DI@pagestyle}%
      \fi
      \ifnum \DI@columns>\@ne
         \end{multicols}%
      \else
         \enough@room\postmulticols
         \addvspace\multicolsep
      \fi
      \DI@epilogue@setup #2\par
   }{\typeout{No file \DI@file@name.\DI@file@ext.}}%
   \endgroup
}
\@ifpackagewith{docindex}{usedocindexps}{%
   \DeclareInstance{docindex}{index}{std}{pagestyle=docindex}%
}{%
   \DeclareInstance{docindex}{index}{std}{}%
}
\DeclareInstance{docindex}{changes}{std}{
   file-extension = gls,
   item2 = fixed-r2a-nocomma,
   item3 = fixed-a3r,
   columns = 2,
   letter-format = {},
   letter-skip = \z@skip
}
\renewcommand\PrintIndex{%
   \UseInstance{docindex}{index}{\index@prologue}{}%
   \global\let\PrintIndex\@empty
}
\renewcommand\PrintChanges{%
   \UseInstance{docindex}{changes}{\glossary@prologue}{}%
   \global\let\PrintChanges\@empty
}
\endinput
%%
%% End of file `docindex.sty'.
