summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncclatex/nccindex.sty
blob: 551ec19633300613e973d04c26391969245b10a6 (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
41
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccindex}
         [2005/12/24 v1.01 Multicolumn index for NCC class (NCC)]
%
% \changes{v1.00}{2005/03/24}{This version is uploaded to CTAN}
% \changes{v1.01}{2005/12/24}{Do package independent on ncc class}
%
% The package redefines index on the base of multicol
% package. Some index control commands are specified here.
%
\RequirePackage{topsection}
\RequirePackage{multicol}
\def\NCC@index#1{%
  \if@twocolumn \onecolumn \fi
  \topsection{#1}%
  \columnseprule\z@ \columnsep 2em
  \parindent\z@ \parskip\z@ \@plus .3\p@
  \NCC@index@
  \NCC@indexstart
}
\def\endNCC@index{\end{multicols}}
\renewenvironment{theindex}{\NCC@index\indexname}{\endNCC@index}
%
% \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