summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/idxlayout
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-13 00:10:04 +0000
committerKarl Berry <karl@freefriends.org>2010-01-13 00:10:04 +0000
commit7aefc275fdc7a7efd8d100cb98c8d12b97f8fa87 (patch)
tree30f5ae16cd46b0d06467b7a9735361a83dbd716d /Master/texmf-dist/tex/latex/idxlayout
parent1af5c8773983ef7a0aa17ab1c46e8ecc5d333bb7 (diff)
new latex package idxlayout (11jan10)
git-svn-id: svn://tug.org/texlive/trunk@16693 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/idxlayout')
-rw-r--r--Master/texmf-dist/tex/latex/idxlayout/idxlayout.sty227
1 files changed, 227 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/idxlayout/idxlayout.sty b/Master/texmf-dist/tex/latex/idxlayout/idxlayout.sty
new file mode 100644
index 00000000000..6584fece56c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/idxlayout/idxlayout.sty
@@ -0,0 +1,227 @@
+%%
+%% This is file `idxlayout.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% idxlayout.dtx (with options: `package')
+%%
+%% Copyright (C) 2010 by Thomas Titz <thomas.titz@chello.at>
+%%
+%% Permission is granted to distribute and/or modify this work under the
+%% terms of the LaTeX Project Public License (LPPL), version 1.3c.
+%%
+%% The LPPL maintenance status of this work is "maintained".
+%%
+%% This work consists of the files idxlayout.dtx, idxlayout.ins and
+%% README and the derived files idxlayout.pdf and idxlayout.sty.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{idxlayout}[2010/01/10 v0.4 Configurable index layout]
+\RequirePackage{etoolbox,kvoptions,multicol}
+\SetupKeyvalOptions{family=ila,prefix=ila@}
+\newcommand*{\ila@defradiokey}[3][]{%
+ \define@key{ila}{#2}[#1]{%
+ \ifcsname ila@#3@##1\endcsname
+ \csname ila@#3@##1\expandafter\endcsname
+ \else
+ \PackageError{idxlayout}{Unknown value ##1 for option #2}%
+ \fi
+ }%
+}
+\newcounter{idxcols}
+\define@key{ila}{columns}{\setcounter{idxcols}{#1}}
+\setkeys{ila}{columns=2}
+\@ifclassloaded{memoir}{%
+ \ifbool{onecolindex}{%
+ \setkeys{ila}{columns=1}%
+ }{%
+ }%
+ \appto{\onecolindex}{\setkeys{ila}{columns=1}}%
+ \appto{\twocolindex}{\setkeys{ila}{columns=2}}%
+}{%
+ \newlength{\indexcolsep}%
+ \setlength{\indexcolsep}{35\p@}%
+ \newlength{\indexrule}%
+ \setlength{\indexrule}{\z@}%
+}
+\define@key{ila}{columnsep}{\setlength{\indexcolsep}{#1}}
+\define@key{ila}{rule}{\setlength{\indexrule}{#1}}
+\newlength{\ila@indentunit}
+\define@key{ila}{indentunit}{\setlength{\ila@indentunit}{#1}}
+\setkeys{ila}{indentunit=20\p@}
+\DeclareStringOption{hangindent}
+\DeclareStringOption{subindent}
+\DeclareStringOption{subsubindent}
+\renewcommand{\@idxitem}{\par\setlength{\hangindent}{\ila@hangindent}}
+\def\ila@it@abshang{%
+ \renewcommand*{\ila@hangindent}{2\ila@indentunit}%
+ \renewcommand*{\ila@subindent}{\ila@indentunit}%
+ \renewcommand*{\ila@subsubindent}{1.5\ila@indentunit}%
+ \renewcommand{\subitem}{\@idxitem\hspace*{\ila@subindent}}%
+ \renewcommand{\subsubitem}{\@idxitem\hspace*{\ila@subsubindent}}%
+}
+\def\ila@it@relhang{%
+ \renewcommand*{\ila@hangindent}{1.5\ila@indentunit}%
+ \renewcommand*{\ila@subindent}{\ila@indentunit}%
+ \renewcommand*{\ila@subsubindent}{2\ila@indentunit}%
+ \renewcommand{\subitem}{%
+ \par
+ \deflength{\hangindent}{\ila@hangindent + \ila@subindent}%
+ \hspace*{\ila@subindent}%
+ }%
+ \renewcommand{\subsubitem}{%
+ \par
+ \deflength{\hangindent}{\ila@hangindent + \ila@subsubindent}%
+ \hspace*{\ila@subsubindent}%
+ }%
+}
+\newcommand*{\indexsubsdelim}{; }
+\def\ila@it@singlepar{%
+ \renewcommand*{\ila@hangindent}{\ila@indentunit}%
+ \renewcommand{\subitem}{\unskip\indexsubsdelim}%
+ \renewcommand{\subsubitem}{\unskip\indexsubsdelim}%
+}
+\ila@defradiokey{itemlayout}{it}
+\setkeys{ila}{itemlayout=abshang}
+\newlength{\ila@initsep}
+\define@key{ila}{initsep}{\setlength{\ila@initsep}{#1}}
+\setkeys{ila}{initsep=10\p@ \@plus 5\p@ \@minus 3\p@}
+\DeclareStringOption[\ila@initsep]{notesep}
+\DeclareStringOption[80\p@]{minspace}
+\renewcommand{\indexspace}{\par\vspace{\ila@initsep}}
+\newcommand*{\indexfont}{}
+\def\ila@fo@current{\renewcommand*{\indexfont}{}}
+\def\ila@fo@normalsize{\renewcommand*{\indexfont}{\normalsize}}
+\def\ila@fo@small{\renewcommand*{\indexfont}{\small}}
+\def\ila@fo@footnotesize{\renewcommand*{\indexfont}{\footnotesize}}
+\ila@defradiokey{font}{fo}
+\setkeys{ila}{font=current}
+\newcommand*{\indexjustific}{}
+\def\ila@ju@standard{%
+ \renewcommand*{\indexjustific}{%
+ \setlength{\parindent}{\z@}%
+ \setlength{\parfillskip}{\z@ \@plus 1fil}%
+ }%
+}
+\def\ila@ju@raggedright{\renewcommand*{\indexjustific}{\raggedright}}
+\def\ila@ju@RaggedRight{%
+ \ifundef{\RaggedRight}{%
+ \PackageWarning{idxlayout}{%
+ Command RaggedRight not defined!\MessageBreak
+ I'm using raggedright instead}%
+ }%
+ \renewcommand*{\indexjustific}{\raggedright}%
+ }{%
+ \renewcommand*{\indexjustific}{\RaggedRight}%
+}
+\ila@defradiokey{justific}{ju}
+\setkeys{ila}{justific=standard}
+\newcommand{\ila@prenote}{}
+\newcommand{\setindexprenote}[1]{%
+ \def\ila@prenote{%
+ \begingroup#1\par\nobreak\endgroup
+ \vspace{\ila@notesep}%
+ }%
+}
+\newcommand*{\noindexprenote}{\let\ila@prenote\relax}
+\noindexprenote
+\newcommand*{\ila@classtype}{0}
+\@ifclassloaded{memoir}{%
+ \def\ila@classtype{2}%
+}{%
+ \ifundef{\KOMAClassName}{%
+ }{%
+ \def\ila@classtype{1}%
+ }%
+}
+\ifcase\ila@classtype\relax
+ \DeclareBoolOption{totoc}%
+ \def\ila@prologue{%
+ \ifundef{\chapter}{%
+ \section*{\indexname}%
+ \ifbool{ila@totoc}{%
+ \addcontentsline{toc}{section}{\indexname}%
+ }{%
+ }%
+ }{%
+ \chapter*{\indexname}%
+ \ifbool{ila@totoc}{%
+ \addcontentsline{toc}{chapter}{\indexname}%
+ }{%
+ }%
+ }%
+ \@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}%
+ }
+\or
+ \def\ila@tc@true{\KOMAoptions{index=totoc}}%
+ \def\ila@tc@false{\KOMAoptions{index=nottotoc}}%
+ \ila@defradiokey[true]{totoc}{tc}%
+ \def\ila@prologue{%
+ \ifundef{\chapter}{%
+ }{%
+ \ifundef{\index@preamble}{%
+ }{%
+ \setchapterpreamble{\index@preamble}%
+ }%
+ }%
+ \idx@@heading{\indexname}%
+ \@mkboth{\indexname}{\indexname}%
+ \ifundef{\chapter}{%
+ \index@preamble
+ }{%
+ \thispagestyle{\indexpagestyle}%
+ }%
+ }
+\or
+ \def\ila@tc@true{\boolfalse{noindexintoc}}%
+ \def\ila@tc@false{\booltrue{noindexintoc}}%
+ \ila@defradiokey[true]{totoc}{tc}%
+ \def\ila@prologue{%
+ \chapter*{\indexname}%
+ \ifbool{noindexintoc}{%
+ }{%
+ \addcontentsline{toc}{chapter}{\indexname}%
+ }%
+ \ifbool{artopt}{%
+ }{%
+ \thispagestyle{indextitlepagestyle}%
+ }%
+ \indexmark
+ \preindexhook
+ }
+\fi
+\ProcessKeyvalOptions*
+\newcommand*{\idxlayout}[1]{\setkeys{ila}{#1}}
+\renewenvironment{theindex}{%
+ \ifbool{@twocolumn}{%
+ \boolfalse{@restonecol}%
+ \onecolumn
+ }{%
+ \booltrue{@restonecol}%
+ }%
+ \setlength{\multicolsep}{\z@}%
+ \setlength{\columnsep}{\indexcolsep}%
+ \setlength{\columnseprule}{\indexrule}%
+ \ifnumcomp{\theidxcols}{<}{\tw@}{%
+ \ila@prologue\indexfont\ila@prenote
+ }{%
+ \begin{multicols}{\theidxcols}%
+ [\ila@prologue\indexfont\ila@prenote][\ila@minspace]%
+ }%
+ \setlength{\parskip}{\z@ \@plus 0.3\p@}%
+ \indexjustific
+ \let\item\@idxitem
+}{%
+ \ifnumcomp{\theidxcols}{<}{\tw@}{%
+ }{%
+ \end{multicols}%
+ }%
+ \ifbool{@restonecol}{%
+ }{%
+ \twocolumn
+ }%
+}
+\endinput
+%%
+%% End of file `idxlayout.sty'.