texlive[67563] trunk: xindex (6jul23)

commits+karl at tug.org commits+karl at tug.org
Thu Jul 6 21:47:42 CEST 2023


Revision: 67563
          http://tug.org/svn/texlive?view=revision&revision=67563
Author:   karl
Date:     2023-07-06 21:47:42 +0200 (Thu, 06 Jul 2023)
Log Message:
-----------
xindex (6jul23)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
    trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile
    trunk/Master/texmf-dist/doc/lualatex/xindex/README.md
    trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.tex
    trunk/Master/texmf-dist/scripts/xindex/xindex.lua
    trunk/Master/texmf-dist/tex/latex/xindex/xindex.sty
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-RU.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -6,11 +6,10 @@
 --       AUTHOR:  Herbert Voß
 --      LICENSE:  LPPL 1.3
 --
--- $Id: xindex.lua 22 2023-01-18 12:18:15Z hvoss $
 -----------------------------------------------------------------------
 
         xindex = xindex or { }
- local version = 0.48
+ local version = 0.49
 xindex.version = version
 --xindex.self = "xindex"
 
@@ -55,7 +54,7 @@
     -l,--language (default en)   
     -g,--no_pagenumber
     -p,--prefix (default L)
-    -u,--use_UCA
+    -u,--use_UCA 
     -s,--use_stdin
     -V,--version
     <files...> (default stdin) .idx file(s)

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile	2023-07-06 19:47:42 UTC (rev 67563)
@@ -16,14 +16,14 @@
 all : doc clean
 # clean
 doc: 	
-	$(LATEX) --shell-escape $(MAIN)
+	$(LATEX) --shell-escape --interaction=nonstopmode $(MAIN)
 #	if ! test -f $(MAIN).glo ; then touch $(MAIN).glo; fi
 	if ! test -f $(MAIN).idx ; then touch $(MAIN).idx; fi
 #	makeindex -s gglo.ist -t $(MAIN).glg -o $(MAIN).gls $(MAIN).glo
 	xindex -a $(MAIN).idx
 #	bibtex $(MAIN)
-	$(LATEX) --shell-escape $(MAIN)
-	$(LATEX) --shell-escape $(MAIN)
+	$(LATEX) --shell-escape --interaction=nonstopmode $(MAIN)
+	$(LATEX) --shell-escape --interaction=nonstopmode $(MAIN)
 
 clean : 
 	$(RM) *.dvi *.aux *.log  *.xml xindex-?.tex xindex-??.tex *.ind *.idx *.toc *.out *.ilg

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/README.md	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/README.md	2023-07-06 19:47:42 UTC (rev 67563)
@@ -1,6 +1,6 @@
 # xindex
 
-Copyright 2019-2022 Herbert Voß
+Copyright 2019-2023 Herbert Voß
 
 Unicode compatible index programm for LaTeX. It needs Lua 5.3 which
 will be included in at least LuaTeX 1.09 (TeXLive 2019)
@@ -38,6 +38,7 @@
     -l,--language (default en)
     -p,--prefix (default L)
     -u,--use_UCA
+    -g,--no_pagenumber
     -s,--use_stdin
     -V,--version
     <files...> (default stdin) .idx file(s)

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

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.tex	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.tex	2023-07-06 19:47:42 UTC (rev 67563)
@@ -81,9 +81,8 @@
 \def\setVersion#1{\setVVersion#1!!}
 \def\setVVersion#1=#2!!{\def\xIndexVersion{#2}} 
 
-\setVersion{version = 0.48}%  can be automatically changed by perl
+\setVersion{version = 0.49}%  can be automatically changed by perl
 
-\setkeys{hv}{cleanup=true,force=false,ExampleDir=Examples,moveToExampleDir}
 
 
 \title{Program and package \texttt{xindex} \\--\\ \normalsize \xIndexVersion\ (\today)}
@@ -138,11 +137,11 @@
                       special = <macro> }
                   },
           sortChar = <unicode codepoint>, -- of the first character of Entry
-          Macro    = <TeX macro>  -- only useful with LaTeX package \Lpack{xindex}
+          Macro    = <TeX macro>  -- only useful with LaTeX package xindex
         }
 \end{verbatim}
 
-After reading the input file the table \texttt{pages} has only one element for the number\index{page number}
+After reading the input file the Lua table \texttt{pages} has only one element for the number\index{page number}
 and the so-called special command. When the pages are compressed the table will collect all pages which
 refer to the same \Index{entry name}.
  
@@ -249,6 +248,9 @@
 \fi
 
 
+\setkeys{hv}{moveToExampleDir=true,ExampleDir=Examples,cleanup={},verbose,force=false,shellesc}
+
+
 \begin{externalDocument}[
 %  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
   pages={1,2},
@@ -256,12 +258,13 @@
   compiler=lualatex,
   crop,
   xindex,
+  xindexOptions=-u,  % use unicode
   runs=2,code,docType=latex,
   showFilename,
   align=\centering,
   lstOptions={columns=fixed}]{xindex}
 %! lualatex
-%! xindex
+%! xindex -u (use unicode)
 \documentclass{scrartcl}
 \makeatletter
 \def\theindex{%    only for demonstration
@@ -269,21 +272,75 @@
   \parskip\z@ \@plus .3\p@\relax \parindent\z@
   \let\item\@idxitem}
 \makeatother
+%StartVisiblePreamble
+\usepackage{makeidx}\makeindex
+\usepackage{xindex}% for \left|\rightParen
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\section{Escaping characters}
+\begin{itemize}
+\item Exclamation mark ! \index{Exclamation ("!)}\index{"!}
+\item Vertical bar | \index{Vertical bar ("|)}\index{"|}
+\item Doublequote \verb|"| \index{""}
+\item Double doublequote \verb|""| \index{""""}
+\item At character @ \index{At ("@)}\index{"@}
+\item Left paranthesis \{ \index{\parenLeft}
+\item Right paranthesis \}  \index{\parenRight}
+\end{itemize}
+run \texttt{xindex -u <file.idx>}\index{file.idx@\texttt{<file.idx>}|textit}\index{123}
+\index{Etage} \index{Ètagé}
+\newpage
+\printindex
+\end{document}
+\end{externalDocument}
 
+It is by design that the parentheses \{ and \} cannot be used as index entry. The \emph{package}
+xindex defines the two commands \Lcs{parenLeft} and \Lcs{parenRight} which can be used instead
+(see examples above and and below).
+
+The same example without using unicode sorting (no option \Loption{-u}):
+
+
+\begin{externalDocument}[
+%  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
+  pages={1,2},
+  frame,
+  compiler=lualatex,
+  crop,
+  xindex,
+%  xindexOptions=-u,  % use unicode
+  runs=2,code,docType=latex,
+  showFilename,
+  align=\centering,
+  lstOptions={columns=fixed}]{xindex}
+%! lualatex
+%! xindex  (no unicode sort -- simple ascii)
+\documentclass{scrartcl}
+\makeatletter
+\def\theindex{%    only for demonstration
+  \section*{\indexname}
+  \parskip\z@ \@plus .3\p@\relax \parindent\z@
+  \let\item\@idxitem}
+\makeatother
 %StartVisiblePreamble
 \usepackage{makeidx}\makeindex
+\usepackage{xindex}% for \left|\rightParen
 %StopVisiblePreamble
 \pagestyle{empty}
 \begin{document}
 \section{Escaping characters}
 \begin{itemize}
-\item Exclamation mark ! \index{exclaim ("!)}
-\item Vertical bar| \index{Vertical bar ("|)}
+\item Exclamation mark ! \index{Exclamation ("!)}\index{"!}
+\item Vertical bar | \index{Vertical bar ("|)}\index{"|}
 \item Doublequote \verb|"| \index{""}
 \item Double doublequote \verb|""| \index{""""}
-\item At character @ \index{At ("@)}
+\item At character @ \index{At ("@)}\index{"@}
+\item Left paranthesis \{ \index{\parenLeft}
+\item Right paranthesis \}  \index{\parenRight}
 \end{itemize}
-run \texttt{xindex <file.idx>}\index{<file.idx>}\index{123}
+run \texttt{xindex -u <file.idx>}\index{file.idx@\texttt{<file.idx>}|textit}\index{123}
+\index{Etage} \index{Ètagé}
 \newpage
 \printindex
 \end{document}
@@ -290,6 +347,8 @@
 \end{externalDocument}
 
 
+
+
 For the German language the double quote is an active character and it makes life easier
 if one chooses another character.
 The escape character can be changed easily by the optional argument \verb|-e "<char>"| or 
@@ -308,8 +367,16 @@
 
 which is, of course, not of interest for the user. With the beginning the escaped chars
 are converted into the internal strings and later back to the origin meaning.
+The two characters \verb|{}| cannot be used as \verb|\{\}| inside the argument of \Lcs{index}.
+The package \Lpack{xindex} defines the two helper macros 
 
+\begin{verbatim}
+\providecommand\parenLeft{\{}
+\providecommand\parenRight{\}}
+\end{verbatim}
 
+The following example shows how to use it:
+
 \begin{externalDocument}[
 %  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
   pages={1,2},
@@ -331,6 +398,7 @@
   \let\item\@idxitem}
 \makeatother
 %StartVisiblePreamble
+\usepackage{xindex}
 \usepackage{makeidx}\makeindex
 %StopVisiblePreamble
 \pagestyle{empty}
@@ -342,6 +410,8 @@
 \item Doublequote \verb|"| \index{>"}
 \item Double doublequote \verb|""| \index{>">"}
 \item At character @ \index{At (>@)}
+\item Group start \{ \index{\parenLeft}
+\item Group end \{ \index{\parenRight}
 \end{itemize}
 Run \texttt{xindex} with \texttt{xindex -e ">"}\index{<file.idx>}\index{123}
 \newpage
@@ -728,23 +798,24 @@
 %  {\perCent StopVisiblePreamble}%  #5
 
 \noindent
-\begin{minipage}[t]{0.45\linewidth}
-\vspace{0pt}
+%\begin{minipage}[t]{0.45\linewidth}
+%\vspace{0pt}
 \setsansfont{SourceHanSans}\sffamily
 \edef\FancyVerbStartString{\perCent StartVisiblePreamble}
 \edef\FancyVerbStopString{\perCent StopVisiblePreamble}
 \colorbox{black!20}{\parbox{\linewidth}{%
-\VerbatimInput[fontfamily=helvetica]{Examples/xindex-6.tex}
+\VerbatimInput[fontfamily=helvetica]{Examples/xindex-9.tex}
 }}
 
 \edef\FancyVerbStartString{\string\begin\string{document\string}}
 \edef\FancyVerbStopString{\string\end\string{document\string}}
 \colorbox{black!10}{\parbox{\linewidth}{%
-\VerbatimInput[fontfamily=helvetica]{Examples/xindex-6.tex}
+\VerbatimInput[fontfamily=helvetica]{Examples/xindex-9.tex}
 }}
-\end{minipage}\hfill
-\begin{minipage}[t]{0.54\linewidth}
-\vspace{0pt}
+
+%\end{minipage}\hfill
+%\begin{minipage}[t]{0.54\linewidth}
+%\vspace{0pt}
 \begin{externalDocument}[
 %  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
 %  mpwidth=0.5\linewidth,
@@ -785,18 +856,14 @@
 \pagestyle{empty}
 \begin{document}
 \Index{車} \Index{車道} 
-日本\index{日本|fbox} 
-\Index{病院} \Index{コンピュータ} 
-\Index{プリンタ} \Index{印刷} 
-\Index{スイミングプール} \Index{天王} 
-\Index{広島} \Index{ドイツ} 
-\Index{日本} \Index{ワープロ} 
-\Index{foo} und \Index{bar}
-\Index{//} \Index{4711}
+日本\index{日本|fbox}  \Index{病院} \Index{コンピュータ} 
+\Index{プリンタ} \Index{印刷}  \Index{スイミングプール} \Index{天王} 
+\Index{広島} \Index{ドイツ} \Index{日本} \Index{ワープロ} 
+\Index{foo} und \Index{bar} \Index{//} \Index{4711}
 \newpage\printindex
 \end{document}
 \end{externalDocument}
-\end{minipage}
+%\end{minipage}
 
 \subsection{Sorting by using UCA (Unicode Collation Algorithm)}
 With the optional argument \verb|-u| or alternatively \verb|--use_UCA| the sorting will be done
@@ -815,12 +882,15 @@
   frame=false,
   compiler=lualatex,
   crop,
+  force=true,
   xindex,
   xindexOptions=-u -l cs,
   runs=2,code,docType=latex,
   showFilename,
   align=\centering,
-  lstOptions={columns=fixed}]{xindex}
+  usefancyvrb,
+%  lstOptions={columns=fixed}
+]{xindex}
 %! lualatex
 \documentclass[paper=a6]{scrartcl}
 \makeatletter
@@ -840,7 +910,7 @@
 \Index{ahoj} \Index{crha}, \Index{čaj}, \Index{chachar}, 
 \Index{rak}, \Index{řeka}, \Index{srp}, \Index{šutr}, 
 \Index{hudba}, \Index{linux}, \Index{zebra}, 
-\Index{žába},  \Index{7 dubů}
+\Index{žába}, \Index{7 dubů}
 \begin{multicols}{2} \printindex \end{multicols}
 \end{document}
 \end{externalDocument}
@@ -858,7 +928,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
 %  xindexOptions=,
@@ -903,6 +973,7 @@
 \end{externalDocument}
 
 
+\clearpage
 
 The same example sorted with the \verb|-a| or \verb|--no_casesensitive| has another output: now
 \verb|xindex-cfg-common.lua| is the first one of the \verb|xindex-???| series.
@@ -913,7 +984,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
   xindexOptions=-a,
@@ -963,7 +1034,7 @@
 
 
 \subsection{Ignore space for sorting}
-By default \textsf{alpha sort} will be sorted \emph{before} \textsf{alphaA}:
+By default »\textsf{alpha sort}« will be sorted \emph{before} »\textsf{alphaA}«:
 
 \begin{externalDocument}[
 %  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
@@ -970,7 +1041,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
 %  xindexOptions=,
@@ -1008,7 +1079,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
   xindexOptions=-i,
@@ -1191,11 +1262,15 @@
   pages={2,3},
   frame=true,
   compiler=lualatex,
-  %crop,
-  force=true,  
+  verbose,
 %  xindex,
 %  xindexOptions=-c description -g, 
-  runs=2,code,docType=latex,
+  runs=2,
+  code,docType=latex,
+  force=true,
+ %xindex -c description -n -g xindex-17.idx
+ %xindex -c description -n --no_pagenumber gls.idx
+  runsequence={lualatex,{xindex -c description -n -g},lualatex,lualatex}
   showFilename,
   align=\centering,
   grfOptions={width=0.45\linewidth},
@@ -1233,10 +1308,11 @@
 alphabet_lower = { { 'е', 'ё' } }
 alphabet_upper = { { 'Е', 'Ё' } }
 \end{filecontents}
+%xindex -c description -n --no_pagenumber gls.idx
 %StartVisiblePreamble
 \usepackage[english]{babel}
 \usepackage[imakeidx]{xindex}%  run xindex internally
-\makeindex[options= -c description -n -g ] % -g same as --no_pagenumber
+\makeindex
 \makeindex[name=gls, options= -c description -n --no_pagenumber]
 %StopVisiblePreamble
 \pagestyle{empty}
@@ -1495,6 +1571,7 @@
   xindex,
   xindexOptions=-c dtk -n -l de,
   runs=2,code,docType=latex,
+  runsAfter=2,
   showFilename,
   align=\centering,
   lstOptions={columns=fixed}]{xindex}
@@ -1689,7 +1766,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
   xindexOptions=-l de,
@@ -1932,11 +2009,17 @@
   mpwidth=0.55\linewidth,
   pages={6},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  force=true,
+  compiler=lualatex, 
   crop,
-  xindex,
-  xindexOptions=-l de,
+  force=true,
+%  xindex,
+%  xindexOptions=-l de,
   runs=2,code,docType=latex,
+%  runsAfter=2,
+%  cleanup={},
+%  moveToExampleDir=false,
+  shellesc,
   showFilename,
   align=\centering,
   lstOptions={columns=fixed}]{xindex}
@@ -1949,7 +2032,7 @@
 %StartVisiblePreamble
 \usepackage[imakeidx]{xindex}
 \makeindex[name=persons,title=Index of names,
-   columns=1,options=--noheadings]
+   columns=1,options= --noheadings]
 \def\ThanhVN{Hàn Thê\protect\llap{%
   \raise 0.5ex\hbox{\'{}}}}
 %StopVisiblePreamble
@@ -2033,10 +2116,10 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
-  xindex,
-  xindexOptions=-l de,
+%  xindex,
+%  xindexOptions=-l de,
   runs=2,code,docType=latex,
   showFilename,
   align=\centering,
@@ -2082,10 +2165,10 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
-  xindex,
-  xindexOptions=-l de,
+%  xindex,
+%  xindexOptions=-l de,
   runs=2,code,docType=latex,
   showFilename,
   align=\centering,
@@ -2100,7 +2183,7 @@
 \makeatother
 %StartVisiblePreamble
 \usepackage[imakeidx]{xindex}
-\makeindex
+\makeindex[options=-l de]
 % Martin Sievers
 %StopVisiblePreamble
 \begin{document}
@@ -2119,7 +2202,7 @@
   mpwidth=0.55\linewidth,
   pages={2},
   frame=false,
-  compiler=lualatex --shell-escape, 
+  compiler=lualatex, 
   crop,
   xindex,
 %  xindexOptions=-l de,
@@ -2148,22 +2231,6 @@
 \end{document}
 \end{externalDocument}
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 \printindex
 
 \end{document}

Modified: trunk/Master/texmf-dist/scripts/xindex/xindex.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/xindex/xindex.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/scripts/xindex/xindex.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -6,11 +6,10 @@
 --       AUTHOR:  Herbert Voß
 --      LICENSE:  LPPL 1.3
 --
--- $Id: xindex.lua 22 2023-01-18 12:18:15Z hvoss $
 -----------------------------------------------------------------------
 
         xindex = xindex or { }
- local version = 0.48
+ local version = 0.49
 xindex.version = version
 --xindex.self = "xindex"
 
@@ -55,7 +54,7 @@
     -l,--language (default en)   
     -g,--no_pagenumber
     -p,--prefix (default L)
-    -u,--use_UCA
+    -u,--use_UCA 
     -s,--use_stdin
     -V,--version
     <files...> (default stdin) .idx file(s)

Modified: trunk/Master/texmf-dist/tex/latex/xindex/xindex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xindex/xindex.sty	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/latex/xindex/xindex.sty	2023-07-06 19:47:42 UTC (rev 67563)
@@ -1,6 +1,6 @@
 %% This is file `xindex.sty',
 %%
-%% Copyright (C) 2018-2022
+%% Copyright (C) 2018-2023
 %% Herbert Voss
 %%
 %% It may be distributed and/or modified under the
@@ -11,10 +11,9 @@
 %% and version 1.3c or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 %
-% $Id: xindex.sty 836 2018-11-11 20:22:56Z herbert $
 %
 % -------------------------------------
-\ProvidesPackage{xindex}[2018/11/11 v. 0.02 write into an idx file (hv)]
+\ProvidesPackage{xindex}[2023/07/01 v. 0.03 write into an idx file (hv)]
 %
 \RequirePackage{xkeyval}
 
@@ -72,5 +71,8 @@
   \def\writeidx#1{\write\@indexfile{\noexpand#1}}
 \fi
 
+\providecommand\parenLeft{\{}
+\providecommand\parenRight{\}}
+
 \endinput
 

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-AU'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -11,7 +11,7 @@
 -- configuration for index files of the Heidelberger Akademie der Wissenschaften
 
 if not modules then modules = { } end modules ['xindex-HAdW-eKO'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-RU.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-RU.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-RU.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-RU'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex.lua",
        author = "Alexey Kuznetzov",
     copyright = "Herbert Voß",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -8,7 +8,7 @@
 -- $Id: xindex-base.lua 22 2022-02-07 12:18:15Z hvoss $
 -----------------------------------------------------------------------
 
-local info = { version = 0.48 } 
+local info = { version = 0.49 } 
 
 -- check config
 if pageNoPrefixDel ~= "" then 
@@ -31,7 +31,7 @@
     writeLog(2,#lines.." lines of data read\n",0)
   end
 end
-print("Anzahl Zeilen: "..#lines)
+--print("Anzahl Zeilen: "..#lines)
 if #lines == 0 then
     print("=========================================")
     print("Input file(s) is/are empty!")
@@ -48,9 +48,10 @@
 end
 
 print("Presort of \\indexentry lines")
+for _,l in pairs(lines) do print (l) end
 table.sort(lines)
 if vlevel > 1 then 
-  print("Pres-Sorted index list:")
+  print("Pre-Sorted index list:")
   for _,l in pairs(lines) do print (l) end
 end
 
@@ -174,6 +175,17 @@
     end
   end
   writeLog(2,"done\n",0)
+else
+  for i=1, #NewIndex do
+    v = NewIndex[i]
+    if findStr(v["SortKey"],"\\parenLeft") < 2      then v["SortKey"] = '{' v["sortChar"] = '{'end
+    if findStr(v["SortKey"],"\\parenRight") < 2     then v["SortKey"] = '}' end
+    if findStr(v["SortKey"],"//escapedexcl//") < 2  then v["SortKey"] = '!' end
+    if findStr(v["SortKey"],"//escapedquote//") < 2 then v["SortKey"] = '"' end
+    if findStr(v["SortKey"],"//escapedat//") < 2    then v["SortKey"] = '@' end
+    if findStr(v["SortKey"],"//escapedvert//") < 2  then v["SortKey"] = '|' end
+    NewIndex[i] = v
+  end
 end
 
 if SORTendhook then
@@ -217,27 +229,34 @@
     writeLog(1," NewIndex[k]: "..v["Entry"].."\n",2)
     writeLog(1,require 'xindex-pretty'.dump(v),3)   -- only for internal dump
     entry = v["Entry"] 
+--    print("SortKey:"..v["SortKey"].."  sortChar:"..v["sortChar"])
     writeLog(1,"\nBase start: "..entry.."\n",2)
 --    local c = utf.sub(v["sortChar"],1,1)
 --    if utf8.codepoint(c) < 12288 then -- Japanese starts at hex 3000
 --      firstChar = v["sortChar"]
 --    else 
+--    print(v["SortKey"],v["sortChar"],v["Entry"])
     if language == "cs" then   -- Czech language has special char ch
       if utf.sub(v["sortChar"],1,2) == "CH" then
-	firstChar = "Ch"
+ 	    firstChar = "Ch"
       else
+--        firstChar = utf.sub(v["SortKey"],1,1)
         firstChar = utf.sub(v["sortChar"],1,1)
       end
     else
+--      firstChar = utf.sub(v["SortKey"],1,1)
       firstChar = utf.sub(v["sortChar"],1,1)  -- catch a translatet Ö->OE
     end
 --    end
     currentChar = firstChar
+    local SortKey = tostring(v["SortKey"])
+    writeLog(1,"SortKey="..SortKey..";  firstChar="..currentChar.."\n",2)
     if string.len(firstChar) > 1 then 
       charType = getCharType(utf.sub(firstChar,1,1))
     else
       charType = getCharType(firstChar)
     end
+--    print(">>"..v["sortChar"].." "..firstChar.." "..tostring(charType))
     if charType == 0 then 
       numbers = false 
       symbols = true

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-baselib'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "base library  to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg-common'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg-lua'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex-cfg-uca.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "main configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration file for the DANTE Edition",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "DTK configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-lib'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "main library  to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",
@@ -125,7 +125,8 @@
         str = line:gsub('^\\%a+%s*{','{')  -- remove "\\indexentry "
         writeLog(1,"read_lines: str="..str.." ("..utf.sub(str,2,2)..")\n",2)
         if getCharType(utf.sub(str,2,2)) == 0 then   -- we have a symbol
-          lines[#lines + 1] = str:gsub('^{*','{ ')  -- add a space before the symbol
+          lines[#lines + 1] = str:gsub('^{*','{')  -- add a space ... why????
+--          lines[#lines + 1] = str:gsub('^{*','{ ')  -- add a space before the symbol
         else 
           lines[#lines + 1] = str
         end
@@ -275,6 +276,7 @@
       sortChar= NormalizedUpper(utf.sub(IndexString,1,1)), --    :byte(), -- Initial for later output
       Macro   = macro
     }
+    --print("Entry:"..EntryList[#EntryList]["sortChar"])
   if args_v then 
     if Special == "" then Special = "-" end
     writeLog(1,"getEntryAndPage: "..tostring(IndexString,pageNo,Special,utf.sub(IndexString,1,1),macro).."\n",2) 
@@ -318,7 +320,7 @@
 
 --[[   example entry
 EntryList[2] = { 
-      Entry   = "Johann",   -- the index item  foo at bar 
+      Entry   = 'Johann//escapedexcl//',   -- the index item  foo at bar 
       pages   = {           -- the page number(s) and the part after |
         { number  = 111,
           special = '\\emph'  },
@@ -502,6 +504,19 @@
   end 
 end
 
+function findStr(s,f)
+  if s == nil then return 99999 end
+  str = s:match'^%s*(.*)'   -- strip left spaces
+--  s:gsub("%s+", "")-- strip spaces
+--  print(s,f)
+  local i,j = str:find(f)
+--  print(tostring(i),tostring(j))
+  if i == nil 
+    then return 99999   -- makes it easier to compare with <
+    else return i
+  end
+end
+
 --print(get_category(utf8.codepoint('ö')))
 --print(category_to_number(get_category(utf8.codepoint('ö'))))
 
@@ -532,7 +547,7 @@
     if ignoreSpace then
       a["SortKey"] = A:gsub("%s+", "") -- remove spaces
     else
-      a["SortKey"] = A
+      a["SortKey"] = A:match'^%s*(.*)' -- strip only left spaces
     end
   else  
     A = NormalizedChars(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!',' ')) -- replace! by empty
@@ -539,15 +554,29 @@
     if ignoreSpace then
       a["SortKey"] = A:gsub("%s+", "")-- remove spaces
     else
-      a["SortKey"] = A
+      a["SortKey"] = A:match'^%s*(.*)' -- strip only left spaces
     end
   end
-  -- print(a["SortKey"])
-  -- return A
+--  s:gsub("%s+", "")  strip spaces
+  if findStr(a["SortKey"],"\\parenLeft") < 2      then a["SortKey"] = '{  '..Apage end
+  if findStr(a["SortKey"],"\\parenRight") < 2     then a["SortKey"] = '}  '..Apage end
+  if findStr(a["SortKey"],"//escapedexcl//") < 2  then a["SortKey"] = '!  '..Apage end
+  if findStr(a["SortKey"],"//escapedquote//") < 2 then a["SortKey"] = '"  '..Apage end
+  if findStr(a["SortKey"],"//escapedat//") < 2    then a["SortKey"] = '@  '..Apage end
+  if findStr(a["SortKey"],"//escapedvert//") < 2  then a["SortKey"] = '|  '..Apage end
+  --  a["SortKey"] = a["SortKey"]:gsub("%s+", "")
+  -- print("Sortkey: " .. a["SortKey"])
+  if not use_UCA then           -- test if it is a symbol after 9 and before A or after Z
+    if (a["SortKey"]:byte() > 57 and a["SortKey"]:byte() < 65) or 
+       (a["SortKey"]:byte() > 122 and a["SortKey"]:byte() < 128) then  -- symbol above digits
+      a["SortKey"] = "/"..a["SortKey"]     -- sort it after /
+    end
+  end   
 end
 
 function GenerateSortKeys(Index)
   for _, entry in ipairs(Index) do
+--    print("<<".._..entry["Entry"])
     GenerateSortKey(entry)
   end
 end
@@ -555,12 +584,13 @@
 function UTFCompare(a,b)
   local A = a["SortKey"]
   local B = b["SortKey"]
-  writeLog(1,"UTFCompare: A--B "..A.."--"..B.."\n",2)
   if use_UCA then
-    return collator_obj:compare_strings(A,B)
+    compare = collator_obj:compare_strings(A,B)
   else
-    return A<B
+    compare = A<B
   end
+  writeLog(1,"UTFCompare: A--B "..A.."--"..B.."A<B:"..tostring(compare).."\n",2)
+  return compare
 end
 
 
@@ -923,6 +953,7 @@
       return getSortChar(codepoints)
     end
     local sort_char = utf8.char(table.unpack(codes))
+    --print("SortChar:"..sort_char)
     -- print unicode category of the first char
     return upper(sort_char) -- use unicode.utf8.upper to make the char uppercase
   end

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -10,7 +10,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-no'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-pretty'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "dump a Lua table for debugging",
        author = "Steve Donovan",
     copyright = "Steve Donovan",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua	2023-07-06 19:47:31 UTC (rev 67562)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua	2023-07-06 19:47:42 UTC (rev 67563)
@@ -9,7 +9,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-yannis'] = {
-      version = 0.48,
+      version = 0.49,
       comment = "main configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",



More information about the tex-live-commits mailing list.