diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-04-28 13:32:45 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-04-28 13:32:45 +0000 |
commit | 9ef0ad52f596026c1e545be621232e76cf2ef45a (patch) | |
tree | 3a47769ca0e2ad17fbf55c8a79950e79a023e4ee /Master/texmf-dist/scripts/xindy | |
parent | e6fefd95977da2f1aa1a512a3fcc871681deb59c (diff) |
Update scripts from source tree
git-svn-id: svn://tug.org/texlive/trunk@33721 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/xindy')
-rwxr-xr-x | Master/texmf-dist/scripts/xindy/texindy.pl | 52 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/xindy/xindy.pl | 82 |
2 files changed, 104 insertions, 30 deletions
diff --git a/Master/texmf-dist/scripts/xindy/texindy.pl b/Master/texmf-dist/scripts/xindy/texindy.pl index 28a7e0a4dd7..7a62a9f241a 100755 --- a/Master/texmf-dist/scripts/xindy/texindy.pl +++ b/Master/texmf-dist/scripts/xindy/texindy.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: texindy,v 1.11 2010/05/10 23:39:24 jschrod Exp $ +# $Id: texindy,v 1.13 2011/01/18 22:18:29 jschrod Exp $ #------------------------------------------------------------ # (history at end) @@ -41,6 +41,9 @@ by xindy modules, with a convenient set already preloaded. Files with the raw index are passed as arguments. If no arguments are passed, the raw index will be read from standard input. +B<Do not use texindy with XeLaTeX or LuaLaTeX!> When you use these +LaTeX engines, you must use B<xindy -C utf8 -M texindy -M page-ranges> instead. + A good introductionary description of B<texindy> appears in the indexing chapter of the LaTeX Companion (2nd ed.) @@ -49,9 +52,7 @@ markup, the command xindy(1) is probably more of interest for you. B<texindy> is an approach to merge support for the I<make-rules> framework, own xindy modules (e.g., for special LaTeX commands in the -index), and a reasonable level of MakeIndex compatibility. There are -other older approaches, eventually they will get a description on the -xindy Web Site, http://www.xindy.org/. +index), and a reasonable level of MakeIndex compatibility. =head1 OPTIONS @@ -110,9 +111,18 @@ encoding, in that order. =item C<--codepage> I<enc> / B <-C> I<enc> -The raw input is in input encoding I<enc>. This information is used to -select the correct xindy sort module and also the I<inputenc> target -encoding for C<latex> input markup. +B<texindy>'s raw input is always assumed to be encoded in LaTeX +Internal Character Representation (LICR). I.e., non-ASCII characters +are encoded as command sequences. This option tells xindy the encoding +it shall use internally for sorting. + +Effectively, you need this option to specify the encoding of letter +group headings. + +Encoding C<utf8> is only supported for Latin alphabets. But if you use +non-Latin alphabets, you probably use XeLaTeX or LuaLaTeX and then you +must not use B<texindy> anyhow. Then direct usage of B<xindy> is +appropriate. When C<omega> input markup is used, C<utf8> is always used as the sort codepage and no inputenc module is loaded. Then this option is @@ -292,6 +302,22 @@ should please contact the author. =item * +If you have an index rage and a location attribute, e.g., +C<\index{key\(attr}> starts the range, one needs (1) to specify that +attribute in the range closing entry as well (i.e., as +C<\index{key\)attr}>) and (2) one needs to declare the index attribute +in an B<xindy> style file. + +MakeIndex will output the markup C<\attr{page1--page2}> for such a +construct. This is not possible to achieve in B<xindy>, output will be +C<\attrMarkup{page1}--\attrMarkup{page2}>. (This is actually +considered a bug, but not a high priority one.) + +The difference between MakeIndex page number tags and B<xindy> +location attributes was already explained in the previous item. + +=item * + The MakeIndex compatibility definitions support only the default raw index syntax and markup definition. It is not possible to configure raw index parsing or use a MakeIndex style file to describe output @@ -340,7 +366,7 @@ GNU General Public License for more details. use strict; use English qw(-no_match_vars); -our $VERSION = sprintf "%d.%02d", q$Revision: 1.11 $ =~ /: (\d+)\.(\d+)/ ; +our $VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /: (\d+)\.(\d+)/ ; # Used modules. @@ -410,7 +436,8 @@ sub usage ( ;$ ) { my $exit_code = shift; $exit_code += 0; # turn undef into 0 - print STDERR <<_EOT_ + my $out = ( $exit_code ? *STDERR : *STDOUT ); + print $out <<_EOT_ usage: $cmd [-V?h] [-qv] [-iglr] [-d magic] [-o outfile.ind] [-t log] \\ [-L lang] [-C codepage] [-M module] [-I input] [idx0 idx1 ...] @@ -598,6 +625,13 @@ sub output_xindy_release () { #====================================================================== # # $Log: texindy,v $ +# Revision 1.13 2011/01/18 22:18:29 jschrod +# Document the range raw markup incompatibility with MakeIndex. +# (Bug ticket 998541) +# +# Revision 1.12 2010/08/12 00:16:01 jschrod +# Output help message on stdout if there's no error. +# # Revision 1.11 2010/05/10 23:39:24 jschrod # Incorporate TeX-Live patches from Vladimir Volovich and Peter # Breitenlohner: Support for TL installation scheme, support for Mac OS diff --git a/Master/texmf-dist/scripts/xindy/xindy.pl b/Master/texmf-dist/scripts/xindy/xindy.pl index a1fecf65a29..80eaafe6d59 100755 --- a/Master/texmf-dist/scripts/xindy/xindy.pl +++ b/Master/texmf-dist/scripts/xindy/xindy.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: xindy.pl,v 1.16 2010/05/10 23:39:24 jschrod Exp $ +# $Id: xindy.pl,v 1.18 2011/01/18 22:18:29 jschrod Exp $ #------------------------------------------------------------ # (history at end) @@ -99,9 +99,12 @@ The index is sorted according to the rules of language I<lang>. These rules are encoded in a xindy module created by I<make-rules>. If no input encoding is specified via C<--codepage>, a xindy module -for that language is searched with a latin, a cp, an iso, or ascii +for that language is searched with a latin, a cp, an iso, ascii, or utf8 encoding, in that order. +Language modules are either placed in the F<lang> or in the +F<contrib/lang> sub-directory of the modules base directory. + =item C<--codepage> I<enc> / B<-C> I<enc> The raw input is in input encoding I<enc>. This information is used to @@ -266,6 +269,22 @@ should please contact the author. =item * +If you have an index rage and a location attribute, e.g., +C<\index{key\(attr}> starts the range, one needs (1) to specify that +attribute in the range closing entry as well (i.e., as +C<\index{key\)attr}>) and (2) one needs to declare the index attribute +in an B<xindy> style file. + +MakeIndex will output the markup C<\attr{page1--page2}> for such a +construct. This is not possible to achieve in B<xindy>, output will be +C<\attrMarkup{page1}--\attrMarkup{page2}>. (This is actually +considered a bug, but not a high priority one.) + +The difference between MakeIndex page number tags and B<xindy> +location attributes was already explained in the previous item. + +=item * + The MakeIndex compatibility definitions support only the default raw index syntax and markup definition. It is not possible to configure raw index parsing or use a MakeIndex style file to describe output @@ -322,7 +341,7 @@ GNU General Public License for more details. use strict; use English qw(-no_match_vars); -our $VERSION = sprintf "%d.%02d", q$Revision: 1.16 $ =~ /: (\d+)\.(\d+)/ ; +our $VERSION = sprintf "%d.%02d", q$Revision: 1.18 $ =~ /: (\d+)\.(\d+)/ ; # Used modules. @@ -370,25 +389,31 @@ $TMPDIR = "."; # FIXME: In standalone installations, modules are still placed in lib # directory. This is not conformant to FHS. -if ( $is_TL ) { # TeX Live +if ( $is_TL ) { # TeX Live and MikTeX $modules_dir = Cwd::realpath("$cmd_dir/../../xindy/modules"); die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; if ( $is_w32 ) { - $cmd_dir = "$cmd_dir/../../../bin/win32"; + if ( -d "$cmd_dir/../../../bin/win32" ) { # TeX Live + $cmd_dir = "$cmd_dir/../../../bin/win32"; + } elsif ( -d "$cmd_dir/../../miktex/bin" ) { # MikTeX + $cmd_dir = "$cmd_dir/../../miktex/bin"; + } else { + die "$cmd: Cannot locate bin directory"; + } } else { die "$cmd: not a symlink as required for TeX Live" unless -l $0; # Follow symlinks and determine $cmd_dir such that # $cmd_dir/xindy -> $r0 = XINDY_SCRIPTDIR/xindy.pl - # - # FIXME: What's this code good for? Cwd::realpath() already - # resolves all symbolic links; this just recomputes that - # information manually! It's from Peter, check with him. + # I.e., it determines the directory with the last symbolic link; the + # one that points to a real file. That's the directory with the binary + # files (Lisp executable and memory file). $real_cmd = $0; while (-l $real_cmd) { $cmd_dir = dirname($real_cmd); $real_cmd = readlink($real_cmd); + # \ directory separator may happen on Cygwin. $real_cmd = "$cmd_dir/$real_cmd" unless $real_cmd =~ m,^[\\/],; # relative link } } @@ -438,7 +463,8 @@ sub usage ( ;$ ) { my $exit_code = shift; $exit_code += 0; # turn undef into 0 - print STDERR <<_EOT_ + my $out = ( $exit_code ? *STDERR : *STDOUT ); + print $out <<_EOT_ usage: $cmd [-V?h] [-qv] [-d magic] [-o outfile.ind] [-t log] \\ [-L lang] [-C codepage] [-M module] [-I input] \\ @@ -702,8 +728,6 @@ sub xindy_expression () { # FIXME: I didn't see all languages. What's on with gypsy and # hausa? if ( $language ) { - my $ld = "$modules_dir/lang"; - my $variant; # If there is no language directory, this might be a variant. # Language names and variants are separated by hyphens. The # variant name "din" is an abbreviation for "din5007". The @@ -711,20 +735,29 @@ sub xindy_expression () { # name. # # FIXME: Or is "iso" the variant "translit"?! - if ( ! -d "$ld/$language" ) { - $language =~ /^([^-]*)-(.*)/ ; # language name ends with 1st hyphen - if ( $2 && -d "$ld/$1" ) { # $2 is not set if the regex didn't match - $language = $1; - $variant = "$2-" unless ( $2 eq 'iso' ); - $variant eq 'din-' and $variant = 'din5007-'; + my @lang_base_dirs = ("$modules_dir/contrib/lang", "$modules_dir/lang"); + my ($lang_dir, $variant); + foreach my $ld ( @lang_base_dirs ) { + if ( -d "$ld/$language" ) { + $lang_dir = "$ld/$language"; + last; + } else { + $language =~ /^([^-]*)-(.*)/ ; # language name ends with 1st hyphen + if ( $2 && -d "$ld/$1" ) { # $2 is not set if the regex didn't match + $language = $1; + $lang_dir = "$ld/$language"; + $variant = "$2-" unless ( $2 eq 'iso' ); + $variant eq 'din-' and $variant = 'din5007-'; + last; + } } } # Let's guess the codepage. We take any that starts with - # "latin", "cp", "iso8859", or "ascii". - @codepages = qw(latin cp iso8859 ascii) unless @codepages; + # "latin", "cp", "iso8859", "ascii", or "utf8". + @codepages = qw(latin cp iso8859 ascii utf8) unless @codepages; my @styles; foreach my $cp ( @codepages ) { - @styles = glob("$ld/$language/$variant$cp*-lang.xdy"); + @styles = glob("$lang_dir/$variant$cp*-lang.xdy"); last if @styles; } unless ( @styles ) { @@ -867,6 +900,13 @@ sub quotify ( $ ) { #====================================================================== # # $Log: xindy.pl,v $ +# Revision 1.18 2011/01/18 22:18:29 jschrod +# Document the range raw markup incompatibility with MakeIndex. +# (Bug ticket 998541) +# +# Revision 1.17 2010/08/12 00:16:01 jschrod +# Output help message on stdout if there's no error. +# # Revision 1.16 2010/05/10 23:39:24 jschrod # Incorporate TeX-Live patches from Vladimir Volovich and Peter # Breitenlohner: Support for TL installation scheme, support for Mac OS |