uuthesis-index.sty 4.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
%%% -*-TeX-*-
%%% ====================================================================
%%% This file contains changes to uuthesis-2016-d (or later) to
%%% provide support for an end-of-thesis subject index.  It must be
%%% used INSTEAD of the standard LaTeX makeidx package, because it
%%% needs to define additional macros and formatting compatible with
%%% the University of Utah Thesis Office regulations.
%%%
%%% Modern machines are sufficiently fast that there is no observable
%%% time savings from suppressing index generation, so this file
%%% always issues the \makeindex command.
%%%
%%% Usage:
%%%
%%%     \documentclass {uuthesis2e}
%%%     ... other \usepackage{...} commands ...
%%%     \usepackage    {uuthesis-2016-d}
%%%     \usepackage    {uuthesis-index}
%%%     ... front matter definitions ...
%%%     \begin {document}
%%%     ...
%%%     \bibliography  {siam}
%%%     \printindex
%%%     \end   {document}
%%%
%%% Two aspects of the formatting are user controllable via commands
%%% issued just before the \printindex command:
%%%
%%%     \columnsep = 0pt                % change from nonzero default
%%%     \renewcommand{TOPIC INDEX}      % change from SUBJECT INDEX default
%%%
%%% That location is also a reasonable place to insert index cross
%%% references, like these examples:
%%%
%%%     \index{DCT|see{Discrete Cosine Transform}}%
%%%     \index{DWT|see{Discrete Wavelet Transform}}%
%%%     \index{DCT|seealso{Discrete Wavelet Transform}}%
%%%     \index{DWT|seealso{Discrete Cosine Transform}}%
%%%     \index{mu@$\mu$ (mu)|see{Borel measure}}%
%%%     \index{m|seealso{mu (\$mu$)}}%
%%%
%%% [23-Mar-2016]
%%% ====================================================================

\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{uuthesis-index}[2016/05/03 v1.01]

\immediate \write16 {===============================================================================}%
\immediate \write16 {}%
\immediate \write16 {This is uuthesis-index.sty version 1.01 <3 May 2016>}%
\immediate \write16 {}%
\immediate \write16 {===============================================================================}%

\usepackage{makeidx}

\def \@makeschapterhead #1{\chapter{#1}} % uuthesis2e.cls uses, but does not define, this macro!

\ifx \undefined \@restonecoltrue        % this standard LaTeX internal macro is not defined in uuthesis2e.cls
    \newif \if@restonecol
    \@restonecoltrue
\fi

\def \indexname {SUBJECT INDEX}

\renewenvironment{theindex}
                 {%
                     \if@twocolumn
                         \@restonecolfalse
                     \else
                         \@restonecoltrue
                     \fi
                     \twocolumn[\mainheading{\MakeUppercase \indexname}]%
                     %% \@mkboth{\indexname}%
                     %%        {\indexname}%
                     \addcontentsline {toc} {chapter} {{\MakeUppercase \indexname}}%
                     \thispagestyle {plain}%
                     \parindent     = \z@
                     \parskip       = \z@ \@plus .3\p@\relax
                     \columnseprule = \z@
                     \columnsep     = 35\p@
                     \columnsep     = 50\p@
                     \columnseprule = 0.5\p@
                     \columnwidth   = \textwidth
                     \advance \columnwidth by -\columnseprule
                     \advance \columnwidth by -\columnsep
                     \advance \columnwidth by -6\p@
                     \divide \columnwidth by 2
                     \let \item     = \@idxitem
		     \ifx \uuthesis@pageheaders \undefined
		     \else
			 %% \global \def \leftmark  {\indexname}%
			 %% \global \def \rightmark {\indexname}%
                     \fi
                     \raggedright
                     \sloppy
                 }
                 {\if@restonecol \onecolumn \else \clearpage \fi}

\makeindex

\newcommand{\newindexgroup}[1]
{%
    \ifx \undefined \color
        \def \color #1{}
    \fi
    % {\textbf{\large \centerline{\color{utahheadingcolor}{#1}}}}%
    % {\textbf{\large \centerline{\color{utahheadingcolor}{\hrulefill\ #1\ \hrulefill }}}}%
    \setbox0 = \hbox{#1}%
    % {\textbf{\large \centerline{\color{utahheadingcolor}{\mbox{ }\hrulefill\ \raisebox{-0.5\ht0}{#1}\ \hrulefill \mbox{ }}}}}%
    {\textbf{\large \centerline{\color{utahheadingcolor}{\kern 2em\hrulefill\ \raisebox{-0.5\ht0}{#1}\ \hrulefill \kern 2em}}}}%
    \nopagebreak
    \vskip 0.5\ht0
    \nopagebreak
    %% \markboth{\indexname\ \ldots{} #1}%
    %%          {\indexname\ \ldots{} #1}%
    %% \nopagebreak
}