summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/glossaries
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-06-11 21:48:43 +0000
committerKarl Berry <karl@freefriends.org>2017-06-11 21:48:43 +0000
commit58551f18efea3adda9329b57a924862ca95b0818 (patch)
treed675b24fcd7d62293d919e3b0ef0115207e93c88 /Master/texmf-dist/scripts/glossaries
parentdb432709c39f01058010e3494b6570a374a93931 (diff)
glossaries (11jun17)
git-svn-id: svn://tug.org/texlive/trunk@44564 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/glossaries')
-rwxr-xr-xMaster/texmf-dist/scripts/glossaries/makeglossaries60
1 files changed, 46 insertions, 14 deletions
diff --git a/Master/texmf-dist/scripts/glossaries/makeglossaries b/Master/texmf-dist/scripts/glossaries/makeglossaries
index b322759f0fb..7321a30dbec 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 : 2.20
+# Version : 2.21
# Description: simple Perl script that calls makeindex or xindy.
# Intended for use with "glossaries.sty" (saves having to remember
# all the various switches)
@@ -25,11 +25,14 @@
# and the derived files glossaries.sty, mfirstuc.sty,
# glossary-hypernav.sty, glossary-list.sty, glossary-long.sty,
# glossary-super.sty, glossaries.perl.
-# Also makeglossaries and makeglossaries.
+# Also makeglossaries and makeglossaries-lite.lua.
-my $version="2.20 (2016-12-16)";
+my $version="2.21 (2017-05-11)";
# History:
+# v2.21:
+# * Fixed spelling of \GlsAddXdyLocation
+# * Adjusted range encap clash
# v2.20 (2016/12/16)
# * Added check for \glsxtr@makeglossaries
# v2.19 (2016/05/27)
@@ -222,9 +225,10 @@ my %xindy_error_text =
'nomain' =>
"\nRemember to use package option 'nomain' if you don't\n".
"want to use the main glossary.",
+#v2.21: fixed spelling of \GlsAddXdyLocation
'badlocation' =>
"You may have forgotten to add a location \n"
- . "class with \\GlsAddLocation or you may have \n"
+ . "class with \\GlsAddXdyLocation or you may have \n"
. "the format incorrect.\n",
'comp207' => "You may need to add 'compatible-2.07' package option.",
'noxdyfile' => "Style file not found. (Have you used \\noist by mistake?)"
@@ -1006,17 +1010,49 @@ sub makeindex{
and $entry{'location'} eq $existing->{'location'}
and $entry{'encap'} ne $existing->{'encap'})
{
- if (&encap_overrides($entry{'encap'},
- $existing->{'encap'}))
+ $add = 0 if ($add == 1);
+
+ # Range encaps should take precedence.
+
+ if ($entry{'encap'}=~/^[\(\)]/)
+ {
+ $add = 2;
+
+ if ($existing->{'encap'}=~/^[\(\)]/)
+ {
+ # too complicated, keep both
+
+ last;
+ }
+ else
+ {
+ # remove existing
+
+ splice @entries, $idx, 1;
+
+ $idx--;
+ }
+ }
+ elsif ($existing->{'encap'}=~/^[\(\)]/)
+ {
+ if ($entry{'encap'}=~/^[\(\)]/)
+ {
+ # too complicated, keep both
+
+ $add = 1;
+ last;
+ }
+ # (otherwise drop new entry)
+ }
+ elsif (&encap_overrides($entry{'encap'},
+ $existing->{'encap'}))
{
$entries[$idx] = \%entry;
}
-
- $add = 0;
}
}
- push @entries, \%entry if $add;
+ push @entries, \%entry if $add > 0;
}
else
{
@@ -1060,15 +1096,11 @@ sub makeindex{
# For example, what happens in the event of 'textbf' and 'emph'?
# Should one override the other or be combined? Combining is harder
# as it would need a corresponding LaTeX command.
-# Range encaps should take precedence.
+# 2.21 check for range encap moved earlier
sub encap_overrides{
my ($newencap, $existing) = @_;
- return 0 if ($existing=~/^[\(\)]/);
-
- return 1 if ($newencap=~/^[\(\)]/);
-
($existing=~/\\glsnumberformat\s*$/ or $newencap!~/\\glsnumberformat\s*$/ )
}