texlive[55401] trunk: xindex (3jun20)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 3 23:22:07 CEST 2020


Revision: 55401
          http://tug.org/svn/texlive?view=revision&revision=55401
Author:   karl
Date:     2020-06-03 23:22:07 +0200 (Wed, 03 Jun 2020)
Log Message:
-----------
xindex (3jun20)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
    trunk/Master/texmf-dist/doc/lualatex/xindex/CHANGELOG
    trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile
    trunk/Master/texmf-dist/doc/lualatex/xindex/README.md
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW.tex
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW2.ind
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/Umlaute.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/Umlaute2.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/buch.ind
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/buch.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/demo-hyperref.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/demo.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/demo3.pdf
    trunk/Master/texmf-dist/doc/lualatex/xindex/tests/runTests.sh
    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/lualatex/xindex/xindex-DIN2.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua

Removed Paths:
-------------
    trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2020-06-03 21:22:07 UTC (rev 55401)
@@ -1,12 +1,12 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 54766 2020-04-16 11:50:17Z preining $
+# $Id: tlmgr.pl 55369 2020-06-01 00:32:00Z preining $
 #
 # Copyright 2008-2020 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 54766 $';
-my $datrev = '$Date: 2020-04-16 13:50:17 +0200 (Thu, 16 Apr 2020) $';
+my $svnrev = '$Revision: 55369 $';
+my $datrev = '$Date: 2020-06-01 02:32:00 +0200 (Mon, 01 Jun 2020) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -25,6 +25,7 @@
 our $loadmediasrcerror;
 our $packagelogfile;
 our $packagelogged;
+our $commandlogfile;
 our $tlmgr_config_file;
 our $pinfile;
 our $action; # for the pod2usage -sections call
@@ -358,6 +359,7 @@
   "machine-readable" => 1,
   "no-execute-actions" => 1,
   "package-logfile" => "=s",
+  "command-logfile" => "=s",
   "persistent-downloads" => "!",
   "pause" => 1,
   "pin-file" => "=s",
@@ -653,6 +655,22 @@
     debug("appending to package log file: $packagelogfile\n");
   }
 
+  # output of executed commands are put into -command-logfile
+  $commandlogfile = $opts{"command-logfile"};
+  if ($opts{"usermode"}) {
+    $commandlogfile ||= "$::maintree/web2c/tlmgr-commands.log";
+  } else {
+    $commandlogfile ||= "$texmfsysvar/web2c/tlmgr-commands.log";
+  }
+  # Try to open the packagelog file, but do NOT die when that does not work
+  if (!open(COMMANDLOG, ">>$commandlogfile")) {
+    debug("Cannot open command log file for appending: $commandlogfile\n");
+    debug("Will not log output of executed commands for this run\n");
+    $commandlogfile = "";
+  } else {
+    debug("appending to command log file: $commandlogfile\n");
+  }
+
   $loadmediasrcerror = "Cannot load TeX Live database from ";
 
   # load the config file and set the config options
@@ -815,7 +833,7 @@
   # tlmgr front ends (MacOSX's TeX Live Utility) can read it
   # and show it to the user before the possibly long delay.
   info("running $cmd ...\n");
-  logpackage("running $cmd");
+  logcommand("running $cmd");
   my ($out, $ret);
   if ($opts{"dry-run"}) {
     $ret = $F_OK;
@@ -829,22 +847,17 @@
   } else {
     ($out, $ret) = TeXLive::TLUtils::run_cmd("$cmd 2>&1");
   }
-  # Although it is quite verbose to report all the output from every
-  # fmtutil (especially) run, it's the only way to know what's normal
-  # when something fails. Prefix each line to make them easy to see
-  # (and filter out/in).
-  (my $prefixed_out = $out) =~ s/^/(cmd)/gm;
-  $prefixed_out =~ s/\n+$//; # trailing newlines don't seem interesting
-  my $outmsg = "output:\n$prefixed_out\n--end of output of $cmd.\n";
+  $out =~ s/\n+$//; # trailing newlines don't seem interesting
+  my $outmsg = "output:\n$out\n--end of output of $cmd.\n";
   if ($ret == $F_OK) {
     info("done running $cmd.\n");
-    logpackage("success, $outmsg");
+    logcommand("success, $outmsg");
     ddebug("$cmd $outmsg");
     return ($F_OK);
   } else {
     info("\n");
     tlwarn("$prg: $cmd failed (status $ret), output:\n$out\n");
-    logpackage("error, status: $ret, $outmsg");
+    logcommand("error, status: $ret, $outmsg");
     return ($F_ERROR);
   }
 }
@@ -7457,7 +7470,14 @@
     print PACKAGELOG "[$tim] @_\n";
   }
 }
+sub logcommand {
+  if ($commandlogfile) {
+    my $tim = localtime();
+    print COMMANDLOG "[$tim] @_\n";
+  }
+}
 
+
 # resolve relative paths from tlpdb wrt tlroot 
 sub norm_tlpdb_path {
   my ($path) = @_;
@@ -7805,6 +7825,13 @@
 
 tlshell shares its message catalog with tlmgr.
 
+=item B<--command-logfile> I<file>
+
+C<tlmgr> logs the output of all programs invoked (mktexlr, mtxrun, fmtutil,
+updmap) to a separate log file, by default
+C<TEXMFSYSVAR/web2c/tlmgr-commands.log>.  This option allows you to specify a
+different file for the log.
+
 =item B<--debug-translation>
 
 In GUI mode, this switch tells C<tlmgr> to report any untranslated (or
@@ -10037,7 +10064,7 @@
 distribution (L<https://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 54766 2020-04-16 11:50:17Z preining $
+$Id: tlmgr.pl 55369 2020-06-01 00:32:00Z preining $
 =cut
 
 # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -8,7 +8,7 @@
 -----------------------------------------------------------------------
 
         xindex = xindex or { }
- local version = 0.22
+ local version = 0.23
 xindex.version = version
 --xindex.self = "xindex"
 
@@ -49,6 +49,7 @@
     -o,--output (default "")
     -l,--language (default en)
     -p,--prefix (default L)
+    -u,--use_UCA
     <input> (string)
 ]]
 
@@ -174,6 +175,8 @@
   {esc_char..')', '//escapedparenright//',')'    }
 }
 
+local language = "en" -- default language
+
 language = string.lower(args["language"]):sub(1, 2)
 writeLog(2,"Language = "..language.."\n",1) 
 if (indexheader[language] == nil) then
@@ -189,6 +192,39 @@
   page_folium = folium[language]
 end  
 
+use_UCA = args["use_UCA"]
+if use_UCA then
+  writeLog(1,"Will use LUA-UCA\n",1)
+  ducet = require "lua-uca.lua-uca-ducet"
+  collator = require "lua-uca.lua-uca-collator"
+  languages = require "lua-uca.lua-uca-languages"
+  collator_obj = collator.new(ducet)
+  
+  local uca_config_file = "xindex-cfg-uca.lua"
+  writeLog(2,"Loading local UCA config file "..uca_config_file,0)
+  UCA_Config_File = kpse.find_file(uca_config_file) 
+  uca_cfg = require(UCA_Config_File)
+  writeLog(2," ... done\n",0)
+  
+-- language name specified on the command line doesn't seem to be available
+-- in the config file, so we just try to find it ourselves
+  for i, a in ipairs(arg) do
+    if a == "-l" or a=="--language" then
+      language = arg[i+1]
+      break
+    end
+  end
+
+  if languages[language] then
+    print("[Lua-UCA] Loading language: " .. language)
+    collator_obj = languages[language](collator_obj)
+  end
+else
+  writeLog(1,"Will _not_ use LUA-UCA\n",1)
+end
+
+upper = unicode.utf8.upper
+
 no_caseSensitive = args["no_casesensitive"]
 if no_caseSensitive then
   writeLog(1,"Sorting will be no case sensitive\n",1)

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/CHANGELOG
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/CHANGELOG	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/CHANGELOG	2020-06-03 21:22:07 UTC (rev 55401)
@@ -1,3 +1,4 @@
+0.23  2020-06-02 - added support for the package LUA-UCA (Unicode Collation Algorithm)
 0.22  2020-05-30 - added test for correct language with a fallback to english (en)
                    and also allow de_DE, where only the first two letters are used
 0.21  2020-05-29 - added support for italian language

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/Makefile	2020-06-03 21:22:07 UTC (rev 55401)
@@ -1,8 +1,7 @@
-# `Makefile' for `pst-grad.pdf', hv, 2008/08/11
 
 .SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
 
-PACKAGE = xhfill
+PACKAGE = xindex
 
 MAIN = xindex-doc
 
@@ -21,13 +20,13 @@
 #	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 $(MAIN).idx
+	xindex -a $(MAIN).idx
 #	bibtex $(MAIN)
 	$(LATEX) --shell-escape $(MAIN)
 #	$(LATEX) --shell-escape $(MAIN)
 
 clean : 
-	$(RM) *.dvi *.aux *.log  *.xml xindex-?.tex xindex-??.tex *.ind *.idx *.toc *.out *.ilg *.adx
+	$(RM) *.dvi *.aux *.log  *.xml xindex-?.tex xindex-??.tex *.ind *.idx *.toc *.out *.ilg
 
 veryclean : clean
 	$(RM) *.pdf 

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/README.md	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/README.md	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,6 +7,7 @@
 * xindex.lua            -- main file
 * xindex-cfg.lua        -- config module
 * xindex-cfg-common.lua -- main config module
+* xindex-cfg-uca.lua    -- config module for uca
 * xindex-base.lua       -- base file
 * xindex-lib.lua        -- functions module
 * xindex-lapp.lua       -- read parameter
@@ -17,15 +18,17 @@
      xindex [options] <inputfile>[.idx]
 
 possible options are (short,long):
-
     -q,--quiet
     -h,--help
-    -v
+    -v...          Verbosity level; can be -v, -vv, -vvv
     -c,--config (default cfg)
     -e,--escapechar (default ")
     -n,--noheadings 
+    -a,--no_casesensitive
     -o,--output (default "")
     -l,--language (default en)
+    -p,--prefix (default L)
+    -u,--use_UCA
     <input> (string)
 
 Testfiles:
@@ -42,4 +45,3 @@
     ./xindex.lua buch.idx
     lualatex buch
 
-

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

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW.tex	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW.tex	2020-06-03 21:22:07 UTC (rev 55401)
@@ -1,10 +1,11 @@
 \documentclass[paper=a4,parskip=half-,ngerman,DIV=13]{scrartcl}
 \usepackage{eurosym}
 \usepackage[silent]{fontspec}
-\usepackage[nomath]{libertinus-otf}
+\usepackage{libertinus-otf}
 \usepackage{babel}
 \usepackage{makeidx}
-\usepackage{dtk-logos,xcolor}
+\usepackage{dtk-logos}
+\usepackage[table]{xcolor}
 \makeatletter
 \def\theindex{%    only for demonstration
   \section*{\indexname}
@@ -13,7 +14,7 @@
 \makeatother
 
 \begin{document}
-Run with \verb|xindex --config HAdW|
+Run with \verb|xindex --config HAdW-eKO|
 
 \printindex
 \end{document}

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW2.ind
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW2.ind	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/tests/HADW2.ind	2020-06-03 21:22:07 UTC (rev 55401)
@@ -2,63 +2,67 @@
 \begin{theindex}
 
 \indexspace
-\textbf{A}\label{L-xindex-A}
+\textbf{K}
 \nopagebreak[4]
-  \item Aachen, Johannes von \dotfill  {\colorbox{black!15}{VII/1}:~215}
-  \item Aarones \dotfill  {\colorbox{black!15}{VII/2/1}:~1003}, {1012}
-  \item Abrahamson \dotfill  {\colorbox{black!15}{VII/2/1}:~864}, {991}, {1048}, {1067}, {1156}
-  \item Adamson \dotfill  {\colorbox{black!15}{VII/2/1}:~1223}, {\colorbox{black!15}{IX/1}:~1228}
+  \item  Karl II, {VII/1 147}
+  \item  Karl III, {VII/1 149}
+  \item  Karl IV, {VII/1 147}, {34}
+  \item  Karl V, {VII/1 34}
+  \item  Karl VI, {VII/1 296}
+  \item  Karl IX, {VII/1 296}
+  \item  Karl X, {VII/1 149}
+
+\indexspace
+\textbf{A}
+\nopagebreak[4]
+  \item Aachen, Johannes von, {VII/1 215}
+  \item Aarones, {VII/2/1 1003}, {1012}
+  \item Abrahamson, {VII/2/1 1048}, {1067}, {1156}, {864}, {991}
+  \item Adamson, {VII/2/1 1223}, {IX/1 1228}
   \item Adrian
-    \subitem -\,Hauster \dotfill  {\colorbox{black!15}{VII/1}:~514}, {\colorbox{black!15}{XI/1}:~515}
+    \subitem -\,Hauster, {VII/1 514}, {XI/1 515}
   \item Alting
-    \subitem -\,Mensa \dotfill  {\colorbox{black!15}{VII/1}:~426}, {434}, {453}, {455}, {466f.}
+    \subitem -\,Mensa, {VII/1 426}, {434}, {453}, {455}, {466f}
 
 \indexspace
-\textbf{B}\label{L-xindex-B}
+\textbf{B}
 \nopagebreak[4]
   \item Bremen
-    \subitem -\,Heinz von, Erzbischof \dotfill  \see{Sachsen-Lauenburg}{ }
+    \subitem -\,Heinz von, Erzbischof, \see{Sachsen-Lauenburg}{}
 
 \indexspace
-\textbf{J}\label{L-xindex-J}
+\textbf{J}
 \nopagebreak[4]
   \item Julian
-    \subitem -\,Apostata, römischer Kaiser \dotfill  {\colorbox{black!15}{VII/2/1}:~904}
-  \item Justinian I., byzantinischer Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~326}, {734}, {\colorbox{black!15}{VII/2/1}:~1011}
+    \subitem -\,Apostata, römischer Kaiser, {VII/2/1 904}
+  \item Justinian I., byzantinischer Kaiser, {VII/1 326}, {734}, {VII/2/1 1011}
 
 \indexspace
-\textbf{K}\label{L-xindex-K}
+\textbf{K}
 \nopagebreak[4]
   \item Karl
-    \subitem -\,II., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~147}
-    \subitem -\,III., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~149}
-    \subitem -\,IV., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~147}, {147}
-    \subitem -\,V., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~34}
-    \subitem -\,VI., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~296}
-    \subitem -\,IX., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~296}
-    \subitem -\,X., Kaiser \dotfill  {\colorbox{black!15}{VII/1}:~149}
-  \item Karl II \dotfill  {\colorbox{black!15}{VII/1}:~147}
-  \item Karl III \dotfill  {\colorbox{black!15}{VII/1}:~149}
-  \item Karl IV \dotfill  {\colorbox{black!15}{VII/1}:~147}, {147}
-  \item Karl V \dotfill  {\colorbox{black!15}{VII/1}:~34}
-  \item Karl VI \dotfill  {\colorbox{black!15}{VII/1}:~296}
-  \item Karl IX \dotfill  {\colorbox{black!15}{VII/1}:~296}
-  \item Karl X \dotfill  {\colorbox{black!15}{VII/1}:~149}
+    \subitem -\,II., Kaiser, {VII/1 147}
+    \subitem -\,III., Kaiser, {VII/1 149}
+    \subitem -\,IV., Kaiser, {VII/1 147}, {34}
+    \subitem -\,IX., Kaiser, {VII/1 296}
+    \subitem -\,V., Kaiser, {VII/1 34}
+    \subitem -\,VI., Kaiser, {VII/1 296}
+    \subitem -\,X., Kaiser, {VII/1 149}
 
 \indexspace
-\textbf{O}\label{L-xindex-O}
+\textbf{O}
 \nopagebreak[4]
   \item Osnabrück
-    \subitem -\,Heinz  von, Bischof \dotfill  \see{Sachsen-Lauenburg}{ }
+    \subitem -\,Heinz  von, Bischof, \see{Sachsen-Lauenburg}{}
 
 \indexspace
-\textbf{S}\label{L-xindex-S}
+\textbf{S}
 \nopagebreak[4]
   \item Schleswig-Holstein
-    \subitem -\,Rudolf von, Herzog \dotfill  {\colorbox{black!15}{VII/2/1}:~758--761}, {765}
+    \subitem -\,Rudolf von, Herzog, {VII/2/1 758--761}, {765}
 
 \indexspace
-\textbf{Z}\label{L-xindex-Z}
+\textbf{Z}
 \nopagebreak[4]
-  \item Zwingl, Haldrich \dotfill  {\colorbox{black!15}{IX}:~479}, {692}
+  \item Zwingl, Haldrich, {IX 479}, {692}
 \end{theindex}

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

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

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/tests/buch.ind
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/tests/buch.ind	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/tests/buch.ind	2020-06-03 21:22:07 UTC (rev 55401)
@@ -473,10 +473,11 @@
     \subitem -\,Stil, {378}
     \subitem -\,Tiefe, {64}
     \subitem -\,Warnung, {883}
-    \subitem -\,fett, {411}, {451}
   \item Schriftattribut, {660}
   \item Schrifteinbindung, {9}
   \item Schriftfamilie, {85}, {442}, {595}
+  \item Schrift
+    \subitem -\,fett, {411}, {451}
   \item Schriftgröße, {63}, {87}, {404}
   \item Schriftkodierung, {9}, {54}, {70}
   \item Schriftstärke, {87}

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

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

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

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

Modified: trunk/Master/texmf-dist/doc/lualatex/xindex/tests/runTests.sh
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/xindex/tests/runTests.sh	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/tests/runTests.sh	2020-06-03 21:22:07 UTC (rev 55401)
@@ -23,11 +23,7 @@
 echo "HADW"
 xindex -l de -c HAdW-eKO HADW > /dev/null
 lualatex HADW > /dev/null
-lualatex HADW > /dev/null
 
-echo "HADW2"
-xindex -l de --config HAdW-eKO HADW2 > /dev/null
-
 echo "Umlaute"
 xindex -l de Umlaute  > /dev/null
 lualatex Umlaute > /dev/null

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	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/doc/lualatex/xindex/xindex-doc.tex	2020-06-03 21:22:07 UTC (rev 55401)
@@ -80,7 +80,7 @@
 \def\setVersion#1{\setVVersion#1!!}
 \def\setVVersion#1=#2!!{\def\xIndexVersion{#2}} 
 
-\setVersion{version = 0.22}%  can be automatically changed by perl
+\setVersion{version = 0.23}%  can be automatically changed by perl
 
 \setkeys{dtk}{cleanup=true,force=false}
 
@@ -94,6 +94,8 @@
 \vfill
 Thanks to: \\
 Mark Baudoin;
+Denis Bitouzé;
+Michal Hoftich;
 Heiko Oberdiek;
 Matteo Paolini
 
@@ -162,6 +164,7 @@
     [-o,--output ]                        default is <input>.ind
     [-l,--language ]                      default is en 
     [-p,--prefix]                         default L
+    [-u,--use_UCA ]                       default is false
     <input file> 
 \end{verbatim}
 
@@ -306,11 +309,13 @@
 {\Japanese
 \begin{Verbatim}[fontfamily=helvetica,commandchars=\\<>]
 indexheader = { 
+  cs = {"Symboly", "Čísla"},
+  da = {"Symboler", "Tal"},
   de = {"Symbole", "Zahlen"},
   en = {"Symbols", "Numbers"},
-  fr = {"Symboles","Chiffre"},
+  fr = {"Symboles","Nombres"},
   it = {"Simboli", "Numeri"},
-\Japanese  jp = {"シンボル","番号"},
+  jp = {"シンボル","番号"},
 }
 \end{Verbatim}
 }
@@ -325,7 +330,7 @@
   crop,
   xindex,
   xindexOptions=-l it -e ">",
-  force=true,
+  force=false,
   runs=2,code,docType=latex,
   showFilename,
   align=\centering,
@@ -358,7 +363,7 @@
 
 
 \section{Sorting}
-
+\subsection{Default sorting by a character table}
 The default sorting is unicode aware and uses a translation table for accented characters:
 
 \begin{verbatim}
@@ -624,8 +629,56 @@
 \end{externalDocument}
 \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
+by Michal Hoftich's Lua package \texttt{LUA-UCA}, which should be part of any \TeX{} installation.
 
 
+\begin{externalDocument}[
+%  grfOptions={width=\dimexpr\linewidth-2\fboxsep-2\fboxrule},
+  mpwidth=0.55\linewidth,
+%  pages={6},
+  frame=false,
+  compiler=lualatex,
+  crop,
+  xindex,
+  xindexOptions=-u -l cs,
+  force=true,
+  runs=2,code,docType=latex,
+  showFilename,
+  align=\centering,
+  lstOptions={columns=fixed}]{xindex}
+\documentclass[paper=a6]{scrartcl}
+\makeatletter
+\def\theindex{%    only for demonstration
+  \section*{\indexname}
+  \parskip\z@ \@plus .3\p@\relax \parindent\z@
+  \let\item\@idxitem}
+\makeatother
+%StartVisiblePreamble
+\usepackage{multicol}
+\usepackage{makeidx}\makeindex
+\def\Index#1{#1\index{#1}}
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+Sorted with \verb|-u -l cs|
+\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ů}
+\begin{multicols}{2} \printindex \end{multicols}
+\end{document}
+\end{externalDocument}
+
+The sorting order can be easliy modified. Read the documentation of the package \texttt{LUA-UCA}
+on how to do it and what languages are supported so far. Any additional code setting for
+UCA should be dont in the file \Lfile{xindex-cfg-uca.lua}, which will automatically be read
+by \Lprog{xindex}.
+
+
+
+
 %\clearpage
 
 \section{Compressing pagenumbers}\label{Compressing}
@@ -643,12 +696,14 @@
 \small
 \begin{Verbatim}[fontfamily=helvetica]
 folium = { 
+  cs = {"f.", "ff."},
+  da = {"f", "ff"},
   de = {"f", "ff"},
   en = {"f", "ff"},
-  fr = {"\,sq","\,sqq"},
+  fr = {"\\,sq","\\,sqq"},
   it = {"f", "ff"},
+  jp = {"シンボル","番号"},
   no = {"\\,f.","\\,ff."},
-  jp = {"シンボル","番号"},
 }
 \end{Verbatim}
 }

Modified: trunk/Master/texmf-dist/scripts/xindex/xindex.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/xindex/xindex.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/scripts/xindex/xindex.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -8,7 +8,7 @@
 -----------------------------------------------------------------------
 
         xindex = xindex or { }
- local version = 0.22
+ local version = 0.23
 xindex.version = version
 --xindex.self = "xindex"
 
@@ -49,6 +49,7 @@
     -o,--output (default "")
     -l,--language (default en)
     -p,--prefix (default L)
+    -u,--use_UCA
     <input> (string)
 ]]
 
@@ -174,6 +175,8 @@
   {esc_char..')', '//escapedparenright//',')'    }
 }
 
+local language = "en" -- default language
+
 language = string.lower(args["language"]):sub(1, 2)
 writeLog(2,"Language = "..language.."\n",1) 
 if (indexheader[language] == nil) then
@@ -189,6 +192,39 @@
   page_folium = folium[language]
 end  
 
+use_UCA = args["use_UCA"]
+if use_UCA then
+  writeLog(1,"Will use LUA-UCA\n",1)
+  ducet = require "lua-uca.lua-uca-ducet"
+  collator = require "lua-uca.lua-uca-collator"
+  languages = require "lua-uca.lua-uca-languages"
+  collator_obj = collator.new(ducet)
+  
+  local uca_config_file = "xindex-cfg-uca.lua"
+  writeLog(2,"Loading local UCA config file "..uca_config_file,0)
+  UCA_Config_File = kpse.find_file(uca_config_file) 
+  uca_cfg = require(UCA_Config_File)
+  writeLog(2," ... done\n",0)
+  
+-- language name specified on the command line doesn't seem to be available
+-- in the config file, so we just try to find it ourselves
+  for i, a in ipairs(arg) do
+    if a == "-l" or a=="--language" then
+      language = arg[i+1]
+      break
+    end
+  end
+
+  if languages[language] then
+    print("[Lua-UCA] Loading language: " .. language)
+    collator_obj = languages[language](collator_obj)
+  end
+else
+  writeLog(1,"Will _not_ use LUA-UCA\n",1)
+end
+
+upper = unicode.utf8.upper
+
 no_caseSensitive = args["no_casesensitive"]
 if no_caseSensitive then
   writeLog(1,"Sorting will be no case sensitive\n",1)

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.22,
+      version = 0.23,
       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	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -9,7 +9,7 @@
 -- configuration for index files of the Heidelberger Akademie der Wissenschaften
 
 if not modules then modules = { } end modules ['xindex-HAdW-eKO'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -6,7 +6,7 @@
 --      LICENSE:  LPPL1.3
 -----------------------------------------------------------------------
 
-local info = { version = 0.22 } 
+local info = { version = 0.23 } 
 
 -- check config
 if pageNoPrefixDel ~= "" then 
@@ -120,6 +120,21 @@
 end
 ]]   -- no more needed, we redo the setting 
 
+if use_UCA then
+  for i=1, #NewIndex do
+    v = NewIndex[i]
+    -- the collator:get_lowest_char will return character on the given
+    -- position. It will be lowercase and without accents.
+    local codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.SortKey))
+    v.sortChar = getSortChar(codepoints) --or getSortChar(collator_obj:string_to_codepoints(NormalizedUpper(v.Entry)))
+    if not v.sortChar then
+      -- alternativelly use v.Entry if SortKey doesn't contain usable string
+      codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.Entry))
+      v.sortChar = getSortChar(codepoints)
+    end
+  end
+end
+
 if SORTendhook then
   NewIndex = SORTendhook(NewIndex)
 end

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg-common'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",
@@ -16,9 +16,10 @@
 
 indexheader = { 
   cs = {"Symboly", "Čísla"},
+  da = {"Symboler", "Tal"},
   de = {"Symbole", "Zahlen"},
   en = {"Symbols", "Numbers"},
-  fr = {"Symboles","Chiffre"},
+  fr = {"Symboles","Nombres"},
   it = {"Simboli", "Numeri"},
   jp = {"シンボル","番号"},
 }
@@ -25,6 +26,7 @@
 
 folium = { 
   cs = {"f.", "ff."},
+  da = {"f", "ff"},
   de = {"f", "ff"},
   en = {"f", "ff"},
   fr = {"\\,sq","\\,sqq"},

Added: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -0,0 +1,17 @@
+-----------------------------------------------------------------------
+--         FILE:  xindex-cfg-uca.lua
+--  DESCRIPTION:  configuration file for lua-uca
+-- REQUIREMENTS:  
+--       AUTHOR:  Herbert Voß
+--      LICENSE:  LPPL1.3
+-----------------------------------------------------------------------
+
+if not modules then modules = { } end modules ['xindex-cfg-lua'] = {
+      version = 0.23,
+      comment = "configuration to xindex-cfg-uca.lua",
+       author = "Herbert Voss",
+    copyright = "Herbert Voss",
+      license = "LPPL 1.3"
+}
+
+-- put any additional code for lua-uca here ---


Property changes on: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "main configuration to xindex.lua",
        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	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-cfg'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "DTK configuration to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -28,7 +28,7 @@
 --~ n       2
 --------------------------------
 if not modules then modules = { } end modules ['xindex-lapp'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "read parameter for xindex.lua",
        author = "Steve Donovan",
     copyright = "Steve Donovan",

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -7,7 +7,7 @@
 -----------------------------------------------------------------------
 
 if not modules then modules = { } end modules ['xindex-lib'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "main library  to xindex.lua",
        author = "Herbert Voss",
     copyright = "Herbert Voss",
@@ -569,43 +569,15 @@
   end
 end
 
-function UTFCompare(a,b)  
--- a, b are something like \indexentry{foo}{bar}
---  writeLog(1,"UTFCompare:  "..a["Entry"]..", "..a["pages"][1]["number"].." - "..b["Entry"]..", "..b["pages"][1]["number"].."\n",2)
---  k = k + 1
---  if (k % 50) == 0 then writeLog(1,".",1) end
-
+function UTFCompare(a,b)
   local A = a["SortKey"]
   local B = b["SortKey"]
-  
   writeLog(1,"UTFCompare: A--B "..A.."--"..B.."\n",2)
--- print(A,B)
---[[ 
-  if A == B then  -- same entry, use also page number
-    Apage = string.format("%09s",a["pages"][1]["number"])
-    Bpage = string.format("%09s",b["pages"][1]["number"])
-    A = string.format("%-90s",A)..Apage
-    B = string.format("%-90s",B)..Bpage
-  end
-  if numericPage then
-    if tonumber(a["pages"][1]["number"]) then
-      Apage = string.format("%09d",a["pages"][1]["number"])
-    else
-      Apage = string.format("%09d",romanToNumber(a["pages"][1]["number"]))
-    end
-    if tonumber(b["pages"][1]["number"]) then
-      Bpage = string.format("%09d",b["pages"][1]["number"])
-    else
-      Bpage = string.format("%09d",romanToNumber(b["pages"][1]["number"]))
-    end
+  if use_UCA then
+    return collator_obj:compare_strings(A,B)
   else
-    Apage = string.format("%09s",a["pages"][1]["number"])
-    Bpage = string.format("%09s",b["pages"][1]["number"])
+    return A<B
   end
-  A = string.format("%-90s",A)..Apage
-  B = string.format("%-90s",B)..Bpage
-]]
-  return A < B
 end
 
 function pageCompare(a,b)  -- a = {{number=...,special=..},{...,...}}
@@ -1012,3 +984,53 @@
 end
 
 
+-- get Unicode category of the codepoint, if supported
+function getCategory(codepoints)
+  local codepoint = codepoints[1]
+  local category = get_category(codepoint)
+  if category == "Nd" then 
+    return "digits"
+  elseif category:match("^L") then
+    local block =  binary_range_search(codepoint, unicode_blocks) or {}
+    return block[3] or "other"
+  end
+  return "other"
+end
+
+-- insert the index entry to the categories subtable
+function categorize(codepoints, entry, categories)
+  local subcategories = categories.categories
+  -- return category name from the Unicode block of the first character
+  local category = getCategory(codepoints)
+  -- if the categories doesn't use this code block, categorize it as other
+  local used = subcategories[category] and category or "other"
+  table.insert(subcategories[used], entry)
+end
+
+-- convert categories back to index list
+function uncategorize(ordering_categories)
+  local newlist = {}
+  -- make new index order based on defined categories
+  for _, category in ipairs(ordering_categories.order) do
+    for _,entry in ipairs(ordering_categories.categories[category]) do
+      newlist[#newlist+1] = entry
+    end
+  end
+  return newlist
+end
+
+function getSortChar(codepoints)
+  if #codepoints > 0 then 
+    local codes, pos = collator_obj:get_lowest_char(codepoints, 1)
+    if not codes then 
+      -- if the first character in the sort key doesn't return letter
+      -- continue until we find some
+      table.remove(codepoints, 1)
+      return getSortChar(codepoints)
+    end
+    local sort_char = utf8.char(table.unpack(codes))
+    -- print unicode category of the first char
+    return upper(sort_char) -- use unicode.utf8.upper to make the char uppercase
+  end
+end
+

Deleted: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -1,155 +0,0 @@
------------------------------------------------------------------------
---         FILE:  xindex-norsk.lua
---  DESCRIPTION:  configuration file for xindex.lua
--- REQUIREMENTS:  
---       AUTHOR:  Herbert Voß
---     MODIFIED:  Sveinung Heggen (2020-01-02)
---      LICENSE:  LPPL1.3
------------------------------------------------------------------------
-
-if not modules then modules = { } end modules ['xindex-norsk'] = {
-      version = 0.22,
-      comment = "configuration to xindex.lua",
-       author = "Herbert Voss",
-    copyright = "Herbert Voss",
-      license = "LPPL 1.3"
-}
-
-local ducet = require "lua-uca.lua-uca-ducet"
-local collator = require "lua-uca.lua-uca-collator"
-local languages = require "lua-uca.lua-uca-languages"
-local collator_obj = collator.new(ducet)
-
-local language = "en" -- default language
--- language name specified on the command line doesn't seem to be available
--- in the config file, so we just try to find it ourselves
-for i, a in ipairs(arg) do
-  if a == "-l" or a=="--language" then
-    language = arg[i+1]
-    break
-  end
-end
-
-if languages[language] then
-  print("[Lua-UCA] Loading language: " .. language)
-  collator_obj = languages[language](collator_obj)
-end
-
-local upper = unicode.utf8.upper
-
-escape_chars = { -- by default " is the escape char
-  {'""', "\\escapedquote",      '\"{}' },
-  {'"@', "\\escapedat",         "@"    },
-  {'"|', "\\escapedvert",       "|"    },
-  {'"!', "\\escapedexcl",       "!"    },
-  {'"(', "\\escapedparenleft",  "("   },
-  {'")', "\\escapedparenright", ")"  }
-}
-
-itemPageDelimiter = ","     -- Hello, 14
-compressPages     = true    -- something like 12--15, instead of 12,13,14,15. the |( ... |) syntax is still valid
-fCompress         = true    -- 3f -> page 3, 4 and 3ff -> page 3, 4, 5
-minCompress       = 3       -- 14--17 or 
-numericPage       = true    -- for non-numerical page numbers, like "VI-17"
-sublabels         = {"", "---\\,", "--\\,", "-\\,"} -- for the (sub(sub(sub-items  first one is for item
-pageNoPrefixDel   = ""     -- a delimiter for page numbers like "VI-17"
-indexOpening      = ""     -- commands after \begin{theindex}
-rangeSymbol       = "--"
-idxnewletter      = "\\textbf"  -- Only valid if -n is not set
-
-folium = { 
-  de = {"f.", "ff."},
-  en = {"f.", "ff."},
-  fr = {"\\,sq","\\,sqq"},
-  no = {"\\,f.","\\,ff."},
-  cs = {"f.", "ff."},
-} 
-
-indexheader = { 
-  de = {"Symbole", "Zahlen"},
-  en = {"Symbols", "Numbers"},
-  fr = {"Symboles","Chiffre"},
-  jp = {"シンボル","番号"},
-  cs = {"Symboly", "Čísla"}
-}
-
-
--- get Unicode category of the codepoint, if supported
-function getCategory(codepoints)
-  local codepoint = codepoints[1]
-  local category = get_category(codepoint)
-  if category == "Nd" then 
-    return "digits"
-  elseif category:match("^L") then
-    local block =  binary_range_search(codepoint, unicode_blocks) or {}
-    return block[3] or "other"
-  end
-  return "other"
-end
-
--- insert the index entry to the categories subtable
-function categorize(codepoints, entry, categories)
-  local subcategories = categories.categories
-  -- return category name from the Unicode block of the first character
-  local category = getCategory(codepoints)
-  -- if the categories doesn't use this code block, categorize it as other
-  local used = subcategories[category] and category or "other"
-  table.insert(subcategories[used], entry)
-end
-
--- convert categories back to index list
-function uncategorize(ordering_categories)
-  local newlist = {}
-  -- make new index order based on defined categories
-  for _, category in ipairs(ordering_categories.order) do
-    for _,entry in ipairs(ordering_categories.categories[category]) do
-      newlist[#newlist+1] = entry
-    end
-  end
-  return newlist
-end
-
-
-function UTFCompare(a,b)
-  local A = a["SortKey"]
-  local B = b["SortKey"]
-  return collator_obj:compare_strings(A,B)
-end
-
-function getSortChar(codepoints)
-  if #codepoints > 0 then 
-    local codes, pos = collator_obj:get_lowest_char(codepoints, 1)
-    if not codes then 
-      -- if the first character in the sort key doesn't return letter
-      -- continue until we find some
-      table.remove(codepoints, 1)
-      return getSortChar(codepoints)
-    end
-    local sort_char = utf8.char(table.unpack(codes))
-    -- print unicode category of the first char
-    return upper(sort_char) -- use unicode.utf8.upper to make the char uppercase
-  end
-end
-
-function SORTendhook(list)
-  -- get the headers for letter groups
-  for i=1, #list do
-    v = list[i]
-    -- the collator:get_lowest_char will return character on the given
-    -- position. It will be lowercase and without accents.
-    local codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.SortKey))
-    v.sortChar = getSortChar(codepoints) --or getSortChar(collator_obj:string_to_codepoints(NormalizedUpper(v.Entry)))
-    if not v.sortChar then
-      -- alternativelly use v.Entry if SortKey doesn't contain usable string
-      codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.Entry))
-      v.sortChar = getSortChar(codepoints)
-    end
-  end
-  return list
-end
-
--- We use Lua-UCA methods for sorting and determining first characters, so
--- alphabet list is obsolete
-
-alphabet_lower = { }
-alphabet_upper = { }

Modified: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua	2020-06-03 21:21:38 UTC (rev 55400)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -5,7 +5,7 @@
 --
 
 if not modules then modules = { } end modules ['xindex-pretty'] = {
-      version = 0.22,
+      version = 0.23,
       comment = "dump a Lua table for debugging",
        author = "Steve Donovan",
     copyright = "Steve Donovan",

Added: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua	2020-06-03 21:22:07 UTC (rev 55401)
@@ -0,0 +1,260 @@
+-----------------------------------------------------------------------
+--         FILE:  xindex-yannis.lua
+--  DESCRIPTION:  configuration file for xindex.lua 
+-- REQUIREMENTS:  
+--       AUTHOR:  Herbert Voß
+--      LICENSE:  LPPL1.3
+-----------------------------------------------------------------------
+
+if not modules then modules = { } end modules ['xindex-yannis'] = {
+      version = 0.23,
+      comment = "main configuration to xindex.lua",
+       author = "Herbert Voss",
+    copyright = "Herbert Voss",
+      license = "LPPL 1.3"
+}
+
+itemPageDelimiter = ","     -- Hello, 14
+compressPages     = true    -- something like 12--15, instaead of 12,13,14,15. the |( ... |) syntax is still valid
+fCompress	  = false    -- 3f -> page 3, 4 and 3ff -> page 3, 4, 5
+minCompress       = 2       -- 14--17 or 
+rangeSymbol       = "-"     -- 14-17 instead of -- 
+numericPage       = true    -- for non numerical pagenumbers, like "VI-17"
+sublabels         = {"", "-\\,", "--\\,", "---\\,"} -- for the (sub(sub(sub-items  first one is for item
+pageNoPrefixDel   = ""     -- a delimiter for page numbers like "VI-17"  -- not used !!!
+indexOpening      = ""     -- commands after \begin{theindex}
+idxnewletter      = "\\textbf"  -- Only valid if -n is not set
+
+
+--[[
+    Each character's position in this array-like table determines its 'priority'.
+    Several characters in the same slot have the same 'priority'.
+]]
+alphabet_lower = { --   for sorting
+    { 'α', 'ά', 'ὰ', 'ᾶ', 'ἀ', 'ἄ', 'ἂ', 'ἆ', 'ἁ', 'ἅ', 'ἃ', 'ἇ', 'ᾳ', 'ᾴ', 'ᾲ', 'ᾷ', 'ᾀ', 'ᾄ', 'ᾂ', 'ᾆ', 'ᾁ', 'ᾅ', 'ᾃ', 'ᾇ' },
+    { 'β', 'ϐ' },
+    { 'γ' },
+    { 'δ' },
+    { 'ε', 'έ', 'ὲ', 'ἐ', 'ἔ', 'ἒ', 'ἑ', 'ἕ', 'ἓ' },
+    { 'ζ' },
+    { 'η', 'ή', 'ὴ', 'ῆ', 'ἠ', 'ἤ', 'ἢ', 'ἦ', 'ἡ', 'ἥ', 'ἣ', 'ἧ', 'ῃ', 'ῄ', 'ῂ', 'ῇ', 'ᾐ', 'ᾔ', 'ᾒ', 'ᾖ', 'ᾑ', 'ᾕ', 'ᾓ', 'ᾗ' },
+    { 'θ' },
+    { 'ι', 'ί', 'ὶ', 'ῖ', 'ἰ', 'ἴ', 'ἲ', 'ἶ', 'ἱ', 'ἵ', 'ἳ', 'ἷ', 'ϊ', 'ΐ', 'ῒ', 'ῗ' },
+    { 'κ' },
+    { 'λ' },
+    { 'μ' },
+    { 'ν' },
+    { 'ξ' },
+    { 'ο', 'ό', 'ὸ', 'ὀ', 'ὄ', 'ὂ', 'ὁ', 'ὅ', 'ὃ' },
+    { 'π' },
+    { 'ρ' },
+    { 'σ', 'ς' },
+    { 'τ' },
+    { 'υ', 'ύ', 'ὺ', 'ῦ', 'ὐ', 'ὔ', 'ὒ', 'ὖ', 'ὑ', 'ὕ', 'ὓ', 'ὗ', 'ϋ', 'ΰ', 'ῢ', 'ῧ' },
+    { 'φ' },
+    { 'χ' },
+    { 'ψ' },
+    { 'ω', 'ώ', 'ὼ', 'ῶ', 'ὠ', 'ὤ', 'ὢ', 'ὦ', 'ὡ', 'ὥ', 'ὣ', 'ὧ', 'ῳ', 'ῴ', 'ῲ', 'ῷ', 'ᾠ', 'ᾤ', 'ᾢ', 'ᾦ', 'ᾡ', 'ᾥ', 'ᾣ', 'ᾧ' },
+    { 'a', 'á', 'à', 'ä', 'å', 'æ', },
+    { 'b' },
+    { 'c', 'ç' },
+    { 'd' },
+    { 'e', 'é', 'è', 'ë' },
+    { 'f' },
+    { 'g' },
+    { 'h' },
+    { 'i', 'í', 'ì', 'ï' },
+    { 'j' },
+    { 'k' },
+    { 'l' },
+    { 'm' },
+    { 'n', 'ñ' },
+    { 'o', 'ó', 'ò', 'ö', 'ø', 'œ'},
+    { 'p' },
+    { 'q' },
+    { 'r' },
+    { 's', 'š', 'ß' },
+    { 't' },
+    { 'u', 'ú', 'ù', 'ü' },
+    { 'v' },
+    { 'w' },
+    { 'x' },
+    { 'y', 'ý', 'ÿ' },
+    { 'z', 'ž' },
+    { 'а' },
+    { 'б' },
+    { 'в' },
+    { 'г', 'ѓ' },
+    { 'д' },
+    { 'е', 'ё' },
+    { 'ж' },
+    { 'з' },
+    { 'и', 'і' },
+    { 'й' },
+    { 'к' },
+    { 'л' },
+    { 'м' },
+    { 'н' },
+    { 'о' },
+    { 'п' },
+    { 'р' },
+    { 'с' },
+    { 'т' },
+    { 'у' },
+    { 'ф' },
+    { 'х' },
+    { 'ц' },
+    { 'ч' },
+    { 'ш' },
+    { 'щ' },
+    { 'ъ' },
+    { 'ы' },
+    { 'ь' },
+    { 'э' },
+    { 'ю' },
+    { 'я' },
+}
+alphabet_upper = { -- for sorting
+    { 'Α', 'Ά', 'Ἀ', 'Ἄ', 'Ἂ', 'Ἆ', 'Ἁ', 'Ἅ', 'Ἃ', 'Ἇ', 'ᾼ', 'ᾈ', 'ᾌ', 'ᾊ', 'ᾎ', 'ᾉ', 'ᾍ', 'ᾋ', 'ᾏ' },
+    { 'Β' },
+    { 'Γ' },
+    { 'Δ' },
+    { 'Ε', 'Έ', 'Ἐ', 'Ἔ', 'Ἒ', 'Ἑ', 'Ἕ', 'Ἓ' },
+    { 'Ζ' },
+    { 'Η', 'Ή', 'Ἠ', 'Ἤ', 'Ἢ', 'Ἦ', 'Ἡ', 'Ἥ', 'Ἣ', 'Ἧ', 'ῌ', 'ᾘ', 'ᾜ', 'ᾚ', 'ᾞ', 'ᾙ', 'ᾝ', 'ᾟ' },
+    { 'Θ' },
+    { 'Ι', 'Ί', 'Ἰ', 'Ἴ', 'Ἲ', 'Ἶ', 'Ἱ', 'Ἵ', 'Ἳ', 'Ἷ', 'Ϊ' },
+    { 'Κ' },
+    { 'Λ' },
+    { 'Μ' },
+    { 'Ν' },
+    { 'Ξ' },
+    { 'Ο', 'Ό', 'Ὀ', 'Ὄ', 'Ὂ', 'Ὁ', 'Ὅ', 'Ὃ' },
+    { 'Π' },
+    { 'Ρ' },
+    { 'Σ' },
+    { 'Τ' },
+    { 'Υ', 'Ύ', 'Ὑ', 'Ὕ', 'Ὓ', 'Ὗ', 'Ϋ' },
+    { 'Φ' },
+    { 'Χ' },
+    { 'Ψ' },
+    { 'Ω', 'Ώ', 'Ὠ', 'Ὤ', 'Ὢ', 'Ὦ', 'Ὡ', 'Ὥ', 'Ὣ', 'Ὧ', 'ῼ', 'ᾩ', 'ᾭ', 'ᾫ', 'ᾯ', 'ᾨ', 'ᾬ', 'ᾪ', 'ᾮ' },
+    { 'A', 'Á', 'À', 'Ä', 'Å', 'Æ'},
+    { 'B' },
+    { 'C', 'Ç' },
+    { 'D' },
+    { 'E', 'È', 'È', 'Ë' },
+    { 'F' },
+    { 'G' },
+    { 'H' },
+    { 'I', 'Í', 'Ì', 'Ï' },
+    { 'J' },
+    { 'K' },
+    { 'L' },
+    { 'M' },
+    { 'N', 'Ñ' },
+    { 'O', 'Ó', 'Ò', 'Ö', 'Ø','Œ' },
+    { 'P' },
+    { 'Q' },
+    { 'R' },
+    { 'S', 'Š' },
+    { 'T' },
+    { 'U', 'Ú', 'Ù', 'Ü' },
+    { 'V' },
+    { 'W' },
+    { 'X' },
+    { 'Y', 'Ý', 'Ÿ' },
+    { 'Z', 'Ž' },
+    { 'А' },
+    { 'Б' },
+    { 'В' },
+    { 'Г', 'Ѓ' },
+    { 'Д' },
+    { 'Е', 'Ё' },
+    { 'Ж' },
+    { 'З' },
+    { 'И', 'І' },
+    { 'Й' },
+    { 'К' },
+    { 'Л' },
+    { 'М' },
+    { 'Н' },
+    { 'О' },
+    { 'П' },
+    { 'Р' },
+    { 'С' },
+    { 'Т' },
+    { 'У' },
+    { 'Ф' },
+    { 'Х' },
+    { 'Ц' },
+    { 'Ч' },
+    { 'Ш' },
+    { 'Щ' },
+    { 'Ъ' },
+    { 'Ы' },
+    { 'Ь' },
+    { 'Э' },
+    { 'Ю' },
+    { 'Я' },
+}
+
+
+function SORTendhook(list)
+  print ("We have "..#list.." total list entries")
+  local greek = {}
+  local latin = {}
+  local cyrillic = {}
+  local symbols = {}
+  local numbers = {}
+  local others = {}
+  local firstChar, charType
+  local firstCharNumber
+  local v
+  for i=1,#list do
+    v = list[i]
+    firstChar = NormalizedUppercase(utf.sub(v["sortChar"],1,1))
+    v["sortChar"] = firstChar -- to be sure it is an uppercase unicode char
+    firstCharNumber = string.utfvalue(firstChar)
+    charType = getCharType(firstChar)
+--    print (utf.sub(v["sortChar"],1,1).."->"..firstChar.." ("..firstCharNumber..") ".." ("..charType..")")
+    if charType == 0 then 
+      symbols[#symbols+1] = v
+    elseif charType == 1 then 
+      numbers[#numbers+1] = v
+    elseif firstCharNumber > 0x052F then  -- 0x052F is last cyrillic character
+      others[#others+1] = v
+    elseif firstCharNumber >= 0x0400 then -- 0x0400-0x052F cyrillic characters
+      cyrillic[#cyrillic+1] = v
+    elseif firstCharNumber <= 0x03FF then -- 0x03FF is last greek character
+      if firstCharNumber >= 0x0370 then
+        greek[#greek+1] = v               -- 0x0370-0x03FF greek characters
+      elseif firstCharNumber <= 0x024F then
+        if firstCharNumber >= 0x041 then  -- 0x041-0x024F latin character
+          latin[#latin+1] = v
+        else
+          others[#others+1] = v           -- everything else
+        end
+      end
+    end
+  end
+  print ("We have "..#greek.." Greek entries")
+  print ("We have "..#latin.." Latin entries")
+  print ("We have "..#cyrillic.." Cyrillic entries")
+  print ("We have "..#symbols.." Symbol entries")
+  print ("We have "..#numbers.." Number entries")
+  print ("We have "..#others.." other entries")
+  list = {}
+  for i = 1,#greek do list[#list+1] = greek[i] end
+  list[#list]["Macro"] = "\\vspace{1cm}"
+  for i = 1,#latin do list[#list+1] = latin[i] end
+  list[#list]["Macro"] = "\\vspace{1cm}"
+  for i = 1,#cyrillic do list[#list+1] = cyrillic[i] end
+  list[#list]["Macro"] = "\\vspace{1cm}"
+  for i = 1,#symbols do list[#list+1] = symbols[i] end
+  for i = 1,#numbers do list[#list+1] = numbers[i] end
+  for i = 1,#others do list[#list+1] = others[i] end
+  print ("Sorted "..#list.." entries")
+  return list
+end
+


Property changes on: trunk/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


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