summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-01 21:19:21 +0000
committerKarl Berry <karl@freefriends.org>2019-10-01 21:19:21 +0000
commit058ac3c069f344c4d3edf97c43fee3f2d07214a6 (patch)
tree3eb06a716a1a3e3e7e893ff3e74ff02fb5295d16 /Master/texmf-dist/tex
parentc1e543f3983621497544fe41fca6db5043023d9e (diff)
gindex (1oct19)
git-svn-id: svn://tug.org/texlive/trunk@52246 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/gindex/gindex.sty99
1 files changed, 99 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/gindex/gindex.sty b/Master/texmf-dist/tex/latex/gindex/gindex.sty
new file mode 100644
index 00000000000..36311da7f9b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/gindex/gindex.sty
@@ -0,0 +1,99 @@
+%
+% Copyright (C) 2019 Javier Bezos http://www.texnia.com
+%
+% This file may be distributed and/or modified under the conditions of
+% the MIT License. A version can be found at the end of this file.
+%
+% Repository: https://github.com/jbezos/gindex
+%
+
+\ProvidesPackage{gindex}[2019/10/01 v0.1 Formatting indexes]
+
+\newcounter{indexsubitems}
+
+\let\esx@save\@empty
+\let\indexnoitem\@gobbletwo
+
+\def\addindexitem#1#2{%
+ \esx@save
+ \indexnoitem{}{}%
+ \setcounter{indexsubitems}{0}%
+ \let\esx@save\@empty
+ \g@addto@macro\esx@save{\indexitem{#1}{#2}}}
+
+\def\addindexskip#1{%
+ \esx@save
+ \indexnoitem{}{}%
+ \setcounter{indexsubitems}{0}%
+ \let\esx@save\@empty
+ \indexskip{#1}}
+
+\def\addindexheading#1{%
+ \esx@save
+ \indexnoitem{}{}%
+ \setcounter{indexsubitems}{0}%
+ \let\esx@save\@empty
+ \indexheading{#1}}
+
+\def\addindexsubitem#1#2{%
+ \stepcounter{indexsubitems}%
+ \g@addto@macro\esx@save{\indexsubitem{#1}{#2}}}
+
+\def\addindexsubsubitem#1#2{%
+ \g@addto@macro\esx@save{\indexsubsubitem{#1}{#2}}}
+
+\newcommand\indexitem[2]{\item #1\ifx\\#2\\\else, #2\fi}
+\newcommand\indexsubitem[2]{\subitem #1\ifx\\#2\\\else, #2\fi}
+\newcommand\indexsubsubitem[2]{\subsubitem #1\ifx\\#2\\\else, #2\fi}
+
+\newcommand\indexitemhang[6]{%
+ \par\hangindent#2\relax
+ \ifdim#1=0pt\relax\else
+ \hspace*{#1}%
+ \fi
+ #5%
+ \ifx\@empty#6\@empty
+ #3%
+ \else
+ #4#6%
+ \fi}
+
+\ifx\indexspace\@undefined
+ \newcommand\indexskip[1]{\par\vskip10\p@\@plus5\p@\@minus3\p@\relax}
+\else
+ \newcommand\indexskip[1]{\indexspace}
+\fi
+\newcommand\indexheading[1]{%
+ {\bfseries\hfil
+ \MakeUppercase{#1}%
+ \hfil}%
+ \nopagebreak}
+
+\let\indexpreamble\relax
+\let\indexpostamble\relax
+
+\def\indexrangesep{-}
+
+\endinput
+
+MIT License
+-----------
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.