diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-07 20:57:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-07 20:57:44 +0000 |
commit | e1d421bf06002cf4deb4df1cf80027c98da92674 (patch) | |
tree | 0afa521c554e33b93bb361432b1cf33808b3225e /Master/texmf-dist/tex/latex | |
parent | 2d9aff4da57523d50b8f3a85a732095abda936f5 (diff) |
gindex (7oct19)
git-svn-id: svn://tug.org/texlive/trunk@52311 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/gindex/gindex.sty | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/gindex/gindex.sty b/Master/texmf-dist/tex/latex/gindex/gindex.sty index 36311da7f9b..5d86fe60a68 100644 --- a/Master/texmf-dist/tex/latex/gindex/gindex.sty +++ b/Master/texmf-dist/tex/latex/gindex/gindex.sty @@ -7,45 +7,50 @@ % Repository: https://github.com/jbezos/gindex % -\ProvidesPackage{gindex}[2019/10/01 v0.1 Formatting indexes] +\ProvidesPackage{gindex}[2019/10/07 v0.2 Formatting indexes] \newcounter{indexsubitems} -\let\esx@save\@empty +\let\gix@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}} +\let\indexspecial\relax -\def\addindexheading#1{% - \esx@save - \indexnoitem{}{}% - \setcounter{indexsubitems}{0}% - \let\esx@save\@empty - \indexheading{#1}} +% #4 current macro, #5 locator +\def\gix@getspecial#1\indexspecial#2\indexspecial#3\@@#4#5{% + \ifx\indexspecial#3\@empty + \g@addto@macro\gix@save{#2}% + \else + \g@addto@macro\gix@save{#4{#1}{#5}}% + \fi} + +%------------------------ + +\def\addindexitem#1#2{% + \indexflushitem + \gix@getspecial#1\indexspecial\indexspecial\@@\indexitem{#2}} \def\addindexsubitem#1#2{% \stepcounter{indexsubitems}% - \g@addto@macro\esx@save{\indexsubitem{#1}{#2}}} + \gix@getspecial#1\indexspecial\indexspecial\@@\indexsubitem{#2}} \def\addindexsubsubitem#1#2{% - \g@addto@macro\esx@save{\indexsubsubitem{#1}{#2}}} + \gix@getspecial#1\indexspecial\indexspecial\@@\indexsubsubitem{#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} +\def\indexflushitem{% + \gix@save + \indexnoitem{}{}% + \setcounter{indexsubitems}{0}% + \let\gix@save\@empty} + +% ---------------------- + \newcommand\indexitemhang[6]{% \par\hangindent#2\relax \ifdim#1=0pt\relax\else @@ -58,6 +63,16 @@ #4#6% \fi} +%---------------------- + +\def\addindexskip#1{% + \indexflushitem + \indexskip{#1}} + +\def\addindexheading#1{% + \indexflushitem + \indexheading{#1}} + \ifx\indexspace\@undefined \newcommand\indexskip[1]{\par\vskip10\p@\@plus5\p@\@minus3\p@\relax} \else @@ -69,10 +84,13 @@ \hfil}% \nopagebreak} +%--------------------- + \let\indexpreamble\relax \let\indexpostamble\relax \def\indexrangesep{-} +\def\indexpagessep{, } \endinput |