summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/latex-tipps-und-tricks/polyind.sty
blob: 342d832d7d6e3b5cc2a74fb1b136789087202862 (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
%  POLYIND.STY
%  \makeindex[name]
%  \index[name]{entry}
%  \printindex[name]
\renewcommand{\makeindex}[1][]
 {\expandafter\newwrite\csname @#1ind\endcsname
  \expandafter\immediate\openout%
    \csname @#1ind\endcsname=\jobname.#1idx
  \typeout{writing index file \jobname.#1idx}
 }

\renewcommand{\index}
 {\@bsphack\begingroup
  \@sanitize\@wrindex
 }

\renewcommand{\@wrindex}[2][]
 {\expandafter\protected@write%
   \csname @#1ind\endcsname{}%
  {\string\indexentry{#2}{\thepage}}%
  \endgroup\@esphack
 }

\newcommand{\printindex}[1][]
 {\InputIfFileExists{\jobname.#1ind}
  {}
  {\typeout{Don't forget to process \jobname.#1idx!}}
 }

\providecommand{\seename}{siehe}
\providecommand*{\see}[2]{\emph{\seename} #1}