From b3f1741ccbe6dede2fc5cc309815e40728c0330f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 14 Jun 2010 22:31:40 +0000 Subject: glossaries 2.06 (14jun10) git-svn-id: svn://tug.org/texlive/trunk@18975 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/scripts/glossaries/makeglossaries | 154 +++++++++++---------- 1 file changed, 84 insertions(+), 70 deletions(-) (limited to 'Master/texmf-dist/scripts/glossaries') 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 () - { - 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 () + { + # 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); -- cgit v1.2.3