texlive[52342] Master/texmf-dist: esindex (11oct19)

commits+karl at tug.org commits+karl at tug.org
Fri Oct 11 23:31:54 CEST 2019


Revision: 52342
          http://tug.org/svn/texlive?view=revision&revision=52342
Author:   karl
Date:     2019-10-11 23:31:54 +0200 (Fri, 11 Oct 2019)
Log Message:
-----------
esindex (11oct19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/esindex/README.md
    trunk/Master/texmf-dist/doc/latex/esindex/esindex.pdf
    trunk/Master/texmf-dist/doc/latex/esindex/esindex.tex
    trunk/Master/texmf-dist/tex/latex/esindex/esindex.sty

Modified: trunk/Master/texmf-dist/doc/latex/esindex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/esindex/README.md	2019-10-11 21:31:43 UTC (rev 52341)
+++ trunk/Master/texmf-dist/doc/latex/esindex/README.md	2019-10-11 21:31:54 UTC (rev 52342)
@@ -18,6 +18,11 @@
 ### Recent changes
 
 ```
+1.7   2019-10-10
+      - Fix - because of a change in a macro name, it stopped
+        working with xe/lua
+      - Multi-level comparisons (up to 3), to better sort the items.
+      
 1.6   2019-09-30
       - Package option 'babel', which wraps each entry not in the main
         language with \foreignlanguage (or other macro).

Modified: trunk/Master/texmf-dist/doc/latex/esindex/esindex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/esindex/esindex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/esindex/esindex.tex	2019-10-11 21:31:43 UTC (rev 52341)
+++ trunk/Master/texmf-dist/doc/latex/esindex/esindex.tex	2019-10-11 21:31:54 UTC (rev 52342)
@@ -14,7 +14,7 @@
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 
-\title{\textsf{esindex}\\\large 1.6\quad 2019-09-30}
+\title{\textsf{esindex}\\\large 1.7\quad 2019-10-10}
 
 \author{Javier Bezos}
 
@@ -46,7 +46,8 @@
 {\LARGE Generating automatically sort keys for \textit{MakeIndex}
 with \LaTeX\par}
 \vspace*{1ex}
-Version 1.6 (2019-09-30)\par
+Version 1.7 (2019-10-10)\par
+\texttt{https://github.com/jbezos/esindex}\par
 Javier Bezos (\texttt{http://www.texnia.com})
 
 \vspace*{6ex}
@@ -86,6 +87,19 @@
 macro is \verb|\esindexlanguage|, which by default is `let' to the
 \textsf{babel} macro.
 
+Version 1.7 (besides fixing a bug with xe/lua) adds multilevel
+comparisons (up to three levels, ie, primary, secondary and tertiary).
+For example:
+\begin{verbatim}
+\esindexreplacesub{å}{a}{2}%
+\esindexreplacesub{à}{a}{1}%
+\end{verbatim}
+creates a two-level key sorting \verb|à| before \verb|å|. For a
+three-level key use \verb|\esindexreplacesubsub| (with 4 arguments). With
+\verb|\esindexexpandkeys| the three levels are expanded. (Internally,
+with the definitions above the key for \verb|ràpid| is
+\verb|rapid^^Ar1pid|.)
+
 \section{Spanish}
 
 Este paquete ha sido diseñado para facilitar la escritura de índices
@@ -282,7 +296,8 @@
 \textsf{iflang}).
 
 As a convenience tool, \verb|\esindexlastchar| is \verb|^^ff| or
-\verb|^^^^ffff|, depending on the engine.
+\verb|^^^^ffff| (\verb|^^^^^^10ffff| in \textsf{luatex}), depending on
+the engine.
 
 You can play with \textsf{lua} inside \verb|\everyesindex|, too. For
 example, to convert at once things like \textit{2,3-dimetilfenol} to

Modified: trunk/Master/texmf-dist/tex/latex/esindex/esindex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/esindex/esindex.sty	2019-10-11 21:31:43 UTC (rev 52341)
+++ trunk/Master/texmf-dist/tex/latex/esindex/esindex.sty	2019-10-11 21:31:54 UTC (rev 52342)
@@ -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 at level{`\!}
 \def\esx at actual{`\@}
@@ -68,6 +68,8 @@
 \catcode`\"=13
 \catcode`\~=13
 
+\catcode`\^^A=12
+
 \gdef\esindex#1#{\esx at index{#1}}
 
 \lowercase{
@@ -90,8 +92,22 @@
 \gdef\esx at bar@eat#1|{\def\esx at a{|#1}}
 }
 
-\gdef\esindexexpandkey{\protected at edef\esindexkey{\esindexkey}}
+\gdef\esindexexpandkey{%
+  \protected at edef\esindexkey{\esindexkey}}
+\gdef\esindexexpandsubkey{%
+  \ifx\esindexsubkey\relax\else
+    \protected at edef\esindexsubkey{\esindexsubkey}%
+  \fi}
+\gdef\esindexexpandsubsubkey{%
+  \ifx\esindexsubsubkey\relax\else
+    \protected at 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 at spanishreplacements
+  \protected at 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 at remwords works on \@temptokena
@@ -235,11 +259,28 @@
   \expandafter\esx at replace@aux#1#2\esx at nil#2%
   \edef#1{\the\toks@}}
 
-\def\esindexreplace#1#2{\esx at replace\esindexkey{#1}{#2}}
+\let\esindexsubkey\relax
+\let\esindexsubsubkey\relax
 
+\newcommand\esindexreplace[2]{%
+  \esx at replace\esindexkey{#1}{#2}}
+\newcommand\esindexreplacesub[3]{%
+  \ifx\esindexsubkey\relax
+    \let\esindexsubkey\esindexkey
+  \fi
+  \esindexreplace{#1}{#2}%
+  \esx at replace\esindexsubkey{#1}{#3}}
+\newcommand\esindexreplacesubsub[4]{%
+  \ifx\esindexsubsubkey\relax
+    \let\esindexsubsubkey\esindexkey
+  \fi
+  \esindexreplacesub{#1}{#2}{#3}%
+  \esx at replace\esindexsubsubkey{#1}{#4}}
+
 %-------------------------
 
 \let\esx at spanishreplacements\relax
+\let\esx@@spanishreplacements\relax
 
 \ifesx at 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 at spanishreplacements\esx@@spanishreplacements
     \fi
-  \else  
-    \catcode`\^^^^ffff=12
-    \xdef\esindexlastchar{^^^^ffff}
+  \else
+    \catcode`\^^^^^^10ffff=12
+    \xdef\esindexlastchar{^^^^^^10ffff}
     \global\let\esx at spanishreplacements\esx@@spanishreplacements
   \fi
 \endgroup



More information about the tex-live-commits mailing list