[texhax] Extra text in index -- package to address this

Poppo Tisting testpop1 at uit.co.uk
Sat May 30 13:26:51 CEST 2009


  2009/5/29 Anders K?llstr?m <anders at texnat.se>:
  > Is there a simple way to put some additional text in an index, after the
  > heading but before the index entries?
  > I use xindy (Swedish) and one way of doing it is to put an extra
  > \lettergroup{} in the .ind file but this means that it has to be 
done after
  > the index entries are sorted and hence every time a new index in 
generated.

We wrote a small (unreleased) package, uitindex, to do exactly this.
See below for the code, and an example of how to use it.

This is the index to the book described at:
    http://uit.co.uk/altdns
You can view the index by clicking on the link in the "Resources"
box on the top right.

    Regards,
    Niall


\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.0}
\def\filedate{2008/06/17}
\ProvidesPackage{uitindex}[\filedate]
\message{Style option: `uitindex' v\fileversion \space  <\filedate> nmm 
(at) uit.co.uk}

\long\def\uitindexblurb#1{\gdef\@uitindexblurb{#1}}
\gdef\@uitindexblurb{}
\long\def\uitindexformattingdef#1{\gdef\uitindexformatting{#1}}
\gdef\uitindexformatting{\usefont{OT1}{phv}{mc}{n}\selectfont\relsize{-1}}


\renewenvironment{theindex}
    {
    \if at twocolumn
        \@restonecolfalse
    \else
        \@restonecoltrue
    \fi
    \columnseprule \z@
    \columnsep 35\p@
   
 \twocolumn[\vspace*{1.2em}\@makeschapterhead{\indexname}\@uitindexblurb]%
        \uitindexformatting
    \@mkboth{\MakeUppercase\indexname}%
    {\MakeUppercase\indexname}%
    \thispagestyle{plain}\parindent\z@
    \parskip\z@ \@plus .3\p@\relax
    \let\item\@idxitem}
    {\if at restonecol\onecolumn\else\clearpage\fi}

\endinput

Notes:

        1. This package changes index operation in two ways:
           a. You can customize the index font and appearance.
           b. You can add a ``blurb'' before the index proper, e.g. to
              explain your indexing font conventions, etc.
           If you don't want either of these features, don't use the
           package.

        2. This package uses \@makeschapterhead, so it works only with
           classes that define that (including book.cls, report.cls, ...).
           

Example usage:

        ...
        \usepackage{uitindex}
        ...

        % This is optional. This package uses a default setting for index
        % font, appearance etc., which applies to the index entries 
only, and
        % not the Chapter heading, blurb, etc. You can define your own 
setting
        % using \uitindexformattingdef.  The current value of the settings,
        % whatever they are, is available as \uitindexformatting, so you can
        % use this in your index blurb to give the blurb the same appearance
        % as the body of the index.
        \uitindexformattingdef{\bf}

        % This is optional -- defines ``blurb'' that goes between the
        % ``Index'' Chapter heading and the start of the 2-column index.

        \usepackage{uitindex}
        \uitindexblurb{
                %{\footnotesize First line}
                {\uitindexformatting

                In the index, many terms are marked with a small
                superscript (as in
                \sf{access-control}\textsuperscript{Unbound}, for
                example), to indicate the program or brand of server
                the item relates to, or in which chapter the term
                appears.  Page numbers in italics indicate where terms
                are defined.  Variable names (\eg \envnx{UID}) are
                sorted under their initial letter, not under ``\$''.


                \vspace{1.5cm}}
                }
        \makeindex



More information about the texhax mailing list