From d94b7a8c132734a1bc4046d54a75c7882c4c2619 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 2 Oct 2019 03:01:29 +0000 Subject: CTAN sync 201910020301 --- macros/latex/contrib/gindex/gindex.sty | 99 ++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 macros/latex/contrib/gindex/gindex.sty (limited to 'macros/latex/contrib/gindex/gindex.sty') diff --git a/macros/latex/contrib/gindex/gindex.sty b/macros/latex/contrib/gindex/gindex.sty new file mode 100644 index 0000000000..36311da7f9 --- /dev/null +++ b/macros/latex/contrib/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. -- cgit v1.2.3