summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncclatex/nccindex.sty
blob: b0cfa2438b7d1004d880d205f1b65a08cdbebd98 (plain)
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccindex}
         [2005/03/24 v1.00 Multicolumn index for NCC class (NCC)]
%
% \changes{v1.00}{2005/03/24}{This version is uploaded to CTAN}
%
% The package redefines index-preparing commands on the base of multicol
% package. Some index control commands are specified here.
%
\@ifundefined{NCC@index}{%
  \PackageError{nccindex}{The package is used with the ncc class only}{}}{}
\RequirePackage{multicol}
\renewenvironment*{NCC@index}[1]{%
  \if@twocolumn \onecolumn \fi
  \noheadingtag
  \@ifundefined{chapter}{\section{#1}}{\chapter{#1}}%
  \columnseprule\z@ \columnsep 2em
  \parindent\z@ \parskip\z@ \@plus .3\p@
  \NCC@index@
  \NCC@indexstart
}{\end{multicols}}
%
% \indexparameters{columns}{indexspace}{margin1}{margin2}{margin3}{style}
%
\newcommand*\indexparameters[6]{%
  \def\NCC@index@{#6\begin{multicols}{#1}%
    \def\indexspace{\par\addvspace{#2}}%
    \def\@idxitem{\par\hangindent #5\relax}%
    \def\item{\@idxitem\pagebreak[0]\leavevmode\nopagebreak\ignorespaces}%
    \def\subitem{\@idxitem \hspace*{#3}}%
    \def\subsubitem{\@idxitem \hspace*{#4}}%
  }%
}
\indexparameters{2}{4ex \@plus 1ex \@minus .5ex}{2em}{4em}{5em}{\small}
%
% \startindexwith{text}
%
\newcommand\startindexwith{\long\def\NCC@indexstart}
\startindexwith{}
\endinput