summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-11 21:31:54 +0000
committerKarl Berry <karl@freefriends.org>2019-10-11 21:31:54 +0000
commitaa2dbb8897371a36028d3ce667140365345dfbfe (patch)
treedb11c7c2f0684c7ec0e05299d0bd51971f2de0e7 /Master/texmf-dist/tex/latex
parent1c5447b65419b4af37c996610389a6ed91670d01 (diff)
esindex (11oct19)
git-svn-id: svn://tug.org/texlive/trunk@52342 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/esindex/esindex.sty57
1 files changed, 49 insertions, 8 deletions
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