From aa2dbb8897371a36028d3ce667140365345dfbfe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 11 Oct 2019 21:31:54 +0000 Subject: esindex (11oct19) git-svn-id: svn://tug.org/texlive/trunk@52342 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/esindex/esindex.sty | 57 +++++++++++++++++++++---- 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/esindex/esindex.sty b/Master/texmf-dist/tex/latex/esindex/esindex.sty index 4594874db47..a63bdba6eb6 100644 --- a/Master/texmf-dist/tex/latex/esindex/esindex.sty +++ b/Master/texmf-dist/tex/latex/esindex/esindex.sty @@ -7,7 +7,7 @@ % Repository: https://github.com/jbezos/esindex % -\ProvidesPackage{esindex}[2019/09/30 v1.6 Spanish indexes (and more)] +\ProvidesPackage{esindex}[2019/10/10 v1.7 Spanish indexes (and more)] \def\esx@level{`\!} \def\esx@actual{`\@} @@ -68,6 +68,8 @@ \catcode`\"=13 \catcode`\~=13 +\catcode`\^^A=12 + \gdef\esindex#1#{\esx@index{#1}} \lowercase{ @@ -90,7 +92,21 @@ \gdef\esx@bar@eat#1|{\def\esx@a{|#1}} } -\gdef\esindexexpandkey{\protected@edef\esindexkey{\esindexkey}} +\gdef\esindexexpandkey{% + \protected@edef\esindexkey{\esindexkey}} +\gdef\esindexexpandsubkey{% + \ifx\esindexsubkey\relax\else + \protected@edef\esindexsubkey{\esindexsubkey}% + \fi} +\gdef\esindexexpandsubsubkey{% + \ifx\esindexsubsubkey\relax\else + \protected@edef\esindexsubsubkey{\esindexsubsubkey}% + \fi} + +\gdef\esindexexpandkeys{% + \esindexexpandkey + \esindexexpandsubkey + \esindexexpandsubsubkey} % The following is called for every ! level, much like a loop. #1 is % the current level. @@ -111,8 +127,16 @@ % Execute \everyesindex and apply accents, so that \'a becomes a, and % redefinitions in \everyesindex are also "applied" \the\everyesindex - \esindexexpandkey + \esindexexpandkeys \esx@spanishreplacements + \protected@edef\esindexkey{% + \esindexkey + \ifx\esindexsubkey\relax\else + ^^A\esindexsubkey + \fi + \ifx\esindexsubsubkey\relax\else + ^^A\esindexsubsubkey + \fi}% \@temptokena\expandafter{\esindexkey}% % Key now in \@temptokena % Particles, with \ignorewords. \esx@remwords works on \@temptokena @@ -235,11 +259,28 @@ \expandafter\esx@replace@aux#1#2\esx@nil#2% \edef#1{\the\toks@}} -\def\esindexreplace#1#2{\esx@replace\esindexkey{#1}{#2}} +\let\esindexsubkey\relax +\let\esindexsubsubkey\relax + +\newcommand\esindexreplace[2]{% + \esx@replace\esindexkey{#1}{#2}} +\newcommand\esindexreplacesub[3]{% + \ifx\esindexsubkey\relax + \let\esindexsubkey\esindexkey + \fi + \esindexreplace{#1}{#2}% + \esx@replace\esindexsubkey{#1}{#3}} +\newcommand\esindexreplacesubsub[4]{% + \ifx\esindexsubsubkey\relax + \let\esindexsubsubkey\esindexkey + \fi + \esindexreplacesub{#1}{#2}{#3}% + \esx@replace\esindexsubsubkey{#1}{#4}} %------------------------- \let\esx@spanishreplacements\relax +\let\esx@@spanishreplacements\relax \ifesx@spanish @@ -280,14 +321,14 @@ \ifx\XeTeXinterchartoks\@undefined \catcode`\^^ff=12 \xdef\esindexlastchar{^^ff} - \else + \else % Hats in xetex seem buggy. Limit to 4. \catcode`\^^^^ffff=12 \xdef\esindexlastchar{^^^^ffff} \global\let\esx@spanishreplacements\esx@@spanishreplacements \fi - \else - \catcode`\^^^^ffff=12 - \xdef\esindexlastchar{^^^^ffff} + \else + \catcode`\^^^^^^10ffff=12 + \xdef\esindexlastchar{^^^^^^10ffff} \global\let\esx@spanishreplacements\esx@@spanishreplacements \fi \endgroup -- cgit v1.2.3