summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xindex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-05 00:05:16 +0000
committerKarl Berry <karl@freefriends.org>2018-12-05 00:05:16 +0000
commitf6dff0989d564860048dd15418a39958289ce02f (patch)
tree93f1ab56cb31ca57ddf664360fca9fd3501e47cc /Master/texmf-dist/tex/latex/xindex
parent266a926d90fcb0ac1e5518cd1d6ad87984bb44d9 (diff)
xindex dirs
git-svn-id: svn://tug.org/texlive/trunk@49321 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xindex')
-rw-r--r--Master/texmf-dist/tex/latex/xindex/xindex.sty76
1 files changed, 76 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/xindex/xindex.sty b/Master/texmf-dist/tex/latex/xindex/xindex.sty
new file mode 100644
index 00000000000..58afc99c20d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/xindex/xindex.sty
@@ -0,0 +1,76 @@
+%% This is file `xindex.sty',
+%%
+%% Copyright (C) 2018
+%% Herbert Voss
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%
+% $Id: xindex.sty 836 2018-11-11 20:22:56Z herbert $
+%
+% -------------------------------------
+\ProvidesPackage{xindex}[2018/11/11 v. 0.02 write into an idx file (hv)]
+%
+\RequirePackage{xkeyval}
+
+\newif\if@@imakeidx \@@imakeidxfalse
+
+\DeclareOptionX{imakeidx}{\@@imakeidxtrue}
+\DeclareOptionX*{\PassOptionsToPackage\CurrentOption{imakeidx}}
+\ProcessOptionsX\relax
+
+\@ifpackageloaded{imakeidx}{}{% imakeidx already loaded?? if not then define ...
+ \newif\ifimki@startedidx
+ \newif\ifimki@splitindex
+}
+
+\if@@imakeidx
+ \typeout{xindex: Using package imakeidx}%
+ \RequirePackage{imakeidx}
+ \def\imki@progdefault{xindex}
+ \def\imki@program{xindex}
+%
+ \def\imki@@startidxsplit#1{%
+ \if@filesw
+ \def\index{\@bsphack
+ \@ifnextchar [{\@index}{\@index[\imki@jobname]}}
+ \expandafter\newwrite\csname #1@idxfile\endcsname
+ \immediate\openout \csname #1@idxfile\endcsname #1.idx\relax
+ \def\writeidx##1{\write\expandafter\csname #1@idxfile\endcsname{\noexpand##1}}%
+ \typeout{Writing index file #1.idx}%
+ \fi
+ }
+ \global\imki@startedidxfalse
+ \def\imki@@startidxunique#1{%
+ \if@filesw
+ \ifimki@startedidx\else
+ \newwrite\@indexfile
+ \immediate\openout\@indexfile\imki@jobname.idx%
+ \def\writeidx##1{\write\@indexfile{\noexpand##1}}%
+ \global\imki@startedidxtrue
+ \fi
+ \def\index{\@bsphack
+ \@ifnextchar [{\@index}{\@index[\imki@jobname]}}
+ \expandafter\let\csname #1@idxfile\endcsname\@empty
+ \typeout{Started index file #1}%
+ \fi
+ }
+%
+ \ifimki@splitindex
+ \let\imki@startidx\imki@@startidxunique
+ \else
+ \let\imki@startidx\imki@@startidxsplit
+ \fi
+\else
+ \typeout{xindex: Using package makeidx}%
+ \RequirePackage{makeidx}
+ \def\writeidx#1{\write\@indexfile{\noexpand#1}}
+\fi
+
+\endinput
+