summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/glossaries
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-14 22:31:40 +0000
committerKarl Berry <karl@freefriends.org>2010-06-14 22:31:40 +0000
commitb3f1741ccbe6dede2fc5cc309815e40728c0330f (patch)
treee9c7d2ffc516d8fff6defbf3b85205078e1701f9 /Master/texmf-dist/scripts/glossaries
parentfa2a29ef6564da92ff9b4caede3dd5456dd48eb6 (diff)
glossaries 2.06 (14jun10)
git-svn-id: svn://tug.org/texlive/trunk@18975 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/glossaries')
-rwxr-xr-xMaster/texmf-dist/scripts/glossaries/makeglossaries154
1 files changed, 84 insertions, 70 deletions
diff --git a/Master/texmf-dist/scripts/glossaries/makeglossaries b/Master/texmf-dist/scripts/glossaries/makeglossaries
index 58077a46a42..71f3df40d52 100755
--- a/Master/texmf-dist/scripts/glossaries/makeglossaries
+++ b/Master/texmf-dist/scripts/glossaries/makeglossaries
@@ -2,7 +2,7 @@
# File : makeglossaries
# Author : Nicola Talbot
-# Version : 1.8 (2009/11/03)
+# Version : 1.9 (2010/06/14)
# Description: simple Perl script that calls makeindex or xindy.
# Intended for use with "glossaries.sty" (saves having to remember
# all the various switches)
@@ -30,6 +30,8 @@
my $version="1.7 (2009-09-23)";
# History:
+# v1.9 (2010-06-14) :
+# * Check for \@input
# v1.8 (2009-11-03) :
# * Create an empty output file if the input file is empty
# without calling xindy/makeindex
@@ -121,75 +123,7 @@ my $letterordering = defined($opt_l);
# check aux file for other glossary types
# and for ist file name
-if (open AUXFILE, "$name.aux")
-{
- while (<AUXFILE>)
- {
- if (m/\\\@newglossary\s*\{(.*)\}{(.*)}{(.*)}{(.*)}/)
- {
- $exttype{$1}{'log'} = $2;
- $exttype{$1}{'out'} = $3;
- $exttype{$1}{'in'} = $4;
-
- unless ($opt_q)
- {
- print "added glossary type '$1' ($2,$3,$4)\n";
- }
- }
-
- if (m/\\\@istfilename\s*{([^}]*)}/)
- {
- $istfile = $1;
-
- # check if double quotes were added to \jobname
- $istfile=~s/^"(.*)"\.ist$/$1.ist/;
- }
-
- # v1.5 added
- if (m/\\\@xdylanguage\s*{([^}]+)}{([^}]*)}/)
- {
- $language{$1} = $2;
- }
-
- # v1.5 added
- if (m/\\\@gls\@codepage\s*{([^}]+)}{([^}]*)}/)
- {
- $codepage{$1} = $2;
- }
-
- # v1.5 added
- # Allow -l switch to override specification in aux file
- unless (defined($opt_l))
- {
- if (m/\\\@glsorder\s*{([^}]+)}/)
- {
- my $ordering = $1;
-
- if ($ordering eq "word")
- {
- $letterordering = 0;
- }
- elsif ($ordering eq "letter")
- {
- $letterordering = 1;
- }
- else
- {
- print STDERR
- "Unknown ordering '$letterordering'\n",
- "Assuming word ordering\n";
- $letterordering = 0;
- }
- }
- }
- }
-
- close AUXFILE;
-}
-else
-{
- print STDERR "Unable to open $name.aux: $!\n";
-}
+&scan_aux($name);
# has the style file been specified?
unless ($istfile)
@@ -411,6 +345,86 @@ else
}
}
+sub scan_aux{
+ my $name = shift;
+
+ if (open AUXFILE, "$name.aux")
+ {
+ while (<AUXFILE>)
+ {
+ # v1.8 added
+ if (m/\\\@input{(.+)\.aux}/)
+ {
+ &scan_aux($1);
+ }
+
+ if (m/\\\@newglossary\s*\{(.*)\}{(.*)}{(.*)}{(.*)}/)
+ {
+ $exttype{$1}{'log'} = $2;
+ $exttype{$1}{'out'} = $3;
+ $exttype{$1}{'in'} = $4;
+
+ unless ($opt_q)
+ {
+ print "added glossary type '$1' ($2,$3,$4)\n";
+ }
+ }
+
+ if (m/\\\@istfilename\s*{([^}]*)}/)
+ {
+ $istfile = $1;
+
+ # check if double quotes were added to \jobname
+ $istfile=~s/^"(.*)"\.ist$/$1.ist/;
+ }
+
+ # v1.5 added
+ if (m/\\\@xdylanguage\s*{([^}]+)}{([^}]*)}/)
+ {
+ $language{$1} = $2;
+ }
+
+ # v1.5 added
+ if (m/\\\@gls\@codepage\s*{([^}]+)}{([^}]*)}/)
+ {
+ $codepage{$1} = $2;
+ }
+
+ # v1.5 added
+ # Allow -l switch to override specification in aux file
+ unless (defined($opt_l))
+ {
+ if (m/\\\@glsorder\s*{([^}]+)}/)
+ {
+ my $ordering = $1;
+
+ if ($ordering eq "word")
+ {
+ $letterordering = 0;
+ }
+ elsif ($ordering eq "letter")
+ {
+ $letterordering = 1;
+ }
+ else
+ {
+ print STDERR
+ "Unknown ordering '$letterordering'\n",
+ "Assuming word ordering\n";
+ $letterordering = 0;
+ }
+ }
+ }
+ }
+
+ close AUXFILE;
+ }
+ else
+ {
+ print STDERR "Unable to open $name.aux: $!\n";
+ }
+}
+
sub makeindex{
my($in,$out,$trans,$ist,$rest,$quiet,$dontexec) = @_;
my($name,$cmdstr,$buffer,$n,$i,$j);