From 10e6cd9ce34c0ec20d007ebe6ce8fca9783b7309 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 5 Apr 2013 23:29:43 +0000 Subject: splitindex (5apr13) git-svn-id: svn://tug.org/texlive/trunk@29688 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/texk/texlive/linked_scripts/Makefile.am | 2 +- .../source/texk/texlive/linked_scripts/Makefile.in | 2 +- .../linked_scripts/splitindex/perl/splitindex.pl | 212 ----- .../linked_scripts/splitindex/splitindex.pl | 212 +++++ Master/bin/alpha-linux/splitindex | 2 +- Master/bin/amd64-freebsd/splitindex | 2 +- Master/bin/amd64-kfreebsd/splitindex | 2 +- Master/bin/armel-linux/splitindex | 2 +- Master/bin/i386-cygwin/splitindex | 2 +- Master/bin/i386-freebsd/splitindex | 2 +- Master/bin/i386-kfreebsd/splitindex | 2 +- Master/bin/i386-linux/splitindex | 2 +- Master/bin/i386-solaris/splitindex | 2 +- Master/bin/mipsel-linux/splitindex | 2 +- Master/bin/powerpc-aix/splitindex | 2 +- Master/bin/powerpc-linux/splitindex | 2 +- Master/bin/sparc-solaris/splitindex | 2 +- Master/bin/universal-darwin/splitindex | 2 +- Master/bin/x86_64-darwin/splitindex | 2 +- Master/bin/x86_64-linux/splitindex | 2 +- Master/bin/x86_64-solaris/splitindex | 2 +- Master/texmf-dist/doc/latex/splitindex/README | 20 +- Master/texmf-dist/doc/latex/splitindex/install.txt | 120 +-- .../texmf-dist/doc/latex/splitindex/manifest.txt | 62 ++ .../texmf-dist/doc/latex/splitindex/splitidx.pdf | Bin 243672 -> 420911 bytes .../scripts/splitindex/perl/splitindex.pl | 212 ----- Master/texmf-dist/scripts/splitindex/splitindex.pl | 212 +++++ .../texmf-dist/scripts/splitindex/splitindex.tlu | 50 ++ .../scripts/splitindex/splitindex_main.tlu | 187 ++++ Master/texmf-dist/source/latex/splitindex/README | 20 +- .../texmf-dist/source/latex/splitindex/install.sh | 346 +++----- .../texmf-dist/source/latex/splitindex/install.txt | 120 +-- .../source/latex/splitindex/manifest.txt | 21 +- .../source/latex/splitindex/splitidx.dtx | 942 ++++++++++++--------- .../source/latex/splitindex/splitindex-Linux-i386 | Bin 9924 -> 0 bytes .../latex/splitindex/splitindex-OpenBSD-i386 | Bin 16384 -> 0 bytes .../source/latex/splitindex/splitindex.1 | 10 +- .../source/latex/splitindex/splitindex.class | Bin 9303 -> 0 bytes .../source/latex/splitindex/splitindex.exe | Bin 18944 -> 0 bytes .../source/latex/splitindex/splitindex.tlu | 50 ++ .../source/latex/splitindex/splitindex_main.tlu | 187 ++++ .../tex/generic/splitindex/splitindex.tex | 189 +++++ .../texmf-dist/tex/latex/splitindex/splitidx.sty | 15 +- .../texmf-dist/tex/latex/splitindex/splitindex.tex | 189 ----- Master/texmf/doc/man/man1/splitindex.1 | 10 +- Master/texmf/doc/man/man1/splitindex.man1.pdf | Bin 4716 -> 4755 bytes Master/tlpkg/libexec/ctan2tds | 13 +- 47 files changed, 2031 insertions(+), 1406 deletions(-) delete mode 100755 Build/source/texk/texlive/linked_scripts/splitindex/perl/splitindex.pl create mode 100755 Build/source/texk/texlive/linked_scripts/splitindex/splitindex.pl create mode 100644 Master/texmf-dist/doc/latex/splitindex/manifest.txt delete mode 100755 Master/texmf-dist/scripts/splitindex/perl/splitindex.pl create mode 100755 Master/texmf-dist/scripts/splitindex/splitindex.pl create mode 100755 Master/texmf-dist/scripts/splitindex/splitindex.tlu create mode 100644 Master/texmf-dist/scripts/splitindex/splitindex_main.tlu delete mode 100755 Master/texmf-dist/source/latex/splitindex/splitindex-Linux-i386 delete mode 100755 Master/texmf-dist/source/latex/splitindex/splitindex-OpenBSD-i386 delete mode 100644 Master/texmf-dist/source/latex/splitindex/splitindex.class delete mode 100755 Master/texmf-dist/source/latex/splitindex/splitindex.exe create mode 100755 Master/texmf-dist/source/latex/splitindex/splitindex.tlu create mode 100644 Master/texmf-dist/source/latex/splitindex/splitindex_main.tlu create mode 100644 Master/texmf-dist/tex/generic/splitindex/splitindex.tex delete mode 100644 Master/texmf-dist/tex/latex/splitindex/splitindex.tex diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 90562bc7d2c..d971fcbd994 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -142,7 +142,7 @@ texmf_dist_other_scripts = \ pst2pdf/pst2pdf.pl \ ptex2pdf/ptex2pdf.lua \ purifyeps/purifyeps \ - splitindex/perl/splitindex.pl \ + splitindex/splitindex.pl \ sty2dtx/sty2dtx.pl \ svn-multi/svn-multi.pl \ texdoc/texdoc.tlu \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index f88da960bb8..4edfd749271 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -319,7 +319,7 @@ texmf_dist_other_scripts = \ pst2pdf/pst2pdf.pl \ ptex2pdf/ptex2pdf.lua \ purifyeps/purifyeps \ - splitindex/perl/splitindex.pl \ + splitindex/splitindex.pl \ sty2dtx/sty2dtx.pl \ svn-multi/svn-multi.pl \ texdoc/texdoc.tlu \ diff --git a/Build/source/texk/texlive/linked_scripts/splitindex/perl/splitindex.pl b/Build/source/texk/texlive/linked_scripts/splitindex/perl/splitindex.pl deleted file mode 100755 index 70c61720c9b..00000000000 --- a/Build/source/texk/texlive/linked_scripts/splitindex/perl/splitindex.pl +++ /dev/null @@ -1,212 +0,0 @@ -#! /usr/bin/perl -w -eval 'exec perl -S $0 ${1+"$@"}' - if 0; #$running_under_some_shell - -# ====================================================================== -# splitindex.pl -# Copyright (c) Markus Kohm, 2002-2009 -# -# $Id: splitindex.pl,v 1.3 2009-03-20 14:55:11 mjk Exp $ -# -# This file is part of the SplitIndex bundle. -# -# This work may be distributed and/or modified under the conditions of -# the LaTeX Project Public License, version 1.3c of the license. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3c or later is part of all distributions of LaTeX -# version 2005/12/01 or later and of this work. -# -# This work has the LPPL maintenance status "author-maintained". -# -# The Current Maintainer and author of this work is Markus Kohm. -# -# The list of all files belongig to the SplitIndex bundle is given in -# in the file `manifest.txt'. Files generated by means of unpacking the -# distribution (using, for example, the docstrip program) or by means -# of compiling them from a source file, for example, from splitindex.c -# or splitindex.java may be distributed at the distributor's discretion. -# However if they are distributed then a copy of the SplitIndex bundle -# must be distributed together with them. -# -# The list of derived (unpacked or compiled) files belongig to the -# distribution and covered by LPPL is defined by the unpacking scripts -# (with extension .ins) and the installation script (with name -# install.sh) which are part of the distribution. -# -# Two often ignorred clauses from LPPL 1.3c you should not ignore: -# ---------------------------------------------------------------- -# 2. You may distribute a complete, unmodified copy of the Work as you -# received it. Distribution of only part of the Work is considered -# modification of the Work, and no right to distribute such a Derived -# Work may be assumed under the terms of this clause. -# 3. You may distribute a Compiled Work that has been generated from a -# complete, unmodified copy of the Work as distributed under Clause 2 -# above, as long as that Compiled Work is distributed in such a way that -# the recipients may install the Compiled Work on their system exactly -# as it would have been installed if they generated a Compiled Work -# directly from the Work. -# ====================================================================== - -use strict; -use Getopt::Long; - -my $makeindex = "makeindex"; -# my $identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)\$"; -my $identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)\$"; -my $suffixis = "-\$2"; -my $lineis = "\$1\$3"; -my $verbose = 0; # option verbose with default value -my $result = GetOptions( - 'help' => sub { help() }, - 'makeindex=s' => \$makeindex, - 'identify=s' => \$identify, - 'resultis=s' => \$lineis, - 'suffixis=s' => \$suffixis, - 'verbose|v+' => \$verbose, - 'version' => sub { version(); exit 0; } - ); - -usage("missing raw index file") if ( $#ARGV < 0 ); - -my $indexinput = shift; -my $jobname = ( $indexinput =~ /^(.*)\.idx$/ ) ? $1 : $indexinput; - -my %idxfile; -my %linesatidxfile; - -version() if ($verbose > 0); - -if ( !( open (IDX,"<$indexinput") ) ) { - if ( $indexinput ne "$jobname.idx" ) { - open (IDX,"<$jobname.idx") || - die "Cannot read raw index file $indexinput nor $jobname.idx"; - $indexinput = "$jobname.idx"; - } else { - die "Cannot read raw index file $indexinput"; - } -} - -while () { - my $line; - my $suffix; - if ( /$identify/ ) { - my $eval = "\$line = \"$lineis\n\""; - eval $eval; - $eval = "\$suffix = \"$suffixis\""; - eval $eval; - } else { - $line = $_; - $suffix = ""; - $suffix .= "$1" if ( $suffixis =~ /^(.*)\$/ ); - $suffix .= "idx"; - $suffix .= "$1" if ( $suffixis =~ /\$[123456789](.*)$/ ); - } - while ( $suffix =~ /(^[^,]+)(.*)$/ ) { - $suffix = $2; - writetoidx ($1,$line); - } -} - -closeallind(); - -close(IDX); - -generateallind(@ARGV); - -exit 0; - -sub generateallind { - my $name; - my $file; - - if ( $makeindex ne "" ) { - while (($name,$file) = each %idxfile) { - system( "$makeindex @ARGV $jobname$name.idx" ); - } - } -} - -sub closeallind { - my $name; - my $file; - my $lines; - while (($name,$file) = each %idxfile) { - print "Close $jobname$name.idx\n" - if ( $verbose > 1 ); - close( $file ); - $idxfile{$name}=0; - } - if ( $verbose > 0 ) { - print "\n"; - while (($name,$lines) = each %linesatidxfile) { - print "$jobname$name.idx with $lines lines\n"; - } - } -} - -sub writetoidx { - my $suffix = $_[0]; - my $line = $_[1]; - my $file = $idxfile{$suffix}; - if ( ! $file ) { - open ( $file, ">$jobname$suffix.idx" ) || - die "Cannot write to file $jobname$suffix.idx"; - $idxfile{$suffix} = $file; - $linesatidxfile{$suffix} = 0; - print( "New index file $jobname$suffix.idx\n" ) - if ( $verbose > 1 ); - } - print ($file $line); - $linesatidxfile{$suffix}++; -} - -sub help { - version(); - print "\n"; - usage(); - print - "Split a single raw index file into multiple raw index files.\n". - "Example: splitindex.pl foo.idx.\n". - "\n". - "Options:\n" . - " -h, --help " . - "\tshow this help and terminate\n" . - " -m, --makeindex PROGNAME\n" . - "\t\t\tcall PROGNAME instead of default \`makeindex\'.\n" . - " -i, --identify EXPRESSION\n" . - "\t\t\tuse regular EXPRESSION to match entries\n". - "\t\t\t(see also option --resultis and --suffixis).\n". - "\t\t\tDefault is \'$identify\'.\n". - " -r, --resultis PATTERN\n" . - "\t\t\tcreate line to be written from PATTERN after matching\n". - "\t\t\tlines (see also option --identify).\n". - "\t\t\tDefault is \'$lineis\'.\n". - " -s, --suffixis PATTERN\n" . - "\t\t\tcreate suffix to be used from PATTERN after matching\n". - "\t\t\tlines (see also option --identify).\n". - "\t\t\tDefault is \'$suffixis\'.\n". - " -v, --verbose " . - "\tbe more verbose\n". - "\t\t\t(can be used multiple to increase verbosity)\n" . - " --version " . - "\tshow version and terminate\n"; - exit 0; -} - -sub version { - print "splitindex.pl 0.1\n" . - "Copyright (c) 2002 Markus Kohm \\n"; -} - -sub usage { - my $text = "Usage: splitindex.pl [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n"; - if ( $#_ >= 0 ) { - print STDERR @_; - print STDERR "\n$text"; - print STDERR "Try \`splitindex.pl --help\' for more information.\n"; - exit 1; - } else { - print $text; - } -} diff --git a/Build/source/texk/texlive/linked_scripts/splitindex/splitindex.pl b/Build/source/texk/texlive/linked_scripts/splitindex/splitindex.pl new file mode 100755 index 00000000000..70c61720c9b --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/splitindex/splitindex.pl @@ -0,0 +1,212 @@ +#! /usr/bin/perl -w +eval 'exec perl -S $0 ${1+"$@"}' + if 0; #$running_under_some_shell + +# ====================================================================== +# splitindex.pl +# Copyright (c) Markus Kohm, 2002-2009 +# +# $Id: splitindex.pl,v 1.3 2009-03-20 14:55:11 mjk Exp $ +# +# This file is part of the SplitIndex bundle. +# +# This work may be distributed and/or modified under the conditions of +# the LaTeX Project Public License, version 1.3c of the license. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3c or later is part of all distributions of LaTeX +# version 2005/12/01 or later and of this work. +# +# This work has the LPPL maintenance status "author-maintained". +# +# The Current Maintainer and author of this work is Markus Kohm. +# +# The list of all files belongig to the SplitIndex bundle is given in +# in the file `manifest.txt'. Files generated by means of unpacking the +# distribution (using, for example, the docstrip program) or by means +# of compiling them from a source file, for example, from splitindex.c +# or splitindex.java may be distributed at the distributor's discretion. +# However if they are distributed then a copy of the SplitIndex bundle +# must be distributed together with them. +# +# The list of derived (unpacked or compiled) files belongig to the +# distribution and covered by LPPL is defined by the unpacking scripts +# (with extension .ins) and the installation script (with name +# install.sh) which are part of the distribution. +# +# Two often ignorred clauses from LPPL 1.3c you should not ignore: +# ---------------------------------------------------------------- +# 2. You may distribute a complete, unmodified copy of the Work as you +# received it. Distribution of only part of the Work is considered +# modification of the Work, and no right to distribute such a Derived +# Work may be assumed under the terms of this clause. +# 3. You may distribute a Compiled Work that has been generated from a +# complete, unmodified copy of the Work as distributed under Clause 2 +# above, as long as that Compiled Work is distributed in such a way that +# the recipients may install the Compiled Work on their system exactly +# as it would have been installed if they generated a Compiled Work +# directly from the Work. +# ====================================================================== + +use strict; +use Getopt::Long; + +my $makeindex = "makeindex"; +# my $identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)\$"; +my $identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)\$"; +my $suffixis = "-\$2"; +my $lineis = "\$1\$3"; +my $verbose = 0; # option verbose with default value +my $result = GetOptions( + 'help' => sub { help() }, + 'makeindex=s' => \$makeindex, + 'identify=s' => \$identify, + 'resultis=s' => \$lineis, + 'suffixis=s' => \$suffixis, + 'verbose|v+' => \$verbose, + 'version' => sub { version(); exit 0; } + ); + +usage("missing raw index file") if ( $#ARGV < 0 ); + +my $indexinput = shift; +my $jobname = ( $indexinput =~ /^(.*)\.idx$/ ) ? $1 : $indexinput; + +my %idxfile; +my %linesatidxfile; + +version() if ($verbose > 0); + +if ( !( open (IDX,"<$indexinput") ) ) { + if ( $indexinput ne "$jobname.idx" ) { + open (IDX,"<$jobname.idx") || + die "Cannot read raw index file $indexinput nor $jobname.idx"; + $indexinput = "$jobname.idx"; + } else { + die "Cannot read raw index file $indexinput"; + } +} + +while () { + my $line; + my $suffix; + if ( /$identify/ ) { + my $eval = "\$line = \"$lineis\n\""; + eval $eval; + $eval = "\$suffix = \"$suffixis\""; + eval $eval; + } else { + $line = $_; + $suffix = ""; + $suffix .= "$1" if ( $suffixis =~ /^(.*)\$/ ); + $suffix .= "idx"; + $suffix .= "$1" if ( $suffixis =~ /\$[123456789](.*)$/ ); + } + while ( $suffix =~ /(^[^,]+)(.*)$/ ) { + $suffix = $2; + writetoidx ($1,$line); + } +} + +closeallind(); + +close(IDX); + +generateallind(@ARGV); + +exit 0; + +sub generateallind { + my $name; + my $file; + + if ( $makeindex ne "" ) { + while (($name,$file) = each %idxfile) { + system( "$makeindex @ARGV $jobname$name.idx" ); + } + } +} + +sub closeallind { + my $name; + my $file; + my $lines; + while (($name,$file) = each %idxfile) { + print "Close $jobname$name.idx\n" + if ( $verbose > 1 ); + close( $file ); + $idxfile{$name}=0; + } + if ( $verbose > 0 ) { + print "\n"; + while (($name,$lines) = each %linesatidxfile) { + print "$jobname$name.idx with $lines lines\n"; + } + } +} + +sub writetoidx { + my $suffix = $_[0]; + my $line = $_[1]; + my $file = $idxfile{$suffix}; + if ( ! $file ) { + open ( $file, ">$jobname$suffix.idx" ) || + die "Cannot write to file $jobname$suffix.idx"; + $idxfile{$suffix} = $file; + $linesatidxfile{$suffix} = 0; + print( "New index file $jobname$suffix.idx\n" ) + if ( $verbose > 1 ); + } + print ($file $line); + $linesatidxfile{$suffix}++; +} + +sub help { + version(); + print "\n"; + usage(); + print + "Split a single raw index file into multiple raw index files.\n". + "Example: splitindex.pl foo.idx.\n". + "\n". + "Options:\n" . + " -h, --help " . + "\tshow this help and terminate\n" . + " -m, --makeindex PROGNAME\n" . + "\t\t\tcall PROGNAME instead of default \`makeindex\'.\n" . + " -i, --identify EXPRESSION\n" . + "\t\t\tuse regular EXPRESSION to match entries\n". + "\t\t\t(see also option --resultis and --suffixis).\n". + "\t\t\tDefault is \'$identify\'.\n". + " -r, --resultis PATTERN\n" . + "\t\t\tcreate line to be written from PATTERN after matching\n". + "\t\t\tlines (see also option --identify).\n". + "\t\t\tDefault is \'$lineis\'.\n". + " -s, --suffixis PATTERN\n" . + "\t\t\tcreate suffix to be used from PATTERN after matching\n". + "\t\t\tlines (see also option --identify).\n". + "\t\t\tDefault is \'$suffixis\'.\n". + " -v, --verbose " . + "\tbe more verbose\n". + "\t\t\t(can be used multiple to increase verbosity)\n" . + " --version " . + "\tshow version and terminate\n"; + exit 0; +} + +sub version { + print "splitindex.pl 0.1\n" . + "Copyright (c) 2002 Markus Kohm \\n"; +} + +sub usage { + my $text = "Usage: splitindex.pl [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n"; + if ( $#_ >= 0 ) { + print STDERR @_; + print STDERR "\n$text"; + print STDERR "Try \`splitindex.pl --help\' for more information.\n"; + exit 1; + } else { + print $text; + } +} diff --git a/Master/bin/alpha-linux/splitindex b/Master/bin/alpha-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/alpha-linux/splitindex +++ b/Master/bin/alpha-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/amd64-freebsd/splitindex b/Master/bin/amd64-freebsd/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/amd64-freebsd/splitindex +++ b/Master/bin/amd64-freebsd/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/amd64-kfreebsd/splitindex b/Master/bin/amd64-kfreebsd/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/amd64-kfreebsd/splitindex +++ b/Master/bin/amd64-kfreebsd/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/armel-linux/splitindex b/Master/bin/armel-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/armel-linux/splitindex +++ b/Master/bin/armel-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/i386-cygwin/splitindex b/Master/bin/i386-cygwin/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/i386-cygwin/splitindex +++ b/Master/bin/i386-cygwin/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/i386-freebsd/splitindex b/Master/bin/i386-freebsd/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/i386-freebsd/splitindex +++ b/Master/bin/i386-freebsd/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/i386-kfreebsd/splitindex b/Master/bin/i386-kfreebsd/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/i386-kfreebsd/splitindex +++ b/Master/bin/i386-kfreebsd/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/i386-linux/splitindex b/Master/bin/i386-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/i386-linux/splitindex +++ b/Master/bin/i386-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/i386-solaris/splitindex b/Master/bin/i386-solaris/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/i386-solaris/splitindex +++ b/Master/bin/i386-solaris/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/mipsel-linux/splitindex b/Master/bin/mipsel-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/mipsel-linux/splitindex +++ b/Master/bin/mipsel-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/powerpc-aix/splitindex b/Master/bin/powerpc-aix/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/powerpc-aix/splitindex +++ b/Master/bin/powerpc-aix/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/powerpc-linux/splitindex b/Master/bin/powerpc-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/powerpc-linux/splitindex +++ b/Master/bin/powerpc-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/sparc-solaris/splitindex b/Master/bin/sparc-solaris/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/sparc-solaris/splitindex +++ b/Master/bin/sparc-solaris/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/universal-darwin/splitindex b/Master/bin/universal-darwin/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/universal-darwin/splitindex +++ b/Master/bin/universal-darwin/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/x86_64-darwin/splitindex b/Master/bin/x86_64-darwin/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/x86_64-darwin/splitindex +++ b/Master/bin/x86_64-darwin/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/x86_64-linux/splitindex b/Master/bin/x86_64-linux/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/x86_64-linux/splitindex +++ b/Master/bin/x86_64-linux/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/bin/x86_64-solaris/splitindex b/Master/bin/x86_64-solaris/splitindex index 2a8232f7a9d..a6ccd3d40a2 120000 --- a/Master/bin/x86_64-solaris/splitindex +++ b/Master/bin/x86_64-solaris/splitindex @@ -1 +1 @@ -../../texmf-dist/scripts/splitindex/perl/splitindex.pl \ No newline at end of file +../../texmf-dist/scripts/splitindex/splitindex.pl \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/splitindex/README b/Master/texmf-dist/doc/latex/splitindex/README index 8b531b75d6b..2aac0717b62 100644 --- a/Master/texmf-dist/doc/latex/splitindex/README +++ b/Master/texmf-dist/doc/latex/splitindex/README @@ -1,15 +1,25 @@ Welcome to SplitIndex, the TeX index splitter. SplitIndex creates -multiple index files from one raw index. See manifest.txt if you want -to know the files SplitIndex exists of. +multiple index files from one (intermediate) raw index. +See manifest.txt if you want to know the files SplitIndex exists of. There are a lot of alternatives in using SplitIndex, because I wanted -solutions at every platform. Not all of the programs are distributed +solutions for every platform. Not all of the programs are distributed in binary form. But splitindex.tex will work at every platform. And you need only TeX (even not LaTeX) to run it. -Currently I support binaries for the following platforms: +Currently I provide binaries for the following platforms: - Linux ELF i386, OpenBSD 3.0 i386, CygWIN Windows 32 Bit i386 + - Linux ELF i386, + - OpenBSD 3.0 i386, + - OpenSolaris i386, + - CygWIN Windows 32 Bit i386 + +And four platform independent solutions using one of: + + - Perl, + - Java 1.4.1, + - TeX + - TeXLua If you need support, you can write me a mail. Use diff --git a/Master/texmf-dist/doc/latex/splitindex/install.txt b/Master/texmf-dist/doc/latex/splitindex/install.txt index 353a37af06a..9fa69851ce9 100644 --- a/Master/texmf-dist/doc/latex/splitindex/install.txt +++ b/Master/texmf-dist/doc/latex/splitindex/install.txt @@ -1,6 +1,6 @@ SplitIndex Installation Guide - 2009-03-18 + 2013-04-04 INTRODUCTION @@ -8,15 +8,12 @@ INTRODUCTION If you know how to install LaTeX packages and how to install binary programs, just do it. If you don't know, read the following. If you -are using Linux-i386 or OpenBSD-i386 or another Unix like environment -with installed Gnu fileutils and installed Gnu-C-Compiler, you may try +are using a system which provides a bash and gnu tools, you may try install.sh for installation. See ./install.sh --help -for more information. If you don't have GCC, Linux-i386 or -OpenBSD-i386 you may also use install.sh, but you have to compile -and link splitindex.c before. See the splitidx manual for this. +for more information. But you may also try the following step by step installation: @@ -29,10 +26,12 @@ The SplitIndex TDS-archive has following contents: +- doc/ | +- latex/ - | +- splitindex/ - | +- install.txt - | +- README - | +- splitidx.pdf + | | +- splitindex/ + | | +- install.txt + | | +- README + | | +- splitidx.pdf + | +- man/ + | +- man1/ | +- splitindex.1 +- tex/ | +- latex/ @@ -41,8 +40,9 @@ The SplitIndex TDS-archive has following contents: | +- splitindex.tex +- scripts/ | +- splitindex/ - | +- perl/ - | +- splitindex.pl + | +- splitindex.pl + | +- splitindex.tlu + | +- splitindex_main.tlu +- source/ +- latex/ +- splitindex/ @@ -54,12 +54,10 @@ The SplitIndex TDS-archive has following contents: +- splitidx.ins +- splitindex.1 +- splitindex.c - +- splitindex.class - +- splitindex.exe +- splitindex.java - +- splitindex-Linux-i386 - +- splitindex-OpenBSD-i386 +- splitindex.pl + +- splitindex.tlu + +- splitindex_main.tlu +- splitindex.tex If you don't have such an archive, continue reading at 1st step of ``HOW TO @@ -68,14 +66,14 @@ the file name ``splitindex.tds.zip'' in the following - you may continue with: A) Have a look where your LaTeX Distribution searchs for files. - With teTeX you can ask kpathsea for this, e.g. using a unix + With TeX Live you can ask kpathsea for this, e.g. using a unix shell: kpsexpand \$TEXMFLOCAL to use the local texmf tree or: - kpsexpand \$HOMETEXMF + kpsexpand \$TEXMFHOME to use your private texmf tree. Following uses ``'' to be a synonym for the texmf tree you want to use. @@ -89,7 +87,7 @@ B) Extract splitindex.tds.zip at with all the subdirectories of or any other zip extraction programm. -C) Continue with 5th to 9th step of ``HOW TO INSTALL THE BINARIES''. +C) Continue with 5th or 6th step at ``HOW TO INSTALL THE EXECUTABLES''. D) Call the program, which is used to update the filename data base, e.g., texhash or mktexlsr if you are using teTeX/TeX Live. @@ -115,14 +113,14 @@ should skip this section. Answer this question with yes. 2nd) Have a look where your LaTeX Distribution searchs for files. - With teTeX you can ask kpathsea for this, e.g. using a unix + With TeX Live you can ask kpathsea for this, e.g. using a unix shell: kpsexpand \$TEXMFLOCAL to use the local texmf tree or: - kpsexpand \$HOMETEXMF + kpsexpand \$TEXMFHOME to use your private texmf tree. Following uses ``'' to be a synonym for the texmf tree you want to use. @@ -131,70 +129,78 @@ should skip this section. \tex\latex\splitindex), if it doesn't exist. Copy splitidx.sty to this folder. -4th) Call the program, which is used to update the filename data +4th) Create folder /scripts/splitindex (at Windows: + \scripts\latex\splitindex), if it doesn't exist. Copy + splitindex.pl, splitindex.tlu and splitindex_main.tlu to this folder. + +5th) Call the program, which is used to update the filename data base, e.g. texhash or mktexlsr if you are using teTeX/TeX Live. -HOW TO INSTALL THE BINARIES -=========================== +HOW TO INSTALL THE EXECUTABLE +============================= + +You need only one of the executables splitindex.pl or splitindex.tlu. +I recommend to use splitindex.pl, but if your system doesn't provide perl +but TeXLua, you may use splitindex.tlu instead. + +To install splitindex.pl or splitindex.tlu on Windows: -You need only one of the binaries splitindex (compiled from splitindex.c), -splitindex.class (compiled from splitindex.java) or splitindex.pl (using a -perl interpreter). Following steps will install all these binaries. -Please do them all, before asking for support. +5th) Rename a copy of runscript.exe into splitindex.exe and copy it + into the binary folder of your TeX installation. You may simply search + for runscript.exe itself to find the binary folder. -5th) Rename the suitable binary (e.g. splitindex-Linux-i386, if you're - using Linux-i386) to splitindex or compile splitindex.c to generate - a binary named splitindex using e.g. - gcc -O3 -Wall -o splitindex splitindex.c - or - gcc -O3 -Wall -DNO_LONGOPT -o splitindex splitindex.c +To install splitindex.pl or splitindex.tlu on Linux, OpenBSD, OS X, +OpenSolaris etc.: -6th) Copy splitindex.java to the binary search path of SUN JAVA - 1.4.1. +6th) Copy splitindex.pl or splitindex.tlu to the binary folder of your TeX + installation and rename it into splitindex. You may simply do a + `which pdflatex' to find the binary folder. Make splitindex executable + for everybody using e.g. `chmod a+x splitindex'. -7th) Copy splitindex.pl and splitindex or splitindex.exe somewhere to - your binary search path (ask environment variable PATH). -8th) Copy the manual page splitindex.1 to your manual seach path. If you are - using Linux or OpenBSD, this may be, e.g., /usr/local/man/man1/ (ask - environment variable MANPATH). +HOW TO GET A REAL BINARY +======================== -9th) Copy splitindex.tex to the same location you've copied - splitidx.sty to and do 4th step again. +If you don't like scripts, you may make a real binary from the C source file +splitindex.c and install that instead of the script. If your getopt library +doesn't support long options, you may define NO_LONGOPT. In this case the code +for long options won't be compiled. I recommend to use either the perl or the +TeXLua script. Nevertheless, you may find binaries in the splitindex +repository at +. HOW TO GENERATE THE MANUAL ========================== -10th) process splitidx.dtx with LaTeX to generate the user manual of - splitidx and SplitIndex, e.g. using the following input at a - command shell: +7th) process splitidx.dtx with LaTeX to generate the user manual of + splitidx and SplitIndex, e.g. using the following input at a + command shell: - latex splitidx.dtx - latex splitidx.dtx + pdflatex splitidx.dtx + pdflatex splitidx.dtx mkindex splitidx - latex splitidx.dtx + pdflatex splitidx.dtx - or (if you do not have the mkindex script): + or (if you do not have the mkindex script): - latex splitidx.dtx - latex splitidx.dtx + pdflatex splitidx.dtx + pdflatex splitidx.dtx makeindex -s gind.ist splitidx makeindex -s gglo.ist -o splitidx.gls splitidx.glo - latex splitidx.dtx + pdflatex splitidx.dtx - You may print the resulting splitidx.dvi. If you prefere PDF - files, use pdflatex instead of latex. + You may print the resulting splitidx.pdf. -11th) read the manual you produced at 10th step. +8th) read the manual you produced at 7th step. HOW TO TEST YOUR INSTALLATION ============================= Use the following LaTeX source to test the installation. See -splitidx.dvi or splitidx.pdf to see how to do this. +splitidx.pdf to learn to know how to do this. \documentclass{article} % We use \Class{article} class ... \usepackage{splitidx} % ... and the \Package{splitidx} package diff --git a/Master/texmf-dist/doc/latex/splitindex/manifest.txt b/Master/texmf-dist/doc/latex/splitindex/manifest.txt new file mode 100644 index 00000000000..651a683912a --- /dev/null +++ b/Master/texmf-dist/doc/latex/splitindex/manifest.txt @@ -0,0 +1,62 @@ +% +% The following files form the SplitIndex Bundle and also every +% SplitIndex Distribution since 2013. +% +% +% CONTENTS OF THE SplitIndex DISTRIBUTION +% ======================================= +% +% Documentation: +% -------------- +% +% manifest.txt -- This file. +% install.txt -- How to install SplitIndex (overview). +% README -- Should be read first. +% splitindex.1 -- The unix manual page of all SplitIndex +% programs. +% splitidx.pdf -- The user manual of SplitIndex and +% splitidx.sty. +% +% +% LaTeX files: +% ------------ +% +% splitidx.dtx -- The source of the splitidx package and of the +% manual. +% splitidx.ins -- The installation script for the splitidx +% package. +% +% +% Program sources: +% ---------------- +% +% splitindex.pl -- The source of the reference implementation of +% the SplitIndex program. +% splitindex.java -- The source of the SUN JAVA 1.4.1 implementation +% of the SplitIndex program. +% splitindex.c -- The source of the C implementation of the +% SplitIndex program. +% splitindex.tex -- The source of the TeX implementation of the +% SplitIndex program. +% splitindex.tlu -- TeXlua wrapper for the TeXlua implementation of +% the SplitIndex program. +% splitindex_main.tlu +% -- TeXlua implementation of the SplitIndex program. +% +% +% Programs (binaries): +% -------------------- +% +% splitindex.pl -- Perl is an interpreter, so this is the source +% and the program itself (but not binary) +% splitindex.tlu -- TeXlua is an interpreter, so this is the source +% and the program itself (but not binary) +% +% Installation programs: +% ---------------------- +% +% install.sh -- See `install.txt' for more information about +% this. +% +% ==================================================================== +% diff --git a/Master/texmf-dist/doc/latex/splitindex/splitidx.pdf b/Master/texmf-dist/doc/latex/splitindex/splitidx.pdf index 85509454bac..c83a734499b 100644 Binary files a/Master/texmf-dist/doc/latex/splitindex/splitidx.pdf and b/Master/texmf-dist/doc/latex/splitindex/splitidx.pdf differ diff --git a/Master/texmf-dist/scripts/splitindex/perl/splitindex.pl b/Master/texmf-dist/scripts/splitindex/perl/splitindex.pl deleted file mode 100755 index 70c61720c9b..00000000000 --- a/Master/texmf-dist/scripts/splitindex/perl/splitindex.pl +++ /dev/null @@ -1,212 +0,0 @@ -#! /usr/bin/perl -w -eval 'exec perl -S $0 ${1+"$@"}' - if 0; #$running_under_some_shell - -# ====================================================================== -# splitindex.pl -# Copyright (c) Markus Kohm, 2002-2009 -# -# $Id: splitindex.pl,v 1.3 2009-03-20 14:55:11 mjk Exp $ -# -# This file is part of the SplitIndex bundle. -# -# This work may be distributed and/or modified under the conditions of -# the LaTeX Project Public License, version 1.3c of the license. -# The latest version of this license is in -# http://www.latex-project.org/lppl.txt -# and version 1.3c or later is part of all distributions of LaTeX -# version 2005/12/01 or later and of this work. -# -# This work has the LPPL maintenance status "author-maintained". -# -# The Current Maintainer and author of this work is Markus Kohm. -# -# The list of all files belongig to the SplitIndex bundle is given in -# in the file `manifest.txt'. Files generated by means of unpacking the -# distribution (using, for example, the docstrip program) or by means -# of compiling them from a source file, for example, from splitindex.c -# or splitindex.java may be distributed at the distributor's discretion. -# However if they are distributed then a copy of the SplitIndex bundle -# must be distributed together with them. -# -# The list of derived (unpacked or compiled) files belongig to the -# distribution and covered by LPPL is defined by the unpacking scripts -# (with extension .ins) and the installation script (with name -# install.sh) which are part of the distribution. -# -# Two often ignorred clauses from LPPL 1.3c you should not ignore: -# ---------------------------------------------------------------- -# 2. You may distribute a complete, unmodified copy of the Work as you -# received it. Distribution of only part of the Work is considered -# modification of the Work, and no right to distribute such a Derived -# Work may be assumed under the terms of this clause. -# 3. You may distribute a Compiled Work that has been generated from a -# complete, unmodified copy of the Work as distributed under Clause 2 -# above, as long as that Compiled Work is distributed in such a way that -# the recipients may install the Compiled Work on their system exactly -# as it would have been installed if they generated a Compiled Work -# directly from the Work. -# ====================================================================== - -use strict; -use Getopt::Long; - -my $makeindex = "makeindex"; -# my $identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)\$"; -my $identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)\$"; -my $suffixis = "-\$2"; -my $lineis = "\$1\$3"; -my $verbose = 0; # option verbose with default value -my $result = GetOptions( - 'help' => sub { help() }, - 'makeindex=s' => \$makeindex, - 'identify=s' => \$identify, - 'resultis=s' => \$lineis, - 'suffixis=s' => \$suffixis, - 'verbose|v+' => \$verbose, - 'version' => sub { version(); exit 0; } - ); - -usage("missing raw index file") if ( $#ARGV < 0 ); - -my $indexinput = shift; -my $jobname = ( $indexinput =~ /^(.*)\.idx$/ ) ? $1 : $indexinput; - -my %idxfile; -my %linesatidxfile; - -version() if ($verbose > 0); - -if ( !( open (IDX,"<$indexinput") ) ) { - if ( $indexinput ne "$jobname.idx" ) { - open (IDX,"<$jobname.idx") || - die "Cannot read raw index file $indexinput nor $jobname.idx"; - $indexinput = "$jobname.idx"; - } else { - die "Cannot read raw index file $indexinput"; - } -} - -while () { - my $line; - my $suffix; - if ( /$identify/ ) { - my $eval = "\$line = \"$lineis\n\""; - eval $eval; - $eval = "\$suffix = \"$suffixis\""; - eval $eval; - } else { - $line = $_; - $suffix = ""; - $suffix .= "$1" if ( $suffixis =~ /^(.*)\$/ ); - $suffix .= "idx"; - $suffix .= "$1" if ( $suffixis =~ /\$[123456789](.*)$/ ); - } - while ( $suffix =~ /(^[^,]+)(.*)$/ ) { - $suffix = $2; - writetoidx ($1,$line); - } -} - -closeallind(); - -close(IDX); - -generateallind(@ARGV); - -exit 0; - -sub generateallind { - my $name; - my $file; - - if ( $makeindex ne "" ) { - while (($name,$file) = each %idxfile) { - system( "$makeindex @ARGV $jobname$name.idx" ); - } - } -} - -sub closeallind { - my $name; - my $file; - my $lines; - while (($name,$file) = each %idxfile) { - print "Close $jobname$name.idx\n" - if ( $verbose > 1 ); - close( $file ); - $idxfile{$name}=0; - } - if ( $verbose > 0 ) { - print "\n"; - while (($name,$lines) = each %linesatidxfile) { - print "$jobname$name.idx with $lines lines\n"; - } - } -} - -sub writetoidx { - my $suffix = $_[0]; - my $line = $_[1]; - my $file = $idxfile{$suffix}; - if ( ! $file ) { - open ( $file, ">$jobname$suffix.idx" ) || - die "Cannot write to file $jobname$suffix.idx"; - $idxfile{$suffix} = $file; - $linesatidxfile{$suffix} = 0; - print( "New index file $jobname$suffix.idx\n" ) - if ( $verbose > 1 ); - } - print ($file $line); - $linesatidxfile{$suffix}++; -} - -sub help { - version(); - print "\n"; - usage(); - print - "Split a single raw index file into multiple raw index files.\n". - "Example: splitindex.pl foo.idx.\n". - "\n". - "Options:\n" . - " -h, --help " . - "\tshow this help and terminate\n" . - " -m, --makeindex PROGNAME\n" . - "\t\t\tcall PROGNAME instead of default \`makeindex\'.\n" . - " -i, --identify EXPRESSION\n" . - "\t\t\tuse regular EXPRESSION to match entries\n". - "\t\t\t(see also option --resultis and --suffixis).\n". - "\t\t\tDefault is \'$identify\'.\n". - " -r, --resultis PATTERN\n" . - "\t\t\tcreate line to be written from PATTERN after matching\n". - "\t\t\tlines (see also option --identify).\n". - "\t\t\tDefault is \'$lineis\'.\n". - " -s, --suffixis PATTERN\n" . - "\t\t\tcreate suffix to be used from PATTERN after matching\n". - "\t\t\tlines (see also option --identify).\n". - "\t\t\tDefault is \'$suffixis\'.\n". - " -v, --verbose " . - "\tbe more verbose\n". - "\t\t\t(can be used multiple to increase verbosity)\n" . - " --version " . - "\tshow version and terminate\n"; - exit 0; -} - -sub version { - print "splitindex.pl 0.1\n" . - "Copyright (c) 2002 Markus Kohm \\n"; -} - -sub usage { - my $text = "Usage: splitindex.pl [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n"; - if ( $#_ >= 0 ) { - print STDERR @_; - print STDERR "\n$text"; - print STDERR "Try \`splitindex.pl --help\' for more information.\n"; - exit 1; - } else { - print $text; - } -} diff --git a/Master/texmf-dist/scripts/splitindex/splitindex.pl b/Master/texmf-dist/scripts/splitindex/splitindex.pl new file mode 100755 index 00000000000..70c61720c9b --- /dev/null +++ b/Master/texmf-dist/scripts/splitindex/splitindex.pl @@ -0,0 +1,212 @@ +#! /usr/bin/perl -w +eval 'exec perl -S $0 ${1+"$@"}' + if 0; #$running_under_some_shell + +# ====================================================================== +# splitindex.pl +# Copyright (c) Markus Kohm, 2002-2009 +# +# $Id: splitindex.pl,v 1.3 2009-03-20 14:55:11 mjk Exp $ +# +# This file is part of the SplitIndex bundle. +# +# This work may be distributed and/or modified under the conditions of +# the LaTeX Project Public License, version 1.3c of the license. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3c or later is part of all distributions of LaTeX +# version 2005/12/01 or later and of this work. +# +# This work has the LPPL maintenance status "author-maintained". +# +# The Current Maintainer and author of this work is Markus Kohm. +# +# The list of all files belongig to the SplitIndex bundle is given in +# in the file `manifest.txt'. Files generated by means of unpacking the +# distribution (using, for example, the docstrip program) or by means +# of compiling them from a source file, for example, from splitindex.c +# or splitindex.java may be distributed at the distributor's discretion. +# However if they are distributed then a copy of the SplitIndex bundle +# must be distributed together with them. +# +# The list of derived (unpacked or compiled) files belongig to the +# distribution and covered by LPPL is defined by the unpacking scripts +# (with extension .ins) and the installation script (with name +# install.sh) which are part of the distribution. +# +# Two often ignorred clauses from LPPL 1.3c you should not ignore: +# ---------------------------------------------------------------- +# 2. You may distribute a complete, unmodified copy of the Work as you +# received it. Distribution of only part of the Work is considered +# modification of the Work, and no right to distribute such a Derived +# Work may be assumed under the terms of this clause. +# 3. You may distribute a Compiled Work that has been generated from a +# complete, unmodified copy of the Work as distributed under Clause 2 +# above, as long as that Compiled Work is distributed in such a way that +# the recipients may install the Compiled Work on their system exactly +# as it would have been installed if they generated a Compiled Work +# directly from the Work. +# ====================================================================== + +use strict; +use Getopt::Long; + +my $makeindex = "makeindex"; +# my $identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)\$"; +my $identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)\$"; +my $suffixis = "-\$2"; +my $lineis = "\$1\$3"; +my $verbose = 0; # option verbose with default value +my $result = GetOptions( + 'help' => sub { help() }, + 'makeindex=s' => \$makeindex, + 'identify=s' => \$identify, + 'resultis=s' => \$lineis, + 'suffixis=s' => \$suffixis, + 'verbose|v+' => \$verbose, + 'version' => sub { version(); exit 0; } + ); + +usage("missing raw index file") if ( $#ARGV < 0 ); + +my $indexinput = shift; +my $jobname = ( $indexinput =~ /^(.*)\.idx$/ ) ? $1 : $indexinput; + +my %idxfile; +my %linesatidxfile; + +version() if ($verbose > 0); + +if ( !( open (IDX,"<$indexinput") ) ) { + if ( $indexinput ne "$jobname.idx" ) { + open (IDX,"<$jobname.idx") || + die "Cannot read raw index file $indexinput nor $jobname.idx"; + $indexinput = "$jobname.idx"; + } else { + die "Cannot read raw index file $indexinput"; + } +} + +while () { + my $line; + my $suffix; + if ( /$identify/ ) { + my $eval = "\$line = \"$lineis\n\""; + eval $eval; + $eval = "\$suffix = \"$suffixis\""; + eval $eval; + } else { + $line = $_; + $suffix = ""; + $suffix .= "$1" if ( $suffixis =~ /^(.*)\$/ ); + $suffix .= "idx"; + $suffix .= "$1" if ( $suffixis =~ /\$[123456789](.*)$/ ); + } + while ( $suffix =~ /(^[^,]+)(.*)$/ ) { + $suffix = $2; + writetoidx ($1,$line); + } +} + +closeallind(); + +close(IDX); + +generateallind(@ARGV); + +exit 0; + +sub generateallind { + my $name; + my $file; + + if ( $makeindex ne "" ) { + while (($name,$file) = each %idxfile) { + system( "$makeindex @ARGV $jobname$name.idx" ); + } + } +} + +sub closeallind { + my $name; + my $file; + my $lines; + while (($name,$file) = each %idxfile) { + print "Close $jobname$name.idx\n" + if ( $verbose > 1 ); + close( $file ); + $idxfile{$name}=0; + } + if ( $verbose > 0 ) { + print "\n"; + while (($name,$lines) = each %linesatidxfile) { + print "$jobname$name.idx with $lines lines\n"; + } + } +} + +sub writetoidx { + my $suffix = $_[0]; + my $line = $_[1]; + my $file = $idxfile{$suffix}; + if ( ! $file ) { + open ( $file, ">$jobname$suffix.idx" ) || + die "Cannot write to file $jobname$suffix.idx"; + $idxfile{$suffix} = $file; + $linesatidxfile{$suffix} = 0; + print( "New index file $jobname$suffix.idx\n" ) + if ( $verbose > 1 ); + } + print ($file $line); + $linesatidxfile{$suffix}++; +} + +sub help { + version(); + print "\n"; + usage(); + print + "Split a single raw index file into multiple raw index files.\n". + "Example: splitindex.pl foo.idx.\n". + "\n". + "Options:\n" . + " -h, --help " . + "\tshow this help and terminate\n" . + " -m, --makeindex PROGNAME\n" . + "\t\t\tcall PROGNAME instead of default \`makeindex\'.\n" . + " -i, --identify EXPRESSION\n" . + "\t\t\tuse regular EXPRESSION to match entries\n". + "\t\t\t(see also option --resultis and --suffixis).\n". + "\t\t\tDefault is \'$identify\'.\n". + " -r, --resultis PATTERN\n" . + "\t\t\tcreate line to be written from PATTERN after matching\n". + "\t\t\tlines (see also option --identify).\n". + "\t\t\tDefault is \'$lineis\'.\n". + " -s, --suffixis PATTERN\n" . + "\t\t\tcreate suffix to be used from PATTERN after matching\n". + "\t\t\tlines (see also option --identify).\n". + "\t\t\tDefault is \'$suffixis\'.\n". + " -v, --verbose " . + "\tbe more verbose\n". + "\t\t\t(can be used multiple to increase verbosity)\n" . + " --version " . + "\tshow version and terminate\n"; + exit 0; +} + +sub version { + print "splitindex.pl 0.1\n" . + "Copyright (c) 2002 Markus Kohm \\n"; +} + +sub usage { + my $text = "Usage: splitindex.pl [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n"; + if ( $#_ >= 0 ) { + print STDERR @_; + print STDERR "\n$text"; + print STDERR "Try \`splitindex.pl --help\' for more information.\n"; + exit 1; + } else { + print $text; + } +} diff --git a/Master/texmf-dist/scripts/splitindex/splitindex.tlu b/Master/texmf-dist/scripts/splitindex/splitindex.tlu new file mode 100755 index 00000000000..a367634b037 --- /dev/null +++ b/Master/texmf-dist/scripts/splitindex/splitindex.tlu @@ -0,0 +1,50 @@ +#!/usr/bin/env texlua +-- splitindex.tlu +-- Copyright (c) Markus Kohm, 2013 +-- +-- $Id: splitindex.tlu,v 1.1 2013-04-04 11:28:17 mjk Exp $ +-- +-- This file is part of the SplitIndex bundle. +-- +-- This work may be distributed and/or modified under the conditions of +-- the LaTeX Project Public License, version 1.3c of the license. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3c or later is part of all distributions of LaTeX +-- version 2005/12/01 or later and of this work. +-- +-- This work has the LPPL maintenance status "author-maintained". +-- +-- The Current Maintainer and author of this work is Markus Kohm. +-- +-- The list of all files belongig to the SplitIndex bundle is given in +-- in the file `manifest.txt'. Files generated by means of unpacking the +-- distribution (using, for example, the docstrip program) or by means +-- of compiling them from a source file, for example, from splitindex.c +-- or splitindex.java may be distributed at the distributor's discretion. +-- However if they are distributed then a copy of the SplitIndex bundle +-- must be distributed together with them. +-- +-- The list of derived (unpacked or compiled) files belongig to the +-- distribution and covered by LPPL is defined by the unpacking scripts +-- (with extension .ins) and the installation script (with name +-- install.sh) which are part of the distribution. +-- +-- Two often ignorred clauses from LPPL 1.3c you should not ignore: +-- ---------------------------------------------------------------- +-- 2. You may distribute a complete, unmodified copy of the Work as you +-- received it. Distribution of only part of the Work is considered +-- modification of the Work, and no right to distribute such a Derived +-- Work may be assumed under the terms of this clause. +-- 3. You may distribute a Compiled Work that has been generated from a +-- complete, unmodified copy of the Work as distributed under Clause 2 +-- above, as long as that Compiled Work is distributed in such a way that +-- the recipients may install the Compiled Work on their system exactly +-- as it would have been installed if they generated a Compiled Work +-- directly from the Work. + +kpse.set_program_name(arg[-1],'splitindex') +require('splitindex.splitindex_main') + +-- +-- End of file `splitindex.tlu' diff --git a/Master/texmf-dist/scripts/splitindex/splitindex_main.tlu b/Master/texmf-dist/scripts/splitindex/splitindex_main.tlu new file mode 100644 index 00000000000..1fc19b13fb2 --- /dev/null +++ b/Master/texmf-dist/scripts/splitindex/splitindex_main.tlu @@ -0,0 +1,187 @@ +#!/usr/bin/env texlua +-- splitindex.tlu +-- Copyright (c) Markus Kohm, 2013 +-- +-- $Id: splitindex_main.tlu,v 1.2 2013-04-04 13:59:54 mjk Exp $ +-- +-- This file is part of the SplitIndex bundle. +-- +-- This work may be distributed and/or modified under the conditions of +-- the LaTeX Project Public License, version 1.3c of the license. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3c or later is part of all distributions of LaTeX +-- version 2005/12/01 or later and of this work. +-- +-- This work has the LPPL maintenance status "author-maintained". +-- +-- The Current Maintainer and author of this work is Markus Kohm. +-- +-- The list of all files belongig to the SplitIndex bundle is given in +-- in the file `manifest.txt'. Files generated by means of unpacking the +-- distribution (using, for example, the docstrip program) or by means +-- of compiling them from a source file, for example, from splitindex.c +-- or splitindex.java may be distributed at the distributor's discretion. +-- However if they are distributed then a copy of the SplitIndex bundle +-- must be distributed together with them. +-- +-- The list of derived (unpacked or compiled) files belongig to the +-- distribution and covered by LPPL is defined by the unpacking scripts +-- (with extension .ins) and the installation script (with name +-- install.sh) which are part of the distribution. +-- +-- Two often ignorred clauses from LPPL 1.3c you should not ignore: +-- ---------------------------------------------------------------- +-- 2. You may distribute a complete, unmodified copy of the Work as you +-- received it. Distribution of only part of the Work is considered +-- modification of the Work, and no right to distribute such a Derived +-- Work may be assumed under the terms of this clause. +-- 3. You may distribute a Compiled Work that has been generated from a +-- complete, unmodified copy of the Work as distributed under Clause 2 +-- above, as long as that Compiled Work is distributed in such a way that +-- the recipients may install the Compiled Work on their system exactly +-- as it would have been installed if they generated a Compiled Work +-- directly from the Work. + +local version_number = string.sub( '$Revision: 1.2 $', 12, -2 ) +local action_version = ' r'..version_number..'\n'..[[ +Copyright (c) 2013 Markus Kohm. +License: lppl 1.3c or later. See . +]] +local action_help = [[ +options: + -h, --help Print this help message. + -i, --identify + Setup the regular expression to match the entries. + -m, --makeindex + Use instead of `makeindex'. + -r, --resultis + Create line to be written from after matching. + -s, --suffixis + Create suffix to be used from after matching. + -v, --verbose Be more verbose. + -V,--version Print the version information. +]] + +local action_opts = { + ['-h'] = 'help', + ['--help'] = 'help', + ['-i'] = 'identify', + ['--identify'] = 'identify', + ['-m'] = 'makeindex', + ['--makeindex'] = 'makeindex', + ['-r'] = 'resultis', + ['--resultis'] = 'resultis', + ['-s'] = 'suffixis', + ['--suffixis'] = 'suffixis', + ['-v'] = 'verbose', + ['--verbose'] = 'verbose', + ['-V'] = 'version', + ['--version'] = 'version', + ['--'] = '--', +} + +local identify = '^(\\indexentry)%[([^]]*)%](.*)$' +local makeindex = 'makeindex' +local resultis = '%1%3' +local suffixis = '-%2' +local verbose = 0 + +while arg[1] do + local action = action_opts[arg[1]] + if action == '--' then + table.remove(arg,1) + break + elseif action == 'help' then + print( arg[0]..action_version ) + print( 'Usage: ' .. arg[0] .. ' -h/--help' ) + print( ' ' .. arg[0] .. ' -V/--version' ) + print( ' ' .. arg[0] .. ' [