summaryrefslogtreecommitdiff
path: root/support/makeglossariesgui
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/makeglossariesgui
Initial commit
Diffstat (limited to 'support/makeglossariesgui')
-rw-r--r--support/makeglossariesgui/README48
-rw-r--r--support/makeglossariesgui/makeglossariesgui-en.pdfbin0 -> 596234 bytes
-rw-r--r--support/makeglossariesgui/src/CHANGES17
-rw-r--r--support/makeglossariesgui/src/Makefile56
-rw-r--r--support/makeglossariesgui/src/README-src29
-rwxr-xr-xsupport/makeglossariesgui/src/bin/makeglossariesgui4
-rw-r--r--support/makeglossariesgui/src/doc/LICENSE674
-rw-r--r--support/makeglossariesgui/src/doc/Makefile45
-rwxr-xr-xsupport/makeglossariesgui/src/doc/createmakeglossariesguidocs2414
-rw-r--r--support/makeglossariesgui/src/doc/images/basic-sample-details.pngbin0 -> 10993 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/basic-sample-diagnostics.pngbin0 -> 47200 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/basic-sample.pngbin0 -> 38477 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/missing-sort-details.pngbin0 -> 12552 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/missing-sort-diagnostics.pngbin0 -> 74168 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-applications.pngbin0 -> 17693 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-diagnostics.pngbin0 -> 12135 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-gui-cde.pngbin0 -> 8440 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-gui-gtk.pngbin0 -> 19723 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-gui-metal.pngbin0 -> 13511 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-gui-nimbus.pngbin0 -> 17198 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/properties-startdir.pngbin0 -> 11878 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/unsupported-enc-details.pngbin0 -> 11572 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/unsupported-enc-diagnostics.pngbin0 -> 43421 bytes
-rw-r--r--support/makeglossariesgui/src/doc/images/unsupported-enc-summary.pngbin0 -> 44853 bytes
-rw-r--r--support/makeglossariesgui/src/doc/info.txt41
-rw-r--r--support/makeglossariesgui/src/doc/jlfgr-license.txt57
-rw-r--r--support/makeglossariesgui/src/doc/makeglossariesgui-en.xml957
-rw-r--r--support/makeglossariesgui/src/doc/makeglossariesgui.cls125
-rw-r--r--support/makeglossariesgui/src/doc/makeglossariesgui.dtd106
-rw-r--r--support/makeglossariesgui/src/doc/makeglossariesgui.pod87
-rw-r--r--support/makeglossariesgui/src/images/icons/back.pngbin0 -> 388 bytes
-rw-r--r--support/makeglossariesgui/src/images/icons/forward.pngbin0 -> 324 bytes
-rw-r--r--support/makeglossariesgui/src/images/icons/home.pngbin0 -> 480 bytes
-rw-r--r--support/makeglossariesgui/src/images/icons/makeglossariesgui-logolarge.pngbin0 -> 9043 bytes
-rw-r--r--support/makeglossariesgui/src/images/icons/makeglossariesgui-logosmall.pngbin0 -> 1435 bytes
-rw-r--r--support/makeglossariesgui/src/images/icons/makeglossariesgui.icobin0 -> 10898 bytes
-rw-r--r--support/makeglossariesgui/src/images/makeglossariesgui-splash.pngbin0 -> 104953 bytes
-rw-r--r--support/makeglossariesgui/src/installer/install.xml108
-rw-r--r--support/makeglossariesgui/src/installer/shortcutSpec.xml61
-rw-r--r--support/makeglossariesgui/src/installer/unix_shortcutSpec.xml60
-rw-r--r--support/makeglossariesgui/src/java/AppSelector.java167
-rw-r--r--support/makeglossariesgui/src/java/AuxFileFilter.java82
-rw-r--r--support/makeglossariesgui/src/java/DiagnosticPanel.java90
-rw-r--r--support/makeglossariesgui/src/java/FileField.java142
-rw-r--r--support/makeglossariesgui/src/java/Glossaries.java1468
-rw-r--r--support/makeglossariesgui/src/java/GlossariesPanel.java327
-rw-r--r--support/makeglossariesgui/src/java/Glossary.java940
-rw-r--r--support/makeglossariesgui/src/java/GlossaryBatchMessage.java110
-rw-r--r--support/makeglossariesgui/src/java/GlossaryException.java33
-rw-r--r--support/makeglossariesgui/src/java/GlossaryMessage.java15
-rw-r--r--support/makeglossariesgui/src/java/GlsTransferHandler.java69
-rw-r--r--support/makeglossariesgui/src/java/InvalidSyntaxException.java35
-rw-r--r--support/makeglossariesgui/src/java/MakeGlossariesDictionary.java187
-rw-r--r--support/makeglossariesgui/src/java/MakeGlossariesGUI.java1493
-rw-r--r--support/makeglossariesgui/src/java/MakeGlossariesInvoker.java842
-rw-r--r--support/makeglossariesgui/src/java/MakeGlossariesProperties.java538
-rw-r--r--support/makeglossariesgui/src/java/Manifest.txt2
-rw-r--r--support/makeglossariesgui/src/java/PropertiesDialog.java709
-rw-r--r--support/makeglossariesgui/src/java/ViewEntries.java238
-rw-r--r--support/makeglossariesgui/src/java/ViewFile.java96
-rw-r--r--support/makeglossariesgui/src/java/XindyModule.java295
-rw-r--r--support/makeglossariesgui/src/resources/dictionaries/makeglossariesgui-en.prop310
-rw-r--r--support/makeglossariesgui/src/resources/glossary-info-template.html46
-rw-r--r--support/makeglossariesgui/src/resources/information-template.html47
-rw-r--r--support/makeglossariesgui/src/tests/basic-sample/basic-sample.tex15
-rw-r--r--support/makeglossariesgui/src/tests/doc-defs/doc-defs.tex15
-rw-r--r--support/makeglossariesgui/src/tests/indexed-too-soon/indexed-too-soon.tex16
-rw-r--r--support/makeglossariesgui/src/tests/missing-printglossary/missing-printglossary.tex13
-rw-r--r--support/makeglossariesgui/src/tests/missing-sort/missing-sort.tex25
-rw-r--r--support/makeglossariesgui/src/tests/missing-sty/missing-sty.tex6
-rw-r--r--support/makeglossariesgui/src/tests/no-glossaries/no-glossaries.tex15
-rw-r--r--support/makeglossariesgui/src/tests/no-makeglossaries/no-makeglossaries.tex13
-rw-r--r--support/makeglossariesgui/src/tests/none-indexed/none-indexed.tex15
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossaries-accsupp.sty813
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossaries-babel.sty297
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossaries-compatible-207.sty328
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossaries-polyglossia.sty188
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossaries.sty4175
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-hypernav.sty96
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-list.sty104
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-long.sty182
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-longragged.sty174
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-super.sty210
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-superragged.sty189
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/glossary-tree.sty264
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/mfirstuc.sty94
-rw-r--r--support/makeglossariesgui/src/tests/old-version-301/old-version-301.tex63
-rw-r--r--support/makeglossariesgui/src/tests/restricted-doc-defs/restricted-doc-defs.tex15
-rw-r--r--support/makeglossariesgui/src/tests/sample-babel/sample-babel.tex16
-rw-r--r--support/makeglossariesgui/src/tests/sample-bib2gls-hybrid/sample-bib2gls-hybrid.tex15
-rw-r--r--support/makeglossariesgui/src/tests/sample-bib2gls/sample-bib2gls.tex13
-rw-r--r--support/makeglossariesgui/src/tests/sample-fragile/sample-fragile.tex23
-rw-r--r--support/makeglossariesgui/src/tests/sample-german/sample-german.tex19
-rw-r--r--support/makeglossariesgui/src/tests/sample-include/gloss.tex5
-rw-r--r--support/makeglossariesgui/src/tests/sample-include/main.tex2
-rw-r--r--support/makeglossariesgui/src/tests/sample-include/sample-include.tex12
-rw-r--r--support/makeglossariesgui/src/tests/sample-latin1/sample-latin1-makeindex.tex16
-rw-r--r--support/makeglossariesgui/src/tests/sample-latin1/sample-latin1.tex16
-rw-r--r--support/makeglossariesgui/src/tests/sample-noidx/sample-noidx.tex15
-rw-r--r--support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists-xindy.tex23
-rw-r--r--support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists.tex21
-rw-r--r--support/makeglossariesgui/src/tests/unsupported-enc/unsupported-enc.tex18
-rw-r--r--support/makeglossariesgui/src/tests/utf8-label/utf8-label.tex19
-rw-r--r--support/makeglossariesgui/src/tests/working-examples/working-sample-makeindex.tex15
-rw-r--r--support/makeglossariesgui/src/tests/working-examples/working-sample-xindy.tex17
-rw-r--r--support/makeglossariesgui/src/tests/wrong-type/wrong-type.tex15
-rw-r--r--support/makeglossariesgui/src/tests/xindy-english/xindy-english.tex18
-rw-r--r--support/makeglossariesgui/src/tests/xindy-german-xetex/xindy-german-xetex.tex18
-rw-r--r--support/makeglossariesgui/src/tests/xindy-german/xindy-german.tex18
109 files changed, 20829 insertions, 0 deletions
diff --git a/support/makeglossariesgui/README b/support/makeglossariesgui/README
new file mode 100644
index 0000000000..0515911bce
--- /dev/null
+++ b/support/makeglossariesgui/README
@@ -0,0 +1,48 @@
+Application : MakeGlossariesGUI
+
+Author : Nicola L. C. Talbot
+
+License : GPLv3+ <http://gnu.org/licenses/gpl.html>
+
+Home Page : http://www.dickimaw-books.com/software/makeglossariesgui/
+
+Requirements : Java Runtime Environment (JRE 8)
+
+DESCRIPTION
+===========
+
+MakeGlossariesGui is a Java GUI diagnostic tool for the glossaries
+LaTeX package (http://ctan.org/pkg/glossaries). It can check for
+common problems that can cause the entries within the glossary or
+the entire glossary to be omitted. In GUI mode it parses both the
+.aux and the .log file for known error and warning messages.
+
+When run in batch mode, it can be used as alternative to the
+makeglossaries Perl script and the makeglossaries-lite.lua Lua
+script supplied by the glossaries package. (It doesn't parse the log
+file in batch mode or show all the diagnostic information that the
+GUI mode provides.)
+
+Installation
+============
+
+Run the installer:
+
+java -jar makeglossariesgui-installer.jar
+
+Third Party Libraries
+=====================
+
+MakeGlossariesGUI depends on the following third party libraries
+whose jar files are placed in the application's lib directory by
+the installer:
+
+ - Java Help (https://javahelp.java.net/) GPL
+ - The Java Look and Feel Graphics Repository
+ (http://www.oracle.com/technetwork/java/index-138612.html)
+ JLFGR License
+
+If you want to build the application, you will need to fetch those
+jar files and add them to the lib directory.
+
+http://www.dickimaw-books.com/
diff --git a/support/makeglossariesgui/makeglossariesgui-en.pdf b/support/makeglossariesgui/makeglossariesgui-en.pdf
new file mode 100644
index 0000000000..63c974045f
--- /dev/null
+++ b/support/makeglossariesgui/makeglossariesgui-en.pdf
Binary files differ
diff --git a/support/makeglossariesgui/src/CHANGES b/support/makeglossariesgui/src/CHANGES
new file mode 100644
index 0000000000..3e931d6399
--- /dev/null
+++ b/support/makeglossariesgui/src/CHANGES
@@ -0,0 +1,17 @@
+2.1 (2018-05-23):
+
+ * Added check for bib2gls.
+
+ * Added encoding check.
+
+ * Added buttons to test makeglossaries and makeglossaries-lite
+ scripts.
+
+2.0 (2016-06-06):
+
+ * Updated for glossaries v4.0
+
+1.0 (2011-09-16):
+
+ * Initial release
+
diff --git a/support/makeglossariesgui/src/Makefile b/support/makeglossariesgui/src/Makefile
new file mode 100644
index 0000000000..b2f1d3febc
--- /dev/null
+++ b/support/makeglossariesgui/src/Makefile
@@ -0,0 +1,56 @@
+APP_VERSION:=$(shell grep "public static final String APP_VERSION" java/MakeGlossariesInvoker.java | sed "s/public\sstatic\sfinal\sString\sAPP_VERSION=//" | tr -d "\"\; ")
+IZPACKDIR=/usr/local/IzPack
+
+test : app
+ bin/makeglossariesgui --debug
+
+app : lib lib/makeglossariesgui.jar lib/resources lib/makeglossariesgui-splash.png
+
+dist : ../dist/makeglossariesgui-installer.jar
+ cp doc/makeglossariesgui-en.pdf ../dist
+
+../dist/makeglossariesgui-installer.jar : app installer/install.xml
+ $(IZPACKDIR)/bin/compile installer/install.xml -b . \
+ -o ../dist/makeglossariesgui-installer.jar -k standard
+
+lib :
+ mkdir -p lib
+
+lib/resources :
+ cd lib; ln -s ../resources
+
+resources/icons :
+ cd resources; ln -s ../images/icons
+
+resources/LICENSE :
+ cd resources; ln -s ../doc/LICENSE
+
+lib/makeglossariesgui-splash.png : lib
+ cd lib; ln -s -f ../images/makeglossariesgui-splash.png
+
+lib/makeglossariesgui.jar : java/Manifest.txt \
+ resources/icons resources/LICENSE \
+ classes/com/dickimawbooks/makeglossariesgui/MakeGlossariesInvoker.class \
+ doc/createmakeglossariesguidocs doc/makeglossariesgui-*.xml doc/makeglossariesgui.dtd
+ make -C doc
+ cd classes; \
+ jar cmf ../java/Manifest.txt ../lib/makeglossariesgui.jar \
+ com/dickimawbooks/makeglossariesgui/*.class
+
+classes/com/dickimawbooks/makeglossariesgui/MakeGlossariesInvoker.class : classes/com/dickimawbooks/makeglossariesgui \
+ java/*.java \
+ lib/javahelp2.jar lib/jlfgr-1_0.jar
+ cd java; \
+ javac -d ../classes \
+ -Xlint:unchecked -Xlint:deprecation \
+ -cp ../lib/javahelp2.jar:../lib/jlfgr-1_0.jar *.java
+
+classes/com/dickimawbooks/makeglossariesgui :
+ mkdir -p classes/com/dickimawbooks/makeglossariesgui
+
+clean :
+ \rm -f classes/com/dickimawbooks/makeglossariesgui/*.class
+ \rm -f classes/com/dickimawbooks/makeglossariesgui/*/*.class
+
+squeaky :
+ \rm -f lib/makeglossariesgui.jar
diff --git a/support/makeglossariesgui/src/README-src b/support/makeglossariesgui/src/README-src
new file mode 100644
index 0000000000..5edca97ead
--- /dev/null
+++ b/support/makeglossariesgui/src/README-src
@@ -0,0 +1,29 @@
+makeglossariesgui source code
+
+License: GPL
+
+Requirements:
+
+Java Help (https://javahelp.java.net/)
+Java Look and Feel Graphics Repository
+(http://www.oracle.com/technetwork/java/index-138612.html)
+
+Instructions:
+
+Fetch the above and copy or symlink the jar files (javahelp2.jar
+and jlfgr-1_0.jar) in the lib/ directory (create lib/ if it
+doesn't exist)
+
+In the lib/ directory, make a symbolic link to resources/
+images/icons/ and images/splash.png
+
+In the resources/ directory, make a symbolic link to
+doc/LICENSE
+
+The Java helpset files and the .tex file for the documentation
+is created from the .xml file using the Perl script in the
+doc/ directory. The JavaHelp indexer then needs to be run
+on the helpset files and LaTeX on the .tex file (pdflatex,
+makeglossaries, pdflatex, makeindex, pdflatex).
+
+www.dickimaw-books.com
diff --git a/support/makeglossariesgui/src/bin/makeglossariesgui b/support/makeglossariesgui/src/bin/makeglossariesgui
new file mode 100755
index 0000000000..2f712b0a46
--- /dev/null
+++ b/support/makeglossariesgui/src/bin/makeglossariesgui
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+bindir=`dirname $0`
+java -jar "$bindir/../lib/makeglossariesgui.jar" $@
diff --git a/support/makeglossariesgui/src/doc/LICENSE b/support/makeglossariesgui/src/doc/LICENSE
new file mode 100644
index 0000000000..94a9ed024d
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/support/makeglossariesgui/src/doc/Makefile b/support/makeglossariesgui/src/doc/Makefile
new file mode 100644
index 0000000000..06293983f6
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/Makefile
@@ -0,0 +1,45 @@
+TARGETDIR=../resources/helpsets
+DICTDIR=../resources/dictionaries
+TARGETBACKREF=../../doc
+MAINCLASS=../java/MakeGlossariesInvoker.java
+
+all : en makeglossariesgui.1
+
+makeglossariesgui.1 : makeglossariesgui.pod
+ pod2man -c makeglossariesgui makeglossariesgui.pod makeglossariesgui.1
+
+en : $(TARGETDIR)/makeglossariesgui-en/makeglossariesgui.html \
+ makeglossariesgui-en.pdf
+
+$(TARGETDIR)/makeglossariesgui-en/makeglossariesgui.html : $(TARGETDIR) \
+ createmakeglossariesguidocs \
+ makeglossariesgui-en.xml makeglossariesgui.dtd \
+ ../tests/basic-sample/basic-sample.tex \
+ images/*.png \
+ $(MAINCLASS) \
+ $(DICTDIR)/makeglossariesgui-en.prop \
+ $(TARGETDIR)/makeglossariesgui-en/images/
+ createmakeglossariesguidocs en
+ cd $(TARGETDIR)/makeglossariesgui-en; \
+ \rm -r -f JavaHelpSearch ; \
+ jh2indexer .
+
+$(TARGETDIR) :
+ mkdir $(TARGETDIR)
+
+makeglossariesgui-en.pdf : makeglossariesgui-en.tex makeglossariesgui.cls
+ arara makeglossariesgui-en
+
+makeglossariesgui-en.tex : createmakeglossariesguidocs makeglossariesgui-en.xml \
+ $(MAINCLASS) \
+ $(DICTDIR)/makeglossariesgui-en.prop
+ createmakeglossariesguidocs en
+
+$(TARGETDIR)/makeglossariesgui-en/images/ :
+ mkdir -p $(TARGETDIR)/makeglossariesgui-en
+ cd $(TARGETDIR)/makeglossariesgui-en/ ; \
+ ln -s ../$(TARGETBACKREF)/images
+
+clean :
+ \rm -f makeglossariesgui-en.{tex,aux,log,pdf,glg,glo,gls,ist,ilg,ind,idx,acr,acn,alg}
+
diff --git a/support/makeglossariesgui/src/doc/createmakeglossariesguidocs b/support/makeglossariesgui/src/doc/createmakeglossariesguidocs
new file mode 100755
index 0000000000..869bea79d5
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/createmakeglossariesguidocs
@@ -0,0 +1,2414 @@
+#!/usr/bin/perl -w
+
+use strict;
+use XML::Parser;
+
+if ($#ARGV > 1 || $#ARGV < 0)
+{
+ die "Syntax: $0 <lang> [<region>]\n";
+}
+
+my $targetdir = '../resources/helpsets';
+my $dictdir = '../resources/dictionaries';
+my $mainclass = '../java/MakeGlossariesInvoker.java';
+my $base = 'makeglossariesgui';
+
+my $fontenc = 'T1';
+
+# mapping between locales and babel options
+
+my %babel =
+ (
+ 'en' => 'english',
+ 'en-GB' => 'british',
+ 'en-US' => 'american',
+ 'fr' => 'frenchb'
+ );
+
+my $lang = $ARGV[0];
+
+my $locale = $lang;
+
+if ($#ARGV == 1)
+{
+ $locale .= "-".$ARGV[1];
+}
+
+my $encoding_file = 'utf8';
+my $encoding_xml = 'UTF-8';
+
+open FD, "$mainclass" or die "Can't open '$mainclass' $!\n";
+binmode(FD, ":$encoding_file");
+
+my %dict = ();
+
+while (<FD>)
+{
+ if (/\bstatic +final +String +APP_NAME *= *"(.+)";/)
+ {
+ $dict{appname} = $1;
+ }
+ elsif (/\bstatic +final +String +APP_VERSION *= *"(.+)";/)
+ {
+ $dict{appversion} = $1;
+ }
+ elsif (/\bstatic +final +String +APP_DATE *= *"([^"]+)"/)
+ {
+ $dict{appdate} = $1;
+ }
+}
+
+close FD;
+
+my $propfile = "$dictdir/$base-$locale.prop";
+
+if (not (-e $propfile) and ($lang ne $locale))
+{
+ $propfile = "$dictdir/$base-$lang.prop";
+
+ unless (-e $propfile)
+ {
+ die "Can't find either '$dictdir/$base-$locale.prop' or
+'$propfile'\n";
+ }
+}
+
+unless (-e $propfile)
+{
+ die "Can't find '$propfile'\n";
+}
+
+open FD, "$propfile" or die "Can't open '$propfile' $!\n";
+
+$_ = <FD>;
+
+if (/# Encoding: ([^s]+)/)
+{
+ binmode(FD, ":encoding($1)");
+}
+else
+{
+ die "Encoding comment line missing from line 1 of '$propfile'\n";
+}
+
+my $linenum = 1;
+
+my $openquote = chr(hex(2018));
+my $closequote = chr(hex(2019));
+
+while (<FD>)
+{
+ $linenum++;
+
+ next if (/^ *#/ or /^ *$/);
+
+ if (/^([^=]+)=(.*)$/)
+ {
+ my $dictkey = $1;
+ my $value = $2;
+
+ $value=~s/\\{1}[nt]/ /g;
+ $value=~s/(\w)''(\w)/$1$closequote$2/g;
+ $value=~s/'{2}([^']+)'{2}/$openquote$1$closequote/g;
+ $value=~s/'{2}/$closequote/g;
+ $value=~s/\|([a-zA-Z]+)\|/\\cs{$1}/g;
+
+ # strip any trailing ellipsis
+ $value=~s/\.{3}$//g;
+
+ # Don't need the complexity of the Java application here.
+ # (Many of the messages aren't used in the manual, just the
+ # menu items, button labels and dialog titles are required.)
+
+ $value=~s/\{\d,choice,[^\}]+\|<([^\}]*)\}/$1/g;
+
+ $value=~s/\{(\d+)(,[^\}]+)?\}/&arg_placeholder($1)/eg;
+
+ $dict{$dictkey} = $value;
+
+ }
+ else
+ {
+ warn "$propfile: Can't parse line $linenum\n";
+ }
+}
+
+close FD;
+
+my %docinfo = ();
+my @nodes = ();
+my @current = ();
+my @paragraph = ();
+my %tags = ();
+
+my $languagedefinitions =
+ "\\def\\idxpackagename{".&get_label('manual.idxpackage')."}\n"
+ ."\\def\\idxenvname{".&get_label('manual.idxenv')."}\n"
+ ."\\def\\examplename{".&get_label('manual.example')."}\n";
+
+my $xmlfile = "$base-$locale.xml";
+
+if (not (-e $xmlfile) and ($lang ne $locale))
+{
+ $xmlfile = "$base-$lang.xml";
+
+ unless (-e $xmlfile)
+ {
+ die "Can't find either '$base-$locale.xml' or '$xmlfile'\n";
+ }
+}
+
+unless (-e $xmlfile)
+{
+ die "Can't find '$xmlfile'\n";
+}
+
+my $texfile = "$base-$locale.tex";
+my $helpsetdir = "$targetdir/$base-$locale";
+
+unless (-e $helpsetdir)
+{
+ mkdir $helpsetdir or die "Can't mkdir '$helpsetdir' $!\n";
+}
+
+unless (-d $helpsetdir)
+{
+ die "'$helpsetdir' is not a directory\n";
+}
+
+# Is there any way of querying the input encoding picked up by
+# XML::Parser? Let's just stick to utf8
+my $inputenc = 'utf8';
+
+my %section_levels =
+(
+ 'chapter' => '1',
+ 'section' => '2',
+ 'subsection' => '3',
+ 'subsubsection' => '4',
+ 'paragraph' => '5'
+);
+
+my %acros = ();
+
+my %terms = ();
+
+my @float_elements = ();
+
+my @tabular_specs = ();
+
+my %counters = ();
+
+# open the TeX file
+open TEXFD, ">$texfile" or die "Can't open '$texfile' $!\n";
+binmode(TEXFD, ":$encoding_file");
+
+# initialize the parser
+my $parser = XML::Parser->new( Handlers =>
+ {
+ Start=>\&handle_start,
+ End=>\&handle_end,
+ Char=>\&handle_char
+ });
+$parser->parsefile( $xmlfile );
+
+close TEXFD;
+
+# Write helpset files
+
+open HSFD, ">$helpsetdir/$base.hs"
+ or die "Can't open '$helpsetdir/$base.hs' $!\n";
+binmode(HSFD, ":$encoding_file");
+
+my $toctitle = &get_label('manual.toc');
+my $manualtitle = &get_label('manual.title');
+my $indextitle = &get_label('manual.index');
+my $searchtitle = &get_label('manual.search');
+
+print HSFD <<_END_HS_HEAD;
+<?xml version='1.0' encoding='$encoding_xml' ?>
+<!DOCTYPE helpset
+PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
+"http://java.sun.com/products/javahelp/helpset_2_0.dtd">
+
+
+<helpset version="2.0">
+ <!-- title -->
+ <title>$manualtitle</title>
+ <!-- maps -->
+ <maps>
+ <homeID>top </homeID>
+ <mapref location="Map.jhm" />
+ </maps>
+
+ <!-- views -->
+ <view xml:lang="$locale" mergetype="javax.help.UniteAppendMerge">
+ <name>TOC</name>
+ <label>$toctitle</label>
+ <type>javax.help.TOCView</type>
+ <data>${base}TOC.xml</data>
+ </view>
+ <view xml:lang="$locale" mergetype="javax.help.SortMerge">
+ <name>Index</name>
+ <label>$indextitle</label>
+ <type>javax.help.IndexView</type>
+ <data>${base}Index.xml</data>
+ </view>
+ <view xml:lang="$locale">
+ <name>Search</name>
+ <label>$searchtitle</label>
+ <type>javax.help.SearchView</type>
+ <data engine="com.sun.java.help.search.DefaultSearchEngine">
+ JavaHelpSearch
+ </data>
+ </view>
+ <!-- presentation windows -->
+ <!-- main window -->
+ <presentation default=true>
+ <name>main window</name>
+ <size width="600" height="600" />
+ <location x="200" y="200" />
+ <title>$manualtitle</title>
+ <toolbar>
+ <helpaction image="homeIcon">javax.help.HomeAction</helpaction>
+ <helpaction image="backIcon">javax.help.BackAction</helpaction>
+ <helpaction image="forwardIcon">javax.help.ForwardAction</helpaction>
+ </toolbar>
+ <image>appIcon</image>
+ </presentation>
+ <!-- secondary window -->
+ <presentation displayviews=false>
+ <name>secondary window</name>
+ <size width="450" height="500" />
+ <location x="200" y="200" />
+ <image>appIcon</image>
+ </presentation>
+ <!-- implementation section -->
+ <impl>
+ <helpsetregistry helpbrokerclass="javax.help.DefaultHelpBroker" />
+ <viewerregistry viewertype="text/html"
+ viewerclass="com.sun.java.help.impl.CustomKit"/>
+ <viewerregistry viewertype="text/xml"
+ viewerclass="com.sun.java.help.impl.CustomXMLKit" />
+ </impl>
+</helpset>
+_END_HS_HEAD
+
+close HSFD;
+
+open HTMLFD, ">$helpsetdir/$base.html"
+ or die "Can't open '$helpsetdir/$base.html' $!\n";
+binmode(HTMLFD, ":$encoding_file");
+
+print HTMLFD &html_head($docinfo{Title}, '', $nodes[0]->{Tag});
+
+print HTMLFD "<body>\n";
+
+print HTMLFD
+ "<div class=\"title\" \"><p>",
+ $docinfo{Title}, "</p>\n";
+
+print HTMLFD "<p>$docinfo{Author}</p>\n" if ($docinfo{Author});
+
+print HTMLFD "</div><div class=\"date\">";
+
+print HTMLFD "<p>$docinfo{Date}</p>\n" if ($docinfo{Date});
+
+print HTMLFD "</div>";
+
+print HTMLFD &html_nav('', $nodes[0]);
+
+print HTMLFD "</body>\n</html>\n";
+
+close HTMLFD;
+
+my $prev = $base;
+
+open TOCFD, ">$helpsetdir/${base}TOC.xml"
+ or die "Can't open '$helpsetdir/${base}TOC.xml' $!\n";
+binmode(TOCFD, ":$encoding_file");
+
+print TOCFD <<_END_TOC_HEAD;
+<?xml version='1.0' encoding='$encoding_xml' ?>
+ <!DOCTYPE toc
+ PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version
+2.0//EN"
+ "http://java.sun.com/products/javahelp/toc_2_0.dtd">
+
+<toc version="2.0" xml:lang="en">
+<tocitem text="Manual" target="top" >
+_END_TOC_HEAD
+
+my $prevlevel = 0;
+
+for (my $idx = 0; $idx <= $#nodes; $idx++)
+{
+ my $node = $nodes[$idx];
+
+ for (my $level = scalar(keys %section_levels); $level >= 0; $level--)
+ {
+ if ($section_levels{$node->{Type}}+$level <= $prevlevel)
+ {
+ print TOCFD "</tocitem>\n";
+ }
+ }
+
+ print TOCFD "<tocitem text=\"$node->{Title}\" target=\"$node->{Tag}\">\n";
+
+ my $next = ($idx == $#nodes ? '' : $nodes[$idx+1]);
+
+ my $tag = $node->{Tag};
+
+ open HTMLFD, ">$helpsetdir/$tag.html"
+ or die "Can't open '$helpsetdir/$tag.html' $!\n";
+
+ binmode(HTMLFD, ":$encoding_file");
+
+ print HTMLFD &html_head($node->{Title},
+ ($prev eq $base ? $base : $prev->{Tag}),
+ ($next ? $next->{Tag} : ''));
+
+ print HTMLFD "<body>\n";
+
+ my $header = 'h'.$section_levels{$node->{Type}};
+
+ print HTMLFD "<$header>", $node->{Title}, "</$header>\n";
+
+ my $content = $node->{Contents};
+
+ $content=~s/<ref>([^<]+)<\/ref>/&get_ref($1)/eg;
+
+ print HTMLFD "<div>$content</div>";
+
+ if ($node->{Footnotes})
+ {
+ $content = $node->{Footnotes};
+
+ $content=~s/<ref>([^<]+)<\/ref>/&get_ref($1)/eg;
+
+ print HTMLFD "<hr />$content";
+ }
+
+ print HTMLFD &html_nav($prev, $next);
+
+ print HTMLFD "</body>\n</html>\n";
+
+ close HTMLFD;
+
+ $prev = $node;
+ $prevlevel = $section_levels{$node->{Type}};
+}
+
+for (my $level = scalar(keys %section_levels); $level >= 0; $level--)
+{
+ if ($level < $prevlevel)
+ {
+ print TOCFD "</tocitem>\n";
+ }
+}
+
+print TOCFD "</tocitem>\n</toc>\n";
+
+close TOCFD;
+
+# write map file
+
+open MAPFD, ">$helpsetdir/Map.jhm"
+ or die "Can't open '$helpsetdir/Map.jhm' $!\n";
+binmode(MAPFD, ":$encoding_file");
+
+print MAPFD <<_END_MAP_HEAD;
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE map
+ PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 2.0//EN"
+ "http://java.sun.com/products/javahelp/map_2_0.dtd">
+<map version="2.0" xml:lang="$locale">
+_END_MAP_HEAD
+
+print MAPFD "<mapID target=\"top\" url=\"$base.html\" />\n";
+print MAPFD "<mapID target=\"appIcon\" url=\"../../icons/makeglossariesgui-logosmall.png\" />\n";
+print MAPFD "<mapID target=\"homeIcon\" url=\"../../icons/home.png\" />\n";
+print MAPFD "<mapID target=\"backIcon\" url=\"../../icons/back.png\" />\n";
+print MAPFD "<mapID target=\"forwardIcon\" url=\"../../icons/forward.png\" />\n";
+
+&hs_map_id(\%tags);
+&hs_map_id(\%terms);
+
+print MAPFD "</map>\n";
+close MAPFD;
+
+# Write the helpset index file
+
+open IDXFD, ">$helpsetdir/${base}Index.xml"
+ or die "Can't open '$helpsetdir/${base}Index.xml' $!\n";
+binmode(IDXFD, ":$encoding_file");
+
+print IDXFD <<_END_IDX_HEAD;
+<?xml version='1.0' encoding='$encoding_xml' ?>
+ <!DOCTYPE index
+ PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 2.0//EN"
+ "http://java.sun.com/products/javahelp/index_2_0.dtd">
+
+<index version="2.0">
+_END_IDX_HEAD
+
+&print_idx_entries(\%terms);
+
+print IDXFD "</index>\n";
+close IDXFD;
+
+sub print_idx_entries{
+ my ($hash) = @_;
+
+ foreach my $key (keys %$hash)
+ {
+ if ($hash->{$key}->{Text})
+ {
+ my $text = $hash->{$key}->{Text};
+
+ $text=~s/<\/?[^>]*>//g;
+
+ print IDXFD "<indexitem text=\"",
+ $text, "\" target=\"",
+ $key, "\">\n";
+
+ if ($hash->{$key}->{Children})
+ {
+ &print_idx_entries($hash->{$key}->{Children});
+ }
+
+ print IDXFD "</indexitem>\n";
+ }
+ else
+ {
+ warn "Text not set for '$key'\n";
+ }
+ }
+}
+
+sub handle_char{
+ my( $expat, $string ) = @_;
+
+ &handle_html($string);
+
+ print TEXFD $string;
+}
+
+sub hs_map_id{
+ my ($hash) = @_;
+
+ foreach my $tag (keys %$hash)
+ {
+ if ($hash->{$tag}->{Ref})
+ {
+ print MAPFD "<mapID target=\"$tag\" url=\"$hash->{$tag}->{Ref}\" />\n";
+ }
+ else
+ {
+ warn "No Ref found for '$tag'\n";
+ }
+
+ if ($hash->{$tag}->{Children})
+ {
+ &hs_map_id($hash->{$tag}->{Children});
+ }
+ }
+}
+
+sub hs_index_term{
+ my ($tag, $text, $term, $hash) = @_;
+
+ if ($hash->{$tag})
+ {
+ &handle_html($text);
+ }
+ else
+ {
+ $hash->{$tag}->{Text} = $term;
+ $hash->{$tag}->{Ref} = $nodes[$#nodes]->{Tag}.".html#$tag";
+
+ &handle_html("<a name=\"$tag\">$text</a>");
+ }
+
+}
+
+sub hs_popup{
+ my ($href, $text) = @_;
+
+ my $html = <<_END_POPUP;
+ <object classid="java:com.sun.java.help.impl.JHSecondaryViewer">
+ <param name="viewerStyle" value="javax.help.Popup" />
+ <param name="viewerSize" value="400,200" />
+ <param name="content" value="$href" />
+ <param name="viewerActivator" value="javax.help.LinkLabel" />
+ <param name="text" value="&#x261B;" />
+ <param name="textColor" value="blue" />
+ </object>
+_END_POPUP
+
+ $html.$text
+}
+
+sub handle_html{
+ my ($string) = @_;
+
+ if ($#current > -1)
+ {
+ my $element = $current[$#current];
+
+ $docinfo{$element} .= $string;
+ }
+ elsif ($#nodes > -1)
+ {
+ $nodes[$#nodes]->{Contents} .= $string;
+ }
+}
+
+sub handle_start {
+ my( $expat, $element, %attrs ) = @_;
+
+ my $sub = "start_$element";
+
+ if (defined(&$sub))
+ {
+ {
+ no strict 'refs';
+ &$sub($expat, %attrs);
+ }
+ }
+ else
+ {
+ die "Don't know what to do with '<$element>'\n";
+ }
+}
+
+sub handle_end {
+ my( $expat, $element ) = @_;
+
+ my $sub = "end_$element";
+
+ if (defined(&$sub))
+ {
+ {
+ no strict 'refs';
+ &$sub($expat);
+ }
+ }
+ else
+ {
+ die "Don't know what to do with '</$element>'\n";
+ }
+}
+
+sub get_ref{
+ my ($tag) = @_;
+
+ unless ($tags{$tag})
+ {
+ die "Unknown tag '$tag'\n";
+ }
+
+ my $ref = $tags{$tag}->{Ref};
+ my $text = $tags{$tag}->{Text};
+
+ "<a href=\"$ref\">$text</a>";
+}
+
+sub get_label{
+ my ($tag, $attrs, $expat) = @_;
+
+ unless ($dict{$tag})
+ {
+ if ($expat)
+ {
+ die "No dictionary entry for tag '$tag' on line ",
+ $expat->current_line, "\n";
+ }
+ else
+ {
+ die "No dictionary entry for tag '$tag'\n";
+ }
+ }
+
+ my $text = $dict{$tag};
+
+ if ($attrs)
+ {
+ $text=~s/\$(\d)/$attrs->{"arg$1"}/eg;
+ }
+
+ # strip any trailing ellipsis
+
+ $text=~s/\.{3}$//;
+
+ $text
+}
+
+sub start_manual{
+ my ($expat, %attrs) = @_;
+
+ if ($attrs{fontenc})
+ {
+ $fontenc = $attrs{'fontenc'};
+ }
+
+ print TEXFD "% arara: pdflatex\n";
+ print TEXFD "% arara: makeglossaries\n";
+ print TEXFD "% arara: pdflatex\n";
+ print TEXFD "% arara: makeindex\n";
+ print TEXFD "% arara: pdflatex\n";
+ print TEXFD "\\documentclass[index=totoc,$babel{$locale}]{makeglossariesgui}\n";
+}
+
+sub end_manual{
+ my ($expat) = @_;
+}
+
+sub start_preamble{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\usepackage[$inputenc]{inputenc}\n",
+ "\\usepackage[$fontenc]{fontenc}\n",
+ "\\usepackage{lmodern}\n",
+ "\\usepackage{graphicx}\n",
+ "\\usepackage{verbatim}\n",
+ "\\usepackage{alltt}\n",
+ "\\usepackage{moreverb}\n",
+ "\\usepackage{makeidx}\n",
+ "\\usepackage{babel}\n",
+ "\\usepackage[colorlinks]{hyperref}\n",
+ "\\usepackage[toc]{glossaries}\n",
+ "\\makeglossaries\n\\makeindex\n",
+ $languagedefinitions;
+}
+
+sub end_preamble{
+ my ($expat) = @_;
+}
+
+sub start_title{
+ my ($expat, %attrs) = @_;
+
+ push @current, 'Title';
+
+ print TEXFD "\\title{";
+}
+
+sub end_title{
+ my ($expat) = @_;
+
+ pop @current;
+
+ print TEXFD "}\n";
+}
+
+sub start_date{
+ my ($expat, %attrs) = @_;
+
+ push @current, 'Date';
+
+ print TEXFD "\\date{";
+}
+
+sub end_date{
+ my ($expat) = @_;
+
+ pop @current;
+
+ print TEXFD "}\n";
+}
+
+sub start_author{
+ my ($expat, %attrs) = @_;
+
+ push @current, 'Author';
+
+ unless ($docinfo{Author})
+ {
+ $docinfo{Author} = " ";
+ }
+
+ $docinfo{Author} .= "<table class=\"author\"><tr><td>";
+
+ print TEXFD "\\Author{";
+}
+
+sub end_author{
+ my ($expat) = @_;
+
+ $docinfo{Author} .= "</td></tr></table>";
+
+ pop @current;
+
+ print TEXFD "}\n";
+}
+
+sub start_document{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\begin{document}\n\\maketitle\n\\tableofcontents\n";
+}
+
+sub end_document{
+ my ($expat) = @_;
+
+ print TEXFD "\\end{document}\n";
+}
+
+sub start_node{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{type})
+ {
+ die "Missing 'type' attribute for element 'node' on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'tag' attribute for element 'node' on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{title})
+ {
+ die "Missing 'title' attribute for element 'node' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $currentlevel = $section_levels{$attrs{type}};
+
+ unless ($currentlevel)
+ {
+ die "Unknown section level '$attrs{type}' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $lastlevel;
+
+ if ($#nodes == -1)
+ {
+ $lastlevel = 0;
+ }
+ else
+ {
+ $lastlevel = $section_levels{$nodes[$#nodes]->{Type}};
+ }
+
+ unless ($currentlevel <= $lastlevel+1)
+ {
+ die "Node '$attrs{tag}' type can't be deeper than '",
+ $section_levels{$lastlevel+1},"' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my %node =
+ (
+ Type => $attrs{type},
+ Title => $attrs{title},
+ Tag => $attrs{tag},
+ Contents => '',
+ Footnotes => ''
+ );
+
+ push @nodes, \%node;
+
+ $tags{$attrs{tag}}->{Ref} = $attrs{tag}.'.html';
+ $tags{$attrs{tag}}->{Text} = $attrs{title};
+
+ print TEXFD "\\", $attrs{type}, "{",
+ $attrs{title}, "}\\label{",
+ $attrs{tag}, "}\n";
+}
+
+sub end_node{
+ my ($expat) = @_;
+
+}
+
+sub start_newacro{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'tag' attribute for element 'newacro' on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{short})
+ {
+ die "Missing 'short' attribute for element 'newacro' on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{long})
+ {
+ die "Missing 'long' attribute for element 'newacro' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $tag = $attrs{tag};
+
+ if ($acros{$tag})
+ {
+ die "Acronym '$tag' already defined\n";
+ }
+
+ $acros{$tag}->{Short} = $attrs{short};
+ $acros{$tag}->{Long} = $attrs{long};
+
+ # write html file used by popup window
+
+ open FD, ">$helpsetdir/acr_$tag.html"
+ or die "Can't open '$helpsetdir/acr_$tag.html' $!\n";
+
+ print FD &html_head($attrs{short});
+
+ print FD "<body>\n<h1>$attrs{short}</h1>\n",
+ ucfirst($attrs{long}), ".\n";
+
+ print FD "</body>\n</html>\n";
+
+ close FD;
+
+ print TEXFD "\\newacronym{$tag}{$attrs{short}}{$attrs{long}}\n";
+}
+
+sub end_newacro{
+ my ($expat) = @_;
+}
+
+sub start_newterm{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'tag' attribute for element 'newterm' on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{text})
+ {
+ die "Missing 'text' attribute for element 'newterm' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $tag = 'gls_'.$attrs{tag};
+
+ if ($terms{$tag})
+ {
+ die "Term '", $attrs{tag}, "' already defined\n";
+ }
+
+ $terms{$tag}->{Text} = $attrs{text};
+
+ if ($attrs{description})
+ {
+ $terms{$tag}->{Description} = $attrs{description};
+ $terms{$tag}->{Fmt} = $attrs{fmt};
+
+ # write html file used by popup window if a description has been
+ # supplied
+
+ open FD, ">$helpsetdir/$tag.html"
+ or die "Can't open '$helpsetdir/$tag.html' $!\n";
+
+ print FD &html_head($attrs{text});
+
+ print FD "<body>\n<h1>";
+
+ if ($attrs{fmt})
+ {
+ print FD "<$attrs{fmt}>$attrs{text}</$attrs{fmt}>";
+ }
+ else
+ {
+ print FD $attrs{text};
+ }
+
+ print FD "</h1>\n", ucfirst($attrs{description}), ".\n";
+
+ print FD "</body>\n</html>\n";
+
+ close FD;
+
+ if ($attrs{fmt})
+ {
+ print TEXFD "\\newglossaryentry{$attrs{tag}}{name={",
+ "\\html$attrs{fmt}\{",
+ $attrs{text}, "}},sort={",
+ $attrs{text}, "},description={",
+ $attrs{description},
+ "\\index{$attrs{text}\@\\html$attrs{fmt}\{",
+ $attrs{text}, "}}}}\n";
+ }
+ else
+ {
+ print TEXFD "\\newglossaryentry{$attrs{tag}}{name={",
+ $attrs{text}, "},description={", $attrs{description}, "\\index{$attrs{text}}}}\n";
+ }
+ }
+}
+
+sub end_newterm{
+ my ($expat) = @_;
+}
+
+sub start_p{
+ my ($expat, %attrs) = @_;
+
+ my $endtag="\n\n";
+
+ if ($attrs{noindent})
+ {
+ my $value = lc($attrs{noindent});
+
+ if ($value eq 'true' or $value eq 1)
+ {
+ $attrs{noindent} = 1;
+ }
+ elsif ($value eq 'false' or $value eq 0)
+ {
+ $attrs{noindent} = 0;
+ }
+ else
+ {
+ die "Invalid value '$value' of attribute 'noindent' on line ",
+ $expat->current_line, "\n";
+ }
+ }
+
+ if ($attrs{align})
+ {
+ &handle_html('<p align="'.$attrs{'align'}.'">');
+
+ if ($attrs{align} eq 'left')
+ {
+ print TEXFD "\\begin{flushleft}";
+ $endtag="\\end{flushleft}";
+ }
+ elsif ($attrs{align} eq 'right')
+ {
+ print TEXFD "\\begin{flushright}";
+ $endtag="\\end{flushright}";
+ }
+ elsif ($attrs{align} eq 'center')
+ {
+ print TEXFD "\\begin{center}";
+ $endtag="\\end{center}";
+ }
+ else
+ {
+ die "Unknown alignment option", $attrs{align},
+ " for 'p' element on line ", $expat->current_line, "\n";
+ }
+ }
+ else
+ {
+ &handle_html("<p>");
+ print TEXFD "\n\n";
+
+ print TEXFD "\\noindent " if $attrs{noindent};
+ }
+
+ push @paragraph, $endtag;
+}
+
+sub end_p{
+ my ($expat) = @_;
+
+ &handle_html("</p>");
+
+ print TEXFD pop @paragraph;
+}
+
+sub start_dl{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<dl>");
+
+ print TEXFD "\\begin{description}";
+}
+
+sub end_dl{
+ my ($expat) = @_;
+
+ &handle_html("</dl>");
+
+ print TEXFD "\\end{description}";
+}
+
+sub start_ul{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<ul>");
+
+ print TEXFD "\\begin{itemize}";
+}
+
+sub end_ul{
+ my ($expat) = @_;
+
+ &handle_html("</ul>");
+
+ print TEXFD "\\end{itemize}";
+}
+
+sub start_tt{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<tt>");
+
+ print TEXFD "\\texttt{";
+}
+
+sub end_tt{
+ my ($expat) = @_;
+
+ &handle_html('</tt>');
+
+ print TEXFD "}";
+}
+
+sub start_b{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<b>");
+
+ print TEXFD "\\textbf{";
+}
+
+sub end_b{
+ my ($expat) = @_;
+
+ &handle_html('</b>');
+
+ print TEXFD "}";
+}
+
+sub start_em{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<em>");
+
+ print TEXFD "\\emph{";
+}
+
+sub end_em{
+ my ($expat) = @_;
+
+ &handle_html('</em>');
+
+ print TEXFD "}";
+}
+
+sub start_li{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<li>");
+
+ print TEXFD "\\item ";
+}
+
+sub end_li{
+ my ($expat) = @_;
+
+ &handle_html("</li>");
+}
+
+
+sub start_dt{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<dt>");
+
+ print TEXFD "\\item[{";
+}
+
+sub end_dt{
+ my ($expat) = @_;
+
+ &handle_html("</dt>");
+
+ print TEXFD "}]";
+}
+
+sub start_dd{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<dd>");
+
+}
+
+sub end_dd{
+ my ($expat) = @_;
+
+ &handle_html("</dd>");
+
+}
+
+sub start_meta{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("&#x27E8;<em>");
+
+ print TEXFD "\\meta{";
+}
+
+sub end_meta{
+ my ($expat) = @_;
+
+ &handle_html('</em>&#x27E9;');
+
+ print TEXFD "}";
+}
+
+sub start_marg{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('{');
+
+ print TEXFD "\\marg{";
+}
+
+sub end_marg{
+ my ($expat) = @_;
+
+ &handle_html('}');
+
+ print TEXFD "}";
+}
+
+sub start_dq{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('"');
+
+ print TEXFD "\\dq{";
+}
+
+sub end_dq{
+ my ($expat) = @_;
+
+ &handle_html('"');
+
+ print TEXFD "}";
+}
+
+sub start_sq{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("'");
+
+ print TEXFD "\\sq{";
+}
+
+sub end_sq{
+ my ($expat) = @_;
+
+ &handle_html("'");
+
+ print TEXFD "}";
+}
+
+sub start_url{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{www})
+ {
+ die "element 'url' missing 'www' attribute\n";
+ }
+
+ my $string;
+
+ my $uri = $attrs{www};
+
+ $uri = "http://$uri" unless ($uri=~/^[a-z]+:\/\//);
+
+ if ($attrs{text})
+ {
+ print TEXFD "\\href{", $attrs{www}, "}{", $attrs{text}, "}";
+ $string = "<a href=\"$uri\">$attrs{text}</a>";
+ }
+ else
+ {
+ print TEXFD "\\url{", $attrs{www}, "}";
+ $string = "<a href=\"$uri\"><tt>$attrs{www}</tt></a>";
+ }
+
+ &handle_html($string);
+}
+
+sub end_url{
+ my ($expat) = @_;
+}
+
+sub start_sty{
+ my ($expat, %attrs) = @_;
+
+ push @current, 'sty';
+
+ print TEXFD "\\sty{";
+}
+
+sub end_sty{
+ my ($expat) = @_;
+
+ pop @current;
+
+ my $sty = $docinfo{sty};
+ $docinfo{sty} = '';
+
+ &hs_index_term("sty_$sty", "<tt>$sty</tt>", "$sty.sty", \%terms);
+
+ print TEXFD "}";
+}
+
+sub start_footnote{
+ my ($expat, %attrs) = @_;
+
+ if ($counters{footnote})
+ {
+ $counters{footnote} = 1;
+ }
+ else
+ {
+ $counters{footnote}++;
+ }
+
+ $nodes[$#nodes]->{Contents} .=
+ "<sup><a href=\"#fn-$counters{footnote}\">$counters{footnote}</a></sup>";
+
+ push @current, 'Footnote';
+
+ print TEXFD "\\footnote{";
+}
+
+sub end_footnote{
+ my ($expat) = @_;
+
+ pop @current;
+
+ $nodes[$#nodes]->{Footnotes} .=
+ "<p><sup><a name=\"fn-$counters{footnote}\">$counters{footnote}</a></sup>"
+ . $docinfo{Footnote}
+ . '</p>';
+
+ $docinfo{Footnote} = '';
+
+ print TEXFD "}";
+}
+
+sub start_blockquote{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\begin{blockquote}";
+
+ &handle_html('<blockquote>');
+}
+
+sub end_blockquote{
+ my ($expat) = @_;
+
+ print TEXFD "\\end{blockquote}";
+
+ &handle_html('</blockquote>');
+}
+
+sub start_example{
+ my ($expat, %attrs) = @_;
+
+ if ($counters{example})
+ {
+ $counters{example}++;
+ }
+ else
+ {
+ $counters{example} = 1;
+ }
+
+ &handle_html('<blockquote><p><b>'
+ . &get_label('manual.example')
+ . '&nbsp;' . $counters{example}
+ . ($attrs{title}? "($attrs{title})." : '.')
+ . '</b></p>');
+
+ print TEXFD "\\begin{example}";
+
+ if ($attrs{title})
+ {
+ print TEXFD '[', $attrs{title}, ']';
+ }
+}
+
+sub end_example{
+ my ($expat) = @_;
+
+ &handle_html('</blockquote>');
+
+ print TEXFD "\\end{example}";
+}
+
+sub start_seealso{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tags})
+ {
+ die "Element 'seealso' missing 'tags' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my @tags = split /,/, $attrs{tags};
+
+ my $seealso = &get_label('manual.seealso');
+
+ &handle_html("<p>$seealso<ul>");
+
+ print TEXFD "\n\n\\minisec{$seealso}\n";
+
+ print TEXFD "\\begin{itemize}\n";
+
+ foreach my $tag (@tags)
+ {
+ &handle_html("<li><ref>$tag</ref>");
+ print TEXFD "\\item \\nameref{$tag}\n";
+ }
+
+ print TEXFD "\\end{itemize}\n";
+
+ &handle_html('</ul>');
+}
+
+sub end_seealso{
+ my ($expat) = @_;
+}
+
+sub start_pre{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('<pre>');
+
+ print TEXFD "\\begin{verbatim}";
+}
+
+sub end_pre{
+ my ($expat) = @_;
+
+ &handle_html('</pre>');
+
+ print TEXFD "\\end{verbatim}";
+}
+
+sub start_alltt{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('<pre>');
+
+ print TEXFD "\\begin{alltt}";
+}
+
+sub end_alltt{
+ my ($expat) = @_;
+
+ &handle_html('</pre>');
+
+ print TEXFD "\\end{alltt}";
+}
+
+sub start_verbinput{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{src})
+ {
+ die "Missing 'verbinput' element's 'src' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ &handle_html('<pre>');
+
+ open FD, $attrs{src} or die "Can't open '$attrs{src}' $!\n";
+
+ while (<FD>)
+ {
+ s/\&/\&amp;/g;
+ s/</\&lt;/g;
+ s/>/\&gt;/g;
+
+ &handle_html($_);
+ }
+
+ close FD;
+
+ &handle_html('</pre>');
+
+ print TEXFD "\\verbatiminput{$attrs{src}}";
+}
+
+sub end_verbinput{
+ my ($expat) = @_;
+}
+
+sub start_verbtabinput{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{src})
+ {
+ die "Missing 'verbtabinput' element's 'src' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ &handle_html('<pre>');
+
+ open FD, $attrs{src} or die "Can't open '$attrs{src}' $!\n";
+
+ while (<FD>)
+ {
+ s/\&/\&amp;/g;
+ s/</\&lt;/g;
+ s/>/\&gt;/g;
+
+ &handle_html($_);
+ }
+
+ close FD;
+
+ &handle_html('</pre>');
+
+ print TEXFD "\\verbatimtabinput{$attrs{src}}";
+}
+
+sub end_verbtabinput{
+ my ($expat) = @_;
+}
+
+sub start_float{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{type})
+ {
+ die "Element 'float' missing 'type' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{tag})
+ {
+ die "Element 'float' missing 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($attrs{caption})
+ {
+ die "Element 'float' missing 'caption' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $pos = ($attrs{pos}? "[$attrs{pos}]" : '');
+
+ if ($counters{$attrs{type}})
+ {
+ $counters{$attrs{type}}++;
+ }
+ else
+ {
+ $counters{$attrs{type}} = 1;
+ }
+
+ $attrs{counter} = $counters{$attrs{type}};
+
+ push @float_elements, \%attrs;
+
+ &handle_html("<div class=\"float\"><a name=\"$attrs{tag}\"></a>");
+
+ $tags{$attrs{tag}}->{Ref} = $nodes[$#nodes]->{Tag}
+ .'.html#'.$attrs{tag};
+ $tags{$attrs{tag}}->{Text} = ucfirst(&get_label('manual.'.$attrs{type}))
+ . '&nbsp;' . $attrs{counter};
+
+ unless ($attrs{type} eq 'figure')
+ {
+ &handle_html('<p></p><p>' . $tags{$attrs{tag}}->{Text} . ': '
+ . $attrs{caption} . '</p>');
+ }
+
+ print TEXFD "\\begin{", $attrs{type}, "}$pos\n";
+ print TEXFD "\\floatconts{", $attrs{tag}, "}{\\caption";
+
+ if ($attrs{listcaption})
+ {
+ print TEXFD "[", $attrs{listcaption}, "]";
+ }
+
+ print TEXFD "{", $attrs{caption}, "}}{";
+}
+
+sub end_float{
+ my ($expat) = @_;
+
+ my $attrs = pop @float_elements;
+
+ if ($attrs->{type} eq 'figure')
+ {
+ &handle_html('<p>'. $tags{$attrs->{tag}}->{Text} . ': '
+ . $attrs->{caption} . '</p><p></p>');
+ }
+
+ &handle_html('</div>');
+
+ print TEXFD "}%\n\\end{", $attrs->{type}, "}\n";
+}
+
+sub start_nbsp{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('&nbsp;');
+
+ print TEXFD "~";
+}
+
+sub end_nbsp{
+ my ($expat) = @_;
+}
+
+sub start_emdash{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('&#x2014;');
+
+ print TEXFD "---";
+}
+
+sub end_emdash{
+ my ($expat) = @_;
+}
+
+sub start_hash{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('<tt>#</tt>');
+
+ print TEXFD "\\texttt{\\#}";
+}
+
+sub end_hash{
+ my ($expat) = @_;
+}
+
+sub start_tilde{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('~');
+
+ print TEXFD "\\textasciitilde ";
+}
+
+sub end_tilde{
+ my ($expat) = @_;
+}
+
+sub start_lt{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('&lt;');
+
+ print TEXFD "\\textless ";
+}
+
+sub end_lt{
+ my ($expat) = @_;
+}
+
+sub start_gt{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('&gt;');
+
+ print TEXFD "\\textgreater ";
+}
+
+sub end_gt{
+ my ($expat) = @_;
+}
+
+sub start_element{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('<tt>&lt;');
+
+ print TEXFD "\\element{";
+}
+
+sub end_element{
+ my ($expat) = @_;
+
+ &handle_html('&gt;</tt>');
+
+ print TEXFD "}";
+}
+
+sub start_image{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{src})
+ {
+ die "Missing 'image' element's 'src' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $imgfile = $attrs{src};
+
+ unless (-e $imgfile)
+ {
+ die "Can't find image file '$imgfile' referenced on line ",
+ $expat->current_line, "\n";
+ }
+
+ my @opts=();
+
+ my $html = "";
+
+ foreach my $key (keys %attrs)
+ {
+ if ($key eq 'scale')
+ {
+ push @opts, "scale=$attrs{scale}";
+ }
+ elsif ($key eq 'width')
+ {
+ push @opts, "width=$attrs{width}";
+ $html .= "$key=\"$attrs{$key}\" ";
+ }
+ elsif ($key eq 'height')
+ {
+ push @opts, "height=$attrs{height}";
+ $html .= "$key=\"$attrs{$key}\" ";
+ }
+ else
+ {
+ $html .= "$key=\"$attrs{$key}\" ";
+ }
+ }
+
+ if (not $attrs{width} or not $attrs{height})
+ {
+ # get image dimensions
+
+ $_ = `file $imgfile`;
+
+ if (/(\d+) x (\d+)/)
+ {
+ $html .= "width=\"$1\" " unless $attrs{width};
+ $html .= "height=\"$2\" " unless $attrs{height};
+ }
+ else
+ {
+ warn "Can't determine dimensions of image '$imgfile'\n";
+ }
+ }
+
+ $html = "<img $html />";
+
+ &handle_html($html);
+
+ print TEXFD "\\includegraphics[",
+ join(',', @opts), "]{$imgfile}";
+}
+
+sub end_image{
+ my ($expat) = @_;
+}
+
+sub start_LaTeX{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('LaTeX');
+
+ print TEXFD "\\LaTeX{}";
+}
+
+sub end_LaTeX{
+ my ($expat) = @_;
+}
+
+sub start_TeX{
+ my ($expat, %attrs) = @_;
+
+ &handle_html('TeX');
+
+ print TEXFD "\\TeX{}";
+}
+
+sub end_TeX{
+ my ($expat) = @_;
+}
+
+sub start_relax{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\relax ";
+}
+
+sub end_relax{
+ my ($expat) = @_;
+}
+
+sub start_app{
+ my ($expat, %attrs) = @_;
+
+ my $tag="appname";
+
+ my $text = &get_label($tag, \%attrs, $expat);
+
+ &handle_html("<font class=\"appname\">$text</font>");
+
+ print TEXFD "\\appfmt{$text}";
+}
+
+sub end_app{
+ my ($expat) = @_;
+}
+
+sub start_dict{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'dict' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $text = &get_label($attrs{tag}, \%attrs, $expat);
+
+ &handle_html($text);
+
+ print TEXFD $text;
+}
+
+sub end_dict{
+ my ($expat) = @_;
+}
+
+sub start_button{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'button' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $text = &get_label($attrs{tag}, \%attrs, $expat);
+
+ $text=~s/:\s*$//;
+
+ &handle_html("<font class=\"button\">$text</font>");
+
+ print TEXFD "\\button{$text}";
+}
+
+sub end_button{
+ my ($expat) = @_;
+}
+
+sub start_menu{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'menu' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $hash = \%terms;
+
+ my $currentlabel;
+ my $index = '';
+ my $html = '';
+
+ foreach my $item (split /\./, $attrs{tag})
+ {
+ if ($currentlabel)
+ {
+ $currentlabel .= ".$item";
+ print TEXFD "\\mto ";
+ $index .= '!';
+ $html .= '&#x279C;';
+ }
+ else
+ {
+ $currentlabel = $item;
+ }
+
+ my $text = &get_label($currentlabel, \%attrs, $expat);
+
+ $html .= $text;
+
+ print TEXFD "\\menu{$text}";
+
+ my $termtag = 'menu_'.$currentlabel;
+
+ &hs_index_term($termtag, "", $text, $hash);
+
+ unless ($hash->{$termtag}->{Children})
+ {
+ my %h = ();
+ $hash->{$termtag}->{Children} = \%h;
+ }
+
+ $hash = $hash->{$termtag}->{Children};
+
+ $text=~s/([@"!|])/"$1/g;
+
+ $index .= "$text@\\menu{$text}";
+ }
+
+ &handle_html("<font class=\"menu\">$html</font>");
+
+ print TEXFD "\\index{$index}";
+}
+
+sub end_menu{
+ my ($expat) = @_;
+}
+
+sub start_acr{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'acr' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ unless ($acros{$attrs{tag}})
+ {
+ die "Unknown acronym tag '$attrs{tag}' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $html;
+
+ if ($acros{$attrs{tag}}->{Used})
+ {
+ $html = $acros{$attrs{tag}}->{Short};
+
+ &handle_html(&hs_popup("acr_".$attrs{tag}.".html", $html));
+ }
+ else
+ {
+ $acros{$attrs{tag}}->{Used} = 1;
+
+ $html = $acros{$attrs{tag}}->{Long}
+ . ' (' . $acros{$attrs{tag}}->{Short} . ')';
+
+ &hs_index_term('acr_'.$attrs{tag}, $html, ucfirst($html), \%terms);
+ }
+
+ print TEXFD "\\gls{", $attrs{tag}, "}";
+}
+
+sub end_acr{
+ my ($expat) = @_;
+}
+
+sub start_term{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'term' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $hstag = "gls_".$attrs{tag};
+
+ unless ($terms{$hstag})
+ {
+ die "Unknown term tag '$hstag' on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $html = $terms{$hstag}->{Text};
+ my $fmt = $terms{$hstag}->{Fmt};
+
+ if ($fmt)
+ {
+ $html = "<$fmt>$html</$fmt>";
+ }
+
+ unless ($terms{$hstag}->{Ref})
+ {
+ $terms{$hstag}->{Ref} = $nodes[$#nodes]->{Tag} . ".html#$hstag";
+ }
+
+ if ($terms{$hstag}->{Description})
+ {
+ if ($attrs{hyper} and $attrs{hyper} eq 'false')
+ {
+ print TEXFD "\\gls*{", $attrs{tag}, "}";
+ }
+ else
+ {
+ $html = &hs_popup("gls_".$attrs{tag}.".html", $html);
+
+ print TEXFD "\\gls{", $attrs{tag}, "}";
+ }
+ }
+ else
+ {
+ my $text = $terms{$hstag}->{Text};
+
+ my $idx = $text;
+
+ $idx=~s/([!@"|])/"$1/g;
+
+ if ($fmt)
+ {
+ $idx = "$idx\@\\html$fmt\{$idx\}";
+ }
+
+ print TEXFD "$text\\index{$idx}";
+ }
+
+ &hs_index_term($hstag, $html, $terms{$hstag}->{Text},
+ \%terms);
+
+}
+
+sub end_term{
+ my ($expat) = @_;
+}
+
+sub start_ref{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'ref' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ &handle_html("<ref>$attrs{tag}</ref>");
+
+ if ($attrs{text})
+ {
+ print TEXFD "\\hyperref[$attrs{tag}]{$attrs{text}}";
+ }
+ else
+ {
+ print TEXFD "\\autoref{", $attrs{tag}, "}";
+ }
+}
+
+sub end_ref{
+ my ($expat) = @_;
+}
+
+sub start_opt{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'opt' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $text = '--'.$attrs{tag};
+
+ unless ($terms{options})
+ {
+ &hs_index_term('options', '', &get_label('manual.options'), \%terms);
+
+ my %hash = ();
+
+ $terms{options}->{Children} = \%hash;
+ }
+
+ &hs_index_term('opt_'.$attrs{tag}, "<tt>$text</tt>", $text,
+ $terms{options}->{Children});
+
+ print TEXFD "\\opt{", $attrs{tag}, "}";
+}
+
+sub end_opt{
+ my ($expat) = @_;
+}
+
+sub start_backslash{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<tt>\\</tt>");
+
+ print TEXFD "\\texttt{\\char`\\\\}";
+}
+
+sub end_backslash{
+ my ($expat) = @_;
+}
+
+sub start_doublebackslash{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<tt>\\\\</tt>");
+
+ print TEXFD "\\cs{\\char`\\\\}";
+}
+
+sub end_doublebackslash{
+ my ($expat) = @_;
+}
+
+sub start_cs{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'cs' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $text = "\\".$attrs{tag};
+
+ print TEXFD '\\cs{', $attrs{tag}, '}';
+
+ &hs_index_term('cs_'.$attrs{tag}, "<tt>$text</tt>", $text, \%terms);
+
+}
+
+sub end_cs{
+ my ($expat) = @_;
+}
+
+sub start_env{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{tag})
+ {
+ die "Missing 'env' element's 'tag' attribute on line ",
+ $expat->current_line, "\n";
+ }
+
+ my $text = $attrs{tag};
+
+ print TEXFD '\\env{', $attrs{tag}, '}';
+
+ &hs_index_term('env_'.$attrs{tag}, "<tt>$text</tt>", $text, \%terms);
+
+}
+
+sub end_env{
+ my ($expat) = @_;
+}
+
+sub start_tabular{
+ my ($expat, %attrs) = @_;
+
+ unless ($attrs{spec})
+ {
+ die "Element 'tabular' missing 'spec' attribute on line ",
+ $expat->current_line;
+ }
+
+ &handle_html('<table>');
+
+ print TEXFD "\\begin{tabular}{", $attrs{spec}, '}';
+
+ my %hash =
+ (
+ spec => $attrs{spec},
+ column => 1
+ );
+
+ push @tabular_specs, \%hash;
+}
+
+sub end_tabular{
+ my ($expat) = @_;
+
+ &handle_html('</table>');
+
+ pop @tabular_specs;
+
+ print TEXFD "\\end{tabular}";
+}
+
+sub start_tr{
+ my ($expat, %attrs) = @_;
+
+ $tabular_specs[$#tabular_specs]->{column} = 1;
+
+ &handle_html('<tr>');
+}
+
+sub end_tr{
+ my ($expat) = @_;
+
+ &handle_html('</tr>');
+
+ print TEXFD "\\tabularnewline ";
+}
+
+sub start_td{
+ my ($expat, %attrs) = @_;
+
+ my $colspan = 1;
+
+ if ($attrs{span})
+ {
+ $colspan = $attrs{span};
+
+ unless ($colspan=~/^\d+$/)
+ {
+ die "Attribute 'span' must be an integer on line ",
+ $expat->current_line, "\n";
+ }
+ }
+
+ my $orgcolspec = substr $tabular_specs[$#tabular_specs]->{spec},
+ $tabular_specs[$#tabular_specs]->{column}-1, 1;
+
+ my $colspec = $orgcolspec;
+
+ if ($attrs{spec})
+ {
+ $colspec = $attrs{spec};
+ }
+
+ my $htmlcolspan = ($colspan == 1 ? '' : "colspan=\"$colspan\"");
+
+ if ($colspec eq 'l')
+ {
+ &handle_html("<td align=\"left\" $htmlcolspan>");
+ }
+ elsif ($colspec eq 'r')
+ {
+ &handle_html("<td align=\"right\" $htmlcolspan>");
+ }
+ elsif ($colspec eq 'c')
+ {
+ &handle_html("<td align=\"center\" $htmlcolspan>");
+ }
+
+ unless ($tabular_specs[$#tabular_specs]->{column} == 1)
+ {
+ print TEXFD "&";
+ }
+
+ if (($orgcolspec eq $colspec) and $colspan == 1)
+ {
+ $tabular_specs[$#tabular_specs]->{egroup} = '';
+ }
+ else
+ {
+ print TEXFD "\\multicolumn{$colspan}{$colspec}{";
+ $tabular_specs[$#tabular_specs]->{egroup} = '}';
+ }
+
+ $tabular_specs[$#tabular_specs]->{column} += $colspan;
+}
+
+sub end_td{
+ my ($expat) = @_;
+
+ &handle_html('</td>');
+
+ print TEXFD $tabular_specs[$#tabular_specs]->{egroup};
+}
+
+sub start_printglossary{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\printglossary";
+}
+
+sub end_printglossary{
+ my ($expat) = @_;
+}
+
+sub start_printacronyms{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\printglossary[type=acronym]";
+}
+
+sub end_printacronyms{
+ my ($expat) = @_;
+}
+
+sub start_printindex{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\printindex ";
+}
+
+sub end_printindex{
+ my ($expat) = @_;
+}
+
+sub start_br{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<br />");
+
+ print TEXFD "\\\\";
+}
+
+sub end_br{
+ my ($expat) = @_;
+}
+
+sub start_hr{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("<hr />");
+
+ print TEXFD "\\hrulefill ";
+}
+
+sub end_hr{
+ my ($expat) = @_;
+}
+
+sub start_cont{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD "\\continueline ";
+}
+
+sub end_cont{
+ my ($expat) = @_;
+}
+
+sub start_contexplan{
+ my ($expat, %attrs) = @_;
+
+ print TEXFD &get_label('manual.cont_explanation');
+}
+
+
+sub end_contexplan{
+ my ($expat) = @_;
+}
+
+sub start_percent{
+ my ($expat, %attrs) = @_;
+
+ &handle_html("%");
+ print TEXFD "\\%";
+}
+
+sub end_percent{
+ my ($expat) = @_;
+}
+
+sub html_head{
+ my ($title, $prev, $next) = @_;
+
+ my $head = <<_END_HTML_HEAD;
+<!DOCTYPE html html public "-//w3c//dtd xhtml 1.0 Transitional//en"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB"
+xml:lang="en-GB">
+<head>
+ <style type="text/css">
+ .title
+ {
+ display: inline;
+ font-weight: bold;
+ font-size: xx-large;
+ text-align: center;
+ }
+ .author
+ {
+ display: inline;
+ font-weight: bold;
+ font-size: large;
+ text-align: center;
+ padding: 2em;
+ }
+ .date
+ {
+ display: inline;
+ font-weight: bold;
+ font-size: normal;
+ text-align: center;
+ }
+ .float
+ {
+ text-align: center;
+ padding-top: 16;
+ }
+ .menu
+ {
+ font-weight: bold;
+ font-family: sans-serif;
+ }
+ .button
+ {
+ font-weight: bold;
+ font-family: sans-serif;
+ }
+ .appname
+ {
+ font-family: sans-serif;
+ }
+ </style>
+ <title>$title</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+_END_HTML_HEAD
+
+ if ($next)
+ {
+ $head .= "<link rel=\"next\" href=\"$next.html\" />";
+ }
+
+ if ($prev)
+ {
+ $head .= "<link rel=\"prev\" href=\"$prev.html\" />";
+ }
+
+ "$head</head>";
+}
+
+sub html_nav{
+ my ($prevNode, $nextNode) = @_;
+
+ my $nav = '<hr /><table width="100%"><tr><td align="left">';
+
+ if ($prevNode)
+ {
+ my $prev;
+ my $title;
+
+ if ($prevNode eq $base)
+ {
+ $prev = $base;
+ $title = &get_label('manual.home');
+ }
+ else
+ {
+ $prev = $prevNode->{Tag};
+ $title = $prevNode->{Title};
+ }
+
+ $nav .= "<a href=\"$prev.html\">&#x21E6; " .
+ $title . "</a>";
+ }
+
+ $nav .= '</td><td align="right">';
+
+ if ($nextNode)
+ {
+ $nav .= "<a href=\"$nextNode->{Tag}.html\">"
+ . $nextNode->{Title}
+ . " &#x21E8;</a>";
+ }
+
+ "$nav</td></tr></table>"
+}
+
+sub arg_placeholder{
+ "<ARG#" . ($_[0]) . "/>";
+}
+
+1;
diff --git a/support/makeglossariesgui/src/doc/images/basic-sample-details.png b/support/makeglossariesgui/src/doc/images/basic-sample-details.png
new file mode 100644
index 0000000000..29aba1c1c5
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/basic-sample-details.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/basic-sample-diagnostics.png b/support/makeglossariesgui/src/doc/images/basic-sample-diagnostics.png
new file mode 100644
index 0000000000..f4c550fe0f
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/basic-sample-diagnostics.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/basic-sample.png b/support/makeglossariesgui/src/doc/images/basic-sample.png
new file mode 100644
index 0000000000..6cc9d8ecfa
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/basic-sample.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/missing-sort-details.png b/support/makeglossariesgui/src/doc/images/missing-sort-details.png
new file mode 100644
index 0000000000..be051a75fe
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/missing-sort-details.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/missing-sort-diagnostics.png b/support/makeglossariesgui/src/doc/images/missing-sort-diagnostics.png
new file mode 100644
index 0000000000..06b8a479c2
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/missing-sort-diagnostics.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-applications.png b/support/makeglossariesgui/src/doc/images/properties-applications.png
new file mode 100644
index 0000000000..2e58bc681a
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-applications.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-diagnostics.png b/support/makeglossariesgui/src/doc/images/properties-diagnostics.png
new file mode 100644
index 0000000000..cf550b98aa
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-diagnostics.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-gui-cde.png b/support/makeglossariesgui/src/doc/images/properties-gui-cde.png
new file mode 100644
index 0000000000..baa505d64a
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-gui-cde.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-gui-gtk.png b/support/makeglossariesgui/src/doc/images/properties-gui-gtk.png
new file mode 100644
index 0000000000..160b2573a5
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-gui-gtk.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-gui-metal.png b/support/makeglossariesgui/src/doc/images/properties-gui-metal.png
new file mode 100644
index 0000000000..4b0d8cd59f
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-gui-metal.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-gui-nimbus.png b/support/makeglossariesgui/src/doc/images/properties-gui-nimbus.png
new file mode 100644
index 0000000000..8837d8a134
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-gui-nimbus.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/properties-startdir.png b/support/makeglossariesgui/src/doc/images/properties-startdir.png
new file mode 100644
index 0000000000..b4c73a3109
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/properties-startdir.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/unsupported-enc-details.png b/support/makeglossariesgui/src/doc/images/unsupported-enc-details.png
new file mode 100644
index 0000000000..d3316a3a9f
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/unsupported-enc-details.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/unsupported-enc-diagnostics.png b/support/makeglossariesgui/src/doc/images/unsupported-enc-diagnostics.png
new file mode 100644
index 0000000000..2661545288
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/unsupported-enc-diagnostics.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/images/unsupported-enc-summary.png b/support/makeglossariesgui/src/doc/images/unsupported-enc-summary.png
new file mode 100644
index 0000000000..b26e68f20c
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/images/unsupported-enc-summary.png
Binary files differ
diff --git a/support/makeglossariesgui/src/doc/info.txt b/support/makeglossariesgui/src/doc/info.txt
new file mode 100644
index 0000000000..1c4e7d941b
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/info.txt
@@ -0,0 +1,41 @@
+Application : MakeGlossariesGUI
+
+Author : Nicola L. C. Talbot
+
+License : GPLv3+ <http://gnu.org/licenses/gpl.html>
+
+Home Page : http://www.dickimaw-books.com/software/makeglossariesgui/
+
+Requirements : Java Runtime Environment
+
+DESCRIPTION
+===========
+
+MakeGlossariesGui is a Java GUI diagnostic tool for the glossaries
+LaTeX package (http://ctan.org/pkg/glossaries). It can check for
+common problems that can cause the entries within the glossary or
+the entire glossary to be omitted. In GUI mode it parses both the
+.aux and the .log file for known error and warning messages.
+
+When run in batch mode, it can be used as alternative to the
+makeglossaries Perl script and the makeglossaries-lite.lua Lua
+script supplied by the glossaries package. (It doesn't parse the log
+file in batch mode or show all the diagnostic information that the
+GUI mode provides.)
+
+Third Party Libraries
+=====================
+
+MakeGlossariesGUI depends on the following third party libraries
+whose jar files are placed in the application's lib directory by
+the installer:
+
+ - Java Help (https://javahelp.java.net/) GPL
+ - The Java Look and Feel Graphics Repository
+ (http://www.oracle.com/technetwork/java/index-138612.html)
+ JLFGR License
+
+If you want to build the application, you will need to fetch those
+jar files and add them to the lib directory.
+
+http://www.dickimaw-books.com/
diff --git a/support/makeglossariesgui/src/doc/jlfgr-license.txt b/support/makeglossariesgui/src/doc/jlfgr-license.txt
new file mode 100644
index 0000000000..0d73adedeb
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/jlfgr-license.txt
@@ -0,0 +1,57 @@
+Java Look and Feel Graphics Repository (JLFGR) License
+
+SUN IS WILLING TO MAKE THE ACCOMPANYING SOFTWARE
+GRAPHICS ARTWORK AVAILABLE TO YOU ONLY UPON THE
+CONDITION THAT YOU ACCEPT ALL OF THE TERMS
+CONTAINED IN THIS LICENSE. PLEASE READ THE TERMS
+AND CONDITIONS OF THIS LICENSE CAREFULLY. BY
+CLICKING "ACCEPT" AND DOWNLOADING THE SOFTWARE
+GRAPHICS ARTWORK, YOU ARE AGREEING TO THESE TERMS
+AND CONDITIONS. IF YOU DO NOT AGREE TO ALL OF
+THESE TERMS, SELECT THE "DO NOT ACCEPT" BUTTON AT
+THE END OF THIS LICENSE.
+
+
+Copyright 2000 by Sun Microsystems, Inc. All
+Rights Reserved.
+
+Sun grants you ("Licensee") a non-exclusive,
+royalty free, license to use, and redistribute
+this software graphics artwork, as individual
+graphics or as a collection, as part of softwarecode or programs
+that you develop, provided that
+i) this copyright notice and license accompany
+the software graphics artwork; and ii) you do not
+utilize the software graphics artwork in a manner
+which is disparaging to Sun. Unless enforceme nt
+is prohibited by applicable law, you may not
+modify the graphics, and must use them true to
+color and unmodified in every way.
+
+This software graphics artwork is provided "AS
+IS," without a warranty of any kind. ALL EXPRESS
+OR IMPL IED CONDITIONS, REPRESENTATIONS AND
+WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
+OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND
+ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
+SUFFERED BY LICENSEE AS A RESULT OF USING,
+MODIFYING OR DISTRIBUTING THE SOFTWARE GRAPHICS
+ARTWORK.
+
+IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
+FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+INCIDE NTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED
+AND REGARDLESS OF THE THEORY OF LIABILITY,
+ARISING OUT OF THE USE OF OR INABILITY TO USE
+SOFTWARE GRAPHICS ARTWORK, EVEN IF SUN HAS BEEN
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+If any of the above provisions are held to be in
+violation of applicable law, void, or
+unenforceable in any jurisdiction, then such
+provisions are waived to the extent necessary for
+this Disclaimer to be otherwise enforceable in
+such jurisdiction.
+
diff --git a/support/makeglossariesgui/src/doc/makeglossariesgui-en.xml b/support/makeglossariesgui/src/doc/makeglossariesgui-en.xml
new file mode 100644
index 0000000000..81816d94a4
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/makeglossariesgui-en.xml
@@ -0,0 +1,957 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE manual SYSTEM "makeglossariesgui.dtd">
+<manual fontenc="T1">
+ <preamble>
+ <!-- Document Info -->
+ <title>User Manual for <dict tag="appname"/>
+ version<nbsp/><dict tag="appversion" /></title>
+ <author>Nicola L. C. Talbot<br/><url www="www.dickimaw-books.com" /></author>
+<!--
+ <author>Another Author<br />Affliation or URL</author>
+ <author>Translated by Some One<br />Affliation or URL</author>
+-->
+ <date><dict tag="appdate" /></date>
+ <!-- Define Acronyms -->
+ <newacro short="GUI" long="graphical user interface" tag="gui" />
+ <!-- Define Terms. If a description is included it's a glossary
+ term otherwise it goes in the index -->
+ <newterm tag="makeglossaries" text="makeglossaries" fmt="tt"
+ description="a Perl script provided with the glossaries package
+ which runs either makeindex or xindy, depending on the
+ settings in the .aux file"/>
+ <newterm tag="makeglossarieslite" text="makeglossaries-lite.lua" fmt="tt"
+ description="a Lua script provided with the glossaries package
+ as a light-weight alternative to makeglossaries (the .lua extension
+ may be omitted or replaced with .exe, according to the
+ TeX distribution)"/>
+ <newterm tag="bib2gls" text="bib2gls" fmt="tt"
+ description="an indexing application designed specifically for
+ use with glossaries-extra.sty"/>
+ <newterm tag="makeindex" text="makeindex" fmt="tt"
+ description="an indexing application"/>
+ <newterm tag="xindy" text="xindy" fmt="tt"
+ description="an indexing application written in Perl"/>
+ <newterm tag="lookandfeel" text="Look and Feel"
+ description="the appearance (look) of Java applications
+ and how the widgets behave (feel)"/>
+ </preamble>
+ <document>
+ <node tag="introduction" type="chapter" title="Introduction">
+ <p>
+ The <LaTeX /> <sty>glossaries</sty> package has three methods
+ of generating a glossary (list of abbreviations, terms or symbols):
+ directly using <LaTeX />, using <term tag="makeindex"/> or using
+ <term tag="xindy"/>. The first option requires two <LaTeX/> runs
+ (as with cross-references), the last two options requires a <LaTeX/>
+ run followed by running the indexing application
+ (<term hyper="false" tag="makeindex"/>
+ or <term hyper="false" tag="xindy"/>), followed by another <LaTeX/> run.
+ The <sty>glossaries-extra</sty> package provides two more methods
+ (just using <cs tag="printunsrtglossary"/> or using
+ <cs tag="printunsrtglossary"/> with <term tag="bib2gls"/>).
+ These last two methods aren't supported by <app/> (although it
+ will flag documents that require <term tag="bib2gls"/> if detected,
+ as part of its diagnostics). Your document may require additional
+ applications, such as bibtex, but that's outside of the scope of
+ <app/>.
+ </p>
+ <p>
+ The <sty>glossaries</sty> package provides a Perl script called
+ <term tag="makeglossaries"/> that's intended to simplify this step
+ for options 2 and 3. However, sometimes things can go wrong and users
+ may not be able to work out why. The
+ <term hyper="false" tag="makeglossaries"/>
+ script tries to diagnose problems, but not everyone wants to install
+ Perl for some reason (which is a shame, as there are some useful
+ <TeX/>-related Perl scripts, including <term tag="xindy"/>).
+ The <sty>glossaries</sty> package also provides a light-weight Lua
+ alternative, <term tag="makeglossarieslite"/>, but that doesn't provide
+ any diagnostics. <app/> is a Java application that (when run in batch
+ mode) can be used instead of <term hyper="false" tag="makeglossaries"/> or
+ <term hyper="false" tag="makeglossarieslite"/> however its primary
+ purpose is a <acr tag="gui"/> tool for determining what's gone wrong
+ when the glossary doesn't appear or is incomplete.
+ </p>
+ <p>
+ Since <app/> is written in Java, you'll need the Java Runtime Environment
+ installed. If your document build process supports the conditional
+ execution of commands, then you can test if <app/>,
+ <term tag="makeglossaries"/> or <term tag="makeglossarieslite"/> are
+ required by searching the log file for the presence of the command
+ <cs tag="@istfilename"/>. (The argument is the style file. The extension
+ determines whether <term tag="makeindex"/> or <term tag="xindy"/>
+ is required.)
+ </p>
+ <p>The <app/> application runs in <acr tag="gui" /> mode by default, but
+ can be run in batch mode using the <opt tag="batch"/> command line option.
+ Command line invocation:
+ </p>
+ <p align="center">
+ <tt>makeglossariesgui</tt> [<meta>options</meta>] [<meta>filename</meta>]
+ </p>
+ <p noindent="true">
+ The <meta>filename</meta> must be supplied when run in batch mode
+ (the <tt>.aux</tt> extension may be omitted), but
+ is optional in <acr tag="gui"/> mode. The <meta>filename</meta> should
+ be the auxiliary file produced by the <LaTeX/> run, but may also be
+ the <tt>.tex</tt> or <tt>.log</tt> file if it has the same basename as
+ the auxiliary file and is located in the same directory.
+ Unlike <term tag="makeglossaries"/> and <term tag="makeglossarieslite"/>,
+ <meta>filename</meta> may include the directory path.
+ </p>
+ <p>
+ Available options:
+ <dl>
+ <dt><opt tag="batch"/> (or <tt>-b</tt>)</dt>
+ <dd>
+ Invoke <app/> in batch mode (<meta>filename</meta> must be supplied).
+ Note that the extra checks that parse the log file aren't performed
+ in batch mode.
+ </dd>
+ <dt><opt tag="gui"/></dt>
+ <dd>
+ Invoke <app/> in <acr tag="gui"/> mode (default).
+ </dd>
+ <dt><opt tag="quiet"/></dt>
+ <dd>Suppress (non-error) messages that would otherwise have been written
+ to STDOUT.</dd>
+ <dt><opt tag="dry-run"/> (or <tt>-n</tt>)</dt>
+ <dd>Dry run mode (don't run the indexing application).</dd>
+ <dt><opt tag="nodry-run"/></dt>
+ <dd>Not dry run mode (default).</dd>
+ <dt><opt tag="debug"/></dt>
+ <dd>Print debug messages to STDOUT.</dd>
+ <dt><opt tag="version"/> (or <tt>-v</tt>)</dt>
+ <dd>Print the version details to STDOUT and exit.</dd>
+ <dt><opt tag="help"/> (or <tt>-h</tt>)</dt>
+ <dd>Print a brief summary of available options to STDOUT and exit.</dd>
+ </dl>
+ </p>
+ <p>
+ When run in batch mode, <app/> behaves much like
+ <term tag="makeglossaries"/>. It reads the auxiliary file to determine
+ whether to use <term tag="makeindex"/> or <term tag="xindy"/> and
+ what options to pass to them. The <acr tag="gui"/> <ref text="settings" tag="properties"/>
+ will be honoured.
+ </p>
+ </node>
+ <node type="chapter" tag="main" title="Basic Use (GUI Mode)">
+ <p>
+ A file can be loaded from the command line invocation
+ (see <ref tag="introduction"/>) or in the <acr tag="gui"/> using the
+ <menu tag="file.open"/> menu item. You can also use the load file button
+ on the toolbar or (if permitted by your operating system) drag and drop
+ the file onto the main window. The input file should be the <tt>.aux</tt>
+ file created by <LaTeX/>, but if you try to load the main document
+ <tt>.tex</tt> file or the <tt>.log</tt> transcript file,
+ <app/> will assume you meant the associated <tt>.aux</tt> file.
+ (If you have used <LaTeX/>'s <tt>-jobname</tt> or <tt>-output-directory</tt>
+ options, then you won't be able to use the <tt>.tex</tt> file and will have
+ to use either the <tt>.aux</tt> or <tt>.log</tt> file.)
+ </p>
+ <example>
+ <p>
+ Suppose you have the following document (called, say, <tt>basic-sample.tex</tt>):
+ </p>
+ <pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
+ </pre>
+ <p>
+ First run <LaTeX/> the usual way. This should create the auxiliary file
+ <tt>basic-sample.aux</tt> as well as some other files including
+ <tt>basic-sample.glo</tt> and <tt>basic-sample.ist</tt>. Now load the auxiliary file
+ (<tt>basic-sample.aux</tt>) into <app/>. (Since the main <tt>.tex</tt> file
+ has the same basename as the <tt>.aux</tt> file, you can also use that, as
+ mentioned above.)
+ </p>
+ <p>
+ Once <app/> has successfully loaded the <tt>.aux</tt> file, it will run
+ <term tag="makeindex"/> on the associated <tt>.glo</tt> file (with the
+ <tt>.ist</tt> file as the style).
+ In this case, there are no problems with the document and the
+ <tt>.tex</tt> file is now ready for another <LaTeX/> run. The general
+ information panel (<ref tag="basicsample"/>) shows a summary of the
+ document glossaries. In this case, there's only one glossary (the
+ <tt>main</tt> one). If you edit the document source code (<tt>.tex</tt> file)
+ you can use the <menu tag="file.reload"/> menu item to reload the updated
+ <tt>.aux</tt> file in <app/>.
+ </p>
+ <p>
+ <float type="figure" tag="basicsample"
+ caption="General Information Panel (Basic Sample)" pos="htbp">
+ <image src="images/basic-sample.png" scale="0.8"
+ alt="image of general information panel"/>
+ </float>
+ </p>
+ <p>
+ In this example, only one entry has been indexed in the <tt>main</tt> glossary. You
+ can find out more information by clicking on the <dq>Details</dq>
+ link, which will open the window shown in <ref tag="basicsampledetails"/>.
+ </p>
+ <p>
+ <float type="figure" tag="basicsampledetails"
+ caption="Entry Details (Basic Sample)" pos="tbp">
+ <image src="images/basic-sample-details.png"
+ alt="image of details window"/>
+ </float>
+ </p>
+ <p>
+ Since only one entry has been used, there's only one row. The first
+ column lists the entry's label, the second column lists the entry's sort
+ field and the third column shows the number of times that entry was indexed
+ in the document. If you have a long list of entries, you can use the search
+ box to find an entry according to its <em>label</em>. (The sort column
+ isn't searched.) Regular expressions are permitted.
+ </p>
+ <p>
+ The <button tag="diagnostics.title"/> tab
+ (<ref tag="basicsamplediagnostics"/>) provides information, warnings
+ and suggestions. In this example, there are no errors detected, so it
+ just provides suggestions and some links on how to incorporate
+ <term tag="makeglossaries"/> into your document build process. There are
+ also two buttons provided to test the <term tag="makeglossaries"/>
+ and <term tag="makeglossarieslite"/> scripts. In the first case,
+ the action will also test if Perl is installed.
+ </p>
+ <p>
+ <float type="figure" tag="basicsamplediagnostics"
+ caption="Diagnostics Tab (Basic Sample)" pos="tbp">
+ <image scale="0.75" src="images/basic-sample-diagnostics.png"
+ alt="image of diagnostics window"/>
+ </float>
+ </p>
+ </example>
+ <p>
+ If you have defined an entry in your document, but it's not listed in
+ the details window for the relevant glossary, then it hasn't been indexed
+ in your document. Remember that the commands described in section<nbsp/>9
+ (<dq>Using Glossary Terms Without Links</dq>) of the <sty>glossaries</sty>
+ manual don't index the terms. These essentially are all the commands in the
+ form <backslash/><tt>glsentry</tt><meta>field</meta> or
+ <backslash/><tt>glossentryname</tt><meta>field</meta>, such as
+ <cs tag="glsentrytext"/>, <cs tag="glsentryshort"/>,
+ <cs tag="glsentrylong"/> or <cs tag="glossentryname"/>, and their
+ case-changing variants. Also <cs tag="glsentrytitlecase"/> and
+ <cs tag="glshyperlink"/>.
+ </p>
+ <p>
+ If you're using the <sty>glossaries-extra</sty> package, remember that
+ the <tt>noindex</tt> option will suppress indexing.
+ </p>
+ <example>
+ <p>
+ Now let's consider the following document (called, say,
+ <tt>missing-sort.tex</tt>):
+ </p>
+ <pre>
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{S}{name={\S},
+ description={section symbol}}
+
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ description={alpha}}
+
+\newglossaryentry{beta}{name={$\beta$},text={\beta},
+ description={beta}}
+
+\begin{document}
+Test: \gls{S}, $\gls{alpha}$, $\gls{beta}$.
+
+\printglossaries
+
+\end{document}
+ </pre>
+ <p>
+ As before, run <LaTeX/> as usual on this document. Since the <tt>xindy</tt>
+ package option has been used, this will create a <tt>.xdy</tt> file
+ instead of a <tt>.ist</tt> file and the <tt>.glo</tt>
+ file is now in <term tag="xindy"/>'s format. There are, however, problems
+ with this document. The <sty>glossaries</sty> manual advises using the
+ <tt>sort</tt> key for entries that contain special characters or commands
+ in the entry's name. This document hasn't followed that advice, and
+ xindy will complain. The <tt>S</tt> entry just causes a warning:
+ </p>
+<blockquote>
+Would replace complete index key with empty string, ignoring
+</blockquote>
+ <p noindent="true">
+ and the <tt>S</tt> entry is ignored. The <tt>alpha</tt> and <tt>beta</tt>
+ entries cause an error:
+ </p>
+<blockquote>
+index 0 should be less than the length of the string
+</blockquote>
+ <p noindent="true">
+ Again the entries are ignored, but the message is fairly cryptic.
+ If we load the auxiliary file (<tt>missing-sort.aux</tt>) into
+ <app/>, these problems are detected, and the following error message is
+ displayed:
+ </p>
+<blockquote>
+Xindy has ignored one or more entries with empty sort strings.
+Xindy failed with exit code 1.
+</blockquote>
+ <p>
+ Once this error message has been dismissed, the
+ <button tag="diagnostics.title"/> tab
+ should automatically be selected (see <ref tag="missingsortdiagnostics"/>).
+ This identifies the problem entries and recommends a solution, in this case,
+ add the <tt>sort</tt> key to the entry definition. The actual warning and
+ error message reported by <term tag="xindy"/> are shown at the end.
+ (You can adjust the font used by these messages if you like,
+ see <ref tag="properties"/>.)
+ </p>
+ <p>
+ <float type="figure" tag="missingsortdiagnostics"
+ caption="Diagnostics Panel" pos="tbp">
+ <image src="images/missing-sort-diagnostics.png" scale="0.8"
+ alt="image of diagnostics panel"/>
+ </float>
+ </p>
+ <p>
+ In the <button tag="main.title"/> panel, the <dq>Details</dq>
+ link can again be used to view the list of indexed entries,
+ but now the problematic entries are shown in red (see
+ <ref tag="missingsortdetails"/>).
+ </p>
+ <p>
+ <float type="figure" tag="missingsortdetails"
+ caption="Entry Details (Problematic Entries)" pos="htbp">
+ <image src="images/missing-sort-details.png"
+ alt="image of details window with rows displayed in red"/>
+ </float>
+ </p>
+ </example>
+ <p>
+ <app/> actually performs more problem-checking than
+ <term tag="makeglossaries"/> as it also tries to parse
+ the log file for certain messages (but only in <acr tag="gui"/> mode).
+ This is illustrated in the next example, which won't generate any error
+ messages from <term tag="makeglossaries"/>.
+ </p>
+ <example>
+ <p>
+ Spot what's wrong with the following document:
+ </p>
+<pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossary[type=acronym]
+
+\end{document}
+</pre>
+ <p>
+ If you use the normal method of <LaTeX/>,
+ <term tag="makeglossaries"/>, <LaTeX/>, you won't get any
+ error messages, but the glossary won't be displayed. Why not?
+ If we switch from
+ </p>
+<pre>
+\usepackage{glossaries}
+</pre>
+ <p noindent="true">
+ to
+ </p>
+<pre>
+\usepackage{glossaries-extra}
+</pre>
+ <p noindent="true">
+ then we do finally get an error:
+ </p>
+<blockquote>
+! Package glossaries-extra Error: Glossary type <sq>acronym</sq> doesn't exist.
+</blockquote>
+ <p>
+ The <sty>glossaries-extra</sty> package is stricter than
+ the base <sty>glossaries</sty> package. The problem here
+ is that I've used <tt>type=acronym</tt>, but there's no
+ glossary with that label. (I haven't used the <tt>acronym</tt>
+ option.) If you're not using the extension package, this is
+ harder to pick up, but <app/> will notify you of the problem.
+ This example document will trigger the error
+ </p>
+<blockquote>
+No glossary <sq>acronym</sq>.
+</blockquote>
+ <p noindent="false">
+ and the diagnostics panel will show the message:
+ </p>
+<blockquote>
+It looks as though you might have done something like
+<tt><cs tag="printglossary"/>[type=<marg>acronym</marg>]</tt>, but there's no
+<tt>acronym</tt> glossary.
+</blockquote>
+ <p>
+ If you switch to the <button tag="main.title"/> panel,
+ the labels for the glossaries defined in the document are
+ listed next to <dq><dict tag="main.list"/></dq> so you
+ can check the indicated type against it. In this example,
+ the list has only the single label <dq>main</dq>.
+ </p>
+ </example>
+ <p>
+ Remember that you not only have to define your entries, but you also
+ have to index them if you want them to appear in the glossary. The
+ <sty>glossaries</sty> package provides many commands that index entries,
+ the most commonly used one being <cs tag="gls"/>, which displays
+ the text associated with the entry, indexes the entry,
+ marks it as having been used and (if the <sty>hyperref</sty> package has
+ been loaded) also creates a link to the definition in the glossary.
+ Other commands provide variations, such as displaying different text
+ or not changing the <dq>first use flag</dq>. In particular, the
+ <cs tag="glsadd"/> command only indexes the entry without displaying any
+ text.
+ </p>
+ <example>
+ <p>
+ In the sample document below, I've defined an entry but it hasn't been
+ indexed anywhere in the document.
+ </p>
+<pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A sample document.
+
+\printglossaries
+
+\end{document}
+</pre>
+ <p>
+ My first step, as usual, is to run <LaTeX/> on this document, which will
+ create the <tt>.aux</tt> file. Now if I try loading this file into <app/>
+ I get the error message:
+ </p>
+ <blockquote>
+ No entries were found for glossary <sq>main</sq>.
+ </blockquote>
+ <p>
+ The diagnostics panel shows the following message:
+ </p>
+ <blockquote>
+There were no entries listed for the <tt>main</tt> glossary. Remember that you
+must index entries for them to appear in the glossary using the commands
+provided by the glossaries package. Entries that have been defined but not
+indexed won't be listed. If you don't want to use this glossary,
+add the <tt>nomain</tt> package option to your document. Check the following:
+<ul>
+<li>Have you used commands like <cs tag="gls"/> or <cs tag="glsadd"/> in the
+document? (If you haven't, you need to add them.)</li>
+<li>If you have used commands like <cs tag="glsadd"/> or <cs tag="glsaddall"/>
+in the preamble, have you remembered to put them <em>after</em>
+<cs tag="makeglossaries"/></li>
+<li>If you have at least version 4.24 of the glossaries package, have you used the debug option? (That might provide some more information for me to analyse.)</li>
+</ul>
+ </blockquote>
+ <p>
+ (The sentence referencing <tt>nomain</tt> only appears if there are
+ no entries for the <tt>main</tt> glossary, but not for any other glossaries.)
+ </p>
+ </example>
+ <p>
+ Remember that if you use <cs tag="makenoidxglossaries"/>, you don't
+ need <term tag="makeindex"/> or <term tag="xindy"/>.
+ </p>
+ <example>
+ <p>
+ Consider the following document:
+<pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makenoidxglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printnoidxglossaries
+
+\end{document}
+</pre>
+ </p>
+ <p>
+ If I load the <tt>.aux</tt> file for this document into <app/>, I get
+ the following message in the diagnostics panel:
+ </p>
+ <blockquote>
+It seems you've used <cs tag="makenoidxglossaries"/>, which means you don't
+need xindy or makeindex, you just need a second LaTeX run to get the glossary
+up to date.
+ </blockquote>
+ <p>
+ Note that <app/> can still provide some limited diagnostics even when
+ <cs tag="makenoidxglossaries"/> has been used. To illustrate this, if we
+ modify the above sample document slightly, introducing an error:
+ </p>
+<pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makenoidxglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printnoidxglossary[type=acronym]
+
+\end{document}
+</pre>
+ <p>
+ This provides some additional information in the diagnostics panel:
+ </p>
+ <blockquote>
+<p>
+Package glossaries Warning: Empty glossary for
+<tt><cs tag="printnoidxglossary"/>[type=<marg>acronym</marg>]</tt> Rerun may be
+required (or you may have forgotten to use commands like <cs tag="gls"/>) on input
+line 13.
+</p>
+<p>
+It looks as though you might have done something like
+<tt><cs tag="printnoidxglossary"/>[type=<marg>acronym</marg>]</tt>, but there's no
+<tt>acronym</tt> glossary.
+</p>
+ </blockquote>
+ <p>
+ So <app/> picks up the error.
+ </p>
+ </example>
+ <p>
+ Note that <app/> also looks for warnings from the <sty>glossaries</sty>
+ package, so if you are encountering any problems, make sure you
+ haven't suppressed the warnings with the <tt>nowarn</tt> package option.
+ </p>
+ <example>
+ <p>
+ In this example I've omitted <cs tag="printglossary"/> from the document:
+ </p>
+<pre>
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\end{document}
+</pre>
+ <p>
+ This doesn't cause any problems for <term tag="makeindex"/> as all
+ the associated files have been created correctly. The document simply
+ doesn't load the file generated by <term tag="makeindex"/> as there's
+ no <cs tag="printglossary"/> (or <cs tag="printglossaries"/>). However
+ the <sty>glossaries</sty> package does generate a warning, and this
+ warning is picked up by <app/> and displayed in the diagnostics panel:
+ </p>
+ <blockquote>
+Package glossaries Warning: No <cs tag="printglossary"/> or
+<cs tag="printglossaries"/> found. (Remove <cs tag="makeglossaries"/>
+if you don't want any glossaries.) This document will not have a glossary.
+ </blockquote>
+ <p>
+ If you suppress these warnings then <app/> can't help.
+ </p>
+ </example>
+ <p>
+ Sometimes things can go so badly wrong that <LaTeX/> doesn't even
+ generate an auxiliary file. In this case you can load the <tt>.log</tt>
+ file instead. (You'll need to change the file selector filter to
+ show all files.) <app/> will parse the log file to see if it recognises
+ any of the error messages. Some <LaTeX/> error messages can be quite
+ crytic so there's no guarantee that <app/> will be able to help, but it
+ might detect something useful. Note that this option is only available
+ in <acr tag="gui"/> mode.
+ </p>
+ <example>
+ <p>
+ Consider the following document:
+ </p>
+<pre>
+\batchmode
+\documentclass{beamer}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name=sample,first={\textit{sample}},
+ description={an example}}
+
+\begin{document}
+
+\begin{frame}
+\gls{sample}
+\end{frame}
+
+\begin{frame}
+\printglossary
+\end{frame}
+
+\end{document}
+</pre>
+ <p>
+ This document goes badly wrong. The first error message is:
+ </p>
+<pre>
+! Undefined control sequence.
+\in@ #1#2->\begingroup \def \in@@
+</pre>
+ <p>
+ If I load the log file into <app/>, the diagnostic panel displays the
+following:
+ </p>
+<blockquote>
+<p>
+Since the aux file doesn't exist, there's not much I can do to help,
+but I'll parse the log file in case there are any clues there.
+</p>
+<p>
+It's possible that there's an expansion issue involving a fragile command.
+Things to check for:
+</p>
+<ul>
+<li>Have you used a class like <tt>beamer</tt> that doesn't make common
+formatting commands like <cs tag="textit"/> robust?</li>
+<li>Have you tried using <cs tag="protect"/> in front of fragile commands
+contained within your entry definitions?</li>
+<li>Have you tried switching off the expansion using commands like
+<cs tag="glsnoexpandfields"/>? (See section 4.6 Expansion in the
+<tt>glossaries</tt> user manual.)</li>
+</ul>
+</blockquote>
+ <p>
+ The problem here is that a fragile command has been used in the entry
+ definition. The problematic command in this example is
+ <cs tag="textit"/>, which is normally robust, but it happens to be
+ fragile with the <tt>beamer</tt> class. The solution is to either
+ protect the problematic command with <cs tag="protect"/> or
+ use <cs tag="glsnoexpandfields"/> before you define the entries.
+ For example:
+ </p>
+<pre>
+\documentclass{beamer}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\glsnoexpandfields
+
+\newglossaryentry{sample}{name=sample,first={\textit{sample}},
+ description={an example}}
+
+\begin{document}
+
+\begin{frame}
+\gls{sample}
+\end{frame}
+
+\begin{frame}
+\printglossary
+\end{frame}
+
+\end{document}
+</pre>
+ </example>
+ <p>The main panel shows the character encoding that <app/> believes
+ is being used by the indexing application and, if detected, the
+ document input encoding. Since <term tag="makeindex"/> only supports
+ characters in the range 1 to 255, <app/> assumes
+ ISO-8859-1 (Latin-1) for <term tag="makeindex"/> and will add an advisory
+ note if the document class uses a different encoding.</p>
+ <example>
+ <p>Consider the following example:</p>
+<pre>
+\documentclass{article}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+
+\usepackage[style=indexgroup]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{elite}{name={élite},description={select group}}
+
+\begin{document}
+\gls{elite}
+
+\printglossary
+\end{document}
+</pre>
+ <p>This document is saved as UTF-8 and has a term where the sort
+ value starts with an extended character. This doesn't work as
+ <term tag="makeindex"/> treats the UTF-8 letter as two separate
+ characters form from the two octets. This not only affects the
+ sorting but also causes a problem for the <tt>indexgroup</tt>
+ style.</p>
+ <p>
+ <float type="figure" tag="unsupportedencdiagnostics"
+ caption="Encoding Problems (Diagnostics Panel)" pos="htbp">
+ <image src="images/unsupported-enc-diagnostics.png"
+ alt="image of diagnostics panel" scale="0.75"/>
+ </float>
+ </p>
+ <p>
+ The first message in the diagnostics panel (see
+ <ref tag="unsupportedencdiagnostics"/>) is only picked up after you
+ rerun <LaTeX/> and reload the file in <app/>, as it's only after the
+ glossary file has been created by <term tag="makeindex"/> that the
+ <LaTeX/> call fails. The failure is caused by the first octet
+ appearing in the argument of <cs tag="glsgroupheading"/>. This
+ causes two problems: the argument of this command is a label so
+ special or active characters will break it, and the <sty>inputenc</sty>
+ package makes the first octet active, requiring the second octet as
+ the argument. The message reads:</p>
+ <blockquote>
+<p>There seems to be a problem with the letter group label Ã. The label is used to construct a command name, so it can't contain any special characters. (This includes extended characters if you're using inputenc.sty.)</p>
+<pre>l.3 \glsgroupheading{Ã}</pre>
+<p>You may want to consider using xindy with a LaTeX engine that has native Unicode support (XeLaTeX or LuaLaTeX) or use bib2gls instead.</p>
+ </blockquote>
+ <p>This message doesn't show up when you first attempt to create
+ the glossary files with <app/>. However, there's advisory message
+ than points to a problem:</p>
+ <blockquote>
+ The indexer encoding <sq>ISO-8859-1</sq> doesn't seem to match the document
+ encoding (utf8). This may not be a problem if you aren't using extended
+ characters in the sort values.
+ </blockquote>
+ <p>In this case it is a problem. The two different encodings are
+ also shown in <ref tag="unsupportedencdiagnostics"/>. The indexer
+ encoding is listed as ISO-8859-1, and the document encoding is listed
+ as utf8.</p>
+ <p>
+ <float type="figure" tag="unsupportedencsummary"
+ caption="Encoding Problems (General Information Panel)" pos="htbp">
+ <image src="images/unsupported-enc-summary.png"
+ alt="image of general information panel" scale="0.75"/>
+ </float>
+ </p>
+ <p>The problem shows up more clearly in the <dq>Details</dq>
+ window (see <ref tag="unsupportedencdetails"/>), which uses
+ the indexer's encoding and so displays the sort value as
+ élite instead of élite.
+ </p>
+ <p>
+ <float type="figure" tag="unsupportedencdetails"
+ caption="Encoding Problems (Details Window)" pos="htbp">
+ <image src="images/unsupported-enc-details.png"
+ alt="image of the details window" scale="0.75"/>
+ </float>
+ </p>
+ </example>
+ </node>
+ <node type="chapter" tag="properties" title="Settings" >
+ <p>
+ The application settings can be adjusted through the <menu tag="settings"/>
+ menu. This has menu items for increasing or decreasing the font size
+ (<menu tag="settings.incsize"/> or <menu tag="settings.decsize"/>),
+ setting the dry run mode (<menu tag="settings.dryrun"/>) or
+ open the <button tag="properties.title"/> dialog window
+ (<menu tag="settings.editproperties"/>). Note that the dry run mode is the
+ only setting that isn't remembered the next time you run <app/>.
+ </p>
+ <p>
+ The <button tag="properties.title"/> dialog
+ has four tabs: <button tag="properties.start_dir"/>,
+ <button tag="properties.diagnostics"/>,
+ <button tag="properties.applications"/> and
+ <button tag="properties.gui"/>.
+ </p>
+ </node>
+ <node type="section" tag="startdirtab" title="Start Up Directory">
+ <p>
+ <float type="figure" tag="propertiesdialog-startdir"
+ caption="Properties Dialog (Start Up Directory)" pos="htbp">
+ <image src="images/properties-startdir.png"
+ alt="image of properties dialog with start up tab selected"
+ scale="0.8"/>
+ </float>
+ </p>
+ <p>
+ The <button tag="properties.start_dir"/>
+ (<ref tag="propertiesdialog-startdir"/>) tab allows you to
+ select the directory to use on start up. This is the
+ directory the file chooser will be set to initially.
+ </p>
+ </node>
+ <node type="section" tag="diagnosticstab" title="Diagnostic Settings">
+ <p>
+ <float type="figure" tag="propertiesdialog-diagnostics"
+ caption="Properties Dialog (Diagnostics)" pos="htbp">
+ <image src="images/properties-diagnostics.png"
+ alt="image of properties dialog with diagnostics tab selected"
+ scale="0.8"/>
+ </float>
+ </p>
+ <p>
+ <app/> will try to determine if you have defined any
+ entries within the <env tag="document"/> environment.
+ Although the <sty>glossaries</sty> package allows
+ document definitions, the manual encourages defining
+ entries in the preamble, see section<nbsp/>4.10 of
+ the <sty>glossaries</sty> user manual (<dq>Drawbacks
+ With Defining Entries in the Document Environment</dq>).
+ If you want to skip this check, deselect the
+ <button tag="properties.docdefcheck"/> check box.
+ </p>
+ <p>
+ There's also a check to see if the <sty>glossaries</sty>
+ package has complained about missing language modules.
+ Not all languages are supported and, for those languages
+ that are supported, the appropriate module must be installed
+ in addition to installing the <sty>glossaries</sty> package.
+ If the required language support is missing, the glossary
+ files can still be built, you'll just have to manually
+ change the fixed text for the title following the instructions
+ in section<nbsp/>1.3 (<dq>Multi-Lingual Support</dq>)
+ of the <sty>glossaries</sty> user manual. If you want to
+ skip this check, deselect the
+ <button tag="properties.langcheck"/> check box.
+ </p>
+ </node>
+ <node type="section" tag="applicationstab" title="Indexing Applications">
+ <p>
+ <float type="figure" tag="propertiesdialog-applications"
+ caption="Properties Dialog (Applications)" pos="htbp">
+ <image src="images/properties-applications.png"
+ alt="image of properties dialog with applications tab selected"
+ scale="0.8"/>
+ </float>
+ </p>
+ <p>
+ The <button tag="properties.applications"/> tab lists the paths to
+ <term tag="makeindex"/> and <term tag="xindy"/>. <app/> will attempt
+ to locate them on your system's path, but if they can't be detected,
+ you'll need to specify the correct location. You can omit the location
+ for an unrequired application.
+ </p>
+ <p>
+ <app/> will try to determine the language and input encoding from the
+ <tt>.aux</tt> file to pass to <term tag="xindy"/>, but you can override
+ this if you want to. Make sure that the <button tag="properties.override"/>
+ check box is selected, and change the language and encoding as appropriate.
+ Note that the batch mode will also use these settings, although they can
+ only be adjusted in the <acr tag="gui"/> mode.
+ </p>
+ </node>
+ <node type="section" tag="guitab" title="GUI Preferences">
+ <p>
+ <float type="figure" tag="propertiesdialog-gui-metal"
+ caption="GUI Preferences (Metal Look and Feel)" pos="htbp">
+ <image src="images/properties-gui-metal.png"
+ alt="image of properties dialog with GUI tab selected (Metal Look and Feel)"
+ scale="0.8"/>
+ </float>
+ </p>
+ <p>
+ The font used in the <button tag="main.title"/>
+ and <button tag="diagnostics.title"/> panels can be
+ set in the <button tag="properties.gui"/> tab. In addition to
+ adjusting the font size through the
+ <menu tag="settings.incsize"/> or <menu tag="settings.decsize"/>
+ menu items, you can also set the required font size in this tab.
+ </p>
+ <p>
+ The <term tag="lookandfeel"/> can be set by selecting the required
+ option in the <button tag="properties.look_and_feel"/> drop-down menu.
+ Note that a restart is required as the Look and Feel is set on start up.
+ The title bar appearance is governed by your usual operating system
+ preference. The Look and Feel changes the way the window elements are
+ displayed.
+ <ref tag="propertiesdialog-gui-metal"/> shows the <dq>Metal</dq>
+ Look and Feel.
+ <ref tag="propertiesdialog-gui-nimbus"/> shows the <dq>Nimbus</dq>
+ Look and Feel.
+ <ref tag="propertiesdialog-gui-cde"/> shows the <dq>CDE/Motif</dq>
+ Look and Feel.
+ <ref tag="propertiesdialog-gui-gtk"/> shows the <dq>GTK+</dq>
+ Look and Feel.
+ You may not have all these options on your system or you may have
+ additional options, depending on your Java installation.
+ </p>
+ <p>
+ <float type="figure" tag="propertiesdialog-gui-nimbus"
+ caption="GUI Preferences (Nimbus Look and Feel)" pos="htbp">
+ <image src="images/properties-gui-nimbus.png"
+ alt="image of properties dialog with GUI tab selected (Nimbus Look and Feel)"
+ scale="0.8"/>
+ </float>
+ <float type="figure" tag="propertiesdialog-gui-cde"
+ caption="GUI Preferences (CDE/Motif Look and Feel)" pos="htbp">
+ <image src="images/properties-gui-cde.png"
+ alt="image of properties dialog with GUI tab selected (Cde/motif Look and Feel)"
+ scale="0.8"/>
+ </float>
+ <float type="figure" tag="propertiesdialog-gui-gtk"
+ caption="GUI Preferences (GTK+ Look and Feel)" pos="htbp">
+ <image src="images/properties-gui-gtk.png"
+ alt="image of properties dialog with GUI tab selected (GTK+ Look and Feel)"
+ scale="0.8"/>
+ </float>
+ </p>
+ </node>
+ <node type="chapter" tag="licence" title="Licence" >
+ <p>
+ <app/> is licensed under the terms of the GNU General Public License.
+ <app/> depends on the following third party libraries whose jar files are
+ in the <tt>lib</tt> directory: Java Help
+ (<url www="https://javahelp.java.net/"/>) and
+ the Java Look and Feel Graphics Repository (<url www="http://www.oracle.com/technetwork/java/index-138612.html"/>).
+ </p>
+ <verbtabinput src="LICENSE"/>
+ </node>
+ <printglossary />
+ <printindex />
+ </document>
+</manual>
diff --git a/support/makeglossariesgui/src/doc/makeglossariesgui.cls b/support/makeglossariesgui/src/doc/makeglossariesgui.cls
new file mode 100644
index 0000000000..004cb39345
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/makeglossariesgui.cls
@@ -0,0 +1,125 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{makeglossariesgui}[2016/05/17]
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrreprt}}
+
+\ProcessOptions
+
+\LoadClass{scrreprt}
+
+\RequirePackage{etoolbox}
+\RequirePackage{amsthm}
+
+\renewcommand{\@author}{}
+
+\newcommand{\Author}[1]{%
+ \ifdefempty\@author
+ {\def\@author{#1}}%
+ {\appto\@author{\and #1}}%
+}
+
+% Default definition.
+% (Overridden by context label in dictionary file.)
+\providecommand{\idxpackagename}{package}
+
+\newcommand*{\sty}[1]{%
+ \textsf{#1}%
+ \index{#1 \idxpackagename @\textsf{#1} \idxpackagename}%
+}
+
+\newcommand*{\opt}[1]{\texttt{-\/-#1}\index{--#1@\texttt{-\/-#1}}}
+
+\newcommand*{\menu}[1]{\textsf{#1}}
+\newcommand*{\mto}{$\to$}
+
+\newcommand*{\appfmt}[1]{\textsf{#1}}
+
+\newcommand*{\lessthan}{\ifmmode<\else\textless\fi}
+\newcommand*{\greaterthan}{\ifmmode>\else\textgreater\fi}
+\newcommand*{\nbsp}{~}
+\newcommand*{\doublequote}{"}
+\newcommand*{\ampersand}{\&}
+\newcommand*{\leftbrace}{\{}
+\newcommand*{\rightbrace}{\}}
+\newcommand*{\underscore}{\_}
+\newcommand*{\textpercent}{\%}
+\newcommand*{\texthash}{\#}
+\newcommand{\floatconts}[3]{%
+ \@ifundefined{\@captype conts}{\tableconts{#1}{#2}{#3}}%
+ {\csname\@captype conts\endcsname{#1}{#2}{#3}}%
+}
+
+\newcommand{\tableconts}[3]{%
+ #2\label{#1}\vskip\baselineskip
+ {\centering #3\par}%
+}
+
+\newcommand{\figureconts}[3]{%
+ {\centering #3\par}%
+ \vskip\baselineskip
+ #2\label{#1}%
+}
+
+\newcommand{\continuesymbol}{$\hookleftarrow$}
+
+\newcommand*{\continue@symbol}{%
+ \smash{\raisebox{-1.6ex}{\makebox[0pt][r]{\continuesymbol}}}}
+
+\newcommand*{\continueline}{\continue@symbol\newline}
+
+\newcommand*{\sectionautorefname}{Section}
+
+\newcommand*{\dq}[1]{``#1''}
+
+\newcommand*{\sq}[1]{`#1'}
+
+\newcommand*{\meta}[1]{\ensuremath{\langle}\textit{#1}\ensuremath{\rangle}}
+
+\newcommand{\marg}[1]{\texttt{\char`\{#1\char`\}}}
+
+\DeclareRobustCommand*{\csnoindex}[1]{\texttt{\char`\\#1}}
+
+\DeclareRobustCommand*{\cs}[1]{\csnoindex{#1}\index{#1@\csnoindex{#1}}}
+
+\newcommand*{\button}[1]{\textsf{\bfseries #1}}
+
+\newcommand*{\element}[1]{\texttt{\char`\<#1\char`\>}}
+
+\newcommand*{\htmltt}[1]{\texttt{#1}}
+\newcommand*{\htmlem}[1]{\emph{#1}}
+\newcommand*{\htmli}[1]{\textit{#1}}
+
+% Default definition.
+% (Overridden by context label in dictionary file.)
+\providecommand{\idxenvname}{environment}
+\DeclareRobustCommand*{\env}[1]{\textsf{#1}\index{#1@\textsf{#1} \idxenvname}}
+
+\newtheoremstyle{example}% style name
+{2ex}% above space
+{2ex}% below space
+{}% body font
+{}% indent amount
+{\bfseries}% head font
+{.}% post head punctuation
+{\newline}% post head punctuation
+{}% head spec
+
+% Default definition.
+% (Overridden by context label in dictionary file.)
+\providecommand{\examplename}{Example}
+
+\theoremstyle{example}
+\newtheorem{example}{\examplename}
+
+\newenvironment{blockquote}%
+{\begin{quote}\sffamily\raggedright}%
+{\end{quote}}
+
+\renewcommand{\title}[1]{%
+ \gdef\@title{#1}%
+ \ifdef\hypersetup
+ {\hypersetup{pdftitle={#1}}}%
+ {}%
+}
+
+\endinput
diff --git a/support/makeglossariesgui/src/doc/makeglossariesgui.dtd b/support/makeglossariesgui/src/doc/makeglossariesgui.dtd
new file mode 100644
index 0000000000..09fdf90fdc
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/makeglossariesgui.dtd
@@ -0,0 +1,106 @@
+<!-- Parameter entities -->
+<!ENTITY % basic.content '#PCDATA | dict | tt | em | br | url | sty | acr | image | opt | ref | term | tabular | menu | dq | TeX LaTeX | nbsp | meta | dl | app | verbinput | cs | env | hash | cont | button' >
+
+<!-- Main elements-->
+
+<!ELEMENT manual (preamble, document)>
+<!ATTLIST manual fontenc (#PCDATA)+>
+<!ELEMENT preamble (title, author+, date, newacro*, newterm*)>
+<!ELEMENT document (node+ | printglossary | printacronyms | printindex)>
+
+<!-- Preamble elements-->
+
+<!ELEMENT date (%basic.content;)+>
+<!ELEMENT newacro EMPTY>
+<!ATTLIST newacro tag (#PCDATA)+ #REQUIRED>
+<!ATTLIST newacro short (%basic.content;)+ #REQUIRED>
+<!ATTLIST newacro long (%basic.content;)+ #REQUIRED>
+<!ELEMENT newterm EMPTY>
+<!ATTLIST newterm tag (#PCDATA)+ #REQUIRED>
+<!ATTLIST newterm text (%basic.content;)+ #REQUIRED>
+<!ATTLIST newterm description (%basic.content;)+>
+<!ELEMENT author (%basic.content;)+>
+<!ELEMENT translator (%basic.content;)+>
+
+<!-- Document elements -->
+
+<!ELEMENT node (p | float | pre | alltt | dl)+ | printacronyms | printindex >
+<!ATTLIST node tag (#PCDATA)+ #REQUIRED>
+<!ATTLIST node type (#PCDATA)+ #REQUIRED>
+<!ATTLIST node title (%basic.content;)+ #REQUIRED>
+<!ATTLIST node pos (#PCDATA)+ #REQUIRED>
+
+<!-- Basic elements -->
+<!ELEMENT p (%basic.content;)*>
+<!ATTLIST p align (#PCDATA)+>
+<!ATTLIST p noindent (#PCDATA)+>
+<!ELEMENT url EMPTY>
+<!ATTLIST url www (#PCDATA)+ #REQUIRED>
+<!ATTLIST url text (#PCDATA)+>
+<!ELEMENT dict EMPTY>
+<!ATTLIST dict tag (#PCDATA)+ #REQUIRED>
+<!ATTLIST dict arg1 (%basic.content;)+>
+<!ATTLIST dict arg2 (%basic.content;)+>
+<!ATTLIST dict arg3 (%basic.content;)+>
+<!ATTLIST dict arg4 (%basic.content;)+>
+<!ATTLIST dict arg5 (%basic.content;)+>
+<!ATTLIST dict arg6 (%basic.content;)+>
+<!ATTLIST dict arg7 (%basic.content;)+>
+<!ATTLIST dict arg8 (%basic.content;)+>
+<!ATTLIST dict arg9 (%basic.content;)+>
+<!ELEMENT button EMPTY>
+<!ATTLIST button tag (#PCDATA)+ #REQUIRED>
+<!ELEMENT ref EMPTY>
+<!ATTLIST ref tag (#PCDATA)+ #REQUIRED>
+<!ELEMENT menu EMPTY>
+<!ATTLIST menu tag (#PCDATA)+ #REQUIRED>
+<!ELEMENT opt EMPTY >
+<!ATTLIST opt tag (#PCDATA)+ #REQUIRED>
+<!ELEMENT dq (%basic.content;)+>
+<!ELEMENT tt (%basic.content;)+>
+<!ELEMENT meta (%basic.content;)+>
+<!ELEMENT sty (%basic.content;)+>
+<!ELEMENT em (%basic.content;)+>
+<!ELEMENT b (%basic.content;)+>
+<!ELEMENT pre (%basic.content;)+>
+<!ELEMENT float (%basic.content;)+>
+<!ATTLIST float type (#PCDATA)+ #REQUIRED>
+<!ATTLIST float tag (#PCDATA)+ #REQUIRED>
+<!ATTLIST float caption (%basic.content;)+ #REQUIRED>
+<!ATTLIST float listcaption (%basic.content;)+>
+<!ELEMENT dl (dt, dd)+>
+<!ELEMENT dt (%basic.content;)+>
+<!ELEMENT dd (%basic.content;)+>
+
+<!ELEMENT image EMPTY>
+<!ATTLIST image src (%basic.content;)+>
+<!ATTLIST image alt (#PCDATA)+>
+
+<!ELEMENT verbinput EMPTY>
+<!ATTLIST image src (%basic.content;)+>
+
+<!ELEMENT cs EMPTY>
+<!ATTLIST cs tag (%basic.content;)+>
+
+<!ELEMENT env EMPTY>
+<!ATTLIST env tag (%basic.content;)+>
+
+<!ELEMENT tabular (tr)+>
+<!ATTLIST tabular spec (#PCDATA)+ #REQUIRED>
+
+<!ELEMENT tr (td)+>
+
+<!ELEMENT td (%basic.content;)+>
+<!ATTLIST td span (#PCDATA)+>
+<!ATTLIST td spec (#PCDATA)+>
+
+<!ELEMENT br EMPTY>
+<!ELEMENT hr EMPTY>
+<!ELEMENT printindex EMPTY>
+<!ELEMENT printacronyms EMPTY>
+<!ELEMENT LaTeX EMPTY>
+<!ELEMENT TeX EMPTY>
+<!ELEMENT app EMPTY>
+<!ELEMENT nbsp EMPTY>
+<!ELEMENT hash EMPTY>
+<!ELEMENT cont EMPTY>
diff --git a/support/makeglossariesgui/src/doc/makeglossariesgui.pod b/support/makeglossariesgui/src/doc/makeglossariesgui.pod
new file mode 100644
index 0000000000..d832d36d86
--- /dev/null
+++ b/support/makeglossariesgui/src/doc/makeglossariesgui.pod
@@ -0,0 +1,87 @@
+=head1 SYNOPSIS
+
+B<makeglossariesgui> [I<option>]+ [I<filename>]
+
+=head1 DESCRIPTION
+
+MakeGlossariesGUI is a Java GUI diagnostic tool for the glossaries
+LaTeX package. It can check for common problems that can cause the
+entries within the glossary or the entire glossary to be omitted. In
+GUI mode it parses both the .aux and the .log file for known error
+and warning messages.
+
+When run in batch mode, it can be used as alternative to the
+makeglossaries Perl script and the makeglossaries-lite.lua Lua
+script supplied by the glossaries package. (It doesn't parse the log
+file in batch mode or show all the diagnostic information that the
+GUI mode provides.)
+
+Note that if you are opting to use MakeGlossariesGUI because you
+don't want to install Perl, then you are limiting yourself to
+makeindex as xindy also requires Perl.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--version> (or B<-v>)
+
+Show the version number and exit.
+
+=item B<--help> (or B<-h>)
+
+Show the help and exit.
+
+=item B<--debug>
+
+Print debug messages to STDOUT.
+
+=item B<--batch> (or B<-b>)
+
+Run in batch mode. The I<filename> must be supplied with this option
+and should be the name of the .aux file. (The extension may be omitted.)
+
+=item B<--gui>
+
+Run in GUI mode (default).
+
+=item B<--quiet>
+
+Suppress messages that would otherwise be written to STDOUT.
+
+=item B<--dry-run> (or B<-n>)
+
+Switch dry run mode on.
+
+=item B<--nodry-run>
+
+Switch dry run mode off (default).
+
+=back
+
+=head1 REQUIRES
+
+Java 7 and a TeX distribution.
+
+=head1 LICENSE
+
+License GPLv3+: GNU GPL version 3 or later
+<http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+=head1 RECOMMENDED READING
+
+The MakeGlossariesGUI manual (available as a PDF or through the GUI).
+
+The glossaries manual:
+
+ texdoc glossaries
+
+=head1 AUTHOR
+
+Nicola L. C. Talbot,
+L<http://www.dickimaw-books.com/>
+
+=cut
+
diff --git a/support/makeglossariesgui/src/images/icons/back.png b/support/makeglossariesgui/src/images/icons/back.png
new file mode 100644
index 0000000000..dce5f63cb0
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/back.png
Binary files differ
diff --git a/support/makeglossariesgui/src/images/icons/forward.png b/support/makeglossariesgui/src/images/icons/forward.png
new file mode 100644
index 0000000000..9c13a2e92f
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/forward.png
Binary files differ
diff --git a/support/makeglossariesgui/src/images/icons/home.png b/support/makeglossariesgui/src/images/icons/home.png
new file mode 100644
index 0000000000..75fadb2ef5
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/home.png
Binary files differ
diff --git a/support/makeglossariesgui/src/images/icons/makeglossariesgui-logolarge.png b/support/makeglossariesgui/src/images/icons/makeglossariesgui-logolarge.png
new file mode 100644
index 0000000000..1ef20f8e6f
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/makeglossariesgui-logolarge.png
Binary files differ
diff --git a/support/makeglossariesgui/src/images/icons/makeglossariesgui-logosmall.png b/support/makeglossariesgui/src/images/icons/makeglossariesgui-logosmall.png
new file mode 100644
index 0000000000..9be9441c86
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/makeglossariesgui-logosmall.png
Binary files differ
diff --git a/support/makeglossariesgui/src/images/icons/makeglossariesgui.ico b/support/makeglossariesgui/src/images/icons/makeglossariesgui.ico
new file mode 100644
index 0000000000..7807f058d2
--- /dev/null
+++ b/support/makeglossariesgui/src/images/icons/makeglossariesgui.ico
Binary files differ
diff --git a/support/makeglossariesgui/src/images/makeglossariesgui-splash.png b/support/makeglossariesgui/src/images/makeglossariesgui-splash.png
new file mode 100644
index 0000000000..8e94a1cb88
--- /dev/null
+++ b/support/makeglossariesgui/src/images/makeglossariesgui-splash.png
Binary files differ
diff --git a/support/makeglossariesgui/src/installer/install.xml b/support/makeglossariesgui/src/installer/install.xml
new file mode 100644
index 0000000000..2469e12012
--- /dev/null
+++ b/support/makeglossariesgui/src/installer/install.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+
+<!--
+ Installation file for makeglossariesgui.
+-->
+
+<izpack:installation version="5.0" xmlns:izpack="http://izpack.org/schema/installation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
+
+ <properties>
+ <property name="info.appName" value="makeglossariesgui"/>
+ <property name="info.url" value="http://www.dickimaw-books.com/software/makeglossariesgui/"/>
+ <property name="project.version" value="2.1" />
+ </properties>
+
+ <!--
+ The info section.
+ -->
+ <info>
+ <appname>@{info.appName}</appname>
+ <appversion>@{project.version}</appversion>
+ <authors>
+ <author name="Nicola L. C. Talbot" email="www.dickimaw-books.com/contact.html"/>
+ </authors>
+ <url>@{info.url}</url>
+ <javaversion>1.8</javaversion>
+ <run-privileged condition="izpack.windowsinstall|izpack.macinstall"/>
+ </info>
+
+ <guiprefs width="703" height="400" resizable="yes">
+ <splash>images/makeglossariesgui-splash.png</splash>
+ </guiprefs>
+
+ <variables>
+ <variable name="DesktopShortcutCheckboxEnabled" value="true"/>
+ </variables>
+
+ <locale>
+ <langpack iso3="eng"/>
+ </locale>
+
+ <resources>
+ <res id="LicencePanel.licence" src="doc/LICENSE"/>
+ <res id="InfoPanel.info" src="doc/info.txt"/>
+ <res id="shortcutSpec.xml" src="installer/shortcutSpec.xml"/>
+ <res id="Unix_shortcutSpec.xml" src="installer/unix_shortcutSpec.xml"/>
+
+ </resources>
+
+ <panels>
+ <panel classname="HelloPanel"/>
+ <panel classname="InfoPanel"/>
+ <panel classname="LicencePanel"/>
+ <panel classname="TargetPanel"/>
+ <panel classname="PacksPanel"/>
+ <panel classname="InstallPanel"/>
+ <panel classname="ShortcutPanel"/>
+ <panel classname="FinishPanel"/>
+ </panels>
+
+ <packs>
+ <pack name="Base" required="yes">
+ <description>The base files</description>
+ <file src="doc/info.txt" targetdir="$INSTALL_PATH"/>
+ <file src="doc/LICENSE" targetdir="$INSTALL_PATH"/>
+ <file src="lib" targetdir="$INSTALL_PATH"/>
+ <fileset dir="bin" excludes="**/*.bat"
+ targetdir="$INSTALL_PATH/bin"/>
+ <fileset dir="bin" includes="**/*.bat"
+ targetdir="$INSTALL_PATH/bin">
+ <os family="windows"/>
+ </fileset>
+ <executable targetfile="$INSTALL_PATH/bin/makeglossariesgui"
+ stage="never"/>
+ <executable targetfile="$INSTALL_PATH/bin/makeglossariesgui"
+ stage="never"/>
+ </pack>
+ <pack name="Documentation" required="no" preselected="no">
+ <description>The makeglossariesgui documentation</description>
+ <fileset dir="doc" includes="**/*-en.pdf" targetdir="$INSTALL_PATH/doc"/>
+ </pack>
+ <pack name="Source" required="no" preselected="no">
+ <description>The source code</description>
+ <file src="doc/createmakeglossariesguidocs" targetdir="$INSTALL_PATH/src/doc" />
+ <file src="doc/images" targetdir="$INSTALL_PATH/src/doc" />
+ <fileset dir="." includes="**/Makefile"
+ targetdir="$INSTALL_PATH/src" />
+ <fileset dir="." includes="**/info.txt"
+ targetdir="$INSTALL_PATH/src" />
+ <fileset dir="." includes="**/LICENSE"
+ targetdir="$INSTALL_PATH/src" />
+ <fileset dir="." includes="**/*.xml"
+ targetdir="$INSTALL_PATH/src" />
+ <file src="bin" targetdir="$INSTALL_PATH/src" />
+ <file src="images" targetdir="$INSTALL_PATH/src" />
+ <file src="java" targetdir="$INSTALL_PATH/src" />
+ <fileset dir="resources" targetdir="$INSTALL_PATH/src/resources"
+ includes="**/*.prop" />
+ <fileset dir="tests" targetdir="$INSTALL_PATH/src/tests"
+ includes="**/*.tex" />
+ </pack>
+ </packs>
+
+ <natives>
+ <native type="izpack" name="ShellLink.dll"/>
+ <native type="izpack" name="ShellLink_x64.dll"/>
+ </natives>
+
+</izpack:installation>
diff --git a/support/makeglossariesgui/src/installer/shortcutSpec.xml b/support/makeglossariesgui/src/installer/shortcutSpec.xml
new file mode 100644
index 0000000000..f7630605fd
--- /dev/null
+++ b/support/makeglossariesgui/src/installer/shortcutSpec.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+
+<izpack:shortcuts version="5.0" xmlns:izpack="http://izpack.org/schema/shortcuts" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://izpack.org/schema/shortcuts http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">
+
+ <skipIfNotSupported/>
+ <programGroup defaultName="DickimawBooks\MakeGlossariesGUI"
+ location="startMenu"/>
+ <shortcut
+ name="MakeGlossariesGUI"
+ target="$JAVA_HOME\bin\javaw.exe"
+ commandLine="-splash:&quot;$INSTALL_PATH\lib\makeglossariesgui-splash.png&quot; -jar &quot;$INSTALL_PATH\lib\makeglossariesgui.jar&quot;"
+ workingDirectory="$INSTALL_PATH"
+ description="GUI to accompany glossaries.sty"
+ iconFile="$INSTALL_PATH\lib\resources\icons\makeglossariesgui.ico"
+ iconIndex="0"
+ initialState="normal"
+ programGroup="yes"
+ desktop="yes"
+ applications="no"
+ startMenu="no"
+ startup="no">
+
+ <createForPack name="Base"/>
+ </shortcut>
+
+ <shortcut
+ name="MakeGlossariesGUI Uninstaller"
+ programGroup="yes"
+ desktop="no"
+ applications="no"
+ startMenu="no"
+ startup="no"
+ target="$JAVA_HOME\bin\javaw.exe"
+ commandLine="-jar &quot;$INSTALL_PATH\Uninstaller\uninstaller.jar&quot;"
+ iconFile="%SystemRoot%\system32\SHELL32.dll"
+ iconIndex="31"
+ description="Uninstall MakeGlossariesGUI"
+ initialState="noShow"
+ >
+
+ <createForPack name="Base"/>
+ </shortcut>
+
+ <shortcut
+ name="MakeGlossariesGUI Documentation"
+ programGroup="yes"
+ desktop="no"
+ applications="no"
+ startMenu="no"
+ startup="no"
+ target="$INSTALL_PATH\doc\makeglossariesgui-en.pdf"
+ commandLine=""
+ encoding="UTF-8"
+ iconFile="%SystemRoot%\system32\SHELL32.dll"
+ iconIndex="23"
+ description="MakeGlossariesGUI user manual (PDF format)">
+
+ <createForPack name="Documentation"/>
+ </shortcut>
+
+</izpack:shortcuts>
diff --git a/support/makeglossariesgui/src/installer/unix_shortcutSpec.xml b/support/makeglossariesgui/src/installer/unix_shortcutSpec.xml
new file mode 100644
index 0000000000..85ad9ae113
--- /dev/null
+++ b/support/makeglossariesgui/src/installer/unix_shortcutSpec.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+
+<izpack:shortcuts version="5.0" xmlns:izpack="http://izpack.org/schema/shortcuts" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://izpack.org/schema/shortcuts http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">
+
+ <programGroup defaultName="DickimawBooks/MakeGlossariesGUI"
+ location="applications"/>
+
+ <shortcut
+ name="MakeGlossariesGUI GUI"
+ programGroup="yes"
+ applications="no"
+ desktop="yes"
+ target="java"
+ commandLine="-splash:&quot;$INSTALL_PATH/lib/makeglossariesgui-splash.png&quot; -jar &quot;$INSTALL_PATH/lib/makeglossariesgui.jar&quot;"
+ workingDirectory=""
+ description="GUI to accompany glossaries.sty"
+ iconFile="$INSTALL_PATH/lib/icons/makeglossariesgui-logosmall.png"
+ iconIndex="0"
+ type="Application"
+ encoding="UTF-8"
+ terminal="false"
+ KdeSubstUID="false"
+ initialState="normal">
+ <createForPack name="Base"/>
+ </shortcut>
+
+ <shortcut
+ name="MakeGlossariesGUI Documentation"
+ programGroup="yes"
+ applications="no"
+ desktop="no"
+ workingDirectory=""
+ target="evince"
+ commandLine="$INSTALL_PATH/doc/makeglossariesgui-en.pdf"
+ initialState="normal"
+ url="$INSTALL_PATH/doc/makeglossariesgui-en.pdf"
+ type="Application"
+ mimetype="application/pdf"
+ encoding="UTF-8"
+ description="MakeGlossariesGUI user documentation (PDF format)">
+
+ <createForPack name="Documentation"/>
+ </shortcut>
+
+ <shortcut
+ name="MakeGlossariesGUI Uninstaller"
+ programGroup="yes"
+ applications="no"
+ desktop="no"
+ target="java"
+ workingDirectory=""
+ commandLine="-jar &quot;$INSTALL_PATH/Uninstaller/uninstaller.jar&quot;"
+ initialState="normal"
+ type="Application"
+ encoding="UTF-8"
+ description="MakeGlossariesGUI uninstaller">
+ <createForPack name="Base" />
+ </shortcut>
+
+</izpack:shortcuts>
diff --git a/support/makeglossariesgui/src/java/AppSelector.java b/support/makeglossariesgui/src/java/AppSelector.java
new file mode 100644
index 0000000000..6ef120af17
--- /dev/null
+++ b/support/makeglossariesgui/src/java/AppSelector.java
@@ -0,0 +1,167 @@
+/*
+ Copyright (C) 2013 Nicola L.C. Talbot
+ www.dickimaw-books.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+public class AppSelector extends JDialog
+ implements ActionListener
+{
+ public AppSelector(MakeGlossariesGUI application)
+ {
+ super(application, application.getLabel("appselect.title"), true);
+ app = application;
+
+ if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+ {
+ exeSuffix = ".exe";
+ }
+
+ message = new JLabel(application.getLabel("appselect.pathlabel"));
+ message.setDisplayedMnemonic(application.getMnemonic("appselect.pathlabel"));
+
+ getContentPane().add(message, "North");
+
+ fileChooser = new JFileChooser();
+
+ fileField = new FileField(application, this, fileChooser);
+
+ getContentPane().add(fileField, "Center");
+
+ JPanel buttonPanel = new JPanel();
+ add(buttonPanel, "South");
+
+ buttonPanel.add(app.createOkayButton(this));
+ buttonPanel.add(app.createCancelButton(this));
+
+ pack();
+ Dimension dim = getSize();
+
+ dim.width += 50;
+ dim.height += 10;
+
+ setSize(dim);
+
+ setLocationRelativeTo(application);
+ }
+
+ public File findApp(String name)
+ {
+ return app.findApplication(name);
+ }
+
+ public File findApp(String name, String altName, String altName2)
+ {
+ return app.findApplication(name, altName, altName2);
+ }
+
+ public void actionPerformed(ActionEvent evt)
+ {
+ String action = evt.getActionCommand();
+
+ if (action == null) return;
+
+ if (action.equals("choose"))
+ {
+ if (fileChooser.showOpenDialog(this)
+ == JFileChooser.APPROVE_OPTION)
+ {
+ fileField.setFileName(fileChooser.getSelectedFile().getAbsolutePath());
+ }
+ }
+ else if (action.equals("okay"))
+ {
+ selectedFile = fileField.getFile();
+
+ if (selectedFile == null || selectedFile.equals(""))
+ {
+ app.error(this, app.getLabel("error.no_file"));
+ }
+ else
+ {
+ setVisible(false);
+ }
+ }
+ else if (action.equals("cancel"))
+ {
+ setVisible(false);
+ }
+ }
+
+ public File fetchApplicationPath(String appName, String messageText)
+ {
+ return fetchApplicationPath(appName, null, null, messageText);
+ }
+
+ public File fetchApplicationPath(String appName, String altAppName,
+ String altAppName2, String messageText)
+ {
+ selectedFile = null;
+
+ File file = findApp(appName, altAppName, altAppName2);
+
+ if (file != null)
+ {
+ fileChooser.setCurrentDirectory(file.getParentFile());
+ fileChooser.setSelectedFile(file);
+
+ fileField.setFileName(file.getAbsolutePath());
+ }
+ else
+ {
+ fileField.setFileName(appName+exeSuffix);
+ }
+
+ message.setText(messageText);
+
+ setVisible(true);
+
+ return selectedFile;
+ }
+
+ public File fetchApplicationPath(String messageText)
+ {
+ selectedFile = null;
+
+ fileChooser.setSelectedFile(null);
+ fileField.setFileName("");
+
+ message.setText(messageText);
+
+ setVisible(true);
+
+ return selectedFile;
+ }
+
+ private File selectedFile = null;
+
+ private JLabel message;
+
+ private FileField fileField;
+
+ private JFileChooser fileChooser;
+
+ private MakeGlossariesGUI app;
+
+ private String exeSuffix = "";
+}
diff --git a/support/makeglossariesgui/src/java/AuxFileFilter.java b/support/makeglossariesgui/src/java/AuxFileFilter.java
new file mode 100644
index 0000000000..813d82e746
--- /dev/null
+++ b/support/makeglossariesgui/src/java/AuxFileFilter.java
@@ -0,0 +1,82 @@
+// File : AuxFileFilter.java
+// Author : Nicola L.C. Talbot
+// http://www.dickimaw-books.com/
+
+/*
+ Copyright (C) 2006 Nicola L.C. Talbot
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+
+/**
+ * Filter for AUX files. Recognised extension: aux.
+ */
+public class AuxFileFilter extends javax.swing.filechooser.FileFilter
+{
+ /**
+ * Creates a file filter with default description.
+ * The default description is "AUX Files".
+ */
+ public AuxFileFilter()
+ {
+ this("AUX Files");
+ }
+
+ /**
+ * Creates a file filter with given description.
+ */
+ public AuxFileFilter(String description)
+ {
+ super();
+
+ this.description = description;
+ }
+
+ /**
+ * Determines whether given file is accepted by this filter.
+ */
+ public boolean accept(File f)
+ {
+ if (f.isDirectory()) return true;
+
+ String name = f.getName().toLowerCase();
+
+ if (name.endsWith(".aux"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Gets the description of this filter.
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getDefaultExtension()
+ {
+ return "tex";
+ }
+
+ private String description;
+}
diff --git a/support/makeglossariesgui/src/java/DiagnosticPanel.java b/support/makeglossariesgui/src/java/DiagnosticPanel.java
new file mode 100644
index 0000000000..b84eaa6d6f
--- /dev/null
+++ b/support/makeglossariesgui/src/java/DiagnosticPanel.java
@@ -0,0 +1,90 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.datatransfer.*;
+
+import javax.swing.*;
+import javax.swing.text.*;
+import javax.swing.text.html.*;
+
+public class DiagnosticPanel extends JEditorPane
+{
+ public DiagnosticPanel(MakeGlossariesGUI application)
+ {
+ super("text/html", "");
+ app = application;
+
+ setEditable(false);
+ addHyperlinkListener(app);
+ addMouseListener(app);
+ setFont(app.getFont());
+ setTransferHandler(app.getTransferHandler());
+ ((HTMLEditorKit)getEditorKit()).setAutoFormSubmission(false);
+ }
+
+ public void updateDiagnostics()
+ {
+ Font font = app.getFont();
+
+ StyleSheet stylesheet = ((HTMLDocument)getDocument()).getStyleSheet();
+
+ stylesheet.addRule("body { font-size: "+font.getSize()+"pt; }");
+ stylesheet.addRule("body { font-family: "+font.getName()+"; }");
+ stylesheet.addRule("body { font-weight: "+(font.isBold()?"bold":"normal")+"; }");
+ stylesheet.addRule("body { font-style: "+(font.isItalic()?"italic":"normal")+"; }");
+
+ stylesheet.addRule("input { vertical-align: baseline; }");
+
+
+ MakeGlossariesInvoker invoker = app.getInvoker();
+
+ String message = app.diagnosticsForm();
+
+ String results = app.getScriptTestResults();
+
+ if (results != null)
+ {
+ message += results;
+ }
+
+ if (invoker.getGlossaries() == null)
+ {
+ message = String.format("%s<p>%s",
+ invoker.getLabelWithValues("diagnostics.no_file",
+ invoker.getLabel("file"), invoker.getLabel("file.open")),
+ message);
+ }
+ else
+ {
+ String advisory = invoker.getGlossaries().getAdvisoryMessages();
+ String diagnostics = invoker.getGlossaries().getDiagnostics();
+
+ if (diagnostics == null)
+ {
+ message = String.format("%s<p>%s",
+ invoker.getLabel("diagnostics.no_errors"),
+ message);
+ }
+ else
+ {
+ app.selectDiagnosticComponent();
+ message = String.format("%s<p>%s", diagnostics,
+ message);
+ }
+
+ if (advisory != null)
+ {
+ message = String.format("%s<h2>%s</h2>%s",
+ message,
+ invoker.getLabel("diagnostics.advisory"),
+ advisory);
+ }
+
+ }
+
+ setText(message);
+ }
+
+ private MakeGlossariesGUI app;
+}
diff --git a/support/makeglossariesgui/src/java/FileField.java b/support/makeglossariesgui/src/java/FileField.java
new file mode 100644
index 0000000000..77441fd5bc
--- /dev/null
+++ b/support/makeglossariesgui/src/java/FileField.java
@@ -0,0 +1,142 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+public class FileField extends JPanel
+ implements ActionListener
+{
+ public FileField(MakeGlossariesGUI application,
+ Container parent, JFileChooser fileChooser)
+ {
+ this(application, parent, null, fileChooser, JFileChooser.FILES_ONLY);
+ }
+
+ public FileField(MakeGlossariesGUI application,
+ Container parent, JFileChooser fileChooser, int mode)
+ {
+ this(application, parent, null, fileChooser, mode);
+ }
+
+ public FileField(MakeGlossariesGUI application,
+ Container parent, String fileName, JFileChooser fileChooser)
+ {
+ this(application, parent, fileName, fileChooser, JFileChooser.FILES_ONLY);
+ }
+
+ public FileField(MakeGlossariesGUI application,
+ Container parent, String fileName, JFileChooser fileChooser, int mode)
+ {
+ super();
+
+ this.application = application;
+ this.fileChooser = fileChooser;
+ this.parent = parent;
+ this.mode = mode;
+
+ textField = new JTextField(fileName == null ? "" : fileName, 20);
+
+ add(textField);
+
+ button = new JButton("...");
+
+ button.setActionCommand("choose");
+ button.addActionListener(this);
+
+ add(button);
+ }
+
+ public void actionPerformed(ActionEvent evt)
+ {
+ String action = evt.getActionCommand();
+
+ if (action == null) return;
+
+ if (action.equals("choose"))
+ {
+ File file = getFile();
+
+ if (file != null)
+ {
+ fileChooser.setCurrentDirectory(file.getParentFile());
+ }
+
+ fileChooser.setSelectedFile(file);
+
+ fileChooser.setFileSelectionMode(mode);
+
+ fileChooser.setApproveButtonMnemonic(
+ application.getMnemonic("button.select"));
+
+ if (fileChooser.showDialog(parent,
+ application.getLabel("button.select"))
+ == JFileChooser.APPROVE_OPTION)
+ {
+ textField.setText(fileChooser.getSelectedFile().getAbsolutePath());
+ }
+ }
+ }
+
+ public boolean requestFocusInWindow()
+ {
+ return textField.requestFocusInWindow();
+ }
+
+ public JTextField getTextField()
+ {
+ return textField;
+ }
+
+ public File getFile()
+ {
+ String fileName = getFileName();
+
+ if (fileName == null || fileName.equals("")) return null;
+
+ return new File(fileName);
+ }
+
+ public String getFileName()
+ {
+ return textField.getText();
+ }
+
+ public void setFileName(String name)
+ {
+ textField.setText(name);
+ }
+
+ public void setFile(File file)
+ {
+ setFileName(file.getAbsolutePath());
+
+ File parent = file.getParentFile();
+
+ if (parent != null)
+ {
+ fileChooser.setCurrentDirectory(parent);
+ }
+ }
+
+ public void setEnabled(boolean flag)
+ {
+ super.setEnabled(flag);
+
+ textField.setEnabled(flag);
+ button.setEnabled(flag);
+ }
+
+ private JTextField textField;
+
+ private JButton button;
+
+ private JFileChooser fileChooser;
+
+ private Container parent;
+
+ private int mode;
+
+ private MakeGlossariesGUI application;
+}
diff --git a/support/makeglossariesgui/src/java/Glossaries.java b/support/makeglossariesgui/src/java/Glossaries.java
new file mode 100644
index 0000000000..8d25ca7748
--- /dev/null
+++ b/support/makeglossariesgui/src/java/Glossaries.java
@@ -0,0 +1,1468 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.util.*;
+import java.util.regex.*;
+import java.io.*;
+import java.nio.charset.Charset;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.Element;
+
+public class Glossaries
+{
+ public Glossaries(MakeGlossariesInvoker invoker, String istName, String order)
+ {
+ this.invoker = invoker;
+ this.istName = istName;
+ this.order = order;
+ glossaryList = new Vector<Glossary>();
+ }
+
+ public Glossaries(MakeGlossariesInvoker invoker)
+ {
+ this.invoker = invoker;
+ glossaryList = new Vector<Glossary>();
+ }
+
+ public void clear()
+ {
+ glossaryList.clear();
+ }
+
+ public void add(Glossary glossary)
+ {
+ glossaryList.add(glossary);
+ }
+
+ public Glossary getGlossary(int i)
+ {
+ return glossaryList.get(i);
+ }
+
+ public Glossary getGlossary(String label)
+ {
+ for (int i = 0, n = glossaryList.size(); i < n; i++)
+ {
+ Glossary g = glossaryList.get(i);
+
+ if (g.label.equals(label))
+ {
+ return g;
+ }
+ }
+
+ return null;
+ }
+
+ public static Glossaries loadGlossaries(MakeGlossariesInvoker invoker,
+ File file)
+ throws IOException
+ {
+ Glossaries glossaries = new Glossaries(invoker);
+
+ Hashtable<String,String> languages = new Hashtable<String,String>();
+ Hashtable<String,String> codePages = new Hashtable<String,String>();
+
+ invoker.getMessageSystem().message(
+ invoker.getLabelWithValues("message.loading", file));
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(file), invoker.getEncoding()));
+
+ String line;
+
+ boolean override = invoker.getProperties().isOverride();
+
+ while ((line = in.readLine()) != null)
+ {
+ glossaries.parseAux(file.getParentFile(),
+ line, override, languages, codePages);
+ }
+
+ in.close();
+
+ if (glossaries.noidx)
+ {
+ glossaries.addDiagnosticMessage(invoker.getLabel("diagnostics.noidx"));
+ }
+ else if (glossaries.requiresBib2Gls && glossaries.istName == null)
+ {
+ String base = file.getName();
+
+ if (base.endsWith(".aux"))
+ {
+ base = base.substring(0, base.length()-4);
+ }
+
+ glossaries.addDiagnosticMessage(String.format("%s %s",
+ invoker.getLabelWithValues(
+ "diagnostics.bib2gls", base),
+ invoker.getLabel("diagnostics.build")));
+
+ if (!glossaries.hasRecords && !glossaries.selectionAllFound)
+ {
+ glossaries.addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.bib2gls_norecords"));
+ }
+
+ // Is bib2gls on the system PATH?
+
+ File bib2gls = invoker.findApp("bib2gls", "bib2gls.exe", "bib2gls.sh");
+
+ if (bib2gls == null)
+ {
+ glossaries.addDiagnosticMessage(invoker.getLabelWithValues(
+ "error.missing_application", "bib2gls", System.getenv("PATH")));
+ }
+ else
+ {
+ glossaries.addDiagnosticMessage(invoker.getLabelWithValues(
+ "message.found", bib2gls));
+ }
+ }
+ else if (!override)
+ {
+ for (Enumeration<String> en = languages.keys(); en.hasMoreElements();)
+ {
+ String label = en.nextElement();
+ String language = languages.get(label);
+
+ Glossary g = glossaries.getGlossary(label);
+
+ if (g == null)
+ {
+ glossaries.addErrorMessage(invoker.getLabelWithValues(
+ "error.language_no_glossary", language, label));
+ glossaries.addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.language_no_glossary", language, label));
+ }
+ else
+ {
+ g.setLanguage(language);
+ }
+ }
+
+ for (Enumeration<String> en = codePages.keys(); en.hasMoreElements();)
+ {
+ String label = en.nextElement();
+ String code = codePages.get(label);
+
+ Glossary g = glossaries.getGlossary(label);
+
+ if (g == null)
+ {
+ glossaries.addErrorMessage(invoker.getLabelWithValues(
+ "error.codepage_no_glossary", code, label));
+ glossaries.addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.codepage_no_glossary", code, label));
+ }
+ else
+ {
+ g.setCodePage(code);
+ }
+ }
+ }
+
+ if (glossaries.requiresBib2Gls)
+ {
+ }
+
+ return glossaries;
+ }
+
+ private void parseAux(File dir, String line, boolean override,
+ Hashtable<String,String> languages, Hashtable<String,String> codePages)
+ throws IOException
+ {
+ Matcher matcher = newGlossaryPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ add(new Glossary(invoker, matcher.group(1), matcher.group(2),
+ matcher.group(3), matcher.group(4)));
+
+ return;
+ }
+
+ matcher = istFilePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ istName = matcher.group(1);
+ return;
+ }
+
+ matcher = bib2glsPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ requiresBib2Gls = true;
+
+ matcher = selectAllPattern.matcher(matcher.group(1));
+
+ if (matcher.matches())
+ {
+ selectionAllFound = true;
+ }
+
+ return;
+ }
+
+ matcher = orderPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ order = matcher.group(1);
+ return;
+ }
+
+ if (!override)
+ {
+ matcher = languagePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ String label = matcher.group(1);
+
+ String language = matcher.group(2);
+
+ if (language.isEmpty())
+ {
+ language = invoker.getDefaultLanguage();
+
+ String variant = invoker.getDefaultXindyVariant();
+
+ if (variant != null && !variant.isEmpty())
+ {
+ language = String.format("%s-%s", language, variant);
+ }
+
+ addErrorMessage(invoker.getLabelWithValues(
+ "error.no_language", label));
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.no_language", label, language));
+ }
+
+ languages.put(label, language);
+
+ return;
+ }
+
+ matcher = codepagePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ String label = matcher.group(1);
+
+ String code = matcher.group(2);
+
+ if (code.isEmpty())
+ {
+ code = invoker.getDefaultCodePage();
+
+ addErrorMessage(invoker.getLabelWithValues(
+ "error.no_codepage", label));
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.no_codepage", label, code));
+ }
+
+ codePages.put(label, code);
+
+ return;
+ }
+ }
+
+ matcher = glsreferencePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ noidx = true;
+ return;
+ }
+
+ matcher = glsrecordPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ hasRecords = true;
+ return;
+ }
+
+ matcher = extraMakeIndexOptsPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ String opts = matcher.group(1);
+
+ extraMakeIndexOpts = splitArgs(opts);
+
+ return;
+ }
+
+ matcher = inputPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ BufferedReader in = null;
+
+ String aux = matcher.group(1)+".aux";
+
+ String[] split = aux.split("/");
+
+ File f = dir;
+
+ for (int i = 0; i < split.length; i++)
+ {
+ f = new File(f, split[i]);
+ }
+
+ try
+ {
+ invoker.getMessageSystem().message(
+ invoker.getLabelWithValues("message.loading", f));
+
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(f), invoker.getEncoding()));
+
+ while ((line = in.readLine()) != null)
+ {
+ parseAux(f.getParentFile(), line, override, languages, codePages);
+ }
+ }
+ finally
+ {
+ if (in != null)
+ {
+ in.close();
+ }
+ }
+
+ return;
+ }
+ }
+
+ public static Vector<String> splitArgs(String str)
+ {
+ Vector<String> args = new Vector<String>();
+ StringBuilder builder = null;
+ int delim = -1;
+
+ for (int i = 0, n = str.length(); i < n; i++)
+ {
+ char c = str.charAt(i);
+
+ if (builder == null)
+ {
+ if (Character.isWhitespace(c))
+ {
+ continue;
+ }
+
+ builder = new StringBuilder();
+
+ if (c == '\'' || c == '"')
+ {
+ delim = c;
+ }
+ else
+ {
+ delim = -1;
+ builder.append(c);
+ }
+ }
+ else if (c == '\\')
+ {
+ i++;
+
+ if (i < n)
+ {
+ c = str.charAt(i);
+ }
+
+ builder.append(c);
+ }
+ else if (delim == c
+ || (delim == -1 && Character.isWhitespace(c)))
+ {
+ args.add(builder.toString());
+ builder = null;
+ }
+ else
+ {
+ builder.append(c);
+ }
+ }
+
+ if (builder != null)
+ {
+ args.add(builder.toString());
+ }
+
+ return args;
+ }
+
+ public void process()
+ throws GlossaryException,IOException,InterruptedException
+ {
+ File file = invoker.getFile();
+
+ String baseName = file.getName();
+
+ int idx = baseName.lastIndexOf(".");
+
+ if (idx != -1)
+ {
+ baseName = baseName.substring(0, idx);
+ }
+
+ File dir = file.getParentFile();
+
+ Vector<Charset> indexerEncodings = new Vector<Charset>();
+
+ if (!noidx)
+ {
+ String mess = getIndexerError();
+
+ if (mess != null)
+ {
+ if (invoker.isBatchMode())
+ {
+ throw new GlossaryException(mess);
+ }
+
+ addErrorMessage(mess);
+ parseLog(dir, baseName);
+
+ return;
+ }
+
+ String lang = null;
+ String codePage = null;
+
+ if (invoker.getProperties().isOverride())
+ {
+ lang = invoker.getDefaultLanguage();
+ codePage = invoker.getDefaultCodePage();
+
+ String variant = invoker.getDefaultXindyVariant();
+
+ if (variant != null && !variant.isEmpty())
+ {
+ lang = String.format("%s-%s", lang, variant);
+ }
+ }
+
+ if (glossaryList.isEmpty())
+ {
+ addDiagnosticMessage(invoker.getLabel("diagnostics.no_glossaries"));
+ addErrorMessage(invoker.getLabel("error.no_glossaries"));
+ }
+
+ for (int i = 0, n = getNumGlossaries(); i < n; i++)
+ {
+ Glossary g = getGlossary(i);
+
+ try
+ {
+ if (useXindy())
+ {
+ if (lang != null)
+ {
+ g.setLanguage(lang);
+ }
+
+ if (codePage != null)
+ {
+ g.setCodePage(codePage);
+ }
+
+ g.xindy(dir, baseName, isWordOrder(), istName);
+ }
+ else
+ {
+ g.makeindex(dir, baseName, isWordOrder(), istName,
+ extraMakeIndexOpts);
+ }
+
+ String errMess = g.getErrorMessages();
+
+ if (errMess != null)
+ {
+ addErrorMessage(errMess);
+ }
+ }
+ catch (IOException e)
+ {
+ File istFile = new File(dir, istName);
+
+ if (!istFile.exists())
+ {
+ throw new GlossaryException(invoker.getLabelWithValues(
+ "error.no_ist", istName),
+ invoker.getLabel("diagnostics.no_ist"), e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+
+ Charset encoding = invoker.getEncoding();
+
+ if (!indexerEncodings.contains(encoding))
+ {
+ indexerEncodings.add(encoding);
+ }
+ }
+ }
+
+ // Skip the log file check when in batch mode
+
+ if (invoker.isBatchMode()) return;
+
+ parseLog(dir, baseName);
+
+ // Now the log has been parsed, the document encodings should
+ // be known (if support has been provided).
+
+ if (supportedEncodings == null)
+ {
+ // No document encoding detected, assume ASCII (which is
+ // fine for makeindex). Provide advisory note for xindy.
+
+ if (useXindy())
+ {
+ addAdvisoryMessage(invoker.getLabel(
+ "diagnostics.xindy_no_doc_encoding"));
+ }
+ }
+ else
+ {
+ for (Charset encoding: indexerEncodings)
+ {
+ if (!supportedEncodings.contains(encoding))
+ {
+ addAdvisoryMessage(invoker.getLabelWithValues(
+ "diagnostics.doc_indexer_encoding_mismatch", encoding,
+ supportedEncodings.size(), inputEnc));
+ }
+ }
+ }
+ }
+
+ public void parseLog(File dir, String baseName)
+ throws IOException
+ {
+
+ // Now check the log file for any problems
+
+ File log = new File(dir, baseName+".log");
+
+ if (!log.exists())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.no_log", log.getAbsolutePath()));
+
+ // Are there other .aux files in the same directory?
+
+ File[] list = dir.listFiles(new FileFilter()
+ {
+ public boolean accept(File f)
+ {
+ return f.getName().toLowerCase().endsWith(".aux");
+ }
+ });
+
+ if (list != null && list.length > 1)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.multi_aux", dir));
+ }
+
+ return;
+ }
+
+ BufferedReader reader = null;
+
+ boolean checkNonAscii = false;
+
+ String vers = null;
+
+ String build = null;
+
+ try
+ {
+ reader = new BufferedReader(new InputStreamReader(
+ new FileInputStream(log), invoker.getEncoding()));
+
+ String line;
+
+ while ((line = reader.readLine()) != null)
+ {
+ Matcher m;
+
+ if (latexFormat == null)
+ {
+ m = formatPattern.matcher(line);
+
+ if (m.matches())
+ {
+ latexFormat = m.group(1);
+
+ if (latexFormat.startsWith("xe")
+ || latexFormat.startsWith("lua"))
+ {
+ addSupportedEncoding("utf8");
+ }
+
+ continue;
+ }
+ }
+
+ m = inputEncPattern.matcher(line);
+
+ if (m.matches())
+ {
+ addSupportedEncoding(m.group(1));
+ continue;
+ }
+
+ m = glossariesStyPattern.matcher(line);
+
+ if (m.matches())
+ {
+ Calendar cal = Calendar.getInstance();
+
+ String year = m.group(1);
+ String mon = m.group(2);
+ String day = m.group(3);
+ vers = m.group(4);
+
+ try
+ {
+ cal.set(Integer.parseInt(year),
+ Integer.parseInt(mon),
+ Integer.parseInt(day));
+ }
+ catch (NumberFormatException e)
+ {// shouldn't happen
+ invoker.getMessageSystem().debug(e);
+ }
+
+ Calendar v416 = Calendar.getInstance();
+ v416.set(2015, 7, 8);
+
+ if (cal.before(v416))
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.oldversion", vers,
+ // use same format as LaTeX package info:
+ String.format("%s/%s/%s", year, mon, day)
+ ));
+ }
+
+ continue;
+ }
+
+ m = wrongGloTypePattern.matcher(line);
+
+ if (m.matches())
+ {
+ String type = m.group(2);
+
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.wrong_type", type));
+ addErrorMessage(invoker.getLabelWithValues(
+ "error.wrong_type", type));
+
+ continue;
+ }
+
+ if (invoker.isDocDefCheckOn())
+ {
+ m = docDefsPattern.matcher(line);
+
+ if (m.matches())
+ {
+ File f = new File(dir, baseName+".glsdefs");
+
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.doc_defs", f.getAbsolutePath()));
+
+ continue;
+ }
+ }
+
+ if (invoker.isMissingLangCheckOn())
+ {
+ m = missingLangPattern.matcher(line);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.missing_lang", m.group(1)));
+ continue;
+ }
+ }
+
+ m = missingStyPattern.matcher(line);
+
+ if (m.matches())
+ {
+ String sty = m.group(1);
+
+ if (sty.equals("datatool-base"))
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.missing_datatool_base"));
+ }
+ else
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.missing_sty", sty));
+ }
+
+ continue;
+ }
+
+ m = glsGroupHeadingPattern.matcher(line);
+
+ if (m.matches())
+ {
+ String val = m.group(1);
+
+ if (!problemGroupLabels.contains(val))
+ {
+ addDiagnosticMessage(String.format("%s<pre>%s</pre>%s",
+ invoker.getLabelWithValues(
+ "diagnostics.problem_group_label", val),
+ invoker.escapeHTML(line),
+ invoker.getLabel(isUnicodeEngine() ?
+ "diagnostics.suggest_bib2gls" :
+ "diagnostics.suggest_unicode_or_bib2gls")));
+
+ problemGroupLabels.add(val);
+ }
+
+ continue;
+ }
+
+ m = warningPattern.matcher(line);
+
+ if (m.matches())
+ {
+ StringBuilder builder = new StringBuilder(line);
+
+ while ((line = reader.readLine()) != null)
+ {
+ if (line.isEmpty())
+ {
+ break;
+ }
+
+ builder.append(line);
+ }
+
+ String msg = builder.toString();
+
+ if (msg.contains("Package inputenc Error: Unicode char"))
+ {
+ // If a warning message contains this, it's likely
+ // that an entry label contains non-ASCII
+ // characters.
+
+ checkNonAscii = true;
+ continue;
+ }
+
+ if (requiresBib2Gls)
+ {
+ m = missingGlsTeXPattern.matcher(msg);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ istName == null ? "diagnostics.missing_glstex" :
+ "diagnostics.missing_glstex_hybrid",
+ m.group(1)));
+
+ if (build == null)
+ {
+ if (istName == null)
+ {
+ build = invoker.getLabelWithValues(
+ "diagnostics.bib2gls_build", getLaTeXFormat(),
+ baseName
+ );
+ }
+ else
+ {
+ build = invoker.getLabelWithValues(
+ "diagnostics.hybrid_build", getLaTeXFormat(),
+ baseName,
+ "makeglossaries"
+ );
+ }
+
+ addDiagnosticMessage(build);
+ }
+ continue;
+ }
+ }
+
+ addDiagnosticMessage(msg);
+
+ if (noidx)
+ {
+ m = emptyNoIdxGlossaryPattern.matcher(msg);
+
+ if (m.matches())
+ {
+ String type = m.group(1);
+
+ if (!glossaryList.contains(type))
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.wrong_type_noidx", type));
+ }
+ }
+ }
+
+ continue;
+ }
+
+ m = systemPattern.matcher(line);
+
+ if (m.matches())
+ {
+ StringBuilder builder = new StringBuilder(line);
+
+ while (!line.endsWith(".") && (line = reader.readLine()) != null)
+ {
+ if (line.isEmpty())
+ {
+ break;
+ }
+
+ builder.append(line);
+ }
+
+ m = disabledSystemPattern.matcher(builder);
+
+ if (m.matches())
+ {
+ String cmd = m.group(1);
+ String rest = m.group(2);
+
+ if (m.groupCount() == 2)
+ {
+ addAdvisoryMessage(invoker.getLabelWithValues(
+ "diagnostics.shell_disabled", cmd+rest));
+ }
+ else
+ {
+ addAdvisoryMessage(invoker.getLabelWithValues(
+ "diagnostics.shell_restricted", cmd+rest, cmd));
+ }
+
+
+ }
+
+ continue;
+ }
+
+ m = undefControlSequencePattern.matcher(line);
+
+ if (m.matches())
+ {
+ line = reader.readLine();
+
+ m = fragileBrokenPattern.matcher(line);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.fragile"));
+ continue;
+ }
+
+ if (line.contains("\\GenericError"))
+ {
+ // Too complicated, so don't show to avoid
+ // overcluttering the diagnostic panel.
+ continue;
+ }
+
+ if (line.endsWith("\\indexspace "))
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.undef_indexspace"));
+ continue;
+ }
+
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.undef_cs", line));
+
+ continue;
+ }
+
+ m = unknownOptPattern.matcher(line);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.undef_opt", m.group(1)));
+
+ continue;
+ }
+
+ m = infoPattern.matcher(line);
+
+ if (m.matches())
+ {
+ StringBuilder builder = new StringBuilder(m.group(1));
+
+ while (!line.endsWith(".")
+ && (line = reader.readLine()) != null
+ && !line.isEmpty())
+ {
+ builder.append(line);
+ }
+
+ m = wrglossaryPattern.matcher(builder);
+
+ if (m.matches())
+ {
+ String type = m.group(1);
+ String info = m.group(2);
+ String lineNum = m.group(3);
+
+ addDiagnosticMessage(String.format("%s%n<pre>%s</pre>%n",
+ invoker.getLabelWithValues(
+ "diagnostics.wrglossary", type, lineNum),
+ info));
+ }
+
+ continue;
+ }
+
+ m = inputPattern.matcher(line);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.include", m.group(1)));
+ continue;
+ }
+
+ m = istFilePattern.matcher(line);
+
+ if (m.matches())
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.ist_in_log"));
+ continue;
+ }
+ }
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ reader.close();
+ }
+ }
+
+ if (vers == null)
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.no_version"));
+ }
+
+ if (checkNonAscii)
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.inputenc"));
+
+ for (int i = 0, n = glossaryList.size(); i < n; i++)
+ {
+ Glossary glossary = glossaryList.get(i);
+
+ glossary.checkNonAsciiLabels();
+ }
+ }
+ }
+
+ public String getLaTeXFormat()
+ {
+ return latexFormat == null ? "latex" : latexFormat;
+ }
+
+ public boolean isUnicodeEngine()
+ {
+ if (latexFormat == null)
+ {
+ return false;
+ }
+
+ return latexFormat.startsWith("xe") || latexFormat.startsWith("lua");
+ }
+
+ public String displayGlossaryList()
+ {
+ String str = null;
+
+ for (int i = 0, n = glossaryList.size(); i < n; i++)
+ {
+ Glossary glossary = glossaryList.get(i);
+
+ if (str == null)
+ {
+ str = glossary.label;
+ }
+ else
+ {
+ str += ", " + glossary.label;
+ }
+ }
+
+ return str;
+ }
+
+ public String getDisplayGlossaryListError()
+ {
+ return getNumGlossaries() == 0 ?
+ invoker.getLabel("error.no_glossaries"):
+ null;
+ }
+
+ public String displayEncoding()
+ {
+ return invoker.getEncoding().name();
+ }
+
+ private void addSupportedEncoding(String encLabel)
+ {
+ Charset charset = invoker.getCharset(encLabel);
+
+ if (charset == null)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.unknown.encoding", encLabel));
+ }
+ else
+ {
+ if (supportedEncodings == null)
+ {
+ supportedEncodings = new Vector<Charset>();
+ }
+
+ supportedEncodings.add(charset);
+ }
+
+ if (inputEnc == null)
+ {
+ inputEnc = encLabel;
+ }
+ else
+ {
+ inputEnc = String.format("%s, %s", inputEnc, encLabel);
+ }
+ }
+
+ public String displayDocumentEncoding()
+ {
+ return inputEnc == null ? invoker.getLabel("error.unknown") : inputEnc;
+ }
+
+ public String getOrder()
+ {
+ return order;
+ }
+
+ public boolean isWordOrder()
+ {
+ if (order == null) return false;
+ return order.equals("word");
+ }
+
+ public boolean isLetterOrder()
+ {
+ if (order == null) return false;
+ return order.equals("letter");
+ }
+
+ public boolean isValidOrder()
+ {
+ if (order == null) return false;
+
+ return order.equals("word") || order.equals("letter");
+ }
+
+ public String getOrderError()
+ {
+ if (order == null) return invoker.getLabel("error.missing_order");
+
+ return isValidOrder() ? null
+ : invoker.getLabelWithValues("error.invalid_order", order);
+ }
+
+ public String displayFormat()
+ {
+ if (istName == null)
+ {
+ if (requiresBib2Gls)
+ {
+ return "bib2gls";
+ }
+ else
+ {
+ return invoker.getLabel("error.unknown");
+ }
+ }
+
+ return useXindy() ? "xindy" : "makeindex";
+ }
+
+ public String getIstName()
+ {
+ return istName;
+ }
+
+ public String getIstNameError()
+ {
+ return istName == null ? invoker.getLabel("error.missing_ist") : null;
+ }
+
+ public boolean useXindy()
+ {
+ if (istName == null) return false;
+
+ return istName.endsWith(".xdy");
+ }
+
+ public String getIndexerError()
+ {
+ if (noidx) return null;
+
+ if (istName == null)
+ {
+ return
+ invoker.getLabel(requiresBib2Gls ? "error.bib2gls_indexer" :
+ "error.cant_determine_indexer");
+ }
+
+ if (useXindy())
+ {
+ if (invoker.getXindyApp() == null)
+ {
+ return invoker.getLabel("error.no_xindy");
+ }
+ }
+ else
+ {
+ if (invoker.getMakeIndexApp() == null)
+ {
+ return invoker.getLabel("error.no_makeindex");
+ }
+ }
+
+ return null;
+ }
+
+ public int getNumGlossaries()
+ {
+ return glossaryList.size();
+ }
+
+ public String getDiagnostics()
+ {
+ String mess;
+
+ if (!noidx && istName == null && order == null)
+ {
+ mess = getDiagnosticMessages();
+
+ if (mess != null)
+ {
+ return mess;
+ }
+ else if (glossaryList.size() == 0)
+ {
+ return invoker.getFileName().toLowerCase().endsWith(".aux") ?
+ invoker.getLabel("diagnostics.no_glossaries"):
+ invoker.getLabel("diagnostics.not_aux");
+ }
+ else
+ {
+ return invoker.getLabel("diagnostics.no_makeglossaries");
+ }
+ }
+
+ mess = getIndexerError();
+
+ if (mess != null)
+ {
+ return String.format("%s%n%s", mess,
+ invoker.getLabelWithValues("diagnostics.no_indexer",
+ displayFormat()));
+ }
+
+ mess = getDiagnosticMessages();
+
+ for (int i = 0, n = getNumGlossaries(); i < n; i++)
+ {
+ String errmess = getGlossary(i).getDiagnosticMessages();
+
+ if (errmess != null)
+ {
+ if (mess == null)
+ {
+ mess = errmess;
+ }
+ else
+ {
+ mess = String.format("%s%n<p>%s", mess, errmess);
+ }
+ }
+ }
+
+ return mess;
+ }
+
+ private String getDiagnosticMessages()
+ {
+ return diagnosticMessages == null ? null : diagnosticMessages.toString();
+ }
+
+ public void addDiagnosticMessage(String mess)
+ {
+ if (diagnosticMessages == null)
+ {
+ diagnosticMessages = new StringBuilder(mess);
+ }
+ else
+ {
+ diagnosticMessages.append(String.format("<p>%s", mess));
+ }
+ }
+
+ public String getAdvisoryMessages()
+ {
+ return advisoryMessages == null ? null : advisoryMessages.toString();
+ }
+
+ public void addAdvisoryMessage(String mess)
+ {
+ if (advisoryMessages == null)
+ {
+ advisoryMessages = new StringBuilder(mess);
+ }
+ else
+ {
+ advisoryMessages.append(String.format("<p>%s", mess));
+ }
+ }
+
+ public void addErrorMessage(String mess)
+ {
+ if (errorMessages == null)
+ {
+ errorMessages = new StringBuilder(mess);
+ }
+ else
+ {
+ errorMessages.append(String.format("%n%s", mess));
+ }
+ }
+
+ public String getErrorMessages()
+ {
+ return errorMessages == null ? null : errorMessages.toString();
+ }
+
+ public static int getNumFields()
+ {
+ return fields.length;
+ }
+
+ public static String getFieldTag(int i)
+ {
+ return fields[i];
+ }
+
+ public static Element getFieldElement(HTMLDocument doc, int i)
+ {
+ return doc.getElement(fields[i]);
+ }
+
+ public static Element getFieldLabelElement(HTMLDocument doc, int i)
+ {
+ return doc.getElement(fields[i]+"label");
+ }
+
+ public String getFieldLabel(int i)
+ {
+ return invoker.getLabel("main", fields[i]);
+ }
+
+ public String getField(int i)
+ {
+ switch (i)
+ {
+ case AUX: return invoker.getFileName();
+ case ORDER: return getOrder();
+ case IST: return getIstName();
+ case INDEXER: return displayFormat();
+ case GLOSSARIES: return displayGlossaryList();
+ case ENCODING: return displayEncoding();
+ case DOC_ENCODING: return displayDocumentEncoding();
+ }
+
+ return null;
+ }
+
+ public String getFieldError(int i)
+ {
+ switch (i)
+ {
+ case AUX: return invoker.getFileName() == null ?
+ invoker.getLabel("error.no_such_file") :
+ null;
+ case ORDER: return getOrderError();
+ case IST: return getIstNameError();
+ case INDEXER: return getIndexerError();
+ case GLOSSARIES: return getDisplayGlossaryListError();
+ }
+
+ return null;
+ }
+
+ private Vector<Glossary> glossaryList;
+ private String istName;
+
+ private Vector<String> extraMakeIndexOpts;
+
+ private boolean noidx = false;
+
+ private String order;
+
+ private boolean requiresBib2Gls = false;
+
+ private StringBuilder errorMessages, diagnosticMessages, advisoryMessages;
+
+ private static final Pattern newGlossaryPattern
+ = Pattern.compile("\\\\@newglossary\\{([^\\}]+)\\}\\{([^\\}]+)\\}\\{([^\\}]+)\\}\\{([^\\}]+)\\}");
+
+ private static final Pattern istFilePattern
+ = Pattern.compile("\\\\@istfilename\\{([^\\}]+)\\}");
+
+ private static final Pattern bib2glsPattern
+ = Pattern.compile("\\\\glsxtr@resource\\{(.*)\\}\\{(.*?)\\}");
+
+ private static final Pattern selectAllPattern
+ = Pattern.compile(".*selection\\s*=\\s*(all|\\{all\\}).*");
+
+ private static final Pattern orderPattern
+ = Pattern.compile("\\\\@glsorder\\{([^\\}]+)\\}");
+
+ private static final Pattern languagePattern
+ = Pattern.compile("\\\\@xdylanguage\\{([^\\}]+)\\}\\{([^\\}]*)\\}");
+
+ private static final Pattern codepagePattern
+ = Pattern.compile("\\\\@gls@codepage\\{([^\\}]+)\\}\\{([^\\}]*)\\}");
+
+ private static final Pattern glsreferencePattern
+ = Pattern.compile("\\\\@gls@reference\\{.*?\\}\\{.*?\\}\\{.*\\}");
+
+ private static final Pattern glsrecordPattern
+ = Pattern.compile("\\\\glsxtr@record\\{.*?\\}\\{.*?\\}\\{.*\\}");
+
+ private static final Pattern extraMakeIndexOptsPattern
+ = Pattern.compile("\\\\@gls@extramakeindexopts\\{(.*)\\}");
+
+ private static final Pattern glossariesStyPattern
+ = Pattern.compile("Package: glossaries (\\d+)\\/(\\d+)\\/(\\d+) v([\\d\\.a-z]+) \\(NLCT\\).*");
+
+ private static final Pattern glossariesXtrStyPattern
+ = Pattern.compile("Package: glossaries-extra (\\d+)\\/(\\d+)\\/(\\d+) v([\\d\\.a-z]+) \\(NLCT\\).*");
+
+ private static final Pattern wrongGloTypePattern
+ = Pattern.compile("No file (.*?)\\.\\\\@glotype@(.*?)@in\\s*\\.");
+
+ private static final Pattern docDefsPattern
+ = Pattern.compile("\\\\openout\\d+\\s*=\\s*`.*\\.glsdefs'.");
+
+ private static final Pattern missingLangPattern
+ = Pattern.compile("Package glossaries Warning: No language module detected for `(.*)'.\\s*");
+
+ private static final Pattern missingStyPattern
+ = Pattern.compile(".*`(.*?)\\.sty' not found.*");
+
+ private static final Pattern missingGlsTeXPattern
+ = Pattern.compile(".*No file `(.*?\\.glstex)'.*");
+
+ private static final Pattern warningPattern
+ = Pattern.compile("Package glossaries(-extra)? Warning: .*");
+
+ private static final Pattern emptyNoIdxGlossaryPattern
+ = Pattern.compile(".*Empty glossary for \\\\printnoidxglossary\\[type=\\{(.*?)\\}\\]\\..*");
+
+ private static final Pattern systemPattern
+ = Pattern.compile("runsystem\\(.*");
+
+ private static final Pattern disabledSystemPattern
+ = Pattern.compile("runsystem\\(([^ ]+)(.*)\\)\\.\\.\\.disabled(\\s+\\(restricted\\))?\\.");
+
+ private static final Pattern undefControlSequencePattern
+ = Pattern.compile(".* Undefined control sequence.");
+
+ private static final Pattern fragileBrokenPattern
+ = Pattern.compile(".*\\\\in@ #1#2->\\\\begingroup \\\\def \\\\in@@\\s*");
+
+ private static final Pattern unknownOptPattern
+ = Pattern.compile(".*Unknown option `(.*)' for package `glossaries'.*");
+
+ private static final Pattern infoPattern
+ = Pattern.compile("Package glossaries Info:\\s*(.*)");
+
+ private static final Pattern wrglossaryPattern
+ = Pattern.compile("wrglossary\\((.*?)\\)\\((.*)\\) on input line (\\d+).*");
+
+ private static final Pattern inputPattern
+ = Pattern.compile("\\\\@input\\{(.*)\\.aux\\}");
+
+ private static final Pattern formatPattern
+ = Pattern.compile(".* format=(xelatex|lualatex|pdflatex|latex) .*");
+
+ private static final Pattern inputEncPattern
+ = Pattern.compile("File: (utf8|latin[0-9]+|cp[0-9]+(?:de)?|decmulti|applemac|macce|next|ansinew|ascii)\\.def.*");
+
+ private static final Pattern glsGroupHeadingPattern
+ = Pattern.compile(".*\\\\glsgroupheading\\{(.+?)\\}.*");
+
+ private Vector<String> problemGroupLabels = new Vector<String>();
+
+ private static final String[] fields =
+ {
+ "aux",
+ "order",
+ "ist",
+ "indexer",
+ "list",
+ "encoding",
+ "docencoding"
+ };
+
+ public static final int AUX=0, ORDER=1, IST=2, INDEXER=3, GLOSSARIES=4,
+ ENCODING=5, DOC_ENCODING=6;
+
+ private String latexFormat = null;
+
+ private String inputEnc = null;
+
+ private Vector<Charset> supportedEncodings;
+
+ private MakeGlossariesInvoker invoker;
+
+ private boolean hasRecords = false;
+ private boolean selectionAllFound = false;
+}
diff --git a/support/makeglossariesgui/src/java/GlossariesPanel.java b/support/makeglossariesgui/src/java/GlossariesPanel.java
new file mode 100644
index 0000000000..4498c81639
--- /dev/null
+++ b/support/makeglossariesgui/src/java/GlossariesPanel.java
@@ -0,0 +1,327 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.net.*;
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.font.*;
+import java.awt.event.*;
+import java.util.*;
+import java.text.*;
+import java.awt.datatransfer.*;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.*;
+import javax.swing.text.html.*;
+
+public class GlossariesPanel extends JEditorPane
+ implements HyperlinkListener
+{
+ public GlossariesPanel(MakeGlossariesGUI application)
+ throws IOException,BadLocationException
+ {
+ super();
+
+ app = application;
+
+ setContentType("text/html");
+
+ setEditable(false);
+ addHyperlinkListener(this);
+ addMouseListener(app);
+
+ HTMLDocument doc = (HTMLDocument)getDocument();
+ }
+
+ public void updateInfo()
+ throws BadLocationException,IOException
+ {
+ StyleSheet stylesheet = ((HTMLDocument)getDocument()).getStyleSheet();
+
+ Font font = app.getFont();
+
+ stylesheet.addRule(String.format("body { font-size: %dpt; }",
+ font.getSize()));
+ stylesheet.addRule(String.format("body { font-family: %s; }",
+ font.getName()));
+ stylesheet.addRule(String.format("body { font-weight: %s; }",
+ (font.isBold()?"bold":"normal")));
+ stylesheet.addRule(String.format("body { font-style: %s; }",
+ (font.isItalic()?"italic":"normal")));
+
+ setText(app.getMainInfoTemplate());
+ updateHeaders();
+ updateFields();
+ updateGlossaries();
+ }
+
+ private void updateHeaders()
+ throws BadLocationException,IOException
+ {
+ HTMLDocument doc = (HTMLDocument)getDocument();
+ Glossaries glossaries = app.getGlossaries();
+
+ if (glossaries == null)
+ {
+ return;
+ }
+
+ for (int i = 0, n = Glossaries.getNumFields(); i < n; i++)
+ {
+ Element e = Glossaries.getFieldLabelElement(doc, i);
+ String tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, glossaries.getFieldLabel(i), tag));
+ }
+ }
+
+ private void updateFields()
+ throws BadLocationException,IOException
+ {
+ HTMLDocument doc = (HTMLDocument)getDocument();
+ Glossaries glossaries = app.getGlossaries();
+
+ if (glossaries == null) return;
+
+ for (int i = 0, n = glossaries.getNumFields(); i < n; i++)
+ {
+ Element e = glossaries.getFieldElement(doc, i);
+ String field = glossaries.getField(i);
+ String err = glossaries.getFieldError(i);
+ String tag = glossaries.getFieldTag(i);
+
+ String content = "";
+
+ if (err == null)
+ {
+ if (field != null)
+ {
+ content = field;
+ }
+ }
+ else
+ {
+ if (field == null)
+ {
+ content = String.format("<font class=errormess>%s</font>", err);
+ }
+ else
+ {
+ content = String.format(
+ "<font class=error>%s <font class=errormess>%s</font></font>",
+ field, err);
+ }
+ }
+
+ doc.setOuterHTML(e, String.format("<td id=%s>%s</td>", tag, content));
+ }
+ }
+
+ private void updateGlossaries()
+ throws BadLocationException,IOException
+ {
+ HTMLDocument doc = (HTMLDocument)getDocument();
+ Glossaries glossaries = app.getGlossaries();
+
+ if (glossaries == null) return;
+
+ if (glossaries.getIstName() == null) return;
+
+ DateFormat df = DateFormat.getDateTimeInstance();
+
+ File file = app.getFile();
+ File dir = file.getParentFile();
+ String baseName = file.getName();
+
+ int idx = baseName.lastIndexOf(".");
+
+ if (idx != -1)
+ {
+ baseName = baseName.substring(0, idx);
+ }
+
+ String viewLabel = app.getLabel("main.view");
+ String detailsLabel = app.getLabel("main.details");
+
+ for (int i = 0, n = glossaries.getNumGlossaries(); i < n; i++)
+ {
+ Glossary g = glossaries.getGlossary(i);
+ String glossaryInfoTemplate = app.getGlossaryInfoTemplate(g.label);
+
+ doc.insertBeforeEnd(doc.getElement("glossaries"),
+ glossaryInfoTemplate);
+
+ doc.setInnerHTML(doc.getElement("glossaryheader-"+g.label),
+ app.getLabelWithValues("main.glossary", g.label));
+
+ File transFile = new File(dir, baseName+"."+g.transExt);
+ File gloFile = new File(dir, baseName+"."+g.gloExt);
+ File glsFile = new File(dir, baseName+"."+g.glsExt);
+
+ Element e = doc.getElement("loglabel-"+g.label);
+ String tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.glossary.log"), tag));
+
+ if (transFile.exists())
+ {
+ doc.setOuterHTML(doc.getElement("logname-"+g.label),
+ transFile.getName());
+ doc.setOuterHTML(doc.getElement("logmod-"+g.label),
+ transFile.lastModified() < gloFile.lastModified() ?
+ app.getLabel("main.out_of_date"):
+ app.getLabel("main.up_to_date"));
+ doc.setOuterHTML(doc.getElement("logview-"+g.label),
+ String.format("<a href=\"%s\">%s</a>",
+ transFile.toURI(), viewLabel));
+ }
+ else
+ {
+ doc.setInnerHTML(doc.getElement("loginfo-"+g.label),
+ String.format("<font class=error>%s</font>",
+ app.getLabel("error.no_such_file")));
+ }
+
+ e = doc.getElement("glslabel-"+g.label);
+ tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.glossary.gls"), tag));
+
+ if (glsFile.exists())
+ {
+ doc.setOuterHTML(doc.getElement("glsname-"+g.label),
+ glsFile.getName());
+ doc.setOuterHTML(doc.getElement("glsmod-"+g.label),
+ glsFile.length() == 0 ?
+ app.getLabel("main.empty") :
+ (glsFile.lastModified() < gloFile.lastModified() ?
+ app.getLabel("main.out_of_date"):
+ app.getLabel("main.up_to_date")));
+ doc.setOuterHTML(doc.getElement("glsview-"+g.label),
+ String.format("<a href=\"%s\">%s</a>",
+ glsFile.toURI(), viewLabel));
+ }
+ else
+ {
+ doc.setInnerHTML(doc.getElement("glsinfo-"+g.label),
+ String.format("<font class=error>%s</font>",
+ app.getLabel("error.no_such_file")));
+ }
+
+ e = doc.getElement("glolabel-"+g.label);
+ tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.glossary.glo"), tag));
+
+
+ if (gloFile.exists())
+ {
+ doc.setOuterHTML(doc.getElement("gloname-"+g.label),
+ gloFile.getName());
+ doc.setOuterHTML(doc.getElement("glomod-"+g.label),
+ df.format(new Date(gloFile.lastModified())));
+ doc.setOuterHTML(doc.getElement("gloview-"+g.label),
+ String.format("<a href=\"%s\">%s</a>",
+ gloFile.toURI(), viewLabel));
+ }
+ else
+ {
+ doc.setInnerHTML(doc.getElement("gloinfo-"+g.label),
+ String.format("<font class=error>%s</font>",
+ app.getLabel("error.no_such_file")));
+ }
+
+
+ if (glossaries.useXindy())
+ {
+ e = doc.getElement("langlabel-"+g.label);
+ tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.glossary.language"), tag));
+
+ doc.setInnerHTML(doc.getElement("langinfo-"+g.label),
+ g.displayLanguage());
+
+ e = doc.getElement("codelabel-"+g.label);
+ tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.glossary.codepage"), tag));
+
+ doc.setInnerHTML(doc.getElement("codeinfo-"+g.label),
+ g.displayCodePage());
+ }
+ else
+ {
+ doc.setOuterHTML(doc.getElement("xindy"), "");
+ }
+
+ e = doc.getElement("entrieslabel-"+g.label);
+ tag = e.getName();
+
+ doc.setOuterHTML(e, String.format("<%s>%s</%s>",
+ tag, app.getLabel("main.num_entries"), tag));
+
+ e = doc.getElement("entriesinfo-"+g.label);
+ tag = e.getName();
+
+ String detailsLink = "";
+
+ if (g.getNumEntries() > 0)
+ {
+ detailsLink = String.format(
+ " <a description=\"%s\" href=\"%s\">%s</a>",
+ g.label, g.label, detailsLabel);
+ }
+
+ doc.setOuterHTML(e, String.format("<%s>%s%s</%s>",
+ tag, g.getNumEntries(), detailsLink, tag));
+
+ String errMess = g.getErrorMessages();
+
+ if (errMess != null)
+ {
+ doc.setOuterHTML(doc.getElement("error-"+g.label),
+ String.format("<font class=error>%s</font>", errMess));
+ }
+ }
+ }
+
+ public void hyperlinkUpdate(HyperlinkEvent evt)
+ {
+ HyperlinkEvent.EventType type = evt.getEventType();
+ URL url = evt.getURL();
+
+ if (type == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ if (url == null)
+ {
+ Glossary g = app.getGlossaries().getGlossary(evt.getDescription());
+
+ if (g != null)
+ {
+ new ViewEntries(app, g, app.getFont()).setVisible(true);
+ }
+ }
+ else
+ {
+ try
+ {
+ new ViewFile(url, app.getFont(), app).setVisible(true);
+ }
+ catch (Exception e)
+ {
+ app.error(e);
+ }
+ }
+ }
+ }
+
+ private MakeGlossariesGUI app;
+}
diff --git a/support/makeglossariesgui/src/java/Glossary.java b/support/makeglossariesgui/src/java/Glossary.java
new file mode 100644
index 0000000000..8f129a5ab2
--- /dev/null
+++ b/support/makeglossariesgui/src/java/Glossary.java
@@ -0,0 +1,940 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.regex.*;
+
+public class Glossary
+{
+ public Glossary(MakeGlossariesInvoker invoker, String label, String transExt,
+ String glsExt, String gloExt)
+ {
+ this.invoker = invoker;
+ this.label = label;
+ this.transExt = transExt;
+ this.glsExt = glsExt;
+ this.gloExt = gloExt;
+
+ entryTable = new Hashtable<String,GlossaryEntry>();
+ }
+
+ public void xindy(File dir, String baseName,
+ boolean isWordOrder, String istName)
+ throws IOException,InterruptedException,GlossaryException
+ {
+ File xindyApp = new File(invoker.getXindyApp());
+
+ if (!xindyApp.exists())
+ {
+ throw new GlossaryException(invoker.getLabelWithValues(
+ "error.no_indexer_app", "xindy", xindyApp.getAbsolutePath()),
+ invoker.getLabelWithValues("diagnostics.no_indexer", "xindy"));
+ }
+
+ String transFileName = baseName+"."+transExt;
+
+ if (language == null || language.equals(""))
+ {
+ language = invoker.getDefaultLanguage();
+ }
+
+ if (codepage == null || codepage.equals(""))
+ {
+ codepage = invoker.getDefaultCodePage();
+ }
+
+ if (!invoker.getProperties().isOverride())
+ {
+ XindyModule mod = XindyModule.getModule(language);
+
+ if (mod != null)
+ {
+ String variant = mod.getDefaultVariant();
+
+ if (variant != null && !mod.hasCodePage(codepage))
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.variant", language, codepage, variant));
+ codepage = variant+"-"+codepage;
+ }
+ }
+ }
+
+ String style = istName;
+
+ int idx = istName.lastIndexOf(".");
+
+ if (idx != -1)
+ {
+ style = style.substring(0, idx);
+ }
+
+ File gloFile = new File(dir, baseName+"."+gloExt);
+
+ String[] cmdArray;
+
+ if (isWordOrder)
+ {
+ cmdArray = new String[]
+ {
+ xindyApp.getAbsolutePath(),
+ "-L", language,
+ "-C", codepage,
+ "-I", "xindy",
+ "-M", style,
+ "-t", transFileName,
+ "-o", baseName+"."+glsExt,
+ gloFile.getName()
+ };
+ }
+ else
+ {
+ cmdArray = new String[]
+ {
+ xindyApp.getAbsolutePath(),
+ "-L", language,
+ "-C", codepage,
+ "-I", "xindy",
+ "-M", style,
+ "-M", "ord/letorder",
+ "-t", transFileName,
+ "-o", baseName+"."+glsExt,
+ gloFile.getName()
+ };
+ }
+
+ int exitCode = 0;
+ BufferedReader in=null;
+
+ Charset charset = null;
+
+ try
+ {
+ charset = invoker.getCharset(codepage);
+ invoker.setEncoding(charset);
+ }
+ catch (Exception e)
+ {
+ invoker.getMessageSystem().error(e);
+ }
+
+ if (charset == null)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.unknown.encoding", codepage));
+ charset = invoker.getEncoding();
+ }
+
+ File transFile = new File(dir, transFileName);
+
+ invoker.getMessageSystem().aboutToExec(cmdArray, dir);
+
+ if (invoker.isDryRunMode())
+ {
+ if (transFile.exists())
+ {
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(transFile), charset));
+ }
+ }
+ else
+ {
+ Process p = Runtime.getRuntime().exec(cmdArray, null, dir);
+
+ exitCode = p.waitFor();
+
+ in = new BufferedReader(new InputStreamReader(p.getErrorStream(),
+ charset));
+ }
+
+ String line;
+
+ StringBuilder processErrors = null;
+
+ String unknownMod = null;
+ boolean emptySortFound = false;
+
+ while (in != null && (line = in.readLine()) != null)
+ {
+ if (processErrors == null)
+ {
+ processErrors = new StringBuilder();
+ }
+
+ processErrors.append(String.format("%n%s", line));
+
+ Matcher matcher = xindyModulePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ unknownMod = invoker.getLabelWithValues(
+ "diagnostics.unknown_language_or_codepage",
+ matcher.group(1), matcher.group(2));
+ }
+ else
+ {
+ matcher = emptySortPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ emptySortFound = true;
+ }
+ else
+ {
+ matcher = collapsedSortPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ emptySortFound = true;
+ }
+ }
+ }
+ }
+
+ if (in != null)
+ {
+ in.close();
+ }
+
+ String unknownVar = null;
+
+ if (transFile.exists())
+ {
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(transFile), charset));
+
+ while ((line = in.readLine()) != null)
+ {
+ Matcher matcher = xindyIstPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ unknownVar = matcher.group();
+ }
+ }
+
+ in.close();
+ }
+
+ if (emptySortFound)
+ {
+ addErrorMessage(invoker.getLabel("error.empty_sort"));
+ }
+
+ boolean deprecated = false;
+ boolean depCheck = false;
+
+ if (gloFile.exists())
+ {
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(gloFile), charset));
+
+ while ((line = in.readLine()) != null)
+ {
+ Matcher matcher;
+
+ boolean retry = false;
+
+ if (depCheck)
+ {
+ matcher = (deprecated ? makeindexOldEntryPattern.matcher(line):
+ xindyEntryPattern.matcher(line));
+ }
+ else
+ {
+ matcher = xindyEntryPattern.matcher(line);
+
+ depCheck = true;
+
+ if (!matcher.matches())
+ {
+ matcher = xindyOldEntryPattern.matcher(line);
+ retry = true;
+ }
+ }
+
+ if (matcher.matches())
+ {
+ if (retry)
+ {
+ deprecated = true;
+ }
+
+ String sort = matcher.group(1);
+ String key = matcher.group(2);
+
+ GlossaryEntry entry = entryTable.get(key);
+
+ if (entry == null)
+ {
+ sort = sort.replaceAll("\\\\\\\\", "\\\\");
+ entry = new GlossaryEntry(key, sort);
+ entryTable.put(key, entry);
+
+ if (emptySortFound)
+ {
+ matcher = xindyEmptySortPattern.matcher(sort);
+
+ if (matcher.matches())
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.empty_sort",
+ sort, key));
+ entry.setHasProblem(true);
+ }
+ }
+ }
+
+ entry.increment();
+ }
+ }
+
+ in.close();
+ }
+
+ if (deprecated)
+ {
+ addDiagnosticMessage(invoker.getLabel("diagnostics.deprecated"));
+ }
+
+ if (exitCode > 0)
+ {
+ addErrorMessage(invoker.getLabelWithValues("error.app_failed",
+ "Xindy", ""+exitCode));
+
+ if (unknownVar != null)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues
+ ("diagnostics.bad_attributes", istName, "xindy"));
+ }
+ else if (unknownMod != null)
+ {
+ addDiagnosticMessage(unknownMod);
+ }
+ else if (processErrors != null)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.app_err",
+ "Xindy", processErrors.toString()));
+ }
+ else
+ {
+ addDiagnosticMessage(invoker.getLabel("diagnostics.app_err_null"));
+ }
+ }
+ else if (entryTable.size() == 0)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.no_entries", label));
+ }
+ }
+
+ public void makeindex(File dir, String baseName,
+ boolean isWordOrder, String istName, Vector<String> extra)
+ throws IOException,InterruptedException,GlossaryException
+ {
+ File makeindexApp = new File(invoker.getMakeIndexApp());
+
+ if (!makeindexApp.exists())
+ {
+ throw new GlossaryException(invoker.getLabelWithValues(
+ "error.no_indexer_app",
+ "makeindex", makeindexApp.getAbsolutePath()),
+ invoker.getLabelWithValues("diagnostics.no_indexer", "makeindex"));
+ }
+
+ String transFileName = baseName+"."+transExt;
+
+ File gloFile = new File(dir, baseName+"."+gloExt);
+
+ String[] cmdArray;
+
+ int n = (extra == null ? 0 : extra.size());
+
+ if (isWordOrder)
+ {
+ cmdArray = new String[8+n];
+ int idx = 0;
+ cmdArray[idx++] = makeindexApp.getAbsolutePath();
+ cmdArray[idx++] = "-s";
+ cmdArray[idx++] = istName;
+ cmdArray[idx++] = "-t";
+ cmdArray[idx++] = transFileName;
+ cmdArray[idx++] = "-o";
+ cmdArray[idx++] = baseName+"."+glsExt;
+
+ for (int i = 0; i < n; i++)
+ {
+ cmdArray[idx++] = extra.get(i);
+ }
+
+ cmdArray[idx++] = gloFile.getName();
+ }
+ else
+ {
+ cmdArray = new String[9+n];
+ int idx = 0;
+ cmdArray[idx++] = makeindexApp.getAbsolutePath();
+ cmdArray[idx++] = "-l";
+ cmdArray[idx++] = "-s";
+ cmdArray[idx++] = istName;
+ cmdArray[idx++] = "-t";
+ cmdArray[idx++] = transFileName;
+ cmdArray[idx++] = "-o";
+ cmdArray[idx++] = baseName+"."+glsExt;
+
+ for (int i = 0; i < n; i++)
+ {
+ cmdArray[idx++] = extra.get(i);
+ }
+
+ cmdArray[idx++] = gloFile.getName();
+ }
+
+ int exitCode = 0;
+ BufferedReader in = null;
+
+ invoker.getMessageSystem().aboutToExec(cmdArray, dir);
+
+ // makeindex is limited to the range 1 ... 255
+ Charset charset = StandardCharsets.ISO_8859_1;
+ invoker.setEncoding(charset);
+
+ if (invoker.isDryRunMode())
+ {
+ File transFile = new File(dir, transFileName);
+
+ if (transFile.exists())
+ {
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(transFile), charset));
+ }
+ }
+ else
+ {
+ Process p = Runtime.getRuntime().exec(cmdArray, null, dir);
+
+ exitCode = p.waitFor();
+
+ in = new BufferedReader(new InputStreamReader(p.getErrorStream(),
+ charset));
+ }
+
+ String line;
+
+ StringBuilder processErrors = null;
+
+ while (in != null && (line = in.readLine()) != null)
+ {
+ if (processErrors == null)
+ {
+ processErrors = new StringBuilder();
+ }
+
+ processErrors.append(String.format("%n%s", line));
+ }
+
+ in.close();
+
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(new File(dir, transFileName)), charset));
+
+ int numAccepted = 0;
+ int numRejected = 0;
+ String rejected = "";
+
+ int numAttributes = 0;
+ int numIgnored = 0;
+ int numTooLong = 0;
+
+ while ((line = in.readLine()) != null)
+ {
+ Matcher matcher = makeindexAcceptedPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ try
+ {
+ numAccepted = Integer.parseInt(matcher.group(1));
+ rejected = matcher.group(2);
+ numRejected = Integer.parseInt(rejected);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+
+ continue;
+ }
+
+ matcher = makeindexIstAttributePattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ try
+ {
+ numAttributes = Integer.parseInt(matcher.group(1));
+ numIgnored = Integer.parseInt(matcher.group(2));
+ }
+ catch (NumberFormatException e)
+ {
+ }
+
+ continue;
+ }
+
+ matcher = makeindexTooLongPattern.matcher(line);
+
+ if (matcher.matches())
+ {
+ numTooLong++;
+ }
+ }
+
+ in.close();
+
+ boolean deprecated = false;
+ boolean depCheck = false;
+
+ if (gloFile.exists())
+ {
+ in = new BufferedReader(new InputStreamReader(
+ new FileInputStream(gloFile), charset));
+
+ while ((line = in.readLine()) != null)
+ {
+ Matcher matcher;
+ boolean depRetry = false;
+
+ if (depCheck)
+ {
+ matcher = (deprecated ?
+ makeindexOldEntryPattern.matcher(line) :
+ makeindexEntryPattern.matcher(line));
+ }
+ else
+ {
+ matcher = makeindexEntryPattern.matcher(line);
+
+ depCheck = true;
+
+ if (!matcher.matches())
+ {
+ matcher = makeindexOldEntryPattern.matcher(line);
+
+ depRetry = true;
+ }
+ }
+
+ if (matcher.matches())
+ {
+ if (depRetry)
+ {
+ deprecated = true;
+ }
+
+ String sort = matcher.group(1);
+ String key = matcher.group(2);
+
+ GlossaryEntry entry = entryTable.get(key);
+
+ if (entry == null)
+ {
+ entry = new GlossaryEntry(key, sort);
+ entryTable.put(key, entry);
+ }
+
+ entry.increment();
+ }
+ }
+
+ in.close();
+ }
+
+ if (exitCode > 0)
+ {
+ addErrorMessage(invoker.getLabelWithValues("error.app_failed",
+ "Makeindex", exitCode));
+
+ if (processErrors != null)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.app_err",
+ "Makeindex", processErrors.toString()));
+ }
+ else
+ {
+ addDiagnosticMessage(invoker.getLabel("diagnostics.app_err_null"));
+ }
+ }
+ else if (numRejected > 0)
+ {
+ addErrorMessage(invoker.getLabelWithValues("error.entries_rejected",
+ numRejected));
+
+ if (numAccepted == 0)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.makeindex_reject_all", label));
+ }
+
+ if (numIgnored > 0)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues
+ ("diagnostics.bad_attributes", istName, "makeindex"));
+ }
+
+ if (numTooLong > 0)
+ {
+ if (deprecated)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.old_too_long", numTooLong));
+ }
+ else
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.too_long", numTooLong));
+ }
+ }
+ }
+ else if (numAccepted == 0)
+ {
+ if (label.equals("main"))
+ {
+ addDiagnosticMessage(invoker.getLabel(
+ "diagnostics.no_entries_main"));
+ }
+ else
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.no_entries", label));
+ }
+
+ addErrorMessage(invoker.getLabelWithValues("error.no_entries", label));
+ }
+ }
+
+ public int getNumEntries()
+ {
+ return entryTable.size();
+ }
+
+ public String[] getEntryLabels()
+ {
+ int n = entryTable.size();
+
+ String[] array = new String[n];
+
+ int i = 0;
+
+ for (Enumeration<String> en = entryTable.keys(); en.hasMoreElements();)
+ {
+ array[i] = en.nextElement();
+ i++;
+ }
+
+ return array;
+ }
+
+ public Integer getEntryCount(String key)
+ {
+ GlossaryEntry entry = entryTable.get(key);
+
+ return entry == null ? 0 : entry.getCount();
+ }
+
+ public String getEntrySort(String key)
+ {
+ GlossaryEntry entry = entryTable.get(key);
+
+ return entry == null ? null : entry.getSort();
+ }
+
+ public boolean hasProblem(String key)
+ {
+ GlossaryEntry entry = entryTable.get(key);
+
+ return entry == null ? false : entry.hasProblem();
+ }
+
+ public Integer getEntryCount(int entryIdx)
+ {
+ int i = 0;
+
+ for (Enumeration<GlossaryEntry> en = entryTable.elements();
+ en.hasMoreElements();)
+ {
+ GlossaryEntry val = en.nextElement();
+
+ if (i == entryIdx) return val.getCount();
+
+ i++;
+ }
+
+ return 0;
+ }
+
+ public String getEntrySort(int entryIdx)
+ {
+ int i = 0;
+
+ for (Enumeration<GlossaryEntry> en = entryTable.elements();
+ en.hasMoreElements();)
+ {
+ GlossaryEntry val = en.nextElement();
+
+ if (i == entryIdx) return val.getSort();
+
+ i++;
+ }
+
+ return null;
+ }
+
+ public String getEntryLabel(int entryIdx)
+ {
+ int i = 0;
+
+ for (Enumeration<String> en = entryTable.keys(); en.hasMoreElements();)
+ {
+ String key = en.nextElement();
+
+ if (i == entryIdx) return key;
+
+ i++;
+ }
+
+ return null;
+ }
+
+ public int getEntryIdx(String label)
+ {
+ int i = 0;
+
+ for (Enumeration<String> en = entryTable.keys(); en.hasMoreElements();)
+ {
+ String key = en.nextElement();
+
+ if (key.equals(label)) return i;
+
+ i++;
+ }
+
+ return -1;
+ }
+
+ public void setLanguage(String language)
+ {
+ String mappedLang = invoker.getLanguage(language);
+
+ if (!mappedLang.equals(language))
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.mapped_lang", language, mappedLang));
+ this.language = mappedLang;
+ }
+ else
+ {
+ this.language = language;
+ }
+ }
+
+ public void setCodePage(String codepage)
+ {
+ this.codepage = codepage;
+ }
+
+ public String displayCodePage()
+ {
+ return codepage == null ?
+ "<font class=error>"+invoker.getLabel("error.unknown")+"</font>" :
+ codepage;
+ }
+
+ public String displayLanguage()
+ {
+ return language == null ?
+ "<font class=error>"+invoker.getLabel("error.unknown")+"</font>" :
+ language;
+ }
+
+ public void addErrorMessage(String mess)
+ {
+ if (errorMessage == null)
+ {
+ errorMessage = new StringBuilder(mess);
+ }
+ else
+ {
+ errorMessage.append(String.format("%n%s", mess));
+ }
+ }
+
+ public String getErrorMessages()
+ {
+ return errorMessage == null ? null : errorMessage.toString();
+ }
+
+ public String getLanguage()
+ {
+ return language;
+ }
+
+ public String getCodePage()
+ {
+ return codepage;
+ }
+
+ public String getDiagnosticMessages()
+ {
+ return diagnosticMessage == null ? null : diagnosticMessage.toString();
+ }
+
+ public void addDiagnosticMessage(String mess)
+ {
+ if (diagnosticMessage == null)
+ {
+ diagnosticMessage = new StringBuilder(mess);
+ }
+ else
+ {
+ diagnosticMessage.append(String.format("<p>%s", mess));
+ }
+ }
+
+
+ public void checkNonAsciiLabels()
+ {
+ int numFound = 0;
+ StringBuilder builder = null;
+
+ for (Enumeration<String> en=entryTable.keys(); en.hasMoreElements();)
+ {
+ String key = en.nextElement();
+
+ for (int i = 0, n = key.length(); i < n; i++)
+ {
+ int c = key.charAt(i);
+
+ if (c > '|' || c < '!' || c == '#' || c == '$' || c == '&'
+ || c == '\\' || c == '^' || c == '_')
+ {
+ numFound++;
+
+ if (builder == null)
+ {
+ builder = new StringBuilder(key);
+ }
+ else
+ {
+ builder.append(", ");
+ builder.append(key);
+ }
+
+ break;
+ }
+ }
+ }
+
+ if (numFound > 0)
+ {
+ addDiagnosticMessage(invoker.getLabelWithValues(
+ "diagnostics.labels_with_problem_char",
+ numFound, label, builder.toString()));
+ }
+ }
+
+ public String label, transExt, glsExt, gloExt;
+
+ private String language, codepage;
+
+ private StringBuilder errorMessage, diagnosticMessage;
+
+ private Hashtable<String,GlossaryEntry> entryTable;
+
+ private MakeGlossariesInvoker invoker;
+
+ private static final Pattern makeindexAcceptedPattern
+ = Pattern.compile(".*?(\\d+)\\s+entries\\s+accepted.*(\\d+)\\s+rejected.*");
+
+ private static final Pattern makeindexIstAttributePattern
+ = Pattern.compile(".*?(\\d+)\\s+attributes\\s+redefined.*(\\d+).*ignored.*");
+
+ private static final Pattern makeindexTooLongPattern
+ = Pattern.compile("\\s+-- First argument too long \\(max \\d+\\)\\.");
+
+ private static final Pattern xindyIstPattern
+ = Pattern.compile(".*variable (.*) has no value.*");
+
+ private static final Pattern emptySortPattern
+ = Pattern.compile(".*Would replace complete index key by empty string.*");
+
+ private static final Pattern collapsedSortPattern
+ = Pattern.compile(".*index 0 should be less than the length of the string.*");
+
+ private static final Pattern xindyModulePattern
+ = Pattern.compile(".*Cannot\\s+locate\\s+xindy\\s+module\\s+for\\s+language\\s+([a-zA-Z0-9\\-]+)\\s+in\\s+codepage\\s+([a-zA-Z0-9\\-]+)..*");
+
+ private static final Pattern makeindexOldEntryPattern
+ = Pattern.compile("\\\\glossaryentry\\{(.*?)\\?\\\\glossaryentryfield\\{(.*?)\\}.*");
+
+ private static final Pattern makeindexEntryPattern
+ = Pattern.compile("\\\\glossaryentry\\{(.*?)\\?(?:\\\\gls(?:no)?nextpages\\s)?\\\\glossentry\\{(.*?)\\}.*");
+
+ private static final Pattern xindyOldEntryPattern = Pattern.compile(
+ "\\(indexentry\\s+:tkey\\s*\\(\\s*\\(\\s*\"(.*?)\"\\s+\"\\\\\\\\glossaryentryfield\\{(.*?)\\}.*\".*");
+
+ private static final Pattern xindyEntryPattern = Pattern.compile(
+ "\\(indexentry\\s+:tkey\\s*\\(\\s*\\(\\s*\"(.*?)\"\\s+\"(?:\\\\\\\\gls(?:no)?nextpages\\s)?\\\\\\\\glossentry\\{(.*?)\\}.*\".*");
+
+ private static final Pattern xindyEmptySortPattern = Pattern.compile(
+ "(?:\\$|\\{\\\\[a-zA-Z@]+ *\\}|\\\\[a-zA-Z@]+ *)+");
+}
+
+class GlossaryEntry
+{
+ public GlossaryEntry(String label, String sort)
+ {
+ this.label = label;
+ this.sort = sort;
+ this.count = 0;
+ this.hasProblem = false;
+ }
+
+ public void increment()
+ {
+ count++;
+ }
+
+ public int getCount()
+ {
+ return count;
+ }
+
+ public String getSort()
+ {
+ return sort;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public boolean hasProblem()
+ {
+ return hasProblem;
+ }
+
+ public void setHasProblem(boolean hasProblem)
+ {
+ this.hasProblem = hasProblem;
+ }
+
+ private int count = 0;
+ private String label, sort;
+ private boolean hasProblem;
+}
+
diff --git a/support/makeglossariesgui/src/java/GlossaryBatchMessage.java b/support/makeglossariesgui/src/java/GlossaryBatchMessage.java
new file mode 100644
index 0000000000..250c7f7156
--- /dev/null
+++ b/support/makeglossariesgui/src/java/GlossaryBatchMessage.java
@@ -0,0 +1,110 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.File;
+
+public class GlossaryBatchMessage implements GlossaryMessage
+{
+ public GlossaryBatchMessage(MakeGlossariesInvoker invoker)
+ {
+ this.invoker = invoker;
+ }
+
+ public void message(String msg)
+ {
+ if (msg == null)
+ {
+ throw new NullPointerException();
+ }
+
+ if (!invoker.isQuiet())
+ {
+ System.out.println(msg);
+ }
+ }
+
+ public void debug(String msg)
+ {
+ if (msg == null)
+ {
+ throw new NullPointerException();
+ }
+
+ if (invoker.isDebugMode())
+ {
+ System.out.println(msg);
+ }
+ }
+
+ public void debug(Throwable e)
+ {
+ if (invoker.isDebugMode())
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void message(GlossaryException e)
+ {
+ if (!invoker.isQuiet())
+ {
+ System.out.println(e.getMessage());
+
+ String msg = e.getDiagnosticMessage();
+
+ if (msg != null)
+ {
+ System.out.println(msg);
+ }
+
+ if (invoker.isDebugMode())
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void error(Exception e)
+ {
+ System.err.println(e.getMessage());
+ }
+
+ public void error(String message)
+ {
+ if (message == null)
+ {
+ throw new NullPointerException();
+ }
+
+ System.err.println(message);
+ }
+
+ public void showMessages()
+ {
+ }
+
+ public void aboutToExec(String[] cmdArray, File dir)
+ {
+ if (invoker.isDryRunMode() || !invoker.isQuiet())
+ {
+ if (invoker.isDryRunMode())
+ {
+ System.out.println(invoker.getLabel("diagnostics.dry_run"));
+
+ }
+
+ for (int i = 0, n = cmdArray.length-1; i < cmdArray.length; i++)
+ {
+ if (i == n)
+ {
+ System.out.println(String.format("\"%s\"", cmdArray[i]));
+ }
+ else
+ {
+ System.out.print(String.format("\"%s\" ", cmdArray[i]));
+ }
+ }
+ }
+ }
+
+ private MakeGlossariesInvoker invoker;
+}
diff --git a/support/makeglossariesgui/src/java/GlossaryException.java b/support/makeglossariesgui/src/java/GlossaryException.java
new file mode 100644
index 0000000000..5df439f719
--- /dev/null
+++ b/support/makeglossariesgui/src/java/GlossaryException.java
@@ -0,0 +1,33 @@
+package com.dickimawbooks.makeglossariesgui;
+
+public class GlossaryException extends Exception
+{
+ public GlossaryException(String message)
+ {
+ this(message, (String)null);
+ }
+
+ public GlossaryException(String message, String diagnosticMessage)
+ {
+ super(message);
+ diagnostic = diagnosticMessage;
+ }
+
+ public GlossaryException(String message, Throwable cause)
+ {
+ this(message, null, cause);
+ }
+
+ public GlossaryException(String message, String diagnosticMessage, Throwable cause)
+ {
+ super(message, cause);
+ diagnostic = diagnosticMessage;
+ }
+
+ public String getDiagnosticMessage()
+ {
+ return diagnostic;
+ }
+
+ private String diagnostic;
+}
diff --git a/support/makeglossariesgui/src/java/GlossaryMessage.java b/support/makeglossariesgui/src/java/GlossaryMessage.java
new file mode 100644
index 0000000000..910dbd9130
--- /dev/null
+++ b/support/makeglossariesgui/src/java/GlossaryMessage.java
@@ -0,0 +1,15 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.File;
+
+public interface GlossaryMessage
+{
+ public void message(String msg);
+ public void message(GlossaryException e);
+ public void debug(String msg);
+ public void debug(Throwable e);
+ public void error(Exception e);
+ public void error(String message);
+ public void showMessages();
+ public void aboutToExec(String[] cmdArray, File dir);
+}
diff --git a/support/makeglossariesgui/src/java/GlsTransferHandler.java b/support/makeglossariesgui/src/java/GlsTransferHandler.java
new file mode 100644
index 0000000000..1d39af46d6
--- /dev/null
+++ b/support/makeglossariesgui/src/java/GlsTransferHandler.java
@@ -0,0 +1,69 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.util.ArrayList;
+import java.io.File;
+import java.io.IOException;
+import java.awt.datatransfer.*;
+import javax.swing.TransferHandler;
+
+public class GlsTransferHandler extends TransferHandler
+{
+ public GlsTransferHandler(MakeGlossariesGUI application)
+ {
+ super();
+ this.app = application;
+ }
+
+ public boolean canImport(TransferHandler.TransferSupport support)
+ {
+ int action = support.getDropAction();
+
+ if (action != COPY && action != COPY_OR_MOVE)
+ {
+ return false;
+ }
+
+ return support.isDataFlavorSupported(DataFlavor.javaFileListFlavor);
+ }
+
+ public boolean importData(TransferHandler.TransferSupport support)
+ {
+ int action = support.getDropAction();
+
+ if (action != COPY && action != COPY_OR_MOVE)
+ {
+ return false;
+ }
+
+ if (!support.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
+ {
+ return false;
+ }
+
+ Transferable t = support.getTransferable();
+
+ try
+ {
+ Object data = t.getTransferData(DataFlavor.javaFileListFlavor);
+
+ @SuppressWarnings("unchecked")
+ ArrayList<File> list = (ArrayList<File>)data;
+
+ if (list.isEmpty())
+ {
+ return false;
+ }
+
+ app.load(list.get(0));
+ }
+ catch (Exception e)
+ {
+ app.debug(e);
+ return false;
+ }
+
+ return true;
+ }
+
+ private MakeGlossariesGUI app;
+}
diff --git a/support/makeglossariesgui/src/java/InvalidSyntaxException.java b/support/makeglossariesgui/src/java/InvalidSyntaxException.java
new file mode 100644
index 0000000000..ae7e8eb51d
--- /dev/null
+++ b/support/makeglossariesgui/src/java/InvalidSyntaxException.java
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2018 Nicola L.C. Talbot
+ www.dickimaw-books.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+package com.dickimawbooks.makeglossariesgui;
+
+/**
+ * Exception thrown when encountering invalid syntax.
+ */
+public class InvalidSyntaxException extends java.io.IOException
+{
+ public InvalidSyntaxException(String message)
+ {
+ super(message);
+ }
+
+ public InvalidSyntaxException(String message, Throwable e)
+ {
+ super(message, e);
+ }
+}
diff --git a/support/makeglossariesgui/src/java/MakeGlossariesDictionary.java b/support/makeglossariesgui/src/java/MakeGlossariesDictionary.java
new file mode 100644
index 0000000000..98540e256c
--- /dev/null
+++ b/support/makeglossariesgui/src/java/MakeGlossariesDictionary.java
@@ -0,0 +1,187 @@
+/*
+ Copyright (C) 2018 Nicola L.C. Talbot
+ www.dickimaw-books.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+package com.dickimawbooks.makeglossariesgui;
+
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.Iterator;
+import java.text.MessageFormat;
+import java.text.ChoiceFormat;
+
+public class MakeGlossariesDictionary extends Hashtable<String,MessageFormat>
+{
+ public MakeGlossariesDictionary(Properties props) throws InvalidSyntaxException
+ {
+ super(props.isEmpty() ? 10 : props.size());
+
+ init(props);
+ }
+
+ private void init(Properties props) throws InvalidSyntaxException
+ {
+ Iterator<Object> it = props.keySet().iterator();
+
+ while (it.hasNext())
+ {
+ Object key = it.next();
+
+ try
+ {
+ String message = (String)props.get(key);
+ int n = message.length();
+
+ StringBuilder builder = new StringBuilder(n);
+ StringBuilder csBuilder = null;
+
+ for (int i = 0; i < n; )
+ {
+ int cp = message.codePointAt(i);
+ i += Character.charCount(cp);
+
+ if (csBuilder != null)
+ {
+ if (cp == '|')
+ {
+ builder.append('\\');
+ builder.append(csBuilder);
+ csBuilder = null;
+ }
+ else if (Character.isAlphabetic(cp))
+ {
+ csBuilder.appendCodePoint(cp);
+ }
+ else
+ {
+ builder.append('|');
+ builder.append(csBuilder);
+ builder.appendCodePoint(cp);
+ csBuilder = null;
+ }
+ }
+ else if (cp == '\\' && i < n)
+ {
+ int nextCp = message.codePointAt(i);
+ i += Character.charCount(nextCp);
+
+ if (nextCp == 'n')
+ {
+ builder.append(String.format("%n"));
+ }
+ else if (nextCp == 't')
+ {
+ builder.append('\t');
+ }
+ else
+ {
+ builder.appendCodePoint(nextCp);
+ }
+ }
+ else if (cp == '|')
+ {
+ csBuilder = new StringBuilder();
+ }
+ else
+ {
+ builder.appendCodePoint(cp);
+ }
+ }
+
+ if (csBuilder != null)
+ {
+ builder.append('|');
+ builder.append(csBuilder);
+ }
+
+ put((String)key, new MessageFormat(builder.toString()));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new InvalidSyntaxException(
+ String.format(
+ "Property '%s': Invalid message format: %s",
+ key, e.getMessage()),
+ e);
+ }
+ }
+ }
+
+ public String getMessageIfExists(String label, Object... args)
+ {
+ MessageFormat msg = get(label);
+
+ if (msg == null)
+ {
+ return null;
+ }
+
+ return msg.format(args);
+ }
+
+ public String getMessage(String label, Object... args)
+ {
+ MessageFormat msg = get(label);
+
+ if (msg == null)
+ {
+ throw new IllegalArgumentException(
+ "Invalid message label: "+label);
+ }
+
+ return msg.format(args);
+ }
+
+
+ public String getChoiceMessage(String label, int argIdx,
+ String choiceLabel, int numChoices, Object... args)
+ {
+ String[] part = new String[numChoices];
+
+ double[] limits = new double[numChoices];
+
+ for (int i = 0; i < numChoices; i++)
+ {
+ String tag = String.format("message.%d.%s", i, choiceLabel);
+
+ MessageFormat fmt = get(tag);
+
+ if (fmt == null)
+ {
+ throw new IllegalArgumentException(
+ "Invalid message label: "+tag);
+ }
+
+ part[i] = fmt.toPattern();
+ limits[i] = i;
+ }
+
+ MessageFormat fmt = get(label);
+
+ if (fmt == null)
+ {
+ throw new IllegalArgumentException(
+ "Invalid message label: "+label);
+ }
+
+ ChoiceFormat choiceFmt = new ChoiceFormat(limits, part);
+
+ fmt.setFormatByArgumentIndex(argIdx, choiceFmt);
+
+ return fmt.format(args);
+ }
+}
diff --git a/support/makeglossariesgui/src/java/MakeGlossariesGUI.java b/support/makeglossariesgui/src/java/MakeGlossariesGUI.java
new file mode 100644
index 0000000000..4fa64a1455
--- /dev/null
+++ b/support/makeglossariesgui/src/java/MakeGlossariesGUI.java
@@ -0,0 +1,1493 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.net.*;
+import java.util.*;
+import java.util.regex.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.datatransfer.*;
+
+import javax.swing.*;
+import javax.swing.text.*;
+import javax.swing.text.html.*;
+import javax.swing.event.*;
+import javax.help.*;
+
+public class MakeGlossariesGUI extends JFrame
+ implements ActionListener,MenuListener,GlossaryMessage,
+ HyperlinkListener,MouseListener
+{
+ public MakeGlossariesGUI(MakeGlossariesInvoker invoker)
+ {
+ super(invoker.APP_NAME);
+ this.invoker = invoker;
+
+ invoker.setMessageSystem(this);
+
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+
+ addWindowListener(new WindowAdapter()
+ {
+ public void windowClosing(WindowEvent evt)
+ {
+ quit();
+ }
+ });
+
+ setIconImage(new ImageIcon(getClass().getResource(
+ "/resources/icons/makeglossariesgui-logosmall.png")).getImage());
+
+ try
+ {
+ initTemplates();
+ }
+ catch (IOException e)
+ {
+ error(this, e.getMessage());
+ }
+
+ setTransferHandler(new GlsTransferHandler(this));
+
+ toolBar = new JToolBar(invoker.getProperties().getToolBarOrientation());
+ getContentPane().add(toolBar,
+ invoker.getProperties().getToolBarPosition());
+
+ JMenuBar mBar = new JMenuBar();
+ setJMenuBar(mBar);
+
+ JMenu fileM = createMenu("file");
+ mBar.add(fileM);
+
+ recentM = createMenu("file", "recent");
+ recentM.addMenuListener(this);
+ fileM.add(recentM);
+
+ fileM.add(createMenuButtonItem("file", "open",
+ KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK),
+ "general/Open24"));
+ fileM.add(createMenuButtonItem("file", "reload",
+ KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK),
+ "general/Refresh24"));
+ fileM.add(createMenuItem("file", "quit",
+ KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_MASK)));
+
+ JMenu settingsM = createMenu("settings");
+ mBar.add(settingsM);
+
+ settingsM.add(createMenuButtonItem("settings", "incsize",
+ KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK),
+ "general/ZoomIn24"));
+
+ settingsM.add(createMenuButtonItem("settings", "decsize",
+ KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK),
+ "general/ZoomOut24"));
+
+ dryRunItem = createCheckBoxMenuItem("settings", "dryrun",
+ invoker.isDryRunMode());
+
+ settingsM.add(dryRunItem);
+
+ settingsM.add(createMenuButtonItem("settings", "editproperties",
+ KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK),
+ "general/Preferences24"));
+
+ initHelp();
+
+ JMenu helpM = createMenu("help");
+ mBar.add(helpM);
+
+ helpM.add(createMenuItem("help", "about"));
+ helpM.add(createMenuItem("help", "license"));
+ helpM.add(createMenuButtonItem("help", "manual",
+ KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0),
+ "general/Help24", csh));
+
+ tabbedPane = new JTabbedPane();
+ getContentPane().add(tabbedPane, "Center");
+
+ try
+ {
+ mainPanel = new GlossariesPanel(this);
+ }
+ catch (Exception e)
+ {
+ fatalError(e);
+ }
+
+ mainPanel.setTransferHandler(getTransferHandler());
+
+ scrollPane = new JScrollPane(mainPanel);
+ scrollPane.setPreferredSize(new Dimension(800,600));
+
+ setFont(new Font(invoker.getProperties().getFontName(),
+ invoker.getProperties().getFontStyle(),
+ invoker.getProperties().getFontSize()));
+
+ scrollPane.setName(getLabel("main.title"));
+ tabbedPane.add(scrollPane, 0);
+ tabbedPane.setMnemonicAt(0, getMnemonic("main.title"));
+
+ diagnosticArea = new DiagnosticPanel(this);
+
+ diagnosticSP = new JScrollPane(diagnosticArea);
+
+ diagnosticSP.setName(getLabel("diagnostics.title"));
+ tabbedPane.add(diagnosticSP, 1);
+ tabbedPane.setMnemonicAt(1, getMnemonic("diagnostics.title"));
+
+ popupM = new JPopupMenu();
+
+ popupM.add(createMenuItem("popup", "select_all"));
+
+ copyItem = createMenuItem("popup", "copy");
+ popupM.add(copyItem);
+
+ addMouseListener(this);
+
+ ActionMap actionMap = tabbedPane.getActionMap();
+ InputMap inputMap = tabbedPane.getInputMap(
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+
+ inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_CONTEXT_MENU, 0),
+ "popup");
+ inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10,
+ InputEvent.SHIFT_DOWN_MASK),
+ "popup");
+ actionMap.put("popup", new AbstractAction()
+ {
+ public void actionPerformed(ActionEvent evt)
+ {
+ showPopup();
+ }
+ });
+
+ AbstractAction copyAction = new AbstractAction("copy")
+ {
+ public void actionPerformed(ActionEvent evt)
+ {
+ // omit html when copying
+
+ JTextComponent textComp = getSelectedTextComponent();
+
+ if (textComp != null)
+ {
+ StringSelection sel = new StringSelection(
+ textComp.getSelectedText());
+ Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
+ cb.setContents(sel, null);
+ }
+ }
+ };
+
+ actionMap.put("copy", copyAction);
+ diagnosticArea.getActionMap().put("copy", copyAction);
+ mainPanel.getActionMap().put("copy", copyAction);
+
+ fileChooser = new JFileChooser(
+ invoker.getProperties().getDefaultDirectory());
+
+ auxFileFilter = new AuxFileFilter(getLabel("filter.aux"));
+
+ try
+ {
+ // why does this sometimes throw a concurrent exception?
+ // It's running on the EDT. Perhaps related to bug:
+ // https://bugs.openjdk.java.net/browse/JDK-8068244
+
+ fileChooser.setFileFilter(auxFileFilter);
+ }
+ catch (java.util.ConcurrentModificationException e)
+ {
+ invoker.getMessageSystem().debug(e);
+ }
+
+ propertiesDialog = new PropertiesDialog(this);
+
+ appSelector = new AppSelector(this);
+
+ pack();
+ diagnosticArea.updateDiagnostics();
+
+ setLocationRelativeTo(null);
+ setVisible(true);
+
+ String xindy = getXindyApp();
+ String makeindex = getMakeIndexApp();
+
+ if ((xindy == null || xindy.equals(""))
+ &&(makeindex == null || makeindex.equals("")))
+ {
+ File file = findApplication("makeindex");
+
+ if (file != null)
+ {
+ invoker.getProperties().setMakeIndexApp(file);
+ propertiesDialog.setMakeIndex(file);
+ }
+
+ file = findApplication("xindy");
+
+ if (file != null)
+ {
+ invoker.getProperties().setXindyApp(file);
+ propertiesDialog.setXindy(file);
+ }
+ }
+
+ if (invoker.getFileName() != null)
+ {
+ load(invoker.getFile());
+ }
+ }
+
+ public File findApplication(String name)
+ {
+ return invoker.findApp(name);
+ }
+
+ public File findApplication(String name, String altName, String altName2)
+ {
+ return invoker.findApp(name, altName, altName2);
+ }
+
+ public void hyperlinkUpdate(HyperlinkEvent evt)
+ {
+ Desktop desktop = Desktop.isDesktopSupported() ?
+ Desktop.getDesktop() : null;
+
+ if (desktop == null)
+ {
+ debug("desktop not supported");
+ return;
+ }
+
+ HyperlinkEvent.EventType type = evt.getEventType();
+
+ if (evt instanceof FormSubmitEvent)
+ {
+ if (type == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ // The data should only consist of one name=value
+ // and only the name is important.
+
+ String data = ((FormSubmitEvent)evt).getData();
+
+ if (data.startsWith("makeglossaries-lite="))
+ {
+ testMakeGlossariesLite();
+ }
+ else if (data.startsWith("makeglossaries="))
+ {
+ testMakeGlossaries();
+ }
+ else if (data.startsWith("cleartestresults="))
+ {
+ makeglossariesTestResults=null;
+ makeglossariesLiteTestResults=null;
+ updateDiagnostics();
+ }
+ else
+ {
+ error(invoker.getLabel("error.invalid_query", data));
+ }
+ }
+
+ return;
+ }
+
+ URL url = evt.getURL();
+
+ if (url == null)
+ {
+ return;
+ }
+
+ Object source = evt.getSource();
+
+ if (type == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ if (desktop.isSupported(Desktop.Action.BROWSE))
+ {
+ try
+ {
+ desktop.browse(url.toURI());
+ }
+ catch (Exception e)
+ {
+ debug(e);
+ }
+ }
+ }
+ else if (type == HyperlinkEvent.EventType.ENTERED)
+ {
+ if (source instanceof JComponent)
+ {
+ ((JComponent)source).setToolTipText(url.toString());
+ }
+ }
+ else if (type == HyperlinkEvent.EventType.EXITED)
+ {
+ if (source instanceof JComponent)
+ {
+ ((JComponent)source).setToolTipText(null);
+ }
+ }
+ }
+
+ public JTextComponent getSelectedTextComponent()
+ {
+ Component tab = tabbedPane.getSelectedComponent();
+
+ if (tab instanceof JScrollPane)
+ {
+ tab = ((JScrollPane)tab).getViewport().getView();
+ }
+
+ if (tab instanceof JTextComponent)
+ {
+ return (JTextComponent)tab;
+ }
+
+ return null;
+ }
+
+ public void showPopup()
+ {
+ JTextComponent textComp = getSelectedTextComponent();
+
+ if (textComp != null)
+ {
+ copyItem.setEnabled(textComp.getSelectedText() != null);
+
+ int x = 0;
+ int y = 0;
+
+ try
+ {
+ Point p = textComp.getMousePosition();
+
+ if (p != null)
+ {
+ x = (int)p.getX();
+ y = (int)p.getY();
+ }
+ }
+ catch (HeadlessException e)
+ {
+ debug(e);
+ }
+
+ popupM.show(textComp, x, y);
+ }
+ }
+
+ public void showPopup(Component comp, int x, int y)
+ {
+ JTextComponent textComp = getSelectedTextComponent();
+
+ if (textComp != null)
+ {
+ copyItem.setEnabled(textComp.getSelectedText() != null);
+
+ popupM.show(comp, x, y);
+ }
+ }
+
+ public void mousePressed(MouseEvent evt)
+ {
+ checkForPopupTrigger(evt);
+ }
+
+ public void mouseReleased(MouseEvent evt)
+ {
+ checkForPopupTrigger(evt);
+ }
+
+ public void mouseExited(MouseEvent evt)
+ {
+ }
+
+ public void mouseEntered(MouseEvent evt)
+ {
+ }
+
+ public void mouseClicked(MouseEvent evt)
+ {
+ }
+
+ private boolean checkForPopupTrigger(MouseEvent evt)
+ {
+ if (evt.isPopupTrigger())
+ {
+ showPopup(evt.getComponent(), evt.getX(), evt.getY());
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public void actionPerformed(ActionEvent evt)
+ {
+ String action = evt.getActionCommand();
+
+ if (action == null) return;
+
+ try
+ {
+ int idx = Integer.parseInt(action);
+
+ File file = new File(invoker.getProperties().getRecentFileName(idx));
+
+ fileChooser.setCurrentDirectory(file.getParentFile());
+
+ load(file);
+
+ return;
+ }
+ catch (NumberFormatException e)
+ {
+ }
+
+ if (action.equals("open"))
+ {
+ if (fileChooser.showOpenDialog(this)
+ == JFileChooser.APPROVE_OPTION)
+ {
+ load(fileChooser.getSelectedFile());
+ }
+ }
+ else if (action.equals("reload"))
+ {
+ reload();
+ }
+ else if (action.equals("quit"))
+ {
+ quit();
+ }
+ else if (action.equals("incsize"))
+ {
+ Font font = getFont();
+
+ int size = font.getSize()+1;
+
+ invoker.getProperties().setFontSize(size);
+ propertiesDialog.updateFontSize(size);
+
+ updateFont();
+ }
+ else if (action.equals("decsize"))
+ {
+ Font font = getFont();
+ int size = font.getSize()-1;
+
+ if (size < 2)
+ {
+ return;
+ }
+
+ invoker.getProperties().setFontSize(size);
+ propertiesDialog.updateFontSize(size);
+
+ updateFont();
+ }
+ else if (action.equals("dryrun"))
+ {
+ invoker.setDryRunMode(dryRunItem.isSelected());
+ }
+ else if (action.equals("editproperties"))
+ {
+ propertiesDialog.display();
+ }
+ else if (action.equals("select_all"))
+ {
+ JTextComponent textComp = getSelectedTextComponent();
+
+ if (textComp != null)
+ {
+ textComp.requestFocusInWindow();
+ textComp.selectAll();
+ }
+ }
+ else if (action.equals("copy"))
+ {
+ JTextComponent textComp = getSelectedTextComponent();
+
+ if (textComp != null)
+ {
+ textComp.requestFocusInWindow();
+ textComp.copy();
+ }
+ }
+ else if (action.equals("about"))
+ {
+ String[] str;
+
+ String translator = getLabelOrDef("about.translator_info", null);
+
+ if (translator == null || translator.equals(""))
+ {
+ str = new String[]
+ {
+ invoker.APP_NAME,
+ getLabelWithValues("about.version", invoker.APP_VERSION,
+ invoker.APP_DATE),
+ getLabelWithValues("about.copyright", "Nicola L. C. Talbot",
+ String.format("2011-%s", invoker.APP_DATE.substring(0,4))),
+ "http://www.dickimaw-books.com/"
+ };
+ }
+ else
+ {
+ str = new String[]
+ {
+ invoker.APP_NAME,
+ getLabelWithValues("about.version", invoker.APP_VERSION,
+ invoker.APP_DATE),
+ getLabelWithValues("about.copyright", "Nicola L. C. Talbot",
+ String.format("2011-%s", invoker.APP_DATE.substring(0,4))),
+ "http://www.dickimaw-books.com/",
+ translator
+ };
+ }
+
+ JOptionPane.showMessageDialog(this, str,
+ getLabelWithValues("about.title", invoker.APP_NAME),
+ JOptionPane.PLAIN_MESSAGE);
+ }
+ else if (action.equals("license"))
+ {
+ URL url = getClass().getResource("/resources/LICENSE");
+
+ if (url != null)
+ {
+ try
+ {
+ new ViewFile(url, getFont(), this).setVisible(true);
+ }
+ catch (Exception e)
+ {
+ error(this, e.getMessage());
+ }
+ }
+ else
+ {
+ error(this, "Can't locate resources/LICENSE");
+ }
+ }
+ }
+
+ public void menuSelected(MenuEvent evt)
+ {
+ Object source = evt.getSource();
+
+ if (source == recentM)
+ {
+ invoker.getProperties().setRecentFiles(recentM, this);
+ }
+ }
+
+ public void menuDeselected(MenuEvent evt)
+ {
+ }
+
+ public void menuCanceled(MenuEvent evt)
+ {
+ }
+
+ public void quit()
+ {
+ try
+ {
+ MakeGlossariesProperties properties = invoker.getProperties();
+
+ properties.setToolBarPosition((String)
+ ((BorderLayout)getContentPane().getLayout()).getConstraints(toolBar));
+ properties.setToolBarOrientation(toolBar.getOrientation());
+ properties.save(this);
+ }
+ catch (IOException e)
+ {
+ error(this, "Unable to save properties:\n"+e.getMessage());
+ }
+
+ System.exit(0);
+ }
+
+ public void load(File file)
+ {
+ String lc = file.getName().toLowerCase();
+
+ if (lc.endsWith(".tex") || lc.endsWith(".log"))
+ {
+ int idx = file.getName().length()-4;
+
+ file = new File(file.getParentFile(),
+ file.getName().substring(0,idx)+".aux");
+ }
+
+ setTitle(getLabelWithValues("app.title",
+ invoker.APP_NAME, file.getName()));
+
+ invoker.setFile(file);
+ invoker.getProperties().addRecentFile(file.getAbsolutePath());
+ reload(file);
+ }
+
+ public void reload()
+ {
+ reload(invoker.getFile());
+ }
+
+ public void reload(final File file)
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ invoker.reload(file);
+ }
+ });
+ }
+
+ public void updateFont()
+ {
+ MakeGlossariesProperties properties = invoker.getProperties();
+ setFont(new Font(properties.getFontName(),
+ properties.getFontStyle(), properties.getFontSize()));
+
+ updateAll();
+ }
+
+ public void updateAll()
+ {
+ Component comp = tabbedPane.getSelectedComponent();
+ updateDiagnostics();
+ tabbedPane.setSelectedComponent(comp);
+
+ try
+ {
+ mainPanel.updateInfo();
+ }
+ catch (Exception e)
+ {
+ error(e);
+ }
+ }
+
+ public void updateDiagnostics()
+ {
+ diagnosticArea.updateDiagnostics();
+ }
+
+ private JMenu createMenu(String label)
+ {
+ return createMenu(null, label);
+ }
+
+ private JMenu createMenu(String parentLabel, String label)
+ {
+ JMenu menu = new JMenu(getLabel(parentLabel, label));
+ menu.setMnemonic(getMnemonic(parentLabel, label));
+
+ return menu;
+ }
+
+ private JMenuItem createMenuItem(String parentLabel, String label)
+ {
+ return createMenuItem(parentLabel, label, null, null, this);
+ }
+
+ private JMenuItem createMenuItem(String parentLabel, String label, KeyStroke keyStroke)
+ {
+ return createMenuItem(parentLabel, label, keyStroke, null, this);
+ }
+
+ private JMenuItem createMenuItem(String parentLabel, String label, String tooltip)
+ {
+ return createMenuItem(parentLabel, label, null, tooltip, this);
+ }
+
+ private JMenuItem createMenuItem(String parentLabel, String label,
+ KeyStroke keyStroke, String tooltip)
+ {
+ return createMenuItem(parentLabel, label, keyStroke, tooltip, this);
+ }
+
+ private JMenuItem createMenuItem(String parentLabel, String label,
+ KeyStroke keyStroke, String tooltip, ActionListener listener)
+ {
+ JMenuItem item = new JMenuItem(getLabel(parentLabel, label));
+ item.setMnemonic(getMnemonic(parentLabel, label));
+ item.setActionCommand(label);
+
+ if (listener != null)
+ {
+ item.addActionListener(listener);
+ }
+
+ if (keyStroke != null)
+ {
+ item.setAccelerator(keyStroke);
+ }
+
+ if (tooltip != null)
+ {
+ item.setToolTipText(tooltip);
+ }
+
+ return item;
+ }
+
+ private JMenuItem createMenuButtonItem(String parentLabel, String label,
+ KeyStroke keyStroke, String imageName)
+ {
+ return createMenuButtonItem(parentLabel, label, keyStroke, imageName, this);
+ }
+
+ private JMenuItem createMenuButtonItem(String parentLabel, String label,
+ KeyStroke keyStroke, String imageName, ActionListener listener)
+ {
+ String tooltip = getLabelOrDef(parentLabel+"."+label+".tooltip",
+ null);
+ String altText = getLabelOrDef(parentLabel+"."+label+".altText", null);
+
+ JMenuItem item = createMenuItem(parentLabel, label, keyStroke, tooltip, listener);
+
+ String imgLocation = "/toolbarButtonGraphics/"+imageName+".gif";
+
+ URL imageURL = getClass().getResource(imgLocation);
+
+ JButton button = new JButton();
+ button.setActionCommand(label);
+
+ if (listener != null)
+ {
+ button.addActionListener(listener);
+ }
+
+ if (tooltip != null)
+ {
+ button.setToolTipText(tooltip);
+ }
+
+ if (imageURL != null)
+ {
+ button.setIcon(new ImageIcon(imageURL, altText));
+ }
+ else
+ {
+ button.setText(altText);
+ error(this, "Resource not found:\n"+imgLocation);
+ }
+
+ toolBar.add(button);
+
+ return item;
+ }
+
+ private JCheckBoxMenuItem createCheckBoxMenuItem(String parentLabel,
+ String label, boolean isSelected)
+ {
+ return createCheckBoxMenuItem(parentLabel, label, null, null, this,
+ isSelected);
+ }
+
+ private JCheckBoxMenuItem createCheckBoxMenuItem(String parentLabel,
+ String label, KeyStroke keyStroke, String tooltip,
+ ActionListener listener, boolean isSelected)
+ {
+ JCheckBoxMenuItem item = new JCheckBoxMenuItem(
+ getLabel(parentLabel, label), isSelected);
+ item.setMnemonic(getMnemonic(parentLabel, label));
+ item.setActionCommand(label);
+
+ if (listener != null)
+ {
+ item.addActionListener(listener);
+ }
+
+ if (keyStroke != null)
+ {
+ item.setAccelerator(keyStroke);
+ }
+
+ if (tooltip != null)
+ {
+ item.setToolTipText(tooltip);
+ }
+
+ return item;
+ }
+
+ public MakeGlossariesInvoker getInvoker()
+ {
+ return invoker;
+ }
+
+ public String getLabelOrDef(String label, String def)
+ {
+ return invoker.getLabelOrDef(label, def);
+ }
+
+ public String getLabel(String label)
+ {
+ return invoker.getLabel(label);
+ }
+
+ public String getLabel(String parent, String label)
+ {
+ return invoker.getLabel(parent, label);
+ }
+
+ public int getMnemonic(String label)
+ {
+ return invoker.getMnemonic(label);
+ }
+
+ public int getMnemonic(String parent, String label)
+ {
+ return invoker.getMnemonic(parent, label);
+ }
+
+ public String getLabelWithValues(String label, Object... args)
+ {
+ return invoker.getLabelWithValues(label, args);
+ }
+
+ public String getDefaultLanguage()
+ {
+ return invoker.getDefaultLanguage();
+ }
+
+ public String getDefaultCodePage()
+ {
+ return invoker.getDefaultCodePage();
+ }
+
+ public JButton createActionButton(String label, ActionListener listener,
+ KeyStroke keyStroke, String toolTipText)
+ {
+ JButton button = new JButton(getLabel("button", label));
+ button.setMnemonic(getMnemonic("button", label));
+ button.setActionCommand(label);
+
+ if (listener != null)
+ {
+ button.addActionListener(listener);
+
+ if (keyStroke != null)
+ {
+ button.registerKeyboardAction(listener, label, keyStroke,
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+ }
+ }
+
+ if (toolTipText != null)
+ {
+ button.setToolTipText(toolTipText);
+ }
+
+ return button;
+ }
+
+ public JButton createOkayButton(ActionListener listener)
+ {
+ return createActionButton("okay", listener,
+ KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null);
+ }
+
+ public JButton createCancelButton(ActionListener listener)
+ {
+ return createActionButton("cancel", listener,
+ KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), null);
+ }
+
+ private void testMakeGlossaries()
+ {
+ makeglossariesTestResults=null;
+
+ StringBuilder results = new StringBuilder();
+
+ try
+ {
+ int exitCode = testApplication("perl", "perl.exe", null, results);
+
+ if (exitCode == -1)
+ {
+ results.append(invoker.getLabelWithValues("error.no_perl",
+ "makeglossaries"));
+ }
+ else
+ {
+ results.append("<p>");
+
+ exitCode = testApplication("makeglossaries", "makeglossaries.exe",
+ "makeglossaries.bat", results);
+
+ if (exitCode == -1)
+ {
+ results.append(invoker.getLabelWithValues(
+ "error.no_makeglossaries", "makeglossaries"));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ results.append("<p>");
+ results.append(invoker.escapeHTML(e.getMessage()));
+ }
+
+ makeglossariesTestResults=results.toString();
+
+ updateDiagnostics();
+ }
+
+ private void testMakeGlossariesLite()
+ {
+ makeglossariesLiteTestResults=null;
+ StringBuilder results = new StringBuilder();
+
+ try
+ {
+ int exitCode = testApplication("makeglossaries-lite",
+ "makeglossaries-lite.exe", "makeglossaries-lite.lua", results);
+
+ if (exitCode == -1)
+ {
+ results.append(invoker.getLabelWithValues(
+ "error.no_makeglossaries", "makeglossaries-lite"));
+ results.append(invoker.getLabelWithValues(
+ "diagnostics.at_least_version", "4.16", "glossaries.sty"));
+ }
+ }
+ catch (Exception e)
+ {
+ results.append("<p>");
+ results.append(invoker.escapeHTML(e.getMessage()));
+ }
+
+ makeglossariesLiteTestResults=results.toString();
+
+ updateDiagnostics();
+ }
+
+ private int testApplication(String name, String altName1, String altName2,
+ StringBuilder results)
+ throws IOException,InterruptedException
+ {
+ File file = invoker.findApp(name, altName1, altName2);
+
+ if (file == null)
+ {
+ results.append(invoker.getLabelWithValues("error.missing_application",
+ name));
+ results.append("<p>");
+ return -1;
+ }
+
+ results.append(String.format("%s --version<p>", file));
+
+ ProcessBuilder pb = new ProcessBuilder(file.getAbsolutePath(),
+ "--version");
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+
+ int exitCode = p.waitFor();
+
+ InputStream stream = p.getInputStream();
+
+ if (stream == null)
+ {
+ results.append("Unable to open input stream from process.<p>");
+ return exitCode;
+ }
+
+ results.append("<pre>");
+
+ BufferedReader reader = null;
+
+ try
+ {
+ reader = new BufferedReader(new InputStreamReader(stream));
+
+ String line;
+
+ while ((line = reader.readLine()) != null)
+ {
+ results.append(String.format("%s%n", invoker.escapeHTML(line)));
+ }
+ }
+ finally
+ {
+ results.append("</pre>");
+
+ if (reader != null)
+ {
+ reader.close();
+ }
+ }
+
+ if (exitCode == 0)
+ {
+ results.append(invoker.getLabelWithValues(
+ "diagnostics.test_successful", file.getName()));
+ results.append("<p>");
+ }
+
+ return exitCode;
+ }
+
+ public String getScriptTestResults()
+ {
+ if (makeglossariesTestResults == null
+ && makeglossariesLiteTestResults == null)
+ {
+ return null;
+ }
+
+ StringBuilder builder = new StringBuilder();
+
+ builder.append("<dl>");
+
+ if (makeglossariesTestResults != null)
+ {
+ builder.append(String.format(
+ "<dt>makeglossaries</dt><dd>%s</dd>",
+ makeglossariesTestResults));
+ }
+
+ if (makeglossariesLiteTestResults != null)
+ {
+ builder.append(String.format(
+ "<dt>makeglossaries-lite</dt><dd>%s</dd>",
+ makeglossariesLiteTestResults));
+ }
+
+ builder.append("</dl>");
+
+ return builder.toString();
+ }
+
+ public String diagnosticsForm()
+ {
+ StringBuilder builder = new StringBuilder(String.format(
+ "%s<p><form action=\"#\">", invoker.getLabel("diagnostics.build")));
+
+ if (makeglossariesTestResults == null
+ && makeglossariesLiteTestResults == null)
+ {
+ builder.append(invoker.getLabelWithValues("diagnostics.query_two",
+ diagnosticsActionButton("makeglossaries"),
+ diagnosticsActionButton("makeglossaries-lite")));
+ }
+ else if (makeglossariesTestResults == null)
+ {
+ builder.append(invoker.getLabelWithValues("diagnostics.query_one",
+ diagnosticsActionButton("makeglossaries")));
+ }
+ else if (makeglossariesLiteTestResults == null)
+ {
+ builder.append(invoker.getLabelWithValues("diagnostics.query_one",
+ diagnosticsActionButton("makeglossaries-lite")));
+ }
+
+ if (makeglossariesTestResults != null
+ || makeglossariesLiteTestResults != null)
+ {
+ builder.append(String.format(
+ "<p><input type=submit name=\"cleartestresults\" value=\"%s\">",
+ invoker.getLabel("diagnostics.clear_test_results")
+ ));
+ }
+
+ builder.append("</form>");
+
+ return builder.toString();
+ }
+
+ private String diagnosticsActionButton(String name)
+ {
+ return String.format(
+ "<input type=submit name=\"%s\" value=\"%s\">",
+ name, invoker.getLabelWithValues("diagnostics.test_script", name)
+ );
+ }
+
+ public void showMessages()
+ {
+ try
+ {
+ updateInfoPanel();
+ }
+ catch (Exception e)
+ {
+ error(e);
+ }
+
+ updateDiagnostics();
+ }
+
+ public void aboutToExec(String[] cmdArray, File dir)
+ {
+ if (invoker.isDebugMode())
+ {
+ for (int i = 0, n = cmdArray.length-1; i < cmdArray.length; i++)
+ {
+ if (i == n)
+ {
+ System.out.println(String.format("\"%s\"", cmdArray[i]));
+ }
+ else
+ {
+ System.out.print(String.format("\"%s\" ", cmdArray[i]));
+ }
+ }
+ }
+
+ if (invoker.isDryRunMode())
+ {
+ StringBuilder builder = new StringBuilder();
+
+ for (int i = 0, n = cmdArray.length-1; i < cmdArray.length; i++)
+ {
+ if (i == n)
+ {
+ builder.append(String.format("\"%s\"", cmdArray[i]));
+ }
+ else
+ {
+ builder.append(String.format("\"%s\" ", cmdArray[i]));
+ }
+ }
+
+ invoker.getGlossaries().addDiagnosticMessage(
+ String.format("%s<pre>%s</pre>", invoker.getLabel(
+ "diagnostics.dry_run"), builder.toString()));
+ }
+ }
+
+ public void message(String msg)
+ {
+ }
+
+ public void message(GlossaryException e)
+ {
+ error(e);
+ selectDiagnosticComponent();
+ }
+
+ public void debug(String msg)
+ {
+ if (invoker.isDebugMode())
+ {
+ System.out.println(msg);
+ }
+ }
+
+ public void debug(Throwable e)
+ {
+ if (invoker.isDebugMode())
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void error(Exception e)
+ {
+ String msg = e.getMessage();
+
+ if (msg == null || msg.isEmpty())
+ {
+ msg = e.getClass().getName();
+ }
+
+ error(this, msg);
+
+ if (invoker.isDebugMode())
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void error(String message)
+ {
+ error(this, message);
+ }
+
+ public void error(Component parent, String message)
+ {
+ JOptionPane.showMessageDialog(parent, message, getLabel("error.title"),
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ public void error(Component parent, Exception e)
+ {
+ String msg = e.getMessage();
+
+ if (msg == null || msg.isEmpty())
+ {
+ msg = e.getClass().getName();
+ }
+
+ error(parent, msg);
+
+ if (invoker.isDebugMode())
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void fatalError(Exception e)
+ {
+ JOptionPane.showMessageDialog(null,
+ String.format("%s%n%s",
+ getLabelWithValues("error.fatal.info", invoker.APP_NAME),
+ e.getMessage()),
+ getLabel("error.fatal.title"), JOptionPane.ERROR_MESSAGE);
+
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ private String loadTemplate(String templateName)
+ throws IOException
+ {
+ InputStream in =
+ getClass().getResourceAsStream("/resources/"+templateName+"-template.html");
+
+ if (in == null)
+ {
+ throw new IOException("Can't find resources template '"+templateName+"'");
+ }
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+
+ String line;
+ StringBuilder builder = new StringBuilder();
+
+ while ((line = reader.readLine()) != null)
+ {
+ builder.append(line);
+ }
+
+ reader.close();
+
+ in.close();
+
+ return builder.toString();
+ }
+
+ private void initTemplates()
+ throws IOException
+ {
+ mainInfoTemplate = loadTemplate("information");
+ glossaryInfoTemplate = loadTemplate("glossary-info");
+ }
+
+ public String getMainInfoTemplate()
+ {
+ return mainInfoTemplate;
+ }
+
+ public String getGlossaryInfoTemplate()
+ {
+ return glossaryInfoTemplate;
+ }
+
+ public String getGlossaryInfoTemplate(String label)
+ {
+ return glossaryInfoTemplate.replaceAll("-LABEL", "-"+label);
+ }
+
+ public Glossaries getGlossaries()
+ {
+ return invoker.getGlossaries();
+ }
+
+ public MakeGlossariesProperties getProperties()
+ {
+ return invoker.getProperties();
+ }
+
+ public String getFileName()
+ {
+ return invoker.getFileName();
+ }
+
+ public File getFile()
+ {
+ return invoker.getFile();
+ }
+
+ public File getCurrentDirectory()
+ {
+ return invoker.getCurrentDirectory();
+ }
+
+ public String getCurrentDirectoryName()
+ {
+ return invoker.getCurrentDirectoryName();
+ }
+
+ public String getXindyApp()
+ {
+ return invoker.getXindyApp();
+ }
+
+ public String getMakeIndexApp()
+ {
+ return invoker.getMakeIndexApp();
+ }
+
+ public Charset getEncoding()
+ {
+ return invoker.getEncoding();
+ }
+
+ public void selectDiagnosticComponent()
+ {
+ tabbedPane.setSelectedComponent(diagnosticSP);
+ }
+
+ public void updateInfoPanel()
+ throws BadLocationException,IOException
+ {
+ mainPanel.updateInfo();
+ }
+
+ private void initHelp()
+ {
+ if (mainHelpBroker == null)
+ {
+ HelpSet mainHelpSet = null;
+
+ String helpsetLocation = "/resources/helpsets/makeglossariesgui";
+
+ String lang = Locale.getDefault().getLanguage();
+
+ try
+ {
+ URL hsURL = getClass().getResource(helpsetLocation+"-"+lang+"/makeglossariesgui.hs");
+
+ if (hsURL == null && !lang.equals("en"))
+ {
+ hsURL = getClass().getResource(helpsetLocation+"-en/makeglossariesgui.hs");
+ }
+
+ mainHelpSet = new HelpSet(null, hsURL);
+ }
+ catch (Exception e)
+ {
+ error(this, "/resources/helpsets/makeglossariesgui.hs\n"+
+ getLabel("error.io.helpset")+":\n" +e.getMessage());
+ }
+
+ if (mainHelpSet != null)
+ {
+ mainHelpBroker = mainHelpSet.createHelpBroker();
+ }
+
+ if (mainHelpBroker != null)
+ {
+ csh = new CSH.DisplayHelpFromSource(mainHelpBroker);
+ }
+ }
+ }
+
+ public void enableHelpOnButton(JComponent comp, String id)
+ {
+ if (mainHelpBroker != null)
+ {
+ try
+ {
+ mainHelpBroker.enableHelpOnButton(comp, id,
+ mainHelpBroker.getHelpSet());
+ }
+ catch (BadIDException e)
+ {
+ error(this, e.getMessage());
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public String getLanguage(String language)
+ {
+ return invoker.getLanguage(language);
+ }
+
+ public static void createAndShowGUI(final MakeGlossariesInvoker invoker)
+ {
+ String lookAndFeel = invoker.getProperties().getLookAndFeel();
+
+ if (lookAndFeel != null && !lookAndFeel.isEmpty())
+ {
+ try
+ {
+ UIManager.setLookAndFeel(lookAndFeel);
+ }
+ catch (Exception e)
+ {
+ invoker.getMessageSystem().debug(e);
+ }
+ }
+
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ new MakeGlossariesGUI(invoker);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null, e.toString(),
+ "Error", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ });
+ }
+
+
+ private JFileChooser fileChooser;
+
+ private AuxFileFilter auxFileFilter;
+
+ private GlossariesPanel mainPanel;
+
+ private JTabbedPane tabbedPane;
+
+ private JScrollPane scrollPane, diagnosticSP;
+
+ private DiagnosticPanel diagnosticArea;
+
+ private JPopupMenu popupM;
+
+ private JMenuItem copyItem;
+
+ private JMenu recentM;
+
+ private JCheckBoxMenuItem dryRunItem;
+
+ private PropertiesDialog propertiesDialog;
+
+ private String mainInfoTemplate, glossaryInfoTemplate;
+
+ private String makeglossariesTestResults=null;
+ private String makeglossariesLiteTestResults=null;
+
+ private JToolBar toolBar;
+
+ private AppSelector appSelector;
+
+ private HelpBroker mainHelpBroker;
+ private CSH.DisplayHelpFromSource csh;
+
+ private MakeGlossariesInvoker invoker;
+}
diff --git a/support/makeglossariesgui/src/java/MakeGlossariesInvoker.java b/support/makeglossariesgui/src/java/MakeGlossariesInvoker.java
new file mode 100644
index 0000000000..f9ffad4144
--- /dev/null
+++ b/support/makeglossariesgui/src/java/MakeGlossariesInvoker.java
@@ -0,0 +1,842 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.nio.charset.*;
+import java.net.*;
+import java.util.*;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+public class MakeGlossariesInvoker
+{
+ public MakeGlossariesInvoker()
+ {
+ setMessageSystem(new GlossaryBatchMessage(this));
+
+ try
+ {
+ loadDictionary();
+ }
+ catch (IOException e)
+ {
+ getMessageSystem().error(
+ String.format("Unable to load dictionary file:%n%s",
+ e.getMessage()));
+ }
+
+ initLanguageMappings();
+
+ try
+ {
+ properties = MakeGlossariesProperties.fetchProperties();
+ }
+ catch (IOException e)
+ {
+ getMessageSystem().error(
+ getLabelWithValues("error.prop_io", e.getMessage()));
+ properties = new MakeGlossariesProperties();
+ }
+ }
+
+ public void setFile(File file)
+ {
+ setFile(file.getAbsolutePath());
+ }
+
+ public void setFile(String filename)
+ {
+ if (filename.toLowerCase().endsWith(".tex"))
+ {
+ int idx = filename.length()-4;
+
+ filename = filename.substring(0, idx)+".aux";
+ }
+ else if (!filename.endsWith(".aux"))
+ {
+ filename = filename+".aux";
+ }
+
+ currentFileName = filename;
+ }
+
+ public void load(File file)
+ {
+ String lc = file.getName().toLowerCase();
+
+ if (lc.endsWith(".tex") || lc.endsWith(".log"))
+ {
+ int idx = file.getName().length()-4;
+
+ file = new File(file.getParentFile(),
+ file.getName().substring(0, idx)+".aux");
+ }
+
+ setFile(file);
+ reload(file);
+ }
+
+ public void reload()
+ {
+ reload(new File(currentFileName));
+ }
+
+ public void reload(File file)
+ {
+ if (!file.exists())
+ {
+ // Does the log file exists?
+
+ File log = null;
+
+ String name = file.getName();
+
+ if (!isBatchMode() && name.toLowerCase().endsWith(".aux"))
+ {
+ name = name.substring(0, name.length()-4);
+ log = new File(file.getParentFile(), name+".log");
+
+ if (!log.exists())
+ {
+ log = null;
+ }
+ else
+ {
+ glossaries = new Glossaries(this);
+ glossaries.addDiagnosticMessage(
+ getLabel("diagnostics.no_aux"));
+ glossaries.addErrorMessage(getLabelWithValues(
+ "error.io.file_doesnt_exist", file));
+
+ try
+ {
+ glossaries.parseLog(log.getParentFile(), name);
+ }
+ catch (Exception e)
+ {
+ getMessageSystem().error(e);
+ }
+
+ getMessageSystem().showMessages();
+ }
+ }
+
+ if (log == null)
+ {
+ getMessageSystem().error(getLabelWithValues(
+ "error.io.file_doesnt_exist", file.getAbsolutePath()));
+ }
+
+ return;
+ }
+
+ try
+ {
+ glossaries = Glossaries.loadGlossaries(this, file);
+
+ glossaries.process();
+ }
+ catch (InterruptedException e)
+ {
+ getMessageSystem().error(e);
+ }
+ catch (GlossaryException e)
+ {
+ String mess = e.getDiagnosticMessage();
+
+ if (mess != null)
+ {
+ glossaries.addDiagnosticMessage(mess);
+ }
+
+ getMessageSystem().message(e);
+ }
+ catch (IOException e)
+ {
+ glossaries.addDiagnosticMessage(getLabel("diagnostics.io_error"));
+ getMessageSystem().error(e);
+ }
+
+ String errMess = glossaries.getErrorMessages();
+
+ if (errMess != null)
+ {
+ getMessageSystem().error(errMess);
+ }
+
+ getMessageSystem().showMessages();
+ }
+
+ public void setMessageSystem(GlossaryMessage msg)
+ {
+ messageSystem = msg;
+ }
+
+ public GlossaryMessage getMessageSystem()
+ {
+ return messageSystem;
+ }
+
+ public static String escapeHTML(String text)
+ {
+ if (text == null || text.isEmpty()) return "";
+
+ int n = text.length();
+
+ StringBuilder builder = new StringBuilder(n);
+
+ for (int i = 0; i < n; i++)
+ {
+ char c = text.charAt(i);
+
+ if (c == '&')
+ {
+ builder.append("&amp;");
+ }
+ else if (c == '<')
+ {
+ builder.append("&lt;");
+ }
+ else if (c == '>')
+ {
+ builder.append("&gt;");
+ }
+ else
+ {
+ builder.append(c);
+ }
+ }
+
+ return builder.toString();
+ }
+
+ public String getLabelOrDef(String label, String alt)
+ {
+ if (messages == null)
+ {
+ return alt;
+ }
+
+ String val = messages.getMessageIfExists(label);
+
+ return val == null ? alt : val;
+ }
+
+ public String getLabel(String label)
+ {
+ return getLabel(null, label);
+ }
+
+ public String getLabel(String parent, String label)
+ {
+ if (messages == null)
+ {
+ messageSystem.debug("Dictionary not loaded.");
+ return null;
+ }
+
+ String propLabel;
+
+ if (parent == null)
+ {
+ propLabel = label;
+ }
+ else
+ {
+ propLabel = String.format("%s.%s", parent, label);
+ }
+
+ return messages.getMessage(propLabel);
+ }
+
+ public int getMnemonic(String label)
+ {
+ return getMnemonic(null, label);
+ }
+
+ public int getMnemonic(String parent, String label)
+ {
+ if (messages == null)
+ {
+ messageSystem.debug("Dictionary not loaded.");
+ return -1;
+ }
+
+ String propLabel = label+".mnemonic";
+
+ if (parent != null)
+ {
+ propLabel = String.format("%s.%s", parent, propLabel);
+ }
+
+ String val = messages.getMessageIfExists(propLabel);
+
+ if (val == null || val.isEmpty())
+ {
+ return -1;
+ }
+
+ return val.codePointAt(0);
+ }
+
+ public String getLabelWithValues(String label, Object... values)
+ {
+ if (messages == null)
+ {
+ return null;
+ }
+
+ return messages.getMessage(label, values);
+ }
+
+ public MakeGlossariesProperties getProperties()
+ {
+ return properties;
+ }
+
+ public boolean isDocDefCheckOn()
+ {
+ return properties.isDocDefsCheckOn();
+ }
+
+ public boolean isMissingLangCheckOn()
+ {
+ return properties.isMissingLangCheckOn();
+ }
+
+ public String getDefaultLanguage()
+ {
+ return properties.getDefaultLanguage();
+ }
+
+ public String getDefaultXindyVariant()
+ {
+ return properties.getDefaultXindyVariant();
+ }
+
+ public String getDefaultCodePage()
+ {
+ return properties.getDefaultCodePage();
+ }
+
+ // Convert xindy and inputenc encoding labels to Charset
+ // Uses String.contains rather than String.equals as
+ // the xindy codepage may contain additional information,
+ // such as din5007-
+ public static Charset getCharset(String encodingLabel)
+ throws IllegalCharsetNameException,
+ IllegalArgumentException,
+ UnsupportedCharsetException
+ {
+ if (encodingLabel == null)
+ {
+ throw new IllegalArgumentException(
+ "Illegal encoding label (null)");
+ }
+
+ if (encodingLabel.contains("utf8"))
+ {
+ return StandardCharsets.UTF_8;
+ }
+
+ if (encodingLabel.contains("ascii"))
+ {
+ return Charset.forName("US-ASCII");
+ }
+
+ if (encodingLabel.contains("latin10"))
+ {
+ return Charset.forName("ISO-8859-16");
+ }
+
+ if (encodingLabel.contains("latin1"))
+ {
+ return StandardCharsets.ISO_8859_1;
+ }
+
+ if (encodingLabel.contains("latin2"))
+ {
+ return Charset.forName("ISO-8859-2");
+ }
+
+ if (encodingLabel.contains("latin3"))
+ {
+ return Charset.forName("ISO-8859-3");
+ }
+
+ if (encodingLabel.contains("latin4"))
+ {
+ return Charset.forName("ISO-8859-4");
+ }
+
+ if (encodingLabel.contains("latin5"))
+ {
+ return Charset.forName("ISO-8859-9");
+ }
+
+ if (encodingLabel.contains("latin6"))
+ {
+ return Charset.forName("ISO-8859-10");
+ }
+
+ if (encodingLabel.contains("latin7"))
+ {
+ return Charset.forName("ISO-8859-13");
+ }
+
+ if (encodingLabel.contains("latin8"))
+ {
+ return Charset.forName("ISO-8859-14");
+ }
+
+ if (encodingLabel.contains("latin9"))
+ {
+ return Charset.forName("ISO-8859-15");
+ }
+
+ if (encodingLabel.contains("cp1250"))
+ {
+ return Charset.forName("Cp1250");
+ }
+
+ if (encodingLabel.contains("cp1252")
+ || encodingLabel.contains("ansinew"))
+ {
+ return Charset.forName("Cp1252");
+ }
+
+ if (encodingLabel.contains("cp1257"))
+ {
+ return Charset.forName("Cp1257");
+ }
+
+ if (encodingLabel.contains("cp437"))
+ {
+ return Charset.forName("Cp437");
+ }
+
+ if (encodingLabel.contains("cp850"))
+ {
+ return Charset.forName("Cp850");
+ }
+
+ if (encodingLabel.contains("cp852"))
+ {
+ return Charset.forName("Cp852");
+ }
+
+ if (encodingLabel.contains("cp858"))
+ {
+ return Charset.forName("Cp858");
+ }
+
+ if (encodingLabel.contains("cp865"))
+ {
+ return Charset.forName("Cp865");
+ }
+
+ if (encodingLabel.contains("decmulti"))
+ {
+ return Charset.forName("DEC-MCS");
+ }
+
+ if (encodingLabel.contains("applemac"))
+ {
+ return Charset.forName("MacRoman");
+ }
+
+ if (encodingLabel.contains("macce"))
+ {
+ return Charset.forName("MacCentralEurope");
+ }
+
+ // don't know appropriate Java name for inputenc's 'next'
+
+ return null;
+ }
+
+ // indexer character encoding
+ public Charset getEncoding()
+ {
+ return defaultCharset;
+ }
+
+ public void setEncoding(Charset charset)
+ {
+ defaultCharset = charset;
+ }
+
+ private void loadDictionary()
+ throws IOException
+ {
+ Locale locale = Locale.getDefault();
+
+ String lang = locale.getLanguage();
+
+ String resource = "/resources/dictionaries/makeglossariesgui-"
+ +lang+".prop";
+
+ InputStream in = getClass().getResourceAsStream(resource);
+
+ if (in == null && !lang.equals("en"))
+ {
+ resource = "/resources/dictionaries/makeglossariesgui-en.prop";
+ in = getClass().getResourceAsStream(resource);
+ }
+
+ BufferedReader reader = null;
+
+ try
+ {
+ Charset defCharset = Charset.defaultCharset();
+
+ reader = new BufferedReader(new InputStreamReader(in, defCharset));
+
+ // First line should be # Encoding: <encoding name>
+
+ Charset charset = null;
+ String encoding=null;
+
+ try
+ {
+ String line = reader.readLine();
+
+ Pattern p = Pattern.compile("# Encoding: (.+)");
+
+ Matcher m = p.matcher(line);
+
+ if (!m.matches())
+ {
+ throw new InvalidSyntaxException(
+ "Missing encoding comment on line 1 of dictionary file: !"
+ + resource);
+ }
+
+ encoding = m.group(1);
+ charset = Charset.forName(encoding);
+ }
+ catch (UnsupportedCharsetException|IllegalCharsetNameException e)
+ {
+ throw new InvalidSyntaxException(String.format(
+ "Invalid encoding '%s' on line 1 of dictionary file: !%s",
+ encoding, resource), e);
+ }
+
+ if (!charset.equals(defCharset))
+ {
+ reader.close();
+ reader = new BufferedReader(new InputStreamReader(in, charset));
+ }
+
+ Properties dictionary = new Properties();
+ dictionary.load(reader);
+ messages = new MakeGlossariesDictionary(dictionary);
+
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ reader.close();
+ }
+
+ in.close();
+ }
+ }
+
+ public Glossaries getGlossaries()
+ {
+ return glossaries;
+ }
+
+ public String getFileName()
+ {
+ return currentFileName;
+ }
+
+ public File getFile()
+ {
+ return currentFileName == null ? null : new File(currentFileName);
+ }
+
+ public File getCurrentDirectory()
+ {
+ if (currentFileName == null)
+ {
+ return new File(properties.getDefaultDirectory());
+ }
+
+ File file = getFile().getParentFile();
+
+ if (file == null)
+ {
+ file = new File(properties.getDefaultDirectory());
+ }
+
+ return file;
+ }
+
+ public String getCurrentDirectoryName()
+ {
+ return getCurrentDirectory().getAbsolutePath();
+ }
+
+ public String getXindyApp()
+ {
+ return properties.getXindyApp();
+ }
+
+ public String getMakeIndexApp()
+ {
+ return properties.getMakeIndexApp();
+ }
+
+ private void initLanguageMappings()
+ {
+ languageMap = new Hashtable<String,String>();
+
+ languageMap.put("american", "english");
+ languageMap.put("british", "english");
+ languageMap.put("francais", "french");
+ languageMap.put("frenchb", "french");
+ languageMap.put("germanb", "german");
+ languageMap.put("magyar", "hungarian");
+ languageMap.put("ngermanb", "german");
+ languageMap.put("ngerman", "german");
+ languageMap.put("norsk", "norwegian");
+ languageMap.put("portuges", "portuguese");
+ languageMap.put("russianb", "russian");
+ languageMap.put("UKenglish", "english");
+ languageMap.put("ukraineb", "ukrainian");
+ languageMap.put("USenglish", "english");
+ languageMap.put("usorbian", "upper-sorbian");
+ }
+
+ public String getLanguage(String language)
+ {
+ String map = languageMap.get(language);
+
+ return map == null ? language : map;
+ }
+
+ public File findApp(String name)
+ {
+ return findApp(name, name+".exe", null);
+ }
+
+ public File findApp(String name, String altName, String altName2)
+ {
+ String filename = name;
+ String filename2 = (altName == null ? null : altName);
+ String filename3 = (altName2 == null ? null : altName2);
+
+ String path = System.getenv("PATH");
+ String[] split = path.split(File.pathSeparator);
+
+ for (int i = 0; i < split.length; i++)
+ {
+ File file = new File(split[i], filename);
+
+ if (file.exists())
+ {
+ return file;
+ }
+
+ if (filename2 != null)
+ {
+ file = new File(split[i], filename2);
+
+ if (file.exists())
+ {
+ return file;
+ }
+ }
+
+ if (filename3 != null)
+ {
+ file = new File(split[i], filename3);
+
+ if (file.exists())
+ {
+ return file;
+ }
+ }
+ }
+
+ return null;
+ }
+
+
+
+ public void help()
+ {
+ System.out.println(getLabel("syntax.cmdline"));
+ System.out.println();
+ System.out.println(getLabelWithValues("syntax.filename", "--batch"));
+ System.out.println();
+ System.out.println(getLabel("syntax.options"));
+ System.out.println();
+ System.out.println(getLabelWithValues("syntax.help", "--help", "-h"));
+ System.out.println(getLabelWithValues("syntax.version",
+ "--version", "-v"));
+ System.out.println(getLabelWithValues("syntax.debug", "--debug"));
+ System.out.println(getLabelWithValues("syntax.dryrun", "--dry-run",
+ "-n"));
+ System.out.println(getLabelWithValues("syntax.nodryrun", "--nodry-run"));
+ System.out.println(getLabelWithValues("syntax.batch", "--batch", "-b"));
+ System.out.println(getLabelWithValues("syntax.gui", "--gui"));
+ System.out.println(getLabelWithValues("syntax.quiet", "--quiet"));
+
+ }
+
+ public void version()
+ {
+ String translator = getLabelOrDef("about.translator_info", null);
+
+ System.out.println(APP_NAME);
+ System.out.println(getLabelWithValues("about.version",
+ APP_VERSION, APP_DATE));
+ System.out.println(getLabelWithValues("about.copyright",
+ "Nicola L. C. Talbot",
+ String.format("2011-%s", APP_DATE.substring(0, 4))));
+ System.out.println("http://www.dickimaw-books.com/");
+
+ if (translator != null && !translator.isEmpty())
+ {
+ System.out.println(translator);
+ }
+
+ }
+
+ public boolean isQuiet()
+ {
+ return quiet;
+ }
+
+ public void setQuietMode(boolean isSet)
+ {
+ quiet = isSet;
+ }
+
+ public boolean isDebugMode()
+ {
+ return debug;
+ }
+
+ public void setDebugMode(boolean isSet)
+ {
+ debug = isSet;
+ }
+
+ public boolean isBatchMode()
+ {
+ return batchMode;
+ }
+
+ public void setDryRunMode(boolean isDryRun)
+ {
+ dryRun = isDryRun;
+ }
+
+ public boolean isDryRunMode()
+ {
+ return dryRun;
+ }
+
+ public static void main(String[] args)
+ {
+ MakeGlossariesInvoker invoker = new MakeGlossariesInvoker();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ if (args[i].equals("--help") || args[i].equals("-h"))
+ {
+ invoker.batchMode = true;
+ invoker.help();
+ System.exit(0);
+ }
+ else if (args[i].equals("--version") || args[i].equals("-v"))
+ {
+ invoker.batchMode = true;
+ invoker.version();
+ System.exit(0);
+ }
+ else if (args[i].equals("--batch") || args[i].equals("-b"))
+ {
+ invoker.batchMode = true;
+ }
+ else if (args[i].equals("--gui"))
+ {
+ invoker.batchMode = false;
+ }
+ else if (args[i].equals("--quiet"))
+ {
+ invoker.setQuietMode(true);
+ }
+ else if (args[i].equals("--debug"))
+ {
+ invoker.setDebugMode(true);
+ }
+ else if (args[i].equals("--dry-run") || args[i].equals("-n"))
+ {
+ invoker.setDryRunMode(true);
+ }
+ else if (args[i].equals("--nodry-run"))
+ {
+ invoker.setDryRunMode(false);
+ }
+ else if (args[i].startsWith("-"))
+ {
+ System.err.println(invoker.getLabelWithValues("error.unknown_opt",
+ args[i]));
+ System.exit(1);
+ }
+ else if (invoker.getFileName() == null)
+ {
+ invoker.setFile(args[i]);
+
+ }
+ else
+ {
+ System.err.println(invoker.getLabel("error.one_input"));
+ System.exit(1);
+ }
+ }
+
+ if (invoker.batchMode)
+ {
+ if (invoker.getFileName() == null)
+ {
+ System.err.println(invoker.getLabel("error.input_required"));
+ System.exit(1);
+ }
+
+ invoker.reload();
+ }
+ else
+ {
+ MakeGlossariesGUI.createAndShowGUI(invoker);
+ }
+ }
+
+ private String currentFileName = null;
+
+ private MakeGlossariesProperties properties;
+
+ private MakeGlossariesDictionary messages;
+
+ public static final String APP_NAME = "MakeGlossariesGUI";
+
+ public static final String APP_VERSION = "2.1";
+
+ public static final String APP_DATE = "2018-05-23";
+
+ private boolean quiet=false, debug=false, batchMode=false, dryRun=false;
+
+ protected Glossaries glossaries;
+
+ private Charset defaultCharset=Charset.defaultCharset();
+
+ private Hashtable<String,String> languageMap;
+
+ private GlossaryMessage messageSystem;
+}
diff --git a/support/makeglossariesgui/src/java/MakeGlossariesProperties.java b/support/makeglossariesgui/src/java/MakeGlossariesProperties.java
new file mode 100644
index 0000000000..560d87f894
--- /dev/null
+++ b/support/makeglossariesgui/src/java/MakeGlossariesProperties.java
@@ -0,0 +1,538 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.util.*;
+import java.awt.Font;
+
+import java.awt.event.ActionListener;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JToolBar;
+import javax.swing.UIManager;
+import javax.swing.LookAndFeel;
+
+public class MakeGlossariesProperties extends Properties
+{
+ public MakeGlossariesProperties(File propfile, File recentFile)
+ throws IOException
+ {
+ super();
+
+ this.propFile = propfile;
+ this.recentFile = recentFile;
+
+ recentList = new Vector<String>();
+
+ BufferedReader in;
+
+ if (propfile != null && propfile.exists())
+ {
+ in = new BufferedReader(new FileReader(propFile));
+
+ load(in);
+
+ in.close();
+ }
+ else
+ {
+ setDefaults();
+ }
+
+ if (recentFile != null && recentFile.exists())
+ {
+ in = new BufferedReader(new FileReader(recentFile));
+
+ loadRecentFiles(in);
+
+ in.close();
+ }
+ }
+
+ public MakeGlossariesProperties()
+ {
+ super();
+
+ propFile = null;
+ recentFile = null;
+
+ setDefaults();
+ }
+
+ protected void setDefaults()
+ {
+ setDefaultHomeDir();
+ setProperty("language", Locale.getDefault().getDisplayLanguage().toLowerCase());
+ setProperty("codepage", "utf8");
+ setProperty("override", "false");
+ setProperty("docdefscheck", "true");
+ setProperty("langcheck", "true");
+ setProperty("fontsize", "12");
+ setProperty("fontname", "Serif");
+ setProperty("fontstyle", ""+Font.PLAIN);
+ setProperty("toolbar.position", "North");
+ setProperty("toolbar.orientation", ""+JToolBar.HORIZONTAL);
+ }
+
+ public String getToolBarPosition()
+ {
+ String prop = getProperty("toolbar.position");
+
+ return prop == null ? "North" : prop;
+ }
+
+ public void setToolBarPosition(String position)
+ {
+ setProperty("toolbar.position", position == null ? "North" : position);
+ }
+
+ public int getToolBarOrientation()
+ {
+ int orientation = JToolBar.HORIZONTAL;
+
+ String prop = getProperty("toolbar.orientation");
+
+ if (prop != null)
+ {
+ try
+ {
+ orientation = Integer.parseInt(prop);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+
+ return orientation;
+ }
+
+ public void setToolBarOrientation(int orientation)
+ {
+ setProperty("toolbar.orientation", ""+orientation);
+ }
+
+ public int getFontSize()
+ {
+ String prop = getProperty("fontsize");
+
+ if (prop == null) return 12;
+
+ try
+ {
+ return Integer.parseInt(prop);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+
+ return 12;
+ }
+
+ public int getFontStyle()
+ {
+ String prop = getProperty("fontstyle");
+
+ if (prop == null) return Font.PLAIN;
+
+ try
+ {
+ return Integer.parseInt(prop);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+
+ return Font.PLAIN;
+ }
+
+ public String getFontName()
+ {
+ String prop = getProperty("fontname");
+
+ return prop == null ? "Serif" : prop;
+ }
+
+ public void setFontSize(int size)
+ {
+ setProperty("fontsize", ""+size);
+ }
+
+ public void setFontStyle(int style)
+ {
+ setProperty("fontstyle", ""+style);
+ }
+
+ public void setFontName(String name)
+ {
+ setProperty("fontname", name);
+ }
+
+ public String getDefaultXindyVariant()
+ {
+ String prop = getProperty("variant");
+
+ return "".equals(prop) ? null : prop;
+ }
+
+ public void setDefaultXindyVariant(String variant)
+ {
+ setProperty("variant", variant==null?"":variant);
+ }
+
+ public String getDefaultLanguage()
+ {
+ String prop = getProperty("language");
+
+ return prop == null ? "english" : prop;
+ }
+
+ public void setDefaultLanguage(String language)
+ {
+ setProperty("language", language);
+ }
+
+ public String getDefaultCodePage()
+ {
+ String prop = getProperty("codepage");
+
+ return prop == null ? "utf8" : prop;
+ }
+
+ public void setDefaultCodePage(String codepage)
+ {
+ setProperty("codepage", codepage);
+ }
+
+ public void setOverride(boolean override)
+ {
+ setProperty("override", override?"true":"false");
+ }
+
+ public boolean isOverride()
+ {
+ String prop = getProperty("override");
+
+ return prop == null ? false : Boolean.parseBoolean(prop);
+ }
+
+ public void setDocDefsCheck(boolean check)
+ {
+ setProperty("docdefscheck", check?"true":"false");
+ }
+
+ public boolean isDocDefsCheckOn()
+ {
+ String prop = getProperty("docdefscheck");
+
+ return prop == null ? true : Boolean.parseBoolean(prop);
+ }
+
+ public void setMissingLangCheck(boolean check)
+ {
+ setProperty("langcheck", check?"true":"false");
+ }
+
+ public boolean isMissingLangCheckOn()
+ {
+ String prop = getProperty("langcheck");
+
+ return prop == null ? true : Boolean.parseBoolean(prop);
+ }
+
+ public static MakeGlossariesProperties fetchProperties()
+ throws IOException
+ {
+ File parent = getOrMakeConfigDir();
+ File settings = null;
+ File recent = null;
+
+ if (parent != null)
+ {
+ settings = new File(parent, propName);
+ recent = new File(parent, recentName);
+ }
+
+ return new MakeGlossariesProperties(settings, recent);
+ }
+
+ public void save(MakeGlossariesGUI app) throws IOException
+ {
+ File parent = getConfigDir();
+
+ if (parent == null)
+ {
+ parent = getOrMakeConfigDir();
+ }
+
+ if (parent == null)
+ {
+ throw new IOException("Unable to create properties directory");
+ }
+
+ if (propFile == null)
+ {
+ propFile = new File(parent, propName);
+ }
+
+ if (getProperty("directory.setting").equals("last"))
+ {
+ setProperty("directory", app.getCurrentDirectoryName());
+ }
+
+ PrintWriter out = new PrintWriter(new FileWriter(propFile));
+
+ store(out, "makeglossaries-gui properties");
+
+ out.close();
+
+ if (recentFile == null)
+ {
+ recentFile = new File(parent, recentName);
+ }
+
+ out = new PrintWriter(new FileWriter(recentFile));
+
+ for (int i = 0, n = recentList.size(); i < n; i++)
+ {
+ out.println(recentList.get(i));
+ }
+
+ out.close();
+ }
+
+ public String getDefaultDirectory()
+ {
+ String settings = getProperty("directory.setting");
+
+ if (settings == null) settings = "home";
+
+ if (settings.equals("home"))
+ {
+ setProperty("directory", System.getProperty("user.home"));
+ }
+
+ return getProperty("directory");
+ }
+
+ public String getDefaultDirectorySetting()
+ {
+ return getProperty("directory.setting");
+ }
+
+ public String getMakeIndexApp()
+ {
+ String prop = getProperty("makeindex");
+
+ if (prop == null || prop.equals("")) return null;
+
+ return prop;
+ }
+
+ public String getXindyApp()
+ {
+ String prop = getProperty("xindy");
+
+ if (prop == null || prop.equals("")) return null;
+
+ return prop;
+ }
+
+ public void setDefaultCustomDir(String dir)
+ {
+ setProperty("directory", dir);
+ setProperty("directory.setting", "custom");
+ }
+
+ public void setDefaultHomeDir()
+ {
+ setProperty("directory", System.getProperty("user.home"));
+ setProperty("directory.setting", "home");
+ }
+
+ public void setDefaultLastDir()
+ {
+ setProperty("directory.setting", "last");
+ }
+
+ public void setMakeIndexApp(File pathToApp)
+ {
+ setMakeIndexApp(pathToApp.getAbsolutePath());
+ }
+
+ public void setMakeIndexApp(String pathToApp)
+ {
+ setProperty("makeindex", pathToApp);
+ }
+
+ public void setXindyApp(File pathToApp)
+ {
+ setXindyApp(pathToApp.getAbsolutePath());
+ }
+
+ public void setXindyApp(String pathToApp)
+ {
+ setProperty("xindy", pathToApp);
+ }
+
+ public String getLookAndFeel()
+ {
+ String prop = getProperty("look_and_feel");
+
+ if (prop == null)
+ {
+ LookAndFeel current = UIManager.getLookAndFeel();
+
+ if (current == null) return null;
+
+ prop = current.getClass().getName();
+ setProperty("look_and_feel", prop);
+ }
+
+ return prop;
+ }
+
+ public void setLookAndFeel(UIManager.LookAndFeelInfo info)
+ {
+ setLookAndFeel(info.getClassName());
+ }
+
+ public void setLookAndFeel(String lookAndFeel)
+ {
+ setProperty("look_and_feel", lookAndFeel);
+ }
+
+ private void loadRecentFiles(BufferedReader in)
+ throws IOException
+ {
+ String line;
+
+ while ((line = in.readLine()) != null)
+ {
+ recentList.add(line);
+ }
+ }
+
+ public void addRecentFile(String fileName)
+ {
+ if (fileName == null)
+ {
+ throw new NullPointerException();
+ }
+
+ recentList.remove(fileName); // just in case it's already in the list
+ recentList.add(fileName);
+ }
+
+ public void setRecentFiles(JMenu menu, ActionListener listener)
+ {
+ if (recentList == null) return;
+
+ if (menu.getMenuComponentCount() > 0)
+ {
+ menu.removeAll();
+ }
+
+ int lastIdx = recentList.size()-1;
+
+ int n = Math.min(MAX_RECENT_FILES-1, lastIdx);
+
+ for (int i = 0; i <= n; i++)
+ {
+ File file = new File(recentList.get(lastIdx-i));
+ String num = ""+i;
+ JMenuItem item = new JMenuItem(num+": "+file.getName());
+ item.setMnemonic(num.charAt(0));
+ item.setToolTipText(file.getAbsolutePath());
+ item.setActionCommand(num);
+ item.addActionListener(listener);
+
+ menu.add(item);
+ }
+ }
+
+ public String getRecentFileName(int i)
+ {
+ return recentList.get(recentList.size()-1-i);
+ }
+
+ public static File getConfigDir()
+ {
+ File dir = null;
+
+ String env = System.getenv("MAKEGLOSSARIES-SETTINGS");
+
+ if (env != null)
+ {
+ dir = new File(env);
+
+ if (dir.isDirectory()) return dir;
+ }
+
+ String home = System.getProperty("user.home");
+
+ if (home == null) return null;
+
+ dir = new File(home, ".makeglossaries");
+
+ if (dir.isDirectory()) return dir;
+
+ dir = new File(home, "makeglossaries-settings");
+
+ if (dir.isDirectory()) return dir;
+
+ return null;
+ }
+
+ public static File getOrMakeConfigDir()
+ {
+ File dir = null;
+
+ String env = System.getenv("MAKEGLOSSARIES-SETTINGS");
+
+ if (env != null)
+ {
+ dir = new File(env);
+
+ if (!dir.exists())
+ {
+ if (dir.mkdir()) return dir;
+ }
+
+ if (dir.isDirectory()) return dir;
+ }
+
+ String home = System.getProperty("user.home");
+
+ if (home == null) return null;
+
+ File dir2;
+
+ if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
+ {
+ dir = new File(home, "makeglossaries-settings");
+ dir2 = new File(home, ".makeglossaries");
+ }
+ else
+ {
+ dir = new File(home, ".makeglossaries");
+ dir2 = new File(home, "makeglossaries-settings");
+ }
+
+ if (dir.isDirectory()) return dir;
+
+ if (dir2.isDirectory()) return dir2;
+
+ if (dir.mkdir()) return dir;
+
+ if (dir2.mkdir()) return dir2;
+
+ return null;
+ }
+
+ private File propFile, recentFile;
+ private static String propName = "makeglossaries.prop";
+ private static String recentName = "recentfiles";
+
+ private Vector<String> recentList;
+
+ public static final int MAX_RECENT_FILES = 10;
+}
diff --git a/support/makeglossariesgui/src/java/Manifest.txt b/support/makeglossariesgui/src/java/Manifest.txt
new file mode 100644
index 0000000000..27bfd39dd4
--- /dev/null
+++ b/support/makeglossariesgui/src/java/Manifest.txt
@@ -0,0 +1,2 @@
+Main-Class: com/dickimawbooks/makeglossariesgui/MakeGlossariesInvoker
+Class-Path: . javahelp2.jar jlfgr-1_0.jar
diff --git a/support/makeglossariesgui/src/java/PropertiesDialog.java b/support/makeglossariesgui/src/java/PropertiesDialog.java
new file mode 100644
index 0000000000..0f9fe72e8d
--- /dev/null
+++ b/support/makeglossariesgui/src/java/PropertiesDialog.java
@@ -0,0 +1,709 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.io.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Arrays;
+
+import javax.swing.*;
+import javax.swing.event.*;
+
+public class PropertiesDialog extends JDialog
+ implements ActionListener,ItemListener,ChangeListener
+{
+ public PropertiesDialog(MakeGlossariesGUI application)
+ {
+ super(application, application.getLabel("properties.title"), true);
+
+ app = application;
+
+ JTabbedPane tabbedPane = new JTabbedPane();
+ getContentPane().add(tabbedPane, "Center");
+
+ properties = app.getProperties();
+
+ File file = new File(properties.getDefaultDirectory());
+
+ String setting = properties.getDefaultDirectorySetting();
+
+ if (setting == null) setting = "home";
+
+ fileChooser = new JFileChooser(getDir());
+
+ Box box = Box.createVerticalBox();
+ newTab(tabbedPane, box, "properties.start_dir");
+
+ Box startDirBox = Box.createVerticalBox();
+ startDirBox.setAlignmentX(Component.LEFT_ALIGNMENT);
+ box.add(startDirBox);
+
+ ButtonGroup bg = new ButtonGroup();
+
+ homeButton = createRadioButton("properties.dir.home", "disablecustom",
+ bg);
+ startDirBox.add(homeButton);
+
+ lastButton = createRadioButton("properties.dir.last", "disablecustom",
+ bg);
+ startDirBox.add(lastButton);
+
+ Box panel = Box.createHorizontalBox();
+ panel.setAlignmentX(Component.LEFT_ALIGNMENT);
+ panel.setAlignmentY(Component.TOP_ALIGNMENT);
+ startDirBox.add(panel);
+
+ customButton = createRadioButton("properties.dir.custom", "enablecustom",
+ bg);
+ customButton.setAlignmentY(Component.TOP_ALIGNMENT);
+ panel.add(customButton);
+
+ customField = new FileField(app, this, fileChooser,
+ JFileChooser.DIRECTORIES_ONLY);
+ customField.setOpaque(false);
+ customField.setAlignmentY(Component.TOP_ALIGNMENT);
+ panel.add(customField);
+
+ if (setting.equals("home"))
+ {
+ homeButton.setSelected(true);
+ customField.setEnabled(false);
+ }
+ else if (setting.equals("last"))
+ {
+ lastButton.setSelected(true);
+ customField.setEnabled(false);
+ }
+ else if (setting.equals("custom"))
+ {
+ customButton.setSelected(true);
+ customField.setFileName(file.getAbsolutePath());
+ }
+
+ box = Box.createVerticalBox();
+ newTab(tabbedPane, box, "properties.diagnostics");
+
+ docDefCheckBox = createCheckBox("properties", "docdefcheck",
+ properties.isDocDefsCheckOn());
+ box.add(docDefCheckBox);
+
+ missingLangModBox = createCheckBox("properties", "langcheck",
+ properties.isMissingLangCheckOn());
+ box.add(missingLangModBox);
+
+ box = Box.createVerticalBox();
+ newTab(tabbedPane, box, "properties.applications");
+
+ Box makeindexBox = Box.createVerticalBox();
+ makeindexBox.setBorder(BorderFactory.createEtchedBorder());
+ box.add(makeindexBox);
+
+ panel = Box.createHorizontalBox();
+ panel.setAlignmentX(Component.LEFT_ALIGNMENT);
+ makeindexBox.add(panel);
+
+ JLabel makeindexLabel = createLabel("properties.makeindex");
+ panel.add(makeindexLabel);
+
+ makeindexField = new FileField(app, this,
+ properties.getMakeIndexApp(),
+ fileChooser);
+ makeindexLabel.setLabelFor(makeindexField.getTextField());
+ panel.add(makeindexField);
+ makeindexField.setOpaque(false);
+
+ Box xindyBox = Box.createVerticalBox();
+ xindyBox.setBorder(BorderFactory.createEtchedBorder());
+ box.add(xindyBox);
+
+ panel = Box.createHorizontalBox();
+ panel.setAlignmentX(Component.LEFT_ALIGNMENT);
+ xindyBox.add(panel);
+
+ JLabel xindyLabel = createLabel("properties.xindy");
+ panel.add(xindyLabel);
+
+ JPanel xindyDefaultsPanel = new JPanel();
+ xindyDefaultsPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
+ xindyBox.add(xindyDefaultsPanel);
+ xindyDefaultsPanel.setOpaque(false);
+
+ langLabel = createLabel("properties.language");
+ xindyDefaultsPanel.add(langLabel);
+
+ String[] languages = XindyModule.getKnownLanguages();
+ Arrays.sort(languages);
+
+ languageBox = new JComboBox<String>(languages);
+ langLabel.setLabelFor(languageBox);
+
+ languageBox.setSelectedItem(properties.getDefaultLanguage());
+ languageBox.addItemListener(this);
+
+ xindyDefaultsPanel.add(languageBox);
+
+ xindyModuleLayout = new CardLayout();
+ modulesPanel = new JPanel(xindyModuleLayout);
+ modulesPanel.setOpaque(false);
+
+ initVariants((String)languageBox.getSelectedItem(),
+ properties.getDefaultXindyVariant(),
+ properties.getDefaultCodePage());
+
+ xindyDefaultsPanel.add(modulesPanel);
+
+ overrideBox = createCheckBox("properties", "override",
+ properties.isOverride());
+ xindyBox.add(overrideBox);
+
+ xindyField = new FileField(app, this,
+ properties.getXindyApp(), fileChooser);
+ xindyLabel.setLabelFor(xindyField.getTextField());
+ panel.add(xindyField);
+ xindyField.setOpaque(false);
+
+ box = Box.createVerticalBox();
+ newTab(tabbedPane, box, "properties.gui");
+
+ JPanel lfPanel = new JPanel();
+ lfPanel.setOpaque(false);
+ box.add(lfPanel);
+
+ JLabel lfLabel = createLabel("properties.look_and_feel");
+ lfPanel.add(lfLabel);
+
+ UIManager.LookAndFeelInfo[] lfInfo = UIManager.getInstalledLookAndFeels();
+
+ lookAndFeelBox = new JComboBox<UIManager.LookAndFeelInfo>(lfInfo);
+ lookAndFeelBox.setRenderer(new LookAndFeelCellRenderer());
+
+ String currentLF = properties.getLookAndFeel();
+
+ if (currentLF != null)
+ {
+ for (int i = 0; i < lfInfo.length; i++)
+ {
+ if (lfInfo[i].getClassName().equals(currentLF))
+ {
+ lookAndFeelBox.setSelectedIndex(i);
+ break;
+ }
+ }
+ }
+
+ lfPanel.add(lookAndFeelBox);
+ lfLabel.setLabelFor(lookAndFeelBox);
+
+ JLabel restartLabel = new JLabel(app.getLabel("properties.restart"));
+ lfPanel.add(restartLabel);
+
+ JPanel fontPanel = new JPanel();
+ fontPanel.setOpaque(false);
+ box.add(fontPanel);
+
+ JLabel fontLabel = createLabel("properties.font");
+ fontPanel.add(fontLabel);
+
+ GraphicsEnvironment env =
+ GraphicsEnvironment.getLocalGraphicsEnvironment();
+
+ fontBox = new JComboBox<String>(env.getAvailableFontFamilyNames());
+ fontBox.setSelectedItem(properties.getFontName());
+ fontBox.addItemListener(this);
+ fontPanel.add(fontBox);
+
+ int style = properties.getFontStyle();
+
+ boldBox = createCheckBox("properties.bold", "font",
+ (style & Font.BOLD) != 0);
+ fontPanel.add(boldBox);
+
+ italicBox = createCheckBox("properties.italic", "font",
+ (style & Font.ITALIC) != 0);
+ fontPanel.add(italicBox);
+
+ JLabel fontSizeLabel = createLabel("properties.size.font");
+ fontPanel.add(fontSizeLabel);
+
+ fontSizeBox = new JSpinner(
+ new SpinnerNumberModel(properties.getFontSize(), 2,100,1));
+ fontPanel.add(fontSizeBox);
+ fontSizeLabel.setLabelFor(fontSizeBox);
+ fontSizeBox.addChangeListener(this);
+
+ JPanel p = new JPanel();
+ box.add(p);
+
+ fontSample = new JLabel(app.getLabel("properties.font.sample"));
+ p.setBackground(Color.white);
+ p.setOpaque(true);
+ p.setBorder(BorderFactory.createEtchedBorder());
+ p.add(fontSample);
+
+ updateFontSample();
+
+ JPanel buttonPanel = new JPanel();
+ getContentPane().add(buttonPanel, "South");
+
+ buttonPanel.add(app.createOkayButton(this));
+ buttonPanel.add(app.createCancelButton(this));
+
+ JButton helpButton = new JButton(app.getLabel("button.help"));
+ helpButton.setMnemonic(app.getMnemonic("button.help"));
+ app.enableHelpOnButton(helpButton, "properties");
+ buttonPanel.add(helpButton);
+
+ pack();
+
+ setLocationRelativeTo(app);
+
+ updateOverride();
+ }
+
+ private void newTab(JTabbedPane tabbedPane, JComponent comp,
+ String label)
+ {
+ tabbedPane.add(app.getLabel(label), comp);
+ tabbedPane.setMnemonicAt(tabbedPane.getTabCount()-1,
+ app.getMnemonic(label));
+ }
+
+ private JRadioButton createRadioButton(String label, String action,
+ ButtonGroup bg)
+ {
+ JRadioButton button = new JRadioButton(app.getLabel(label));
+ button.setMnemonic(app.getMnemonic(label));
+ button.setActionCommand(action);
+ button.addActionListener(this);
+ bg.add(button);
+ button.setOpaque(false);
+
+ return button;
+ }
+
+ private JCheckBox createCheckBox(String parent, String label, boolean set)
+ {
+ JCheckBox box = new JCheckBox(app.getLabel(parent, label), set);
+ box.setMnemonic(app.getMnemonic(parent, label));
+ box.setActionCommand(label);
+ box.addActionListener(this);
+ box.setOpaque(false);
+
+ return box;
+ }
+
+ private JLabel createLabel(String label)
+ {
+ JLabel comp = new JLabel(app.getLabel(label));
+ comp.setDisplayedMnemonic(app.getMnemonic(label));
+
+ return comp;
+ }
+
+ private File getDir()
+ {
+ String makeindexApp = app.getMakeIndexApp();
+ String xindyApp = app.getXindyApp();
+
+ if ((makeindexApp == null || makeindexApp.equals(""))
+ &&(xindyApp == null || xindyApp.equals("")))
+ {
+ try
+ {
+ Process p = Runtime.getRuntime().exec("kpsewhich texmf.cnf");
+
+ if (p.waitFor() == 0)
+ {
+ BufferedReader in = null;
+
+ try
+ {
+ in = new BufferedReader(
+ new InputStreamReader(p.getInputStream(),
+ app.getEncoding()));
+
+ String line = in.readLine();
+
+ if (line != null)
+ {
+ File dir = (new File(line)).getParentFile();
+
+ if (dir.isDirectory())
+ {
+ return dir;
+ }
+ }
+ }
+ finally
+ {
+ if (in != null)
+ {
+ in.close();
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ return new File(properties.getDefaultDirectory());
+ }
+
+ public void actionPerformed(ActionEvent e)
+ {
+ String action = e.getActionCommand();
+
+ if (action == null) return;
+
+ if (action.equals("disablecustom"))
+ {
+ customField.setEnabled(false);
+ }
+ else if (action.equals("enablecustom"))
+ {
+ customField.setEnabled(true);
+ customField.requestFocusInWindow();
+ }
+ else if (action.equals("font"))
+ {
+ updateFontSample();
+ }
+ else if (action.equals("cancel"))
+ {
+ setVisible(false);
+ }
+ else if (action.equals("override"))
+ {
+ updateOverride();
+ }
+ else if (action.equals("okay"))
+ {
+ properties.setMakeIndexApp(makeindexField.getFileName());
+ properties.setXindyApp(xindyField.getFileName());
+ properties.setDefaultLanguage((String)languageBox.getSelectedItem());
+ properties.setDefaultCodePage(currentModule.getSelectedCodePage());
+
+ String variant = currentModule.getSelectedVariant();
+
+ if (variant != null)
+ {
+ properties.setDefaultXindyVariant(variant);
+ }
+
+ properties.setOverride(overrideBox.isSelected());
+ properties.setDocDefsCheck(docDefCheckBox.isSelected());
+ properties.setMissingLangCheck(missingLangModBox.isSelected());
+
+ if (homeButton.isSelected())
+ {
+ properties.setDefaultHomeDir();
+ }
+ else if (lastButton.isSelected())
+ {
+ properties.setDefaultLastDir();
+ }
+ else
+ {
+ String fileName = customField.getFileName();
+
+ if (fileName.equals(""))
+ {
+ app.error(this, app.getLabel("error.missing_dir_name"));
+ return;
+ }
+
+ File file = new File(fileName);
+
+ if (!file.isDirectory())
+ {
+ app.error(this,
+ app.getLabelWithValues("error.no_such_directory", fileName));
+ }
+
+ properties.setDefaultCustomDir(fileName);
+ }
+
+ boolean fontChanged=false;
+ String oldFont = properties.getFontName();
+ String newFont = (String)fontBox.getSelectedItem();
+ int oldStyle = properties.getFontStyle();
+ int newStyle = Font.PLAIN;
+ int oldSize = properties.getFontSize();
+ int newSize = ((Number)fontSizeBox.getValue()).intValue();
+
+ if (boldBox.isSelected())
+ {
+ newStyle = Font.BOLD;
+ }
+
+ if (italicBox.isSelected())
+ {
+ newStyle = newStyle | Font.ITALIC;
+ }
+
+ if (!oldFont.equals(newFont))
+ {
+ fontChanged = true;
+ properties.setFontName(newFont);
+ }
+
+ if (oldStyle != newStyle)
+ {
+ fontChanged = true;
+ properties.setFontStyle(newStyle);
+ }
+
+ if (oldSize != newSize)
+ {
+ fontChanged = true;
+ properties.setFontSize(newSize);
+ }
+
+ if (fontChanged)
+ {
+ app.updateFont();
+ }
+
+ properties.setLookAndFeel(
+ (UIManager.LookAndFeelInfo)lookAndFeelBox.getSelectedItem());
+
+ setVisible(false);
+ }
+ }
+
+ public void display()
+ {
+ setVisible(true);
+ }
+
+ private void updateOverride()
+ {
+ boolean enable = overrideBox.isSelected();
+
+ langLabel.setEnabled(enable);
+ languageBox.setEnabled(enable);
+ currentModule.setEnabled(enable);
+ }
+
+ public void setXindy(File path)
+ {
+ xindyField.setFile(path);
+ }
+
+ public void setMakeIndex(File path)
+ {
+ makeindexField.setFile(path);
+ }
+
+ private void initVariants(String lang, String defVariant, String defCode)
+ {
+ HashMap<String,XindyModule> modules = XindyModule.getKnownModules();
+
+ for (Iterator<String> it = modules.keySet().iterator(); it.hasNext();)
+ {
+ String key = it.next();
+ XindyModule mod = modules.get(key);
+ XindyModulePanel panel;
+
+ if (lang.equals(key))
+ {
+ panel = new XindyModulePanel(app, mod, defVariant, defCode);
+ currentModule = panel;
+ }
+ else
+ {
+ panel = new XindyModulePanel(app, mod);
+ }
+
+ modulesPanel.add(panel);
+ xindyModuleLayout.addLayoutComponent(panel, key);
+ }
+
+ xindyModuleLayout.show(modulesPanel, lang);
+ }
+
+ public void itemStateChanged(ItemEvent e)
+ {
+ Object source = e.getSource();
+
+ if (source == languageBox)
+ {
+ updateXindyModule();
+ }
+ else if (source == fontBox)
+ {
+ updateFontSample();
+ }
+ }
+
+ public void stateChanged(ChangeEvent e)
+ {
+ if (e.getSource() == fontSizeBox)
+ {
+ updateFontSample();
+ }
+ }
+
+ private void updateFontSample()
+ {
+ int style = Font.PLAIN;
+
+ if (boldBox.isSelected())
+ {
+ style = Font.BOLD;
+ }
+
+ if (italicBox.isSelected())
+ {
+ style = style | Font.ITALIC;
+ }
+
+ fontSample.setFont(new Font((String)fontBox.getSelectedItem(),
+ style, ((Number)fontSizeBox.getValue()).intValue()));
+
+ fontSample.repaint();
+ }
+
+ public void updateFontSize(int size)
+ {
+ fontSizeBox.setValue(size);
+ }
+
+ private void updateXindyModule()
+ {
+ String language = (String)languageBox.getSelectedItem();
+
+ for (int i = 0, n = modulesPanel.getComponentCount(); i < n; i++)
+ {
+ Component comp = modulesPanel.getComponent(i);
+
+ if (comp.getName().equals(language))
+ {
+ currentModule = (XindyModulePanel)comp;
+ xindyModuleLayout.show(modulesPanel, language);
+ return;
+ }
+ }
+
+ app.debug("Can't find module panel for language "+language);
+ currentModule = (XindyModulePanel)modulesPanel.getComponent(0);
+ xindyModuleLayout.first(modulesPanel);
+ }
+
+ private MakeGlossariesGUI app;
+
+ private CardLayout xindyModuleLayout;
+
+ private JPanel modulesPanel;
+
+ private JLabel langLabel, fontSample;
+
+ private XindyModulePanel currentModule;
+
+ private JRadioButton homeButton, lastButton, customButton;
+
+ private JComboBox<String> languageBox, fontBox;
+
+ private JComboBox<UIManager.LookAndFeelInfo> lookAndFeelBox;
+
+ private JSpinner fontSizeBox;
+
+ private FileField customField, makeindexField, xindyField;
+
+ private JFileChooser fileChooser;
+
+ private JCheckBox overrideBox, docDefCheckBox, missingLangModBox,
+ boldBox, italicBox;
+
+ private MakeGlossariesProperties properties;
+}
+
+class XindyModulePanel extends JPanel
+{
+ public XindyModulePanel(MakeGlossariesGUI app, XindyModule module)
+ {
+ this(app, module, null, null);
+ }
+
+ public XindyModulePanel(MakeGlossariesGUI app,
+ XindyModule module, String defVar, String defCode)
+ {
+ super();
+ setName(module.getLanguage());
+ this.module = module;
+ setOpaque(false);
+
+ encodingLabel = new JLabel(app.getLabel("properties.encoding"));
+ encodingLabel.setDisplayedMnemonic(app.getMnemonic("properties.encoding"));
+ add(encodingLabel);
+
+ codePageBox = new JComboBox<String>(module.getCodePages());
+ add(codePageBox);
+
+ if (defCode != null)
+ {
+ codePageBox.setSelectedItem(defCode);
+ }
+ else
+ {
+ codePageBox.setSelectedIndex(codePageBox.getItemCount()-1);
+ }
+
+ encodingLabel.setLabelFor(codePageBox);
+
+ if (module.hasVariants())
+ {
+ variantBox = new JComboBox<String>(module.getVariants());
+ variantBox.setSelectedItem(
+ defVar == null ? module.getDefaultVariant() : defVar);
+ add(variantBox);
+ }
+ }
+
+ public String getSelectedVariant()
+ {
+ return variantBox == null ? null :
+ (String)variantBox.getSelectedItem();
+ }
+
+ public String getSelectedCodePage()
+ {
+ return (String)codePageBox.getSelectedItem();
+ }
+
+ public void setEnabled(boolean enabled)
+ {
+ if (variantBox != null)
+ {
+ variantBox.setEnabled(enabled);
+ }
+
+ encodingLabel.setEnabled(enabled);
+ codePageBox.setEnabled(enabled);
+ }
+
+ private XindyModule module;
+ private JComboBox<String> variantBox = null;
+ private JComboBox<String> codePageBox = null;
+ private JLabel encodingLabel;
+}
+
+class LookAndFeelCellRenderer extends DefaultListCellRenderer
+{
+ public Component getListCellRendererComponent(JList<?> list,
+ Object value, int index, boolean isSelected, boolean cellHasFocus)
+ {
+ Component comp = super.getListCellRendererComponent(list, value, index,
+ isSelected, cellHasFocus);
+
+ if (value instanceof UIManager.LookAndFeelInfo)
+ {
+ setText(((UIManager.LookAndFeelInfo)value).getName());
+ }
+
+ return comp;
+ }
+}
diff --git a/support/makeglossariesgui/src/java/ViewEntries.java b/support/makeglossariesgui/src/java/ViewEntries.java
new file mode 100644
index 0000000000..de59b3d458
--- /dev/null
+++ b/support/makeglossariesgui/src/java/ViewEntries.java
@@ -0,0 +1,238 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.net.URL;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.regex.*;
+
+import javax.swing.*;
+import javax.swing.table.*;
+
+public class ViewEntries extends JDialog
+ implements ActionListener
+{
+ public ViewEntries(MakeGlossariesGUI application, Glossary g, Font font)
+ {
+ super(application, application.getLabelWithValues("entry.title", g.label),
+ true);
+
+ app = application;
+ glossary = g;
+ entryLabels = glossary.getEntryLabels();
+
+ setIconImage(app.getIconImage());
+
+ TableModel model = new AbstractTableModel()
+ {
+ public int getRowCount() {return entryLabels.length;}
+ public int getColumnCount() {return 3;}
+ public boolean isCellEditable(int row, int column) {return false;}
+
+ public Class<?> getColumnClass(int column)
+ {
+ return column < 2 ? String.class : Integer.class;
+ }
+
+ public Object getValueAt(int row, int column)
+ {
+ String label = entryLabels[row];
+
+ if (column == 0)
+ {
+ return label;
+ }
+ else if (column == 1)
+ {
+ return glossary.getEntrySort(label);
+ }
+ else if (column == 2)
+ {
+ return glossary.getEntryCount(label);
+ }
+
+ return null;
+ }
+
+ public String getColumnName(int columnIndex)
+ {
+ switch (columnIndex)
+ {
+ case 0: return app.getLabel("entry.label");
+ case 1: return app.getLabel("entry.sort");
+ case 2: return app.getLabel("entry.count");
+ }
+
+ return null;
+ }
+ };
+
+ table = new JTable(model);
+
+ table.setAutoCreateRowSorter(true);
+
+ table.setDefaultRenderer(String.class,
+ new EntryTableCellRenderer(this));
+ table.setFont(app.getFont());
+
+ getContentPane().add(new JScrollPane(table), "Center");
+
+ toolbar = new JToolBar();
+ getContentPane().add(toolbar, "North");
+
+ JLabel label = new JLabel(app.getLabel("entry", "find_label"));
+ label.setDisplayedMnemonic(app.getMnemonic("entry", "find_label"));
+ toolbar.add(label);
+
+ searchField = new JTextField(32);
+ searchField.registerKeyboardAction(this, "find",
+ KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
+ JComponent.WHEN_FOCUSED);
+ toolbar.add(searchField);
+ label.setLabelFor(searchField);
+
+ addButton("find", "Find24",
+ KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK));
+
+ pack();
+ setLocationRelativeTo(application);
+ }
+
+ private JButton addButton(String label, String imageName, KeyStroke keyStroke)
+ {
+ JButton button = new JButton();
+
+ String tooltip = app.getLabel("entry."+label, "tooltip");
+ String alttext = app.getLabel("entry", label);
+
+ String imgLocation = "/toolbarButtonGraphics/general/"+imageName+".gif";
+
+ URL imageURL = app.getClass().getResource(imgLocation);
+
+ button.setActionCommand(label);
+ button.addActionListener(this);
+
+ if (keyStroke != null)
+ {
+ button.registerKeyboardAction(this, label, keyStroke,
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+ }
+
+ button.setToolTipText(tooltip);
+
+ if (imageURL != null)
+ {
+ button.setIcon(new ImageIcon(imageURL, alttext));
+ }
+ else
+ {
+ button.setText(alttext);
+ System.err.println("Unable to find resource: "+imageURL);
+ }
+
+ toolbar.add(button);
+
+ return button;
+ }
+
+ public void actionPerformed(ActionEvent evt)
+ {
+ String action = evt.getActionCommand();
+
+ if (action == null) return;
+
+ if (action.equals("find"))
+ {
+ String label = searchField.getText();
+
+ int start = table.getSelectedRow();
+
+ int idx = -1;
+
+ Pattern p = Pattern.compile(label);
+
+ for (int i = start+1; i < entryLabels.length; i++)
+ {
+ Matcher m = p.matcher(entryLabels[i]);
+
+ if (m.find())
+ {
+ idx = i;
+ break;
+ }
+ }
+
+ for (int i = 0; idx == -1 && i <= start; i++)
+ {
+ Matcher m = p.matcher(entryLabels[i]);
+
+ if (m.find())
+ {
+ idx = i;
+ break;
+ }
+ }
+
+ if (idx == -1)
+ {
+ app.error(this,
+ app.getLabelWithValues("error.no_such_entry", label));
+ }
+ else
+ {
+ table.clearSelection();
+ table.addRowSelectionInterval(idx, idx);
+
+ Rectangle rect = table.getCellRect(idx, 1, true);
+ table.scrollRectToVisible(rect);
+ }
+ }
+ }
+
+ public boolean hasProblem(int row)
+ {
+ String label = entryLabels[row];
+
+ return glossary.hasProblem(label);
+ }
+
+ private Glossary glossary;
+
+ private String[] entryLabels;
+
+ private JTable table;
+
+ private JTextField searchField;
+
+ private MakeGlossariesGUI app;
+
+ private JToolBar toolbar;
+}
+
+class EntryTableCellRenderer extends DefaultTableCellRenderer
+{
+ public EntryTableCellRenderer(ViewEntries view)
+ {
+ super();
+ this.view = view;
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column)
+ {
+ Component comp = super.getTableCellRendererComponent(table,
+ value, isSelected, hasFocus, row, column);
+
+ if (column == 1 && view.hasProblem(row))
+ {
+ setForeground(Color.red);
+ }
+ else
+ {
+ setForeground(Color.black);
+ }
+
+ return comp;
+ }
+
+ private ViewEntries view;
+}
diff --git a/support/makeglossariesgui/src/java/ViewFile.java b/support/makeglossariesgui/src/java/ViewFile.java
new file mode 100644
index 0000000000..06db7fdf86
--- /dev/null
+++ b/support/makeglossariesgui/src/java/ViewFile.java
@@ -0,0 +1,96 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.awt.*;
+import java.io.*;
+import java.net.*;
+
+import javax.swing.*;
+import javax.swing.text.*;
+
+public class ViewFile extends JFrame
+{
+ public ViewFile(URL source, Font font, MakeGlossariesGUI application)
+ throws IOException,BadLocationException
+ {
+ super(source.getFile());
+
+ app = application;
+
+ setIconImage(app.getIconImage());
+
+ url = source;
+
+ area = new JTextPane();
+
+ StyledDocument doc = area.getStyledDocument();
+
+ Style def = StyleContext.getDefaultStyleContext()
+ .getStyle(StyleContext.DEFAULT_STYLE);
+
+ doc.addStyle("regular", def);
+
+ area.setEditable(false);
+
+ area.setFont(font);
+
+ scrollPane = new JScrollPane(area);
+
+ getContentPane().add(scrollPane, "Center");
+
+ scrollPane.setPreferredSize(new Dimension(500, 400));
+
+ pack();
+
+ setLocationRelativeTo(null);
+
+ reload();
+ }
+
+ public void reload()
+ throws IOException,BadLocationException
+ {
+ BufferedReader reader = null;
+
+ StringBuilder content = new StringBuilder();
+
+ try
+ {
+ reader = new BufferedReader(new InputStreamReader(
+ url.openStream(), app.getEncoding()));
+
+ String line;
+
+ while ((line = reader.readLine()) != null)
+ {
+ content.append(String.format("%s%n", line));
+ }
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ reader.close();
+ }
+ }
+
+ StyledDocument doc = area.getStyledDocument();
+ doc.insertString(0, content.toString(), doc.getStyle("regular"));
+
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ area.setCaretPosition(0);
+ }
+ }
+ );
+ }
+
+ private URL url;
+
+ private JTextPane area;
+
+ private JScrollPane scrollPane;
+
+ private MakeGlossariesGUI app;
+}
diff --git a/support/makeglossariesgui/src/java/XindyModule.java b/support/makeglossariesgui/src/java/XindyModule.java
new file mode 100644
index 0000000000..550fd26e21
--- /dev/null
+++ b/support/makeglossariesgui/src/java/XindyModule.java
@@ -0,0 +1,295 @@
+package com.dickimawbooks.makeglossariesgui;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+public class XindyModule
+{
+ public XindyModule(String language, String defVariant,
+ String[] variants, String[] codepages)
+ {
+ this.language = language;
+ this.defVariant = defVariant;
+ this.variants = variants;
+ this.codepages = codepages;
+ }
+
+ public XindyModule(String language, String[] codepages)
+ {
+ this(language, null, null, codepages);
+ }
+
+ public String getLanguage()
+ {
+ return language;
+ }
+
+ public String[] getVariants()
+ {
+ return variants;
+ }
+
+ public String getDefaultVariant()
+ {
+ return defVariant;
+ }
+
+ public boolean hasVariants()
+ {
+ return variants != null;
+ }
+
+ public String[] getCodePages()
+ {
+ return codepages;
+ }
+
+ public boolean hasCodePage(String code)
+ {
+ if (variants == null)
+ {
+ for (int i = 0; i < codepages.length; i++)
+ {
+ if (code.equals(codepages[i])) return true;
+ }
+
+ return false;
+ }
+
+ for (int i = 0; i < variants.length; i++)
+ {
+ for (int j = 0; j < codepages.length; j++)
+ {
+ if (code.equals(variants[i]+"-"+codepages[j]))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static XindyModule getModule(String lang)
+ {
+ if (knownModules == null)
+ {
+ initKnownModules();
+ }
+
+ return knownModules.get(lang);
+ }
+
+ public static HashMap<String,XindyModule> getKnownModules()
+ {
+ if (knownModules == null)
+ {
+ initKnownModules();
+ }
+
+ return knownModules;
+ }
+
+ public static String[] getKnownLanguages()
+ {
+ if (knownModules == null)
+ {
+ initKnownModules();
+ }
+
+ String[] languages = new String[knownModules.size()];
+
+ int idx = 0;
+
+ for (Iterator<String> it = knownModules.keySet().iterator();
+ it.hasNext(); idx++)
+ {
+ languages[idx] = it.next();
+ }
+
+ return languages;
+ }
+
+ private static void initKnownModules()
+ {
+ knownModules = new HashMap<String,XindyModule>();
+
+ // need to find some way to do this programmatically
+
+ knownModules.put("albanian",
+ new XindyModule("albanian", new String[]{"latin1", "utf8"}));
+
+ knownModules.put("belarusian",
+ new XindyModule("belarusian",
+ new String[]{"cp1251", "iso88595", "isoir111", "utf8"}));
+
+ knownModules.put("bulgarian",
+ new XindyModule("bulgarian",
+ new String[]{"cp1251", "iso88595", "koi8-r", "utf8"}));
+
+ knownModules.put("croatian",
+ new XindyModule("croatian",
+ new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("czech",
+ new XindyModule("czech",
+ new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("danish",
+ new XindyModule("danish",
+ new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("dutch",
+ new XindyModule("dutch", "ij-as-ij",
+ new String[]{"ij-as-ij", "ij-as-y"},
+ new String[]{"latin1", "utf8"}));
+
+ knownModules.put("english",
+ new XindyModule("english", new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("esperanto",
+ new XindyModule("esperanto", new String[]{"latin3", "utf8"}));
+
+ knownModules.put("estonian",
+ new XindyModule("estonian",
+ new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("finnish",
+ new XindyModule("finnish",
+ new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("french",
+ new XindyModule("french",
+ new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("general",
+ new XindyModule("general",
+ new String[]{"cp1252", "cp850", "latin9", "utf8"}));
+
+ knownModules.put("georgian",
+ new XindyModule("georgian", new String[]{"utf8"}));
+
+ knownModules.put("german",
+ new XindyModule("german", "din5007",
+ new String[]{"braille", "din5007", "duden"},
+ new String[]{"latin1", "utf8"}));
+
+ knownModules.put("greek",
+ new XindyModule("greek",
+ new String[]{"iso88597",
+ "polytonic-utf8",
+ "translit-latin4",
+ "translit-utf8",
+ "utf8"}));
+
+ knownModules.put("gypsy",
+ new XindyModule("gypsy", new String[]{"northrussian-utf8"}));
+
+ knownModules.put("hausa", new XindyModule("hausa", new String[]{"utf8"}));
+
+ knownModules.put("hebrew",
+ new XindyModule("hebrew", new String[]{"iso88598", "utf8"}));
+
+ knownModules.put("hungarian",
+ new XindyModule("hungarian", new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("icelandic",
+ new XindyModule("icelandic", new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("italian",
+ new XindyModule("italian", new String[]{"latin1", "utf8"}));
+
+ knownModules.put("klingon",
+ new XindyModule("klingon", new String[]{"utf8"}));
+
+ knownModules.put("korean",
+ new XindyModule("korean", new String[]{"utf8"}));
+
+ knownModules.put("kurdish",
+ new XindyModule("kurdish", "bedirxan",
+ new String[]{"bedirxan", "turkish-i"},
+ new String[]{"latin5", "utf8"}));
+
+ knownModules.put("latin", new XindyModule("latin", new String[]{"utf8"}));
+
+ knownModules.put("latvian",
+ new XindyModule("latvian", new String[]{"latin4", "utf8"}));
+
+ knownModules.put("lithuanian",
+ new XindyModule("lithuanian", new String[]{"latin4", "utf8"}));
+
+ knownModules.put("lower-sorbian",
+ new XindyModule("lower-sorbian",
+ new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("macedonian",
+ new XindyModule("macedonian",
+ new String[]{"cp1251", "iso88595", "isoir111", "utf8"}));
+
+ knownModules.put("mongolian",
+ new XindyModule("mongolian", new String[]{"cyrillic-utf8"}));
+
+ knownModules.put("norwegian",
+ new XindyModule("norwegian", new String[]{"latin1", "utf8"}));
+
+ knownModules.put("persian",
+ new XindyModule("persian", "variant1",
+ new String[]{"variant1", "variant2", "variant3"},
+ new String[]{"utf8"}));
+
+ knownModules.put("polish",
+ new XindyModule("polish", new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("portuguese",
+ new XindyModule("portuguese", new String[]{"latin1", "utf8"}));
+
+ knownModules.put("romanian",
+ new XindyModule("romanian", new String[]{"latin2", "utf8"}));
+
+ knownModules.put("russian",
+ new XindyModule("russian",
+ new String[]{"cp1251", "iso88595", "koi8-r", "translit-iso-utf8",
+ "utf8"}));
+
+ knownModules.put("serbian",
+ new XindyModule("serbian",
+ new String[]{"cp1251", "iso88595", "isoir111", "utf8"}));
+
+ knownModules.put("slovak",
+ new XindyModule("slovak", "large",
+ new String[]{"large", "small"},
+ new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("slovenian",
+ new XindyModule("slovenian", new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("spanish",
+ new XindyModule("spanish", "modern",
+ new String[]{"modern", "traditional"},
+ new String[]{"latin1", "utf8"}));
+
+ knownModules.put("swedish",
+ new XindyModule("swedish",
+ new String[]{"cp1252", "latin9", "utf8"}));
+
+ knownModules.put("turkish",
+ new XindyModule("turkish", new String[]{"latin3", "latin5", "utf8"}));
+
+ knownModules.put("ukrainian",
+ new XindyModule("ukrainian", new String[]{"cp1251", "koi8-u", "utf8"}));
+
+ knownModules.put("upper-sorbian",
+ new XindyModule("upper-sorbian",
+ new String[]{"cp1250", "latin2", "utf8"}));
+
+ knownModules.put("vietnamese",
+ new XindyModule("vietnamese", new String[]{"utf8"}));
+ }
+
+ private String language, defVariant;
+
+ private String[] variants, codepages;
+
+ private static HashMap<String,XindyModule> knownModules;
+
+}
diff --git a/support/makeglossariesgui/src/resources/dictionaries/makeglossariesgui-en.prop b/support/makeglossariesgui/src/resources/dictionaries/makeglossariesgui-en.prop
new file mode 100644
index 0000000000..6fa96a2de2
--- /dev/null
+++ b/support/makeglossariesgui/src/resources/dictionaries/makeglossariesgui-en.prop
@@ -0,0 +1,310 @@
+# Encoding: UTF-8
+# English language file for makeglossaries-gui
+# Tab -> \t newline -> \n literal backslash -> \\
+# Control sequence (literal) -> |csname|
+
+# File menu
+file=File
+file.mnemonic=F
+file.open=Open...
+file.open.mnemonic=O
+file.open.tooltip=Load an auxiliary (.aux) file
+file.open.alttext=Load File
+file.reload=Reload
+file.reload.mnemonic=R
+file.reload.tooltip=Reload current file
+file.reload.alttext=Reload
+file.recent=Recent
+file.recent.mnemonic=T
+file.quit=Quit
+file.quit.mnemonic=Q
+
+# Settings menu
+settings=Settings
+settings.mnemonic=S
+settings.incsize=Increase Font Size
+settings.incsize.mnemonic=I
+settings.incsize.tooltip=Increase font size
+settings.incsize.alttext=Increase Font Size
+settings.decsize=Decrease Font Size
+settings.decsize.mnemonic=D
+settings.decsize.tooltip=Decrease font size
+settings.decsize.alttext=Decrease Font Size
+settings.dryrun=Dry Run Mode
+settings.dryrun.mnemonic=N
+settings.editproperties=Edit Properties...
+settings.editproperties.mnemonic=P
+settings.editproperties.tooltip=Edit application settings
+settings.editproperties.alttext=Settings
+
+# Help menu
+help=Help
+help.mnemonic=H
+help.about=About
+help.about.mnemonic=A
+help.license=License
+help.license.mnemonic=L
+help.manual=Manual
+help.manual.mnemonic=M
+help.manual.tooltip=Manual
+help.manual.alttext=Help
+
+# about dialog
+about.title=About {0}
+about.version=Version {0} ({1})
+about.copyright=Copyright {0} {1}
+about.translator_info=
+
+# StdOut Syntax
+syntax.cmdline=makeglossariesgui [<options>] [<filename>]
+syntax.filename=<filename> is required with the {0} option. The ".aux" extension may be omitted.
+syntax.options=Options:
+syntax.batch={0} (or {1})\t\trun in batch mode
+syntax.gui={0}\t\t\trun in GUI mode (default)
+syntax.quiet={0}\t\t\tsuppress messages normally written to stdout
+syntax.help={0} (or {1})\t\tprint the help message
+syntax.version={0} (or {1})\tprint the application version
+syntax.debug={0}\t\t\tprint debug messages to stdout
+syntax.dryrun={0} (or {1})\tdry run mode
+syntax.nodryrun={0}\t\tnot dry run mode (default)
+
+# file filter
+filter.aux=Auxiliary (AUX) Files
+
+# application selector
+appselect.title=Select Application
+appselect.pathlabel=Select path to application
+appselect.pathlabel.mnemonic=P
+
+app.title={0} - {1}
+
+# Main panel
+main.title=General Information
+main.title.mnemonic=I
+main.aux=Main AUX File:
+main.order=Order:
+main.ist=Style File:
+main.list=Defined Glossaries:
+main.indexer=Index Format:
+main.encoding=Indexer Encoding:
+main.docencoding=Document Encoding:
+main.glossary=Glossary {0}:
+main.glossary.log=Transcript:
+main.glossary.gls=Output:
+main.glossary.glo=Input:
+main.glossary.language=Language:
+main.glossary.codepage=Code Page:
+main.up_to_date=Up to date
+main.out_of_date=Out of date
+main.empty=Empty
+main.num_entries=Number of Entries:
+main.view=View
+main.details=Details
+
+# Entry viewer
+entry.title=Glossary ''{0}''
+entry.label=Entry Tag
+entry.sort=Sort
+entry.count=Occurrences
+entry.find=Find
+entry.find.tooltip=Find entry
+entry.find_label=Tag:
+entry.find_label.mnemonic=T
+
+# popup menu
+popup.select_all=Select All
+popup.select_all.mnemonic=A
+popup.copy=Copy
+popup.copy.mnemonic=C
+
+# Diagnostics panel
+diagnostics.title=Diagnostics
+diagnostics.title.mnemonic=D
+diagnostics.no_file=Use <b>{0} &gt; {1}</b> to parse your document''s .aux file.
+diagnostics.advisory=Advisory Notes:
+diagnostics.no_glossaries=Either your document hasn''t loaded the glossaries package, or you have selected the wrong auxiliary file.
+diagnostics.no_version=Can''t detect the version number for the glossaries package. Have you remembered to load it (<code>|usepackage|'{'glossaries'}'</code>)?
+diagnostics.not_aux=The file you have selected doesn''t seem to be an auxiliary (.aux) file.
+diagnostics.no_makeglossaries=Your document doesn''t seem to have used <code>|makeglossaries|</code> or the appropriate information hasn''t been correctly written to the .aux file.
+diagnostics.no_errors=No errors detected. If you are missing entries, check the following:<ul><li>Have you used commands like <code>|gls|</code> or <code>|glsadd|</code> in the document?</li><li>If you have used commands like <code>|glsadd|</code> or <code>|glsaddall|</code> in the preamble, have you remembered to put them <em>after</em> <code>|makeglossaries|</code>?</li><li>If you have cross-referenced entries (for example, you have only referenced an entry in the <code>description</code> of another entry) you may need to retry making the glossaries after you have rerun LaTeX. (If you have used the <code>see</code> key, you might want to consider using <a href="http://ctan.org/pkg/glossaries-extra"><tt>glossaries-extra</tt></a> if you haven''t already done so.)</li><li>If you have at least version 4.24 of the <tt>glossaries</tt> package, have you used the <code>debug</code> option? (That might provide some more information for me to analyse.)</li></ul>
+diagnostics.build=If you''re having difficulty integrating the glossary generation into your document build, try <a href="https://www.dickimaw-books.com/latex/buildglossaries/">Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build</a>.<p>Remember that you need to rerun LaTeX after generating the glossary files.
+diagnostics.query_one=Would you like to {0}?
+diagnostics.query_two=Would you like to {0} or {1}?
+diagnostics.test_script=test {0} script
+diagnostics.clear_test_results=Clear test results.
+diagnostics.test_successful=It seems that {0} is correctly installed.
+diagnostics.no_indexer=Use the <b>Settings</b> menu to set the correct path to the <tt>{0}</tt> executable.
+diagnostics.no_language=The language is missing for glossary <tt>{0}</tt>. Have you accidentally done <code>|GlsSetXdyLanguage|[{0}]'{}'</code> or <code>xindy='{'language='}'</code>? I''ve used the fallback <tt>{1}</tt> instead.
+diagnostics.language_no_glossary=Check you have spelt the name of the glossary label correctly when using <code>|GlsSetXdyLanguage|[{1}]'{'{0}'}'</code> or check that you have defined glossary <tt>{1}</tt>.
+diagnostics.codepage_no_glossary=Check you have spelt the name of the glossary label correctly when using <code>|GlsSetXdyCodePage|[{1}]'{'{0}'}'</code> or check that you have defined glossary <tt>{1}</tt>.
+diagnostics.no_codepage=You need to specify the code page for the {0} glossary (e.g. <code>utf8</code> or <code>latin1</code>) either using the <tt>inputenc</tt> package or setting it via <code>|GlsSetXdyCodePage|[{0}]'{'<em>codepage</em>'}'</code>. I''ve used the fallback <code>{1}</code> instead.
+diagnostics.unknown.encoding=I don''t recognise the encoding label ''{0}'' (or your Java Virtual Machine doesn''t support it).
+diagnostics.doc_indexer_encoding_mismatch=The indexer encoding ''{0}'' doesn''t seem to match {1,choice,1#the document encoding|1<any of the supported document encodings} ({2}). This may not be a problem if you aren''t using extended characters in the sort values.
+diagnostics.xindy_no_doc_encoding=You are using xindy, but I can''t detect the document encoding. I''m guessing you''re just using ASCII. If this isn''t the case then you need to add the inputenc package or switch to XeLaTeX/LuaLaTeX.
+diagnostics.makeindex_reject_all=Makeindex has rejected all entries in glossary <tt>{0}</tt>.
+diagnostics.bad_attributes=The file <tt>{0}</tt> doesn''t seem to be a valid {1} style file. When you set the style name, make sure you use <code>|SetStyleFile|</code> instead of redefining <code>|istfilename|</code> and avoid using <code>|glsxindytrue|</code> or <code>|glsxindyfalse|</code>.
+diagnostics.no_entries=There were no entries listed for glossary <tt>{0}</tt>. Remember that you must index entries for them to appear in the glossary using the commands provided by the glossaries package. Entries that have been defined but not indexed won''t be listed. Check the following:<ul><li>Have you used commands like <code>|gls|</code> or <code>|glsadd|</code> in the document? (If you haven''t, you need to add them.)</li><li>If you have used commands like <code>|glsadd|</code> or <code>|glsaddall|</code> in the preamble, have you remembered to put them <em>after</em> <code>|makeglossaries|</code></li><li>If you have cross-referenced entries (for example, you have only referenced an entry in the <code>description</code> of another entry) you may need to retry making the glossaries after you have rerun LaTeX.</li><li>If you have at least version 4.24 of the <tt>glossaries</tt> package, have you used the <code>debug</code> option? (That might provide some more information for me to analyse.)</li></ul><p>If you don''t want to index entries, you may want to consider using <code>|printunsrtglossary|</code> provided by <a href="https://ctan.org/pkg/glossaries-extra">glossaries-extra</a> instead.
+diagnostics.no_entries_main=There were no entries listed for the main glossary. Remember that you must index entries for them to appear in the glossary using the commands provided by the glossaries package. Entries that have been defined but not indexed won''t be listed. If you don''t want to use this glossary, add the <code>nomain</code> package option to your document. Check the following:<ul><li>Have you used commands like <code>|gls|</code> or <code>|glsadd|</code> in the document? (If you haven''t, you need to add them.)</li><li>If you have used commands like <code>|glsadd|</code> or <code>|glsaddall|</code> in the preamble, have you remembered to put them <em>after</em> <code>|makeglossaries|</code>?</li><li>If you have at least version 4.24 of the <tt>glossaries</tt> package, have you used the <code>debug</code> option? (That might provide some more information for me to analyse.)</li></ul><p>If you don''t want to index entries, you may want to consider using <code>|printunsrtglossary|</code> provided by <a href="https://ctan.org/pkg/glossaries-extra">glossaries-extra</a> instead.
+diagnostics.app_err={0} reported the following:<pre>{1}</pre>
+diagnostics.app_err_null=I''m stumped. Nothing was detected on the error output stream.
+diagnostics.unknown_language_or_codepage=Xindy doesn''t have a module for the combination of language <tt>{0}</tt> and codepage <tt>{1}</tt>. Use <code>|GlsSetXdyLanguage|</code> and/or <code>|GlsSetXdyCodePage|</code> to select the closest matching known language and codepage combination.
+diagnostics.io_error=An I/O error occurred. Use the <b>Settings</b> menu to check the paths to makeindex and xindy are correct, and check that the applications have the correct permissions. If you are using xindy, make sure that you also have Perl installed.
+diagnostics.interrupt=Something interrupted the process thread.
+diagnostics.no_ist=The style file can''t be found. If you have used <code>|noist|</code>, you have to supply your own style file.
+diagnostics.empty_sort=Xindy won''t accept the sort value <code>{0}</code> (for entry <code>{1}</code>) as it''s treated as an empty string. This is because xindy ignores (La)TeX commands within the sort field, so once all commands have been stripped from <code>{0}</code> the sort field becomes empty. You will need to explicitly set the sort field using the <code>sort</code> key in the entry definition. Alternatively, you may prefer to use <code>|glsxtrnewsymbol|</code> provided by the <code>symbols</code> package option with <a href="https://ctan.org/pkg/glossaries-extra">glossaries-extra</a> to define symbols (which uses the label as the sort value) or consider using <a href="https://ctan.org/pkg/bib2gls">bib2gls</a> instead of xindy.
+diagnostics.deprecated=You seem to be using a very old version of glossaries.sty. This may cause some complications from bugs or limitations associated with that version. I recommend you upgrade using your TeX distribution manager.
+diagnostics.oldversion=You are using version {0} ({1}) of glossaries.sty. There have been some bug fixes in newer versions that may have addressed some issues you might be facing. I recommend you upgrade using your TeX distribution manager.
+diagnostics.wrong_type=It looks as though you might have done something like <code>|printglossary|[type='{'{0}'}']</code>, but there''s no <tt>{0}</tt> glossary.
+diagnostics.wrong_type_noidx=It looks as though you might have done something like <code>|printnoidxglossary|[type='{'{0}'}']</code>, but there''s no <tt>{0}</tt> glossary.
+diagnostics.no_log=I can''t find the log file <pre>{0}</pre> so I can''t search for any more problems.
+diagnostics.multi_aux=There are multiple .aux files listed in the directory <pre>{0}</pre> Have you selected the correct file? (The base name should be the same as for the main .tex file or matching the <code>-jobname</code> option.)
+diagnostics.doc_defs=It seems you have defined terms in the document rather than in the preamble. <a href="http://mirror.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sec:docdefs">This can cause complications.</a> If you really want them in the document, you may need to delete the file <pre>{0}</pre> if something goes wrong or rebuild the document after making any modifications to the entry definitions. Remember that you can define terms in a separate file and load them using <code>|loadglsentries|'{'<em>filename</em>'}'</code> or <code>|input|'{'<em>filename</em>'}'</code>. If you really want document definitions, you can switch off this message using the <b>Settings</b> menu or consider using the <a href="https://ctan.org/pkg/glossaries-extra">glossaries-extra</a> package with the <code>docdef=restricted</code> option.
+diagnostics.missing_lang=You don''t have any glossaries support for language <tt>{0}</tt>. This could simply mean that you need to install <tt>glossaries-{0}</tt> using your TeX package manager. However, if <tt>glossaries-{0}</tt> isn''t listed (or <a href="https://ctan.org/pkg/glossaries-{0}"><tt>https://ctan.org/pkg/glossaries-{0}</tt></a> doesn''t exist), it most likely means <tt>{0}</tt> isn''t supported, in which case see <a href="http://mirror.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sec:languages">section 1.4 (Multi-Lingual Support)</a> of the <a href="http://mirror.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html">glossaries user manual</a> for further help.
+diagnostics.missing_sty=The package <tt>{0}</tt> is required but doesn''t seem to be installed. Use your TeX package manager to install it. If your package manager can''t find it, try searching for it on CTAN <a href="https://ctan.org/search/?phrase={0}"><tt>http://ctan.org/search/?phrase={0}</tt></a>
+diagnostics.missing_datatool_base=The package <tt>datatool-base</tt> is required but doesn''t seem to be installed. This package is part of the <a href="https://ctan.org/pkg/datatool">datatool</a> bundle. If you already have <tt>datatool</tt> installed it could be that you have an old version that doesn''t include <tt>datatool-base.sty</tt>. Use your TeX package manager to install or update <tt>datatool</tt>.
+diagnostics.noidx=It seems you''ve used <code>|makenoidxglossaries|</code>, which means you don''t need xindy or makeindex, you just need a second LaTeX run to get the glossary up to date. (This is quite a slow and unreliable method of sorting and indexing. You may want to consider using <code>|printunsrtglossary|</code> provided by <a href="https://ctan.org/pkg/glossaries-extra">glossaries-extra</a> instead. See the <a href="https://www.dickimaw-books.com/gallery/glossaries-performance.shtml">glossaries performance page</a> for a comparison.)
+diagnostics.bib2gls=It seems you''ve used <code>|GlsXtrLoadResources|</code> (or <code>|glsxtrresourcefile|</code>), which means you need to run <pre>bib2gls -g {0}</pre> (you may omit the <code>-g</code> switch if you don''t require letter groups) and then rerun LaTeX. You don''t need makeindex or xindy for this document.
+diagnostics.bib2gls_norecords=No records were found in the .aux file. Have you remembered to use the <code>record</code> package option? If you want all entries selected, remember to use <code>selection=all</code> in <code>|GlsXtrLoadResources|</code> not <code>|glsaddall|</code> or <code>|glsaddallunused|</code>.
+diagnostics.missing_glstex=bib2gls is needed to create the missing file ''{0}'' to resolve undefined entry warnings. (Only one bib2gls call is required to create all .glstex files for the document if you have multiple resource sets.)
+diagnostics.missing_glstex_hybrid=bib2gls is needed to create the missing file ''{0}''. (Only one bib2gls call is required to create all .glstex files for the document if you have multiple resource sets.) Since you are using a hybrid bib2gls/makeglossaries document, the indexing can''t be performed until this file has been created.
+diagnostics.bib2gls_build=The complete build process is:<pre>{0} {1}\nbib2gls -g {1}\n{0} {1}</pre>(The -g switch may be omitted if you don''t require letter groups.)
+diagnostics.hybrid_build=The complete build process is:<pre>{0} {1}\nbib2gls -g {1}\n{0} {1}\n{2} {1}\n{0} {1}</pre>(The -g switch may be omitted if you don''t require letter groups.)<p>Are you sure you want this hybrid approach? bib2gls can sort and collate. The hybrid approach is only necessary if you have a specific xindy rule that can''t be replicated by bib2gls''s custom sort rule or if you require particular xindy location classes or location types in an order that''s counter to the document page ordering. If you are happy to just use bib2gls then change the package option <code>record=alsoindex</code> to <code>record=only</code> (or just <code>record</code>), remove <code>|makeglossaries|</code> and replace <code>|printglossary|</code> with <code>|printunsrtglossary|</code>.
+diagnostics.shell_disabled=It seems that TeX refused to run the system command <pre>{0}</pre> because the shell escape had been disabled.
+diagnostics.shell_restricted=It seems that TeX refused to run the system command <pre>{0}</pre> because the restricted mode was on and {1} isn''t on the list of trusted applications. You will need to incorporate the {1} call as part of your document build process.diagnostics.no_glossaries=The document doesn''t define any glossaries. Have you used the <code>nomain</code> option by mistake?
+diagnostics.undef_cs=LaTeX reported an undefined control sequence. Perhaps you''re trying to use a command that has been introduced in a later version of one of the packages you''re using. If this is the case, you''ll need to use your TeX package manager to update the relevant package. Alternatively, you may simply have misspelt the command or forgotten to define it or forgotten to load the package that provides it. Details:<pre>{0}</pre>
+diagnostics.undef_indexspace=It seems that <code>|indexspace|</code> hasn''t been defined. This suggests you''re using an old version of <tt>glossaries</tt> with a class that doesn''t define this command. I recommend you upgrade to a newer version of <tt>glossaries</tt> using your TeX package manager.
+diagnostics.too_long={0,number,integer} {0,choice,1#entry was|1<entries were} too long for makeindex. Do you have an excessively long <code>sort</code> field or label for {0,number,integer} {0,choice,1#that entry|1<those entries}?
+diagnostics.old_too_long={0,number,integer} {0,choice,1#entry was|1<entries were} too long for makeindex. If you upgrade to at least v4.0 of the glossaries package, this shouldn''t be a problem.
+diagnostics.undef_opt=Your version of glossaries doesn''t provide the package option <code>{0}</code>. This may be because that option was introduced to a later version, in which case you will need to use your TeX package manager to update the glossaries package, or it may be that you have misspelt the option.
+diagnostics.dry_run=Dry run mode on. System command would''ve been:
+diagnostics.wrglossary=It seems you have tried to index an entry in the <tt>{0}</tt> glossary on <b>line {1}</b>, but the associated file hasn''t been opened. Remember to use <code>|makeglossaries|</code> before commands like <code>|glsadd|</code> and <code>|glsaddall|</code>. Details of lost indexing code:
+diagnostics.mapped_lang=Your document has requested that xindy be run with language ''{0}''. This is a babel or polyglossia language identifier. I''m going to assume you meant the xindy language module ''{1}''.
+diagnostics.variant=Your document has requested that xindy be run with codepage ''{1}'', but language ''{0}'' requires additional information. I''m going to assume you meant ''{2}-{1}'' for the codepage. (Use <b>Dry Run Mode</b> to find the exact call to xindy.)
+diagnostics.no_aux=Since the aux file doesn''t exist, there''s not much I can do to help, but I''ll parse the log file in case there are any clues there.
+diagnostics.fragile=It''s possible that there''s an expansion issue involving a fragile command. Things to check for:<ul><li>Have you used a class like <tt>beamer</tt> that doesn''t make common formatting commands like <tt>|textit|</tt> robust?</li><li>Have you tried using <code>|protect|</code> in front of fragile commands contained within your entry definitions?</li><li>Have you tried switching off the expansion using commands like <code>|glsnoexpandfields|</code>? (See section <a href="http://mirror.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sec:expansion">4.6 Expansion</a> in the <tt>glossaries</tt> user manual.)</li></ul>
+diagnostics.inputenc=There''s a Unicode character error message from the <tt>inputenc</tt> package. This may or may not be related to any issues you might be having with the <tt>glossaries</tt> package, but remember that if you want to have non-ASCII characters in your entry labels (such as accented letters) you must use XeLaTeX or LuaLaTeX.
+diagnostics.labels_with_problem_char={0,number,integer} {0,choice,1#entry|1<entries} in glossary <tt>{1}</tt> {0,choice,1#contains|1<contain} one or more problem characters in the label: {2}.
+diagnostics.include=Detected possible <code>|include|'{'{0}'}'</code> in the preamble. Remember that <code>|include|</code> should only be used within the <code>document</code> environment. I recommend you use <code>|input|'{'{0}'}'</code> instead. (See also <a href="http://www.dickimaw-books.com/cgi-bin/faq.cgi?action=view&categorylabel=glossaries#include">Why shouldn''t I use <code>|include|</code> to include my glossary definitions?</a>)
+diagnostics.ist_in_log=The indexer information has been written to the .log file instead of the .aux file. This suggests that the .aux file wasn''t available when it was written. The most probable cause is that <code>|makeglossaries|</code> has been placed in a file that has been read using <code>|include|</code> instead of <code>|input|</code>.
+diagnostics.problem_group_label=There seems to be a problem with the letter group label {0}. The label is used to construct a command name, so it can''t contain any special characters. (This includes extended characters if you''re using inputenc.sty.)
+diagnostics.suggest_bib2gls=You may want to consider using bib2gls instead.
+diagnostics.suggest_unicode_or_bib2gls=You may want to consider using xindy with a LaTeX engine that has native Unicode support (XeLaTeX or LuaLaTeX) or use bib2gls instead.
+diagnostics.at_least_version=You need at least version {0} of {1}.
+
+# Properties dialog
+properties.title=Preferences
+properties.start_dir=Start Up Directory
+properties.start_dir.mnemonic=S
+properties.dir.home=Home
+properties.dir.home.mnemonic=H
+properties.dir.last=Last Used Directory
+properties.dir.last.mnemonic=L
+properties.dir.custom=Custom:
+properties.dir.custom.mnemonic=U
+properties.override=Override document language settings
+properties.override.mnemonic=R
+properties.applications=Applications
+properties.applications.mnemonic=A
+properties.makeindex=Path to Makeindex:
+properties.makeindex.mnemonic=M
+properties.xindy=Path to Xindy:
+properties.xindy.mnemonic=X
+properties.german_word_order=German Word Order
+properties.german_word_order.mnemonic=G
+properties.language=Language
+properties.language.mnemonic=G
+properties.encoding=Encoding
+properties.encoding.mnemonic=E
+properties.diagnostics=Diagnostics
+properties.diagnostics.mnemonic=D
+properties.docdefcheck=Check for document definitions
+properties.docdefcheck.mnemonic=D
+properties.langcheck=Check for missing language modules
+properties.langcheck.mnemonic=M
+properties.gui=GUI
+properties.gui.mnemonic=G
+properties.font.sample=Sample Text
+properties.font=Font
+properties.font.mnemonic=F
+properties.bold.font=Bold
+properties.bold.font.mnemonic=B
+properties.italic.font=Italic
+properties.italic.font.mnemonic=I
+properties.size.font=Size
+properties.size.font.mnemonic=Z
+properties.look_and_feel=Look and Feel
+properties.look_and_feel.mnemonic=K
+properties.restart=(restart required)
+
+# batch mode messages
+message.loading=Loading ''{0}''
+message.found=Found {0}
+
+# Error messages
+error.title=Error
+error.io.file_doesnt_exist=File ''{0}'' doesn''t exist.
+error.no_such_file=File not found.
+error.no_xindy=Can''t find Xindy application.
+error.no_makeindex=Can''t find Makeindex application.
+error.no_makeglossaries=Can''t find {0} script. Is glossaries.sty installed and up-to-date?
+error.missing_application=Can''t find {0} on the system path (PATH={1}). Have you installed {0}?
+error.no_perl=Perl is required to run {0}.
+error.no_glossaries=No glossaries defined.
+error.invalid_order=Invalid order ''{0}'' (must be either ''letter'' or ''word'').
+error.missing_order=Missing order.
+error.missing_ist=Missing style file.
+error.cant_determine_indexer=Can''t determine indexer.
+error.bib2gls_indexer=This document requires bib2gls not makeindex or xindy.
+error.unknown=Unknown
+error.missing_dir_name=Missing directory name.
+error.no_such_directory=''{0}'' doesn''t exist or isn''t a directory.
+error.no_language=Missing language for glossary ''{0}''.
+error.no_codepage=Missing codepage for glossary ''{0}''.
+error.language_no_glossary=Language is set to ''{0}'' for glossary ''{1}'', but no such glossary exists.
+error.codepage_no_glossary=Codepage is set to ''{0}'' for glossary ''{1}'', but no such glossary exists.
+error.entries_rejected={0,number,integer} {0,choice,1#entry was|1<entries were} rejected.
+error.no_entries=No entries were found for glossary ''{0}''.
+error.empty_sort=Xindy has ignored one or more entries with empty sort strings.
+error.app_failed={0} failed with exit code {1}.
+error.no_indexer_app=Unable to run {0}. No such file: ''{1}''.
+error.wrong_type=No glossary ''{0}''.
+error.interrupt=The process was interrupted.
+error.no_such_entry=Can''t find entry ''{0}''.
+error.io.helpset=Unable to load helpset.
+error.no_ist=The style file ''{0}'' doesn''t exist.
+error.prop_io=Unable to load properties: {0}
+error.unknown_opt=Unknown option ''{0}''. (Use --help for help.)
+error.one_input=Only one input file permitted. (Use --help for help.)
+error.input_required=Input file required for batch mode. (Use --help for help.)
+error.invalid_query=Invalid query data {0}.
+
+# Fatal errors
+error.fatal.title=Fatal Error
+error.fatal.info=A fatal error has occurred. {0} will have to quit.
+
+# Button labels
+button.okay=Okay
+button.okay.mnemonic=O
+button.cancel=Cancel
+button.cancel.mnemonic=C
+button.select=Select
+button.select.mnemonic=S
+button.help=Help
+button.help.mnemonic=P
+
+# Context labels in manual
+manual.title=Manual
+manual.figure=Figure
+manual.table=Table
+manual.next=Next
+manual.prev=Previous
+manual.home=Home
+manual.options=Options
+manual.toc=Table of Contents
+manual.index=Index
+manual.search=Search
+manual.idxpackage=package
+manual.idxenv=environment
+manual.example=Example
+manual.seealso=See also:
+
diff --git a/support/makeglossariesgui/src/resources/glossary-info-template.html b/support/makeglossariesgui/src/resources/glossary-info-template.html
new file mode 100644
index 0000000000..c096578e8d
--- /dev/null
+++ b/support/makeglossariesgui/src/resources/glossary-info-template.html
@@ -0,0 +1,46 @@
+<div id=glossaryinfo-LABEL>
+ <h2 id=glossaryheader-LABEL></h2>
+ <table id=xindy>
+ <tr>
+ <th id=langlabel-LABEL></th>
+ <td id=langinfo-LABEL></td>
+ </tr>
+ <tr>
+ <th id=codelabel-LABEL></th>
+ <td id=codeinfo-LABEL></td>
+ </tr>
+ </div>
+ </table>
+ <table>
+ <tr>
+ <th id=loglabel-LABEL></th>
+ <td id=loginfo-LABEL>
+ <object id=logname-LABEL></object>&#032;
+ (<object id=logmod-LABEL></object>.)&#032;
+ <object id=logview-LABEL></object>
+ </td>
+ </tr>
+ <tr>
+ <th id=glslabel-LABEL></th>
+ <td id=glsinfo-LABEL>
+ <object id=glsname-LABEL></object>&#032;
+ (<object id=glsmod-LABEL></object>.)&#032;
+ <object id=glsview-LABEL></object>
+ </td>
+ </tr>
+ <tr>
+ <th id=glolabel-LABEL></th>
+ <td id=gloinfo-LABEL>
+ <object id=gloname-LABEL></object>&#032;
+ (<object id=glomod-LABEL></object>.)&#032;
+ <object id=gloview-LABEL></object>
+ </td>
+ </tr>
+ <tr>
+ <th id=entrieslabel-LABEL></th>
+ <td id=entriesinfo-LABEL></td>
+ </tr>
+ </table>
+ <div id=error-LABEL>
+ </div>
+</div>
diff --git a/support/makeglossariesgui/src/resources/information-template.html b/support/makeglossariesgui/src/resources/information-template.html
new file mode 100644
index 0000000000..9920584228
--- /dev/null
+++ b/support/makeglossariesgui/src/resources/information-template.html
@@ -0,0 +1,47 @@
+<html>
+ <head>
+ <title>Information</title>
+ <style type="text/css" >
+ h2 { font-size: larger; }
+ ul { color: blue; }
+ th { text-align: left; }
+ td { text-align: left; }
+ font.error { color: red; }
+ font.errormess { color: red; font-weight: bold; }
+ </style>
+ </head>
+ <body>
+ <table>
+ <tr>
+ <th id=auxlabel></th>
+ <td id=aux></td>
+ </tr>
+ <tr>
+ <th id=orderlabel></th>
+ <td id=order></td>
+ </tr>
+ <tr>
+ <th id=istlabel></th>
+ <td id=ist></td>
+ </tr>
+ <tr>
+ <th id=indexerlabel></th>
+ <td id=indexer></td>
+ </tr>
+ <tr>
+ <th id=listlabel></th>
+ <td id=list></td>
+ </tr>
+ <tr>
+ <th id=encodinglabel></th>
+ <td id=encoding></td>
+ </tr>
+ <tr>
+ <th id=docencodinglabel></th>
+ <td id=docencoding></td>
+ </tr>
+ </table>
+ <div id=glossaries>
+ </div>
+ </body>
+</html>
diff --git a/support/makeglossariesgui/src/tests/basic-sample/basic-sample.tex b/support/makeglossariesgui/src/tests/basic-sample/basic-sample.tex
new file mode 100644
index 0000000000..80cb4a4f5c
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/basic-sample/basic-sample.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/doc-defs/doc-defs.tex b/support/makeglossariesgui/src/tests/doc-defs/doc-defs.tex
new file mode 100644
index 0000000000..74ef3d84ae
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/doc-defs/doc-defs.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\begin{document}
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/indexed-too-soon/indexed-too-soon.tex b/support/makeglossariesgui/src/tests/indexed-too-soon/indexed-too-soon.tex
new file mode 100644
index 0000000000..7713084c2a
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/indexed-too-soon/indexed-too-soon.tex
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage[debug]{glossaries}
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+\glsaddall
+
+\makeglossaries
+
+\begin{document}
+A sample document with a mistake in it.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/missing-printglossary/missing-printglossary.tex b/support/makeglossariesgui/src/tests/missing-printglossary/missing-printglossary.tex
new file mode 100644
index 0000000000..8c8086e4be
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/missing-printglossary/missing-printglossary.tex
@@ -0,0 +1,13 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/missing-sort/missing-sort.tex b/support/makeglossariesgui/src/tests/missing-sort/missing-sort.tex
new file mode 100644
index 0000000000..b0f89e73bd
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/missing-sort/missing-sort.tex
@@ -0,0 +1,25 @@
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\newglossaryentry{S}{name={\S},
+ description={section symbol}}
+
+\newglossaryentry{alpha}{name={\ensuremath{\alpha}},
+ description={alpha}}
+
+\newglossaryentry{beta}{name={$\beta$},text={\beta},
+ description={beta}}
+
+\begin{document}
+Test: \gls{sample}, \gls{S}, $\gls{alpha}$, $\gls{beta}$.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/missing-sty/missing-sty.tex b/support/makeglossariesgui/src/tests/missing-sty/missing-sty.tex
new file mode 100644
index 0000000000..7132d7faec
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/missing-sty/missing-sty.tex
@@ -0,0 +1,6 @@
+\documentclass{article}
+
+\begin{document}
+Test.
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/no-glossaries/no-glossaries.tex b/support/makeglossariesgui/src/tests/no-glossaries/no-glossaries.tex
new file mode 100644
index 0000000000..2feb1acdfc
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/no-glossaries/no-glossaries.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage[nomain]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/no-makeglossaries/no-makeglossaries.tex b/support/makeglossariesgui/src/tests/no-makeglossaries/no-makeglossaries.tex
new file mode 100644
index 0000000000..abc0046cbf
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/no-makeglossaries/no-makeglossaries.tex
@@ -0,0 +1,13 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/none-indexed/none-indexed.tex b/support/makeglossariesgui/src/tests/none-indexed/none-indexed.tex
new file mode 100644
index 0000000000..7128d52075
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/none-indexed/none-indexed.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A sample document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossaries-accsupp.sty b/support/makeglossariesgui/src/tests/old-version-301/glossaries-accsupp.sty
new file mode 100644
index 0000000000..574678f709
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossaries-accsupp.sty
@@ -0,0 +1,813 @@
+%%
+%% This is file `glossaries-accsupp.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossaries-accsupp.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossaries-accsupp}[2011/04/02 v3.0 (NLCT)
+ Experimental glossaries accessibility]
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}}
+\ProcessOptions
+\RequirePackage{glossaries}
+\RequirePackage{accsupp}
+\define@key{glossentry}{access}{%
+ \def\@glo@access{#1}%
+}
+\define@key{glossentry}{textaccess}{%
+ \def\@glo@textaccess{#1}%
+}
+\define@key{glossentry}{firstaccess}{%
+ \def\@glo@firstaccess{#1}%
+}
+\define@key{glossentry}{pluralaccess}{%
+ \def\@glo@pluralaccess{#1}%
+}
+\define@key{glossentry}{firstpluralaccess}{%
+ \def\@glo@firstpluralaccess{#1}%
+}
+\define@key{glossentry}{symbolaccess}{%
+ \def\@glo@symbolaccess{#1}%
+}
+\define@key{glossentry}{symbolpluralaccess}{%
+ \def\@glo@symbolpluralaccess{#1}%
+}
+\define@key{glossentry}{descriptionaccess}{%
+ \def\@glo@descaccess{#1}%
+}
+\define@key{glossentry}{descriptionpluralaccess}{%
+ \def\@glo@descpluralaccess{#1}%
+}
+\define@key{glossentry}{shortaccess}{%
+ \def\@glo@shortaccess{#1}%
+}
+\define@key{glossentry}{shortpluralaccess}{%
+ \def\@glo@shortpluralaccess{#1}%
+}
+\define@key{glossentry}{longaccess}{%
+ \def\@glo@longaccess{#1}%
+}
+\define@key{glossentry}{longpluralaccess}{%
+ \def\@glo@longpluralaccess{#1}%
+}
+\def\@gls@noaccess{\relax}
+\let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook
+\renewcommand*{\@newglossaryentryprehook}{%
+ \@gls@oldnewglossaryentryprehook
+ \def\@glo@access{\@glo@symbol}%
+ \def\@glo@textaccess{\@glo@access}%
+ \def\@glo@firstaccess{\@glo@access}%
+ \def\@glo@pluralaccess{\@glo@textaccess}%
+ \def\@glo@firstpluralaccess{\@glo@pluralaccess}%
+ \def\@glo@symbolaccess{\relax}%
+ \def\@glo@symbolpluralaccess{\@glo@symbolaccess}%
+ \def\@glo@descaccess{\relax}%
+ \def\@glo@descpluralaccess{\@glo@descaccess}%
+ \def\@glo@shortaccess{\relax}%
+ \def\@glo@shortpluralaccess{\@glo@shortaccess}%
+ \def\@glo@longaccess{\relax}%
+ \def\@glo@longpluralaccess{\@glo@longaccess}%
+}
+\let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook
+\renewcommand*{\@newglossaryentryposthook}{%
+ \@gls@oldnewglossaryentryposthook
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @access\endcsname{%
+ \@glo@access}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @textaccess\endcsname{%
+ \@glo@textaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @firstaccess\endcsname{%
+ \@glo@firstaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @pluralaccess\endcsname{%
+ \@glo@pluralaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @firstpluralaccess\endcsname{%
+ \@glo@firstpluralaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @symbolaccess\endcsname{%
+ \@glo@symbolaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @symbolpluralaccess\endcsname{%
+ \@glo@symbolpluralaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @descaccess\endcsname{%
+ \@glo@descaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{%
+ \@glo@descpluralaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{%
+ \@glo@shortaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{%
+ \@glo@shortpluralaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{%
+ \@glo@longaccess}%
+ \expandafter
+ \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{%
+ \@glo@longpluralaccess}%
+}
+\newcommand*{\glsentryaccess}[1]{%
+ \csname glo@#1@access\endcsname
+}
+\newcommand*{\glsentrytextaccess}[1]{%
+ \csname glo@#1@textaccess\endcsname
+}
+\newcommand*{\glsentryfirstaccess}[1]{%
+ \csname glo@#1@firstaccess\endcsname
+}
+\newcommand*{\glsentrypluralaccess}[1]{%
+ \csname glo@#1@pluralaccess\endcsname
+}
+\newcommand*{\glsentryfirstpluralaccess}[1]{%
+ \csname glo@#1@firstpluralaccess\endcsname
+}
+\newcommand*{\glsentrysymbolaccess}[1]{%
+ \csname glo@#1@symbolaccess\endcsname
+}
+\newcommand*{\glsentrysymbolpluralaccess}[1]{%
+ \csname glo@#1@symbolpluralaccess\endcsname
+}
+\newcommand*{\glsentrydescaccess}[1]{%
+ \csname glo@#1@descaccess\endcsname
+}
+\newcommand*{\glsentrydescpluralaccess}[1]{%
+ \csname glo@#1@descaccess\endcsname
+}
+\newcommand*{\glsentryshortaccess}[1]{%
+ \csname glo@#1@shortaccess\endcsname
+}
+\newcommand*{\glsentryshortpluralaccess}[1]{%
+ \csname glo@#1@shortpluralaccess\endcsname
+}
+\newcommand*{\glsentrylongaccess}[1]{%
+ \csname glo@#1@longaccess\endcsname
+}
+\newcommand*{\glsentrylongpluralaccess}[1]{%
+ \csname glo@#1@longpluralaccess\endcsname
+}
+\newcommand*{\glsaccsupp}[2]{%
+ \BeginAccSupp{ActualText=#1}#2\EndAccSupp{}%
+}
+\newcommand*{\xglsaccsupp}[2]{%
+ \protected@edef\@gls@replacementtext{#1}%
+ \expandafter\glsaccsupp\expandafter{\@gls@replacementtext}{#2}%
+}
+\DeclareRobustCommand*{\glsnameaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentryaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glstextaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrytextaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glspluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrypluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsfirstaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentryfirstaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsfirstpluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentryfirstpluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glssymbolaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrysymbolaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glssymbolpluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrysymbolpluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsdescriptionaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrydescaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsdescriptionpluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrydescpluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsshortaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentryshortaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsshortpluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentryshortpluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glslongaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrylongaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glslongpluralaccessdisplay}[2]{%
+ \protected@edef\@glo@access{\glsentrylongpluralaccess{#2}}%
+ \ifx\@glo@access\@gls@noaccess
+ #1%
+ \else
+ \xglsaccsupp{\@glo@access}{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\glsaccessdisplay}[3]{%
+ \@ifundefined{gls#1accessdisplay}%
+ {%
+ \PackageError{glossaries-accsupp}{No accessibility support
+ for key `#1'}{}%
+ }%
+ {%
+ \csname gls#1accessdisplay\endcsname{#2}{#3}%
+ }%
+}
+\def\@gls@#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@Gls@#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glstextaccessdisplay{\Glsentrytext{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@GLS@#1#2[#3]{%
+ \glsdoifexists{#2}{%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \edef\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}%
+ {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}%
+ {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@glspl@#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@Glspl@#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ {%
+ \ifthenelse{\equal{\@glo@type}{\acronymtype}\and
+ \boolean{glsacrfootnote}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@GLSpl@#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @display\endcsname
+ {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ {%
+ \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname
+ {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}%
+ {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}%
+ {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}%
+ {#3}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\)\OR\NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\def\@acrshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glsshortaccessdisplay{\glsentryshort{#2}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}%
+ }%
+}
+\def\@Acrshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glsshortaccessdisplay{\Glsentryshort{#2}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}%
+ }%
+}
+\def\@ACRshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glsshortaccessdisplay{\MakeUppercase{\glsentryshort{#2}}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\acronymfont{\@glo@text#3}}%
+ }%
+}
+\def\@acrlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glslongaccessdisplay{\glsentrylong{#2}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\@glo@text#3}%
+ }%
+}
+\def\@Acrlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glslongaccessdisplay{\Glsentrylong{#2}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\@glo@text#3}%
+ }%
+}
+\def\@ACRlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@glo@text{%
+ \glslongaccessdisplay{\MakeUppercase{\glsentrylong{#2}}}{#2}%
+ }%
+ \@gls@link[#1]{#2}{\@glo@text#3}%
+ }%
+}
+\ifglsxindy
+ \renewcommand*{\@glossaryentryfield}{%
+ \string\\accsuppglossaryentryfield}
+\else
+ \renewcommand*{\@glossaryentryfield}{%
+ \string\accsuppglossaryentryfield}
+\fi
+\ifglsxindy
+ \renewcommand*{\@glossarysubentryfield}{%
+ \string\\accsuppglossarysubentryfield}
+\else
+ \renewcommand*{\@glossarysubentryfield}{%
+ \string\accsuppglossarysubentryfield}
+\fi
+\newcommand*{\accsuppglossaryentryfield}[5]{%
+ \glossaryentryfield{#1}%
+ {\glsnameaccessdisplay{#2}{#1}}%
+ {\glsdescriptionaccessdisplay{#3}{#1}}%
+ {\glssymbolaccessdisplay{#4}{#1}}{#5}%
+}
+\newcommand*{\accsuppglossarysubentryfield}[6]{%
+ \glossaryentryfield{#1}{#2}%
+ {\glsnameaccessdisplay{#3}{#2}}%
+ {\glsdescriptionaccessdisplay{#4}{#2}}%
+ {\glssymbolaccessdisplay{#5}{#2}}{#6}%
+}
+\renewcommand*{\newacronymhook}{%
+ \edef\@gls@keylist{shortaccess=\the\glslongtok,%
+ \the\glskeylisttok}%
+ \expandafter\glskeylisttok\expandafter{\@gls@keylist}%
+}
+\renewcommand*{\DefaultNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\the\glsshorttok},%
+ description={\the\glslongtok},%
+ descriptionaccess=\relax,
+ text={\the\glsshorttok},%
+ access={\noexpand\@glo@textaccess},%
+ sort={\the\glsshorttok},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ shortaccess={\the\glslongtok},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ first={\noexpand\glslongaccessdisplay
+ {\the\glslongtok}{\the\glslabeltok}\space
+ (\noexpand\glsshortaccessdisplay
+ {\the\glsshorttok}{\the\glslabeltok})},%
+ plural={\the\glsshorttok\acrpluralsuffix},%
+ firstplural={\noexpand\glslongpluralaccessdisplay
+ {\noexpand\@glo@longpl}{\the\glslabeltok}\space
+ (\noexpand\glsshortpluralaccessdisplay
+ {\noexpand\@glo@shortpl}{\the\glslabeltok})},%
+ firstaccess=\relax,
+ firstpluralaccess=\relax,
+ textaccess={\noexpand\@glo@shortaccess},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\renewcommand*{\DescriptionFootnoteNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ sort={\the\glsshorttok},%
+ text={\the\glsshorttok},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ shortaccess={\the\glslongtok},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ access={\noexpand\@glo@textaccess},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ symbol={\the\glslongtok},%
+ symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ firstpluralaccess=\relax,
+ textaccess={\noexpand\@glo@shortaccess},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\renewcommand*{\DescriptionNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand
+ \acrnameformat{\the\glsshorttok}{\the\glslongtok}},%
+ access={\noexpand\@glo@textaccess},%
+ sort={\the\glsshorttok},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ shortaccess={\the\glslongtok},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ first={\the\glslongtok},%
+ firstaccess=\relax,
+ firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ text={\the\glsshorttok},%
+ textaccess={\the\glslongtok},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ symbol={\noexpand\@glo@text},%
+ symbolaccess={\noexpand\@glo@textaccess},%
+ symbolplural={\noexpand\@glo@plural},%
+ firstpluralaccess=\relax,
+ textaccess={\noexpand\@glo@shortaccess},%
+ \the\glskeylisttok}%
+ }%
+ \@do@newglossaryentry
+}
+\renewcommand*{\FootnoteNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ sort={\the\glsshorttok},%
+ text={\the\glsshorttok},%
+ textaccess={\the\glslongtok},%
+ access={\noexpand\@glo@textaccess},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\the\glslongtok},%
+ descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\renewcommand*{\SmallNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ access={\noexpand\@glo@symbolaccess},%
+ sort={\the\glsshorttok},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ shortaccess={\the\glslongtok},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ text={\noexpand\@glo@short},%
+ textaccess={\noexpand\@glo@shortaccess},%
+ plural={\noexpand\@glo@shortpl},%
+ first={\the\glslongtok},%
+ firstaccess=\relax,
+ firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\noexpand\@glo@first},%
+ descriptionplural={\noexpand\@glo@firstplural},%
+ symbol={\the\glsshorttok},%
+ symbolaccess={\the\glslongtok},%
+ symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+ \newcommand*{\glsshortaccesskey}{\glsshortkey access}%
+ \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}%
+ \newcommand*{\glslongaccesskey}{\glslongkey access}%
+ \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}%
+\newcommand*{\showglonameaccess}[1]{%
+ \expandafter\show\csname glo@#1@textaccess\endcsname
+}
+\newcommand*{\showglotextaccess}[1]{%
+ \expandafter\show\csname glo@#1@textaccess\endcsname
+}
+\newcommand*{\showglopluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@pluralaccess\endcsname
+}
+\newcommand*{\showglofirstaccess}[1]{%
+ \expandafter\show\csname glo@#1@firstaccess\endcsname
+}
+\newcommand*{\showglofirstpluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@firstpluralaccess\endcsname
+}
+\newcommand*{\showglosymbolaccess}[1]{%
+ \expandafter\show\csname glo@#1@symbolaccess\endcsname
+}
+\newcommand*{\showglosymbolpluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@symbolpluralaccess\endcsname
+}
+\newcommand*{\showglodescaccess}[1]{%
+ \expandafter\show\csname glo@#1@descaccess\endcsname
+}
+\newcommand*{\showglodescpluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@descpluralaccess\endcsname
+}
+\newcommand*{\showgloshortaccess}[1]{%
+ \expandafter\show\csname glo@#1@shortaccess\endcsname
+}
+\newcommand*{\showgloshortpluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@shortpluralaccess\endcsname
+}
+\newcommand*{\showglolongaccess}[1]{%
+ \expandafter\show\csname glo@#1@longaccess\endcsname
+}
+\newcommand*{\showglolongpluralaccess}[1]{%
+ \expandafter\show\csname glo@#1@longpluralaccess\endcsname
+}
+\endinput
+%%
+%% End of file `glossaries-accsupp.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossaries-babel.sty b/support/makeglossariesgui/src/tests/old-version-301/glossaries-babel.sty
new file mode 100644
index 0000000000..cb4c936813
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossaries-babel.sty
@@ -0,0 +1,297 @@
+%%
+%% This is file `glossaries-babel.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossaries-babel.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossaries-babel}[2009/04/16 v1.2 (NLCT)]
+\@ifundefined{captionsenglish}{}{%
+ \addto\captionsenglish{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsamerican}{}{%
+ \addto\captionsamerican{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsaustralian}{}{%
+ \addto\captionsaustralian{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsbritish}{}{%
+ \addto\captionsbritish{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}}%
+\@ifundefined{captionscanadian}{}{%
+ \addto\captionscanadian{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsnewzealand}{}{%
+ \addto\captionsnewzealand{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsUKenglish}{}{%
+ \addto\captionsUKenglish{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsUSenglish}{}{%
+ \addto\captionsUSenglish{%
+ \renewcommand*{\glossaryname}{Glossary}%
+ \renewcommand*{\acronymname}{Acronyms}%
+ \renewcommand*{\entryname}{Notation}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Page List}%
+ \renewcommand*{\glssymbolsgroupname}{Symbols}%
+ \renewcommand*{\glsnumbersgroupname}{Numbers}%
+}%
+}
+\@ifundefined{captionsgerman}{}{%
+ \addto\captionsgerman{%
+ \renewcommand*{\glossaryname}{Glossar}%
+ \renewcommand*{\acronymname}{Akronyme}%
+ \renewcommand*{\entryname}{Bezeichnung}%
+ \renewcommand*{\descriptionname}{Beschreibung}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Seiten}%
+ \renewcommand*{\glssymbolsgroupname}{Symbole}%
+ \renewcommand*{\glsnumbersgroupname}{Zahlen}}
+}
+\@ifundefined{captionsngerman}{}{%
+ \addto\captionsngerman{%
+ \renewcommand*{\glossaryname}{Glossar}%
+ \renewcommand*{\acronymname}{Akronyme}%
+ \renewcommand*{\entryname}{Bezeichnung}%
+ \renewcommand*{\descriptionname}{Beschreibung}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Seiten}%
+ \renewcommand*{\glssymbolsgroupname}{Symbole}%
+ \renewcommand*{\glsnumbersgroupname}{Zahlen}}
+}
+\@ifundefined{captionsitalian}{}{%
+ \addto\captionsitalian{%
+ \renewcommand*{\glossaryname}{Glossario}%
+ \renewcommand*{\acronymname}{Acronimi}%
+ \renewcommand*{\entryname}{Nomenclatura}%
+ \renewcommand*{\descriptionname}{Descrizione}%
+ \renewcommand*{\symbolname}{Simbolo}%
+ \renewcommand*{\pagelistname}{Elenco delle pagine}%
+ \renewcommand*{\glssymbolsgroupname}{Simboli}%
+ \renewcommand*{\glsnumbersgroupname}{Numeri}}
+}
+\@ifundefined{captionsdutch}{}{%
+ \addto\captionsdutch{%
+ \renewcommand*{\glossaryname}{Woordenlijst}%
+ \renewcommand*{\acronymname}{Acroniemen}%
+ \renewcommand*{\entryname}{Benaming}%
+ \renewcommand*{\descriptionname}{Beschrijving}%
+ \renewcommand*{\symbolname}{Symbool}%
+ \renewcommand*{\pagelistname}{Pagina's}%
+ \renewcommand*{\glssymbolsgroupname}{Symbolen}%
+ \renewcommand*{\glsnumbersgroupname}{Cijfers}}
+}
+\@ifundefined{captionsspanish}{}{%
+ \addto\captionsspanish{%
+ \renewcommand*{\glossaryname}{Glosario}%
+ \renewcommand*{\acronymname}{Siglas}%
+ \renewcommand*{\entryname}{Entrada}%
+ \renewcommand*{\descriptionname}{Descripci\'on}%
+ \renewcommand*{\symbolname}{S\'{\i}mbolo}%
+ \renewcommand*{\pagelistname}{Lista de p\'aginas}%
+ \renewcommand*{\glssymbolsgroupname}{S\'{\i}mbolos}%
+ \renewcommand*{\glsnumbersgroupname}{N\'umeros}}
+}
+\@ifundefined{captionsfrench}{}{%
+ \addto\captionsfrench{%
+ \renewcommand*{\glossaryname}{Glossaire}%
+ \renewcommand*{\acronymname}{Acronymes}%
+ \renewcommand*{\entryname}{Terme}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbole}%
+ \renewcommand*{\pagelistname}{Pages}%
+ \renewcommand*{\glssymbolsgroupname}{Symboles}%
+ \renewcommand*{\glsnumbersgroupname}{Nombres}}
+}
+\@ifundefined{captionsfrenchb}{}{%
+ \addto\captionsfrenchb{%
+ \renewcommand*{\glossaryname}{Glossaire}%
+ \renewcommand*{\acronymname}{Acronymes}%
+ \renewcommand*{\entryname}{Terme}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbole}%
+ \renewcommand*{\pagelistname}{Pages}%
+ \renewcommand*{\glssymbolsgroupname}{Symboles}%
+ \renewcommand*{\glsnumbersgroupname}{Nombres}}
+}
+\@ifundefined{captionsfrancais}{}{%
+ \addto\captionsfrancais{%
+ \renewcommand*{\glossaryname}{Glossaire}%
+ \renewcommand*{\acronymname}{Acronymes}%
+ \renewcommand*{\entryname}{Terme}%
+ \renewcommand*{\descriptionname}{Description}%
+ \renewcommand*{\symbolname}{Symbole}%
+ \renewcommand*{\pagelistname}{Pages}%
+ \renewcommand*{\glssymbolsgroupname}{Symboles}%
+ \renewcommand*{\glsnumbersgroupname}{Nombres}}
+}
+\@ifundefined{captionsdanish}{}{%
+ \addto\captionsdanish{%
+ \renewcommand*{\glossaryname}{Ordliste}%
+ \renewcommand*{\acronymname}{Akronymer}%
+ \renewcommand*{\entryname}{Symbolforklaring}%
+ \renewcommand*{\descriptionname}{Beskrivelse}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Side}%
+ \renewcommand*{\glssymbolsgroupname}{Symboler}%
+ \renewcommand*{\glsnumbersgroupname}{Tal}}
+}
+\@ifundefined{captionsirish}{}{%
+ \addto\captionsirish{%
+ \renewcommand*{\glossaryname}{Gluais}%
+ \renewcommand*{\acronymname}{Acrainmneacha}%
+ \renewcommand*{\entryname}{Ciall}%
+ \renewcommand*{\descriptionname}{Tuairisc}%
+ \renewcommand*{\symbolname}{Comhartha}%
+ \renewcommand*{\glssymbolsgroupname}{Comhartha\'{\i}}%
+ \renewcommand*{\pagelistname}{Leathanaigh}%
+ \renewcommand*{\glsnumbersgroupname}{Uimhreacha}}
+}
+\@ifundefined{captionsmagyar}{}{%
+ \addto\captionsmagyar{%
+ \renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}%
+ \renewcommand*{\acronymname}{Bet\H uszavak}%
+ \renewcommand*{\entryname}{Kifejez\'es}%
+ \renewcommand*{\descriptionname}{Magyar\'azat}%
+ \renewcommand*{\symbolname}{Jel\"ol\'es}%
+ \renewcommand*{\pagelistname}{Oldalsz\'am}%
+ \renewcommand*{\glssymbolsgroupname}{Jelek}%
+ \renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}%
+ }
+}
+\@ifundefined{captionshungarian}{}{%
+ \addto\captionshungarian{%
+ \renewcommand*{\glossaryname}{Sz\'ojegyz\'ek}%
+ \renewcommand*{\acronymname}{Bet\H uszavak}%
+ \renewcommand*{\entryname}{Kifejez\'es}%
+ \renewcommand*{\descriptionname}{Magyar\'azat}%
+ \renewcommand*{\symbolname}{Jel\"ol\'es}%
+ \renewcommand*{\pagelistname}{Oldalsz\'am}%
+ \renewcommand*{\glssymbolsgroupname}{Jelek}%
+ \renewcommand*{\glsnumbersgroupname}{Sz\'amjegyek}%
+ }
+}
+\@ifundefined{captionspolish}{}{%
+ \addto\captionspolish{%
+ \renewcommand*{\glossaryname}{S{\l}ownik termin\'ow}%
+ \renewcommand*{\acronymname}{Skr\'ot}%
+ \renewcommand*{\entryname}{Termin}%
+ \renewcommand*{\descriptionname}{Opis}%
+ \renewcommand*{\symbolname}{Symbol}%
+ \renewcommand*{\pagelistname}{Strony}%
+ \renewcommand*{\glssymbolsgroupname}{Symbole}%
+ \renewcommand*{\glsnumbersgroupname}{Liczby}}
+}
+\@ifundefined{captionsbrazil}{}{%
+ \addto\captionsbrazil{%
+ \renewcommand*{\glossaryname}{Gloss\'ario}%
+ \renewcommand*{\acronymname}{Siglas}%
+ \renewcommand*{\entryname}{Nota\c c\~ao}%
+ \renewcommand*{\descriptionname}{Descri\c c\~ao}%
+ \renewcommand*{\symbolname}{S\'imbolo}%
+ \renewcommand*{\pagelistname}{Lista de P\'aginas}%
+ \renewcommand*{\glssymbolsgroupname}{S\'imbolos}%
+ \renewcommand*{\glsnumbersgroupname}{N\'umeros}%
+ }%
+}
+\endinput
+%%
+%% End of file `glossaries-babel.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossaries-compatible-207.sty b/support/makeglossariesgui/src/tests/old-version-301/glossaries-compatible-207.sty
new file mode 100644
index 0000000000..05bd60a57d
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossaries-compatible-207.sty
@@ -0,0 +1,328 @@
+%%
+%% This is file `glossaries-compatible-207.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossaries-compatible-207.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossaries-compatible-207}[2011/04/02 v1.0 (NLCT)]
+\ifglsxindy
+ \renewcommand*\GlsAddXdyAttribute[1]{%
+ \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}%
+ \expandafter\toks@\expandafter{\@xdylocref}%
+ \edef\@xdylocref{\the\toks@ ^^J%
+ (markup-locref
+ :open \string"\string~n\string\setentrycounter
+ {\noexpand\glscounter}%
+ \expandafter\string\csname#1\endcsname
+ \expandafter\@gobble\string\{\string" ^^J
+ :close \string"\expandafter\@gobble\string\}\string" ^^J
+ :attr \string"#1\string")}}
+\fi
+\renewcommand*\GlsAddXdyCounters[1]{%
+ \GlossariesWarning{\string\GlsAddXdyCounters\space not available
+ in compatibility mode.}%
+}
+ \GlsAddXdyAttribute{glsnumberformat}
+ \GlsAddXdyAttribute{textrm}
+ \GlsAddXdyAttribute{textsf}
+ \GlsAddXdyAttribute{texttt}
+ \GlsAddXdyAttribute{textbf}
+ \GlsAddXdyAttribute{textmd}
+ \GlsAddXdyAttribute{textit}
+ \GlsAddXdyAttribute{textup}
+ \GlsAddXdyAttribute{textsl}
+ \GlsAddXdyAttribute{textsc}
+ \GlsAddXdyAttribute{emph}
+ \GlsAddXdyAttribute{glshypernumber}
+ \GlsAddXdyAttribute{hyperrm}
+ \GlsAddXdyAttribute{hypersf}
+ \GlsAddXdyAttribute{hypertt}
+ \GlsAddXdyAttribute{hyperbf}
+ \GlsAddXdyAttribute{hypermd}
+ \GlsAddXdyAttribute{hyperit}
+ \GlsAddXdyAttribute{hyperup}
+ \GlsAddXdyAttribute{hypersl}
+ \GlsAddXdyAttribute{hypersc}
+ \GlsAddXdyAttribute{hyperemph}
+\ifglsxindy
+ \renewcommand*{\GlsAddXdyLocation}[2]{%
+ \edef\@xdyuserlocationdefs{%
+ \@xdyuserlocationdefs ^^J%
+ (define-location-class \string"#1\string"^^J\space\space
+ \space(#2))
+ }%
+ \edef\@xdyuserlocationnames{%
+ \@xdyuserlocationnames^^J\space\space\space
+ \string"#1\string"}%
+ }
+\fi
+\renewcommand{\@do@wrglossary}[1]{%
+\ifglsxindy
+ \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil
+ \def\@glo@range{}%
+ \expandafter\if\@glo@prefix(\relax
+ \def\@glo@range{:open-range}%
+ \else
+ \expandafter\if\@glo@prefix)\relax
+ \def\@glo@range{:close-range}%
+ \fi
+ \fi
+ \protected@edef\@glslocref{\theglsentrycounter}%
+ \@gls@checkmkidxchars\@glslocref
+ \glossary[\csname glo@#1@type\endcsname]{%
+ (indexentry :tkey (\csname glo@#1@index\endcsname)
+ :locref \string"\@glslocref\string" %
+ :attr \string"\@glo@suffix\string" \@glo@range
+ )
+ }%
+\else
+ \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat
+ \glossary[\csname glo@#1@type\endcsname]{%
+ \string\glossaryentry{\csname glo@#1@index\endcsname
+ \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}%
+\fi
+}
+\def\@set@glo@numformat#1#2#3{%
+ \expandafter\@glo@check@mkidxrangechar#3\@nil
+ \protected@edef#1{%
+ \@glo@prefix setentrycounter[]{#2}%
+ \expandafter\string\csname\@glo@suffix\endcsname
+ }%
+ \@gls@checkmkidxchars#1%
+}
+\ifglsxindy
+ \def\writeist{%
+ \openout\glswrite=\istfilename
+ \write\glswrite{;; xindy style file created by the glossaries
+ package in compatible-2.07 mode}%
+ \write\glswrite{;; for document '\jobname' on
+ \the\year-\the\month-\the\day}%
+ \write\glswrite{^^J; required styles^^J}
+ \@for\@xdystyle:=\@xdyrequiredstyles\do{%
+ \ifx\@xdystyle\@empty
+ \else
+ \protected@write\glswrite{}{(require
+ \string"\@xdystyle.xdy\string")}%
+ \fi
+ }%
+ \write\glswrite{^^J%
+ ; list of allowed attributes (number formats)^^J}%
+ \write\glswrite{(define-attributes ((\@xdyattributes)))}%
+ \write\glswrite{^^J; user defined alphabets^^J}%
+ \write\glswrite{\@xdyuseralphabets}%
+ \write\glswrite{^^J; location class definitions^^J}%
+ \protected@edef\@gls@roman{\@roman{0\string"
+ \string"roman-numbers-lowercase\string" :sep \string"}}%
+ \@onelevel@sanitize\@gls@roman
+ \edef\@tmp{\string" \string"roman-numbers-lowercase\string"
+ :sep \string"}%
+ \@onelevel@sanitize\@tmp
+ \ifx\@tmp\@gls@roman
+ \write\glswrite{(define-location-class
+ \string"roman-page-numbers\string"^^J\space\space\space
+ (\string"roman-numbers-lowercase\string")
+ :min-range-length \@glsminrange)}%
+ \else
+ \write\glswrite{(define-location-class
+ \string"roman-page-numbers\string"^^J\space\space\space
+ (:sep "\@gls@roman")
+ :min-range-length \@glsminrange)}%
+ \fi
+ \write\glswrite{(define-location-class
+ \string"Roman-page-numbers\string"^^J\space\space\space
+ (\string"roman-numbers-uppercase\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{(define-location-class
+ \string"arabic-page-numbers\string"^^J\space\space\space
+ (\string"arabic-numbers\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{(define-location-class
+ \string"alpha-page-numbers\string"^^J\space\space\space
+ (\string"alpha\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{(define-location-class
+ \string"Alpha-page-numbers\string"^^J\space\space\space
+ (\string"ALPHA\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{(define-location-class
+ \string"Appendix-page-numbers\string"^^J\space\space\space
+ (\string"ALPHA\string"
+ :sep \string"\@glsAlphacompositor\string"
+ \string"arabic-numbers\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{(define-location-class
+ \string"arabic-section-numbers\string"^^J\space\space\space
+ (\string"arabic-numbers\string"
+ :sep \string"\glscompositor\string"
+ \string"arabic-numbers\string")
+ :min-range-length \@glsminrange)}%
+ \write\glswrite{^^J; user defined location classes}%
+ \write\glswrite{\@xdyuserlocationdefs}%
+ \write\glswrite{^^J; define cross-reference class^^J}%
+ \write\glswrite{(define-crossref-class \string"see\string"
+ :unverified )}%
+ \write\glswrite{(markup-crossref-list
+ :class \string"see\string"^^J\space\space\space
+ :open \string"\string\glsseeformat\string"
+ :close \string"{}\string")}%
+ \write\glswrite{^^J; define the order of the location classes}%
+ \write\glswrite{(define-location-class-order
+ (\@xdylocationclassorder))}%
+ \write\glswrite{^^J; define the glossary markup^^J}%
+ \write\glswrite{(markup-index^^J\space\space\space
+ :open \string"\string
+ \glossarysection[\string\glossarytoctitle]{\string
+ \glossarytitle}\string\glossarypreamble\string~n\string\begin
+ {theglossary}\string\glossaryheader\string~n\string" ^^J\space
+ \space\space:close \string"\expandafter\@gobble
+ \string\%\string~n\string
+ \end{theglossary}\string\glossarypostamble
+ \string~n\string" ^^J\space\space\space
+ :tree)}%
+ \write\glswrite{(markup-letter-group-list
+ :sep \string"\string\glsgroupskip\string~n\string")}%
+ \write\glswrite{(markup-indexentry
+ :open \string"\string\relax \string\glsresetentrylist
+ \string~n\string")}%
+ \write\glswrite{(markup-locclass-list :open
+ \string"\glsopenbrace\string\glossaryentrynumbers
+ \glsopenbrace\string\relax\space \string"^^J\space\space\space
+ :sep \string", \string"
+ :close \string"\glsclosebrace\glsclosebrace\string")}%
+ \write\glswrite{(markup-locref-list
+ :sep \string"\string\delimN\space\string")}%
+ \write\glswrite{(markup-range
+ :sep \string"\string\delimR\space\string")}%
+ \@onelevel@sanitize\gls@suffixF
+ \@onelevel@sanitize\gls@suffixFF
+ \ifx\gls@suffixF\@empty
+ \else
+ \write\glswrite{(markup-range
+ :close "\gls@suffixF" :length 1 :ignore-end)}%
+ \fi
+ \ifx\gls@suffixFF\@empty
+ \else
+ \write\glswrite{(markup-range
+ :close "\gls@suffixFF" :length 2 :ignore-end)}%
+ \fi
+ \write\glswrite{^^J; define format to use for locations^^J}%
+ \write\glswrite{\@xdylocref}%
+ \write\glswrite{^^J; define letter group list format^^J}%
+ \write\glswrite{(markup-letter-group-list
+ :sep \string"\string\glsgroupskip\string~n\string")}%
+ \write\glswrite{^^J; letter group headings^^J}%
+ \write\glswrite{(markup-letter-group
+ :open-head \string"\string\glsgroupheading
+ \glsopenbrace\string"^^J\space\space\space
+ :close-head \string"\glsclosebrace\string")}%
+ \write\glswrite{^^J; additional letter groups^^J}%
+ \write\glswrite{\@xdylettergroups}%
+ \write\glswrite{^^J; additional sort rules^^J}
+ \write\glswrite{\@xdysortrules}%
+ \noist}
+\else
+ \edef\@gls@actualchar{\string?}
+ \edef\@gls@encapchar{\string|}
+ \edef\@gls@levelchar{\string!}
+ \edef\@gls@quotechar{\string"}
+ \def\writeist{\relax
+ \openout\glswrite=\istfilename
+ \write\glswrite{\expandafter\@gobble\string\% makeindex style file
+ created by the glossaries package}
+ \write\glswrite{\expandafter\@gobble\string\% for document
+ '\jobname' on \the\year-\the\month-\the\day}
+ \write\glswrite{actual '\@gls@actualchar'}
+ \write\glswrite{encap '\@gls@encapchar'}
+ \write\glswrite{level '\@gls@levelchar'}
+ \write\glswrite{quote '\@gls@quotechar'}
+ \write\glswrite{keyword \string"\string\\glossaryentry\string"}
+ \write\glswrite{preamble \string"\string\\glossarysection[\string
+ \\glossarytoctitle]{\string\\glossarytitle}\string
+ \\glossarypreamble\string\n\string\\begin{theglossary}\string
+ \\glossaryheader\string\n\string"}
+ \write\glswrite{postamble \string"\string\%\string\n\string
+ \\end{theglossary}\string\\glossarypostamble\string\n
+ \string"}
+ \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n
+ \string"}
+ \write\glswrite{item_0 \string"\string\%\string\n\string"}
+ \write\glswrite{item_1 \string"\string\%\string\n\string"}
+ \write\glswrite{item_2 \string"\string\%\string\n\string"}
+ \write\glswrite{item_01 \string"\string\%\string\n\string"}
+ \write\glswrite{item_x1
+ \string"\string\\relax \string\\glsresetentrylist\string\n
+ \string"}
+ \write\glswrite{item_12 \string"\string\%\string\n\string"}
+ \write\glswrite{item_x2
+ \string"\string\\relax \string\\glsresetentrylist\string\n
+ \string"}
+ \write\glswrite{delim_0 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_1 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_2 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_t \string"\string\}\string\}\string"}
+ \write\glswrite{delim_n \string"\string\\delimN \string"}
+ \write\glswrite{delim_r \string"\string\\delimR \string"}
+ \write\glswrite{headings_flag 1}
+ \write\glswrite{heading_prefix
+ \string"\string\\glsgroupheading\string\{\string"}
+ \write\glswrite{heading_suffix
+ \string"\string\}\string\\relax
+ \string\\glsresetentrylist \string"}
+ \write\glswrite{symhead_positive \string"glssymbols\string"}
+ \write\glswrite{numhead_positive \string"glsnumbers\string"}
+ \write\glswrite{page_compositor \string"\glscompositor\string"}
+ \@gls@escbsdq\gls@suffixF
+ \@gls@escbsdq\gls@suffixFF
+ \ifx\gls@suffixF\@empty
+ \else
+ \write\glswrite{suffix_2p \string"\gls@suffixF\string"}
+ \fi
+ \ifx\gls@suffixFF\@empty
+ \else
+ \write\glswrite{suffix_3p \string"\gls@suffixFF\string"}
+ \fi
+ \noist
+ }
+\fi
+\renewcommand*{\noist}{\let\writeist\relax}
+\endinput
+%%
+%% End of file `glossaries-compatible-207.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossaries-polyglossia.sty b/support/makeglossariesgui/src/tests/old-version-301/glossaries-polyglossia.sty
new file mode 100644
index 0000000000..a92f5411d5
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossaries-polyglossia.sty
@@ -0,0 +1,188 @@
+%%
+%% This is file `glossaries-polyglossia.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossaries-polyglossia.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossaries-polyglossia}[2009/11/09 v1.0 (NLCT)]
+\@ifundefined{captionsenglish}{}{%
+ \expandafter\toks@\expandafter{\captionsenglish
+ \renewcommand*{\glossaryname}{\textenglish{Glossary}}%
+ \renewcommand*{\acronymname}{\textenglish{Acronyms}}%
+ \renewcommand*{\entryname}{\textenglish{Notation}}%
+ \renewcommand*{\descriptionname}{\textenglish{Description}}%
+ \renewcommand*{\symbolname}{\textenglish{Symbol}}%
+ \renewcommand*{\pagelistname}{\textenglish{Page List}}%
+ \renewcommand*{\glssymbolsgroupname}{\textenglish{Symbols}}%
+ \renewcommand*{\glsnumbersgroupname}{\textenglish{Numbers}}%
+ }%
+ \edef\captionsenglish{\the\toks@}%
+}
+\@ifundefined{captionsgerman}{}{%
+ \expandafter\toks@\expandafter{\captionsgerman
+ \renewcommand*{\glossaryname}{\textgerman{Glossar}}%
+ \renewcommand*{\acronymname}{\textgerman{Akronyme}}%
+ \renewcommand*{\entryname}{\textgerman{Bezeichnung}}%
+ \renewcommand*{\descriptionname}{\textgerman{Beschreibung}}%
+ \renewcommand*{\symbolname}{\textgerman{Symbol}}%
+ \renewcommand*{\pagelistname}{\textgerman{Seiten}}%
+ \renewcommand*{\glssymbolsgroupname}{\textgerman{Symbole}}%
+ \renewcommand*{\glsnumbersgroupname}{\textgerman{Zahlen}}%
+ }%
+ \edef\captionsgerman{\the\toks@}%
+}
+\@ifundefined{captionsitalian}{}{%
+ \expandafter\toks@\expandafter{\captionsitalian
+ \renewcommand*{\glossaryname}{\textitalian{Glossario}}%
+ \renewcommand*{\acronymname}{\textitalian{Acronimi}}%
+ \renewcommand*{\entryname}{\textitalian{Nomenclatura}}%
+ \renewcommand*{\descriptionname}{\textitalian{Descrizione}}%
+ \renewcommand*{\symbolname}{\textitalian{Simbolo}}%
+ \renewcommand*{\pagelistname}{\textitalian{Elenco delle pagine}}%
+ \renewcommand*{\glssymbolsgroupname}{\textitalian{Simboli}}%
+ \renewcommand*{\glsnumbersgroupname}{\textitalian{Numeri}}%
+ }%
+ \edef\captionsitalian{\the\toks@}%
+}
+\@ifundefined{captionsdutch}{}{%
+ \expandafter\toks@\expandafter{\captionsdutch
+ \renewcommand*{\glossaryname}{\textdutch{Woordenlijst}}%
+ \renewcommand*{\acronymname}{\textdutch{Acroniemen}}%
+ \renewcommand*{\entryname}{\textdutch{Benaming}}%
+ \renewcommand*{\descriptionname}{\textdutch{Beschrijving}}%
+ \renewcommand*{\symbolname}{\textdutch{Symbool}}%
+ \renewcommand*{\pagelistname}{\textdutch{Pagina's}}%
+ \renewcommand*{\glssymbolsgroupname}{\textdutch{Symbolen}}%
+ \renewcommand*{\glsnumbersgroupname}{\textdutch{Cijfers}}%
+ }%
+ \edef\captionsdutch{\the\toks@}%
+}
+\@ifundefined{captionsspanish}{}{%
+ \expandafter\toks@\expandafter{\captionsspanish
+ \renewcommand*{\glossaryname}{\textspanish{Glosario}}%
+ \renewcommand*{\acronymname}{\textspanish{Siglas}}%
+ \renewcommand*{\entryname}{\textspanish{Entrada}}%
+ \renewcommand*{\descriptionname}{\textspanish{Descripci\'on}}%
+ \renewcommand*{\symbolname}{\textspanish{S\'{\i}mbolo}}%
+ \renewcommand*{\pagelistname}{\textspanish{Lista de p\'aginas}}%
+ \renewcommand*{\glssymbolsgroupname}{\textspanish{S\'{\i}mbolos}}%
+ \renewcommand*{\glsnumbersgroupname}{\textspanish{N\'umeros}}%
+ }%
+ \edef\captionsspanish{\the\toks@}%
+}
+\@ifundefined{captionsfrench}{}{%
+ \expandafter\toks@\expandafter{\captionsfrench
+ \renewcommand*{\glossaryname}{\textfrench{Glossaire}}%
+ \renewcommand*{\acronymname}{\textfrench{Acronymes}}%
+ \renewcommand*{\entryname}{\textfrench{Terme}}%
+ \renewcommand*{\descriptionname}{\textfrench{Description}}%
+ \renewcommand*{\symbolname}{\textfrench{Symbole}}%
+ \renewcommand*{\pagelistname}{\textfrench{Pages}}%
+ \renewcommand*{\glssymbolsgroupname}{\textfrench{Symboles}}%
+ \renewcommand*{\glsnumbersgroupname}{\textfrench{Nombres}}%
+ }%
+ \edef\captionsfrench{\the\toks@}%
+}
+\@ifundefined{captionsdanish}{}{%
+ \expandafter\toks@\expandafter{\captionsdanish
+ \renewcommand*{\glossaryname}{\textdanish{Ordliste}}%
+ \renewcommand*{\acronymname}{\textdanish{Akronymer}}%
+ \renewcommand*{\entryname}{\textdanish{Symbolforklaring}}%
+ \renewcommand*{\descriptionname}{\textdanish{Beskrivelse}}%
+ \renewcommand*{\symbolname}{\textdanish{Symbol}}%
+ \renewcommand*{\pagelistname}{\textdanish{Side}}%
+ \renewcommand*{\glssymbolsgroupname}{\textdanish{Symboler}}%
+ \renewcommand*{\glsnumbersgroupname}{\textdanish{Tal}}%
+ }%
+ \edef\captionsdanish{\the\toks@}%
+}
+\@ifundefined{captionsirish}{}{%
+ \expandafter\toks@\expandafter{\captionsirish
+ \renewcommand*{\glossaryname}{\textirish{Gluais}}%
+ \renewcommand*{\acronymname}{\textirish{Acrainmneacha}}%
+ \renewcommand*{\entryname}{\textirish{Ciall}}%
+ \renewcommand*{\descriptionname}{\textirish{Tuairisc}}%
+ \renewcommand*{\symbolname}{\textirish{Comhartha}}%
+ \renewcommand*{\glssymbolsgroupname}{\textirish{Comhartha\'{\i}}}%
+ \renewcommand*{\pagelistname}{\textirish{Leathanaigh}}%
+ \renewcommand*{\glsnumbersgroupname}{\textirish{Uimhreacha}}%
+ }%
+ \edef\captionsirish{\the\toks@}%
+}
+\@ifundefined{captionsmagyar}{}{%
+ \expandafter\toks@\expandafter{\captionsmagyar
+ \renewcommand*{\glossaryname}{\textmagyar{Sz\'ojegyz\'ek}}%
+ \renewcommand*{\acronymname}{\textmagyar{Bet\H uszavak}}%
+ \renewcommand*{\entryname}{\textmagyar{Kifejez\'es}}%
+ \renewcommand*{\descriptionname}{\textmagyar{Magyar\'azat}}%
+ \renewcommand*{\symbolname}{\textmagyar{Jel\"ol\'es}}%
+ \renewcommand*{\pagelistname}{\textmagyar{Oldalsz\'am}}%
+ \renewcommand*{\glssymbolsgroupname}{\textmagyar{Jelek}}%
+ \renewcommand*{\glsnumbersgroupname}{\textmagyar{Sz\'amjegyek}}%
+ }%
+ \edef\captionsmagyar{\the\toks@}%
+}
+\@ifundefined{captionspolish}{}{%
+ \expandafter\toks@\expandafter{\captionspolish
+ \renewcommand*{\glossaryname}{\textpolish{S{\l}ownik termin\'ow}}%
+ \renewcommand*{\acronymname}{\textpolish{Skr\'ot}}%
+ \renewcommand*{\entryname}{\textpolish{Termin}}%
+ \renewcommand*{\descriptionname}{\textpolish{Opis}}%
+ \renewcommand*{\symbolname}{\textpolish{Symbol}}%
+ \renewcommand*{\pagelistname}{\textpolish{Strony}}%
+ \renewcommand*{\glssymbolsgroupname}{\textpolish{Symbole}}%
+ \renewcommand*{\glsnumbersgroupname}{\textpolish{Liczby}}%
+ }%
+ \edef\captionspolish{\the\toks@}%
+}
+\@ifundefined{captionsportuges}{}{%
+ \expandafter\toks@\expandafter{\captionsportuges
+ \renewcommand*{\glossaryname}{\textportuges{Gloss\'ario}}%
+ \renewcommand*{\acronymname}{\textportuges{Siglas}}%
+ \renewcommand*{\entryname}{\textportuges{Nota\c c\~ao}}%
+ \renewcommand*{\descriptionname}{\textportuges{Descri\c c\~ao}}%
+ \renewcommand*{\symbolname}{\textportuges{S\'imbolo}}%
+ \renewcommand*{\pagelistname}{\textportuges{Lista de P\'aginas}}%
+ \renewcommand*{\glssymbolsgroupname}{\textportuges{S\'imbolos}}%
+ \renewcommand*{\glsnumbersgroupname}{\textportuges{N\'umeros}}%
+ }%
+ \edef\captionsportuges{\the\toks@}%
+}
+\endinput
+%%
+%% End of file `glossaries-polyglossia.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossaries.sty b/support/makeglossariesgui/src/tests/old-version-301/glossaries.sty
new file mode 100644
index 0000000000..33ad66443e
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossaries.sty
@@ -0,0 +1,4175 @@
+%%
+%% This is file `glossaries.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossaries.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossaries}[2011/04/12 v3.01 (NLCT)]
+\RequirePackage{ifthen}
+\RequirePackage{xkeyval}[2006/11/18]
+\RequirePackage{mfirstuc}
+\RequirePackage{xfor}
+\RequirePackage{amsgen}
+\RequirePackage{etoolbox}
+\define@boolkey{glossaries.sty}[gls]{toc}[true]{}
+\define@boolkey{glossaries.sty}[gls]{numberline}[true]{}
+\ifcsundef{chapter}%
+ {\newcommand*{\@@glossarysec}{section}}%
+ {\newcommand*{\@@glossarysec}{chapter}}
+\define@choicekey{glossaries.sty}{section}{part,chapter,section,%
+subsection,subsubsection,paragraph,subparagraph}[section]{%
+ \renewcommand*{\@@glossarysec}{#1}}
+\newcommand*{\@@glossarysecstar}{*}
+\newcommand*{\@@glossaryseclabel}{}
+\newcommand*{\glsautoprefix}{}
+\define@choicekey{glossaries.sty}{numberedsection}[\val\nr]{%
+false,nolabel,autolabel}[nolabel]{%
+ \ifcase\nr\relax
+ \renewcommand*{\@@glossarysecstar}{*}%
+ \renewcommand*{\@@glossaryseclabel}{}%
+ \or
+ \renewcommand*{\@@glossarysecstar}{}%
+ \renewcommand*{\@@glossaryseclabel}{}%
+ \or
+ \renewcommand*{\@@glossarysecstar}{}%
+ \renewcommand*{\@@glossaryseclabel}{%
+ \label{\glsautoprefix\@glo@type}}%
+ \fi
+}
+\newcommand*{\@glossary@default@style}{list}
+\define@key{glossaries.sty}{style}{%
+\renewcommand*{\@glossary@default@style}{#1}}
+\newcommand*{\glossaryentrynumbers}[1]{#1}
+\DeclareOptionX{nonumberlist}{%
+\renewcommand*{\glossaryentrynumbers}[1]{}}
+\newcommand*\@glo@seeautonumberlist{}
+\DeclareOptionX{seeautonumberlist}{%
+ \renewcommand*{\@glo@seeautonumberlist}{%
+ \def\@glo@prefix{\glsnextpages}%
+ }%
+}
+\newcommand*{\@gls@loadlong}{\RequirePackage{glossary-long}}
+\DeclareOptionX{nolong}{\renewcommand*{\@gls@loadlong}{}}
+\IfFileExists{supertabular.sty}{%
+ \newcommand*{\@gls@loadsuper}{\RequirePackage{glossary-super}}}{%
+ \newcommand*{\@gls@loadsuper}{}}
+\DeclareOptionX{nosuper}{\renewcommand*{\@gls@loadsuper}{}}
+\newcommand*{\@gls@loadlist}{\RequirePackage{glossary-list}}
+\DeclareOptionX{nolist}{\renewcommand*{\@gls@loadlist}{}}
+\newcommand*{\@gls@loadtree}{\RequirePackage{glossary-tree}}
+\DeclareOptionX{notree}{\renewcommand*{\@gls@loadtree}{}}
+\DeclareOptionX{nostyles}{%
+ \renewcommand*{\@gls@loadlong}{}%
+ \renewcommand*{\@gls@loadsuper}{}%
+ \renewcommand*{\@gls@loadlist}{}%
+ \renewcommand*{\@gls@loadtree}{}%
+ \let\@glossary@default@style\relax
+}
+\define@boolkey{glossaries.sty}[gls]{entrycounter}[true]{}
+\glsentrycounterfalse
+\define@key{glossaries.sty}{counterwithin}{%
+ \renewcommand*{\@gls@counterwithin}{#1}%
+ \glsentrycountertrue
+}
+\newcommand*{\@gls@counterwithin}{}
+\define@boolkey{glossaries.sty}[gls]{subentrycounter}[true]{}
+\glssubentrycounterfalse
+\define@choicekey{glossaries.sty}{sort}{standard,def,use}{%
+ \csname @gls@setupsort@#1\endcsname
+}
+\newcommand*{\@gls@setupsort@standard}{%
+ \def\do@glo@storeentry{\@glo@storeentry}%
+ \def\@gls@defsortcount##1{}%
+ \def\@gls@defsort##1##2{%
+ \ifx\@glo@sort\@glsdefaultsort
+ \let\@glo@sort\@glo@name
+ \fi
+ \@onelevel@sanitize\@glo@sort
+ \expandafter\protected@xdef\csname glo@##2@sort\endcsname{\@glo@sort}%
+ }%
+ \def\@gls@setsort##1{}%
+}
+\@gls@setupsort@standard
+\newcommand*\glssortnumberfmt[1]{%
+ \ifnum#1<100000 0\fi
+ \ifnum#1<10000 0\fi
+ \ifnum#1<1000 0\fi
+ \ifnum#1<100 0\fi
+ \ifnum#1<10 0\fi
+ \number#1%
+}
+\newcommand*{\@gls@setupsort@def}{%
+ \def\do@glo@storeentry{\@glo@storeentry}%
+ \def\@gls@defsortcount##1{%
+ \expandafter\global
+ \expandafter\newcount\csname glossary@##1@sortcount\endcsname
+ }%
+ \def\@gls@defsort##1##2{%
+ \expandafter\global\expandafter
+ \advance\csname glossary@##1@sortcount\endcsname by 1\relax
+ \expandafter\protected@xdef\csname glo@##2@sort\endcsname{%
+ \expandafter\glssortnumberfmt
+ {\csname glossary@##1@sortcount\endcsname}}%
+ }%
+ \def\@gls@setsort##1{}%
+}
+\newcommand*{\@gls@setupsort@use}{%
+ \let\do@glo@storeentry\@gobble
+ \def\@gls@defsortcount##1{%
+ \expandafter\global
+ \expandafter\newcount\csname glossary@##1@sortcount\endcsname
+ }%
+ \def\@gls@defsort##1##2{%
+ \expandafter\gdef\csname glo@##2@sort\endcsname{}%
+ }%
+ \def\@gls@setsort##1{%
+ \edef\@glo@parent{\csname glo@##1@parent\endcsname}%
+ \ifx\@glo@parent\@empty
+ \else
+ \expandafter\@gls@setsort\expandafter{\@glo@parent}%
+ \fi
+ \edef\@glo@type{\csname glo@##1@type\endcsname}%
+ \edef\@gls@tmp{\csname glo@##1@sort\endcsname}%
+ \ifx\@gls@tmp\@empty
+ \expandafter\global\expandafter
+ \advance\csname glossary@\@glo@type @sortcount\endcsname by 1\relax
+ \expandafter\protected@xdef\csname glo@##1@sort\endcsname{%
+ \expandafter\glssortnumberfmt
+ {\csname glossary@\@glo@type @sortcount\endcsname}}%
+ \@glo@storeentry{##1}%
+ \fi
+ }%
+}
+\newcommand*{\glsdefmain}{%
+ \newglossary{main}{gls}{glo}{\glossaryname}%
+}
+\newcommand*{\glsdefaulttype}{main}
+\newcommand*{\acronymtype}{\glsdefaulttype}
+\DeclareOptionX{nomain}{%
+ \let\glsdefaulttype\relax
+ \renewcommand*{\glsdefmain}{}%
+}
+\define@boolkey{glossaries.sty}[gls]{acronym}[true]{%
+ \DeclareAcronymList{acronym}%
+}
+\newcommand*{\@glsacronymlists}{}
+\newcommand*{\@addtoacronymlists}[1]{%
+ \ifx\@glsacronymlists\@empty
+ \protected@xdef\@glsacronymlists{#1}%
+ \else
+ \protected@xdef\@glsacronymlists{\@glsacronymlists,#1}%
+ \fi
+}
+\newcommand*{\DeclareAcronymList}[1]{%
+ \glsIfListOfAcronyms{#1}{}{\@addtoacronymlists{#1}}%
+}
+\newcommand{\glsIfListOfAcronyms}[1]{%
+ \edef\@do@gls@islistofacronyms{%
+ \noexpand\@gls@islistofacronyms{#1}{\@glsacronymlists}}%
+ \@do@gls@islistofacronyms
+}
+\newcommand{\@gls@islistofacronyms}[4]{%
+ \def\gls@islistofacronyms##1,#1,##2\end@gls@islistofacronyms{%
+ \def\@before{##1}\def\@after{##2}}%
+ \gls@islistofacronyms,#2,#1,\@nil\end@gls@islistofacronyms
+ \ifx\@after\@nnil
+ #4%
+ \else
+ #3%
+ \fi
+}
+\newif\if@glsisacronymlist
+\newcommand*{\gls@checkisacronymlist}[1]{%
+ \glsIfListOfAcronyms{#1}%
+ {\@glsisacronymlisttrue}{\@glsisacronymlistfalse}%
+}
+\newcommand*{\SetAcronymLists}[1]{%
+ \renewcommand*{\@glsacronymlists}{#1}%
+}
+\define@key{glossaries.sty}{acronymlists}{%
+ \@addtoacronymlists{#1}%
+}
+\newcommand{\glscounter}{page}
+\define@key{glossaries.sty}{counter}{%
+ \renewcommand*{\glscounter}{#1}%
+}
+\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}
+\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}
+\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol}
+\define@boolkey[gls]{sanitize}{description}[true]{%
+\ifgls@sanitize@description
+ \renewcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}%
+\else
+ \renewcommand*{\@gls@sanitizedesc}{}%
+\fi
+}
+\define@boolkey[gls]{sanitize}{name}[true]{%
+\ifgls@sanitize@name
+ \renewcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}%
+\else
+ \renewcommand*{\@gls@sanitizename}{}%
+\fi}
+\define@boolkey[gls]{sanitize}{symbol}[true]{%
+\ifgls@sanitize@symbol
+ \renewcommand*{\@gls@sanitizesymbol}{%
+\@onelevel@sanitize\@glo@symbol}%
+\else
+ \renewcommand*{\@gls@sanitizesymbol}{}%
+\fi}
+\define@key{glossaries.sty}{sanitize}[description=true,symbol=true,
+name=true]{%
+\ifthenelse{\equal{#1}{none}}{%
+\renewcommand*{\@gls@sanitizedesc}{}%
+\renewcommand*{\@gls@sanitizename}{}%
+\renewcommand*{\@gls@sanitizesymbol}{}%
+}{\setkeys[gls]{sanitize}{#1}}%
+}
+\define@boolkey{glossaries.sty}[gls]{translate}[true]{}
+\glstranslatefalse
+\@ifpackageloaded{translator}{\glstranslatetrue}{%
+\@ifpackageloaded{babel}{\glstranslatetrue}{%
+\@ifpackageloaded{polyglossia}{\glstranslatetrue}{}}}
+\define@boolkey{glossaries.sty}[gls]{hyperfirst}[true]{}
+\glshyperfirsttrue
+\define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{%
+\ifthenelse{\boolean{glsacrdescription}}{}%
+{\renewcommand*{\@gls@sanitizedesc}{}}%
+}
+\define@boolkey{glossaries.sty}[glsacr]{description}[true]{%
+ \renewcommand*{\@gls@sanitizesymbol}{}%
+}
+\define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{%
+ \renewcommand*{\@gls@sanitizesymbol}{}%
+}
+\define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{%
+ \renewcommand*{\@gls@sanitizesymbol}{}%
+}
+\define@boolkey{glossaries.sty}[glsacr]{dua}[true]{%
+ \renewcommand*{\@gls@sanitizesymbol}{}%
+}
+\define@boolkey{glossaries.sty}[glsacr]{shortcuts}[true]{}
+\newcommand*{\glsorder}{word}
+\newcommand*{\@glsorder}[1]{}
+\define@choicekey{glossaries.sty}{order}{word,letter}{%
+ \def\glsorder{#1}}
+\newif\ifglsxindy
+\glsxindyfalse
+\DeclareOptionX{makeindex}{\glsxindyfalse}
+\define@boolkey[gls]{xindy}{glsnumbers}[true]{}
+\gls@xindy@glsnumberstrue
+\def\@xdy@main@language{\rootlanguagename}%
+\define@key[gls]{xindy}{language}{\def\@xdy@main@language{#1}}
+\ifcsundef{inputencodingname}{%
+ \def\gls@codepage{}}{%
+ \def\gls@codepage{\inputencodingname}
+}
+\define@key[gls]{xindy}{codepage}{\def\gls@codepage{#1}}
+\define@key{glossaries.sty}{xindy}[]{%
+ \glsxindytrue
+ \setkeys[gls]{xindy}{#1}%
+}
+\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{}
+\glssavewritesfalse
+\newcommand*{\GlossariesWarning}[1]{%
+ \PackageWarning{glossaries}{#1}%
+}
+\newcommand*{\GlossariesWarningNoLine}[1]{%
+ \PackageWarningNoLine{glossaries}{#1}%
+}
+\DeclareOptionX{nowarn}{%
+ \renewcommand*{\GlossariesWarning}[1]{}%
+ \renewcommand*{\GlossariesWarningNoLine}[1]{}%
+}
+\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{}
+\csname glscompatible-2.07false\endcsname
+\ProcessOptionsX
+\ifglstranslate
+ \@ifpackageloaded{babel}{\IfFileExists{translator.sty}{%
+ \RequirePackage{translator}}{}}{}
+\fi
+\ifthenelse{\equal{\glscounter}{section}}%
+{%
+ \ifcsundef{chapter}{}%
+ {%
+ \let\@gls@old@chapter\@chapter
+ \def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}%
+ \ifcsundef{hyperdef}{}{\hyperdef{section}{\thesection}{}}}%
+ }%
+}%
+{}
+\newcommand*{\@gls@onlypremakeg}{}
+\newcommand*{\@onlypremakeg}[1]{%
+\ifx\@gls@onlypremakeg\@empty
+ \def\@gls@onlypremakeg{#1}%
+\else
+ \expandafter\toks@\expandafter{\@gls@onlypremakeg}%
+ \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}%
+\fi}
+\newcommand*{\@disable@onlypremakeg}{%
+\@for\@thiscs:=\@gls@onlypremakeg\do{%
+ \expandafter\@disable@premakecs\@thiscs%
+}}
+\newcommand*{\@disable@premakecs}[1]{%
+ \def#1{\PackageError{glossaries}{\string#1\space may only be
+ used before \string\makeglossaries}{You can't use
+ \string#1\space after \string\makeglossaries}}%
+}
+\providecommand*{\glossaryname}{Glossary}
+\providecommand*{\acronymname}{Acronyms}
+\newcommand*{\glssettoctitle}[1]{%
+\def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}
+\providecommand*{\entryname}{Notation}
+\providecommand*{\descriptionname}{Description}
+\providecommand*{\symbolname}{Symbol}
+\providecommand*{\pagelistname}{Page List}
+\providecommand*{\glssymbolsgroupname}{Symbols}
+\providecommand*{\glsnumbersgroupname}{Numbers}
+\newcommand*{\glspluralsuffix}{s}
+\providecommand*{\seename}{see}
+\providecommand*{\andname}{\&}
+\newcommand*{\addglossarytocaptions}[1]{%
+ \ifcsundef{captions#1}{}%
+ {%
+ \expandafter\let\expandafter\@gls@tmp\csname captions#1\endcsname
+ \expandafter\toks@\expandafter{\@gls@tmp
+ \renewcommand*{\glossaryname}{\translate{Glossary}}%
+ }%
+ \expandafter\edef\csname captions#1\endcsname{\the\toks@}%
+ }%
+}
+\ifglstranslate
+ \@ifpackageloaded{translator}{%
+ \usedictionary{glossaries-dictionary}%
+ \addglossarytocaptions{portuges}%
+ \addglossarytocaptions{portuguese}%
+ \addglossarytocaptions{brazil}%
+ \addglossarytocaptions{brazilian}%
+ \addglossarytocaptions{danish}%
+ \addglossarytocaptions{dutch}%
+ \addglossarytocaptions{afrikaans}%
+ \addglossarytocaptions{english}%
+ \addglossarytocaptions{UKenglish}%
+ \addglossarytocaptions{USenglish}%
+ \addglossarytocaptions{american}%
+ \addglossarytocaptions{australian}%
+ \addglossarytocaptions{british}%
+ \addglossarytocaptions{canadian}%
+ \addglossarytocaptions{newzealand}%
+ \addglossarytocaptions{french}%
+ \addglossarytocaptions{frenchb}%
+ \addglossarytocaptions{francais}%
+ \addglossarytocaptions{acadian}%
+ \addglossarytocaptions{canadien}%
+ \addglossarytocaptions{german}%
+ \addglossarytocaptions{germanb}%
+ \addglossarytocaptions{austrian}%
+ \addglossarytocaptions{naustrian}%
+ \addglossarytocaptions{ngerman}%
+ \addglossarytocaptions{irish}%
+ \addglossarytocaptions{italian}%
+ \addglossarytocaptions{magyar}%
+ \addglossarytocaptions{hungarian}%
+ \addglossarytocaptions{polish}%
+ \addglossarytocaptions{spanish}%
+ \renewcommand*{\glssettoctitle}[1]{%
+ \ifthenelse{\equal{#1}{main}}{%
+ \translatelet{\glossarytoctitle}{Glossary}}{%
+ \ifthenelse{\equal{#1}{acronym}}{%
+ \translatelet{\glossarytoctitle}{Acronyms}}{%
+ \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}}}%
+ \renewcommand*{\glossaryname}{\translate{Glossary}}%
+ \renewcommand*{\acronymname}{\translate{Acronyms}}%
+ \renewcommand*{\entryname}{\translate{Notation (glossaries)}}%
+ \renewcommand*{\descriptionname}{%
+ \translate{Description (glossaries)}}%
+ \renewcommand*{\symbolname}{\translate{Symbol (glossaries)}}%
+ \renewcommand*{\pagelistname}{%
+ \translate{Page List (glossaries)}}%
+ \renewcommand*{\glssymbolsgroupname}{%
+ \translate{Symbols (glossaries)}}%
+ \renewcommand*{\glsnumbersgroupname}{%
+ \translate{Numbers (glossaries)}}%
+ }{%
+ \@ifpackageloaded{babel}%
+ {\RequirePackage{glossaries-babel}}%
+ {%
+ \@ifpackageloaded{polyglossia}{%
+ \RequirePackage{glossaries-polyglossia}}{}%
+ }}
+\fi
+\newcommand*{\glspostdescription}{.}
+\newcommand*{\nopostdesc}{}
+\newcommand*{\@nopostdesc}{%
+ \let\org@glspostdescription\glspostdescription
+ \def\glspostdescription{%
+ \let\glspostdescription\org@glspostdescription}%
+}
+\newcommand{\glspar}{\par}
+\ifglsxindy
+ \newcommand{\setStyleFile}[1]{%
+ \renewcommand{\istfilename}{#1.xdy}}
+\else
+ \newcommand{\setStyleFile}[1]{%
+ \renewcommand{\istfilename}{#1.ist}}
+\fi
+\@onlypremakeg\setStyleFile
+\ifglsxindy
+ \def\istfilename{\jobname.xdy}
+\else
+ \def\istfilename{\jobname.ist}
+\fi
+\newcommand*{\@istfilename}[1]{}
+\newcommand*{\glscompositor}{.}
+\newcommand*{\glsSetCompositor}[1]{%
+ \renewcommand*{\glscompositor}{#1}}
+\@onlypremakeg\glsSetCompositor
+\newcommand*{\@glsAlphacompositor}{\glscompositor}
+\ifglsxindy
+ \newcommand*\glsSetAlphaCompositor[1]{%
+ \renewcommand*\@glsAlphacompositor{#1}}
+\else
+ \newcommand*\glsSetAlphaCompositor[1]{%
+ \glsnoxindywarning\glsSetAlphaCompositor}
+\fi
+\@onlypremakeg\glsSetAlphaCompositor
+\newcommand*{\gls@suffixF}{}
+\newcommand*{\glsSetSuffixF}[1]{%
+ \renewcommand*{\gls@suffixF}{#1}}
+\@onlypremakeg\glsSetSuffixF
+\newcommand*{\gls@suffixFF}{}
+\newcommand*{\glsSetSuffixFF}[1]{%
+ \renewcommand*{\gls@suffixFF}{#1}%
+}
+\ifcsundef{hyperlink}%
+{%
+ \newcommand*{\glsnumberformat}[1]{#1}%
+}%
+{%
+ \newcommand*{\glsnumberformat}[1]{\glshypernumber{#1}}%
+}
+\newcommand{\delimN}{, }
+\newcommand{\delimR}{--}
+\newcommand*{\glossarypreamble}{}
+\newcommand*{\glossarypostamble}{}
+\newcommand*{\glossarysection}[2][\@gls@title]{%
+ \def\@gls@title{#2}%
+ \ifcsundef{phantomsection}%
+ {%
+ \@glossarysection{#1}{#2}%
+ }%
+ {%
+ \@p@glossarysection{#1}{#2}%
+ }%
+ \glossarymark{\glossarytoctitle}%
+}
+\ifcsundef{glossarymark}%
+{%
+ \newcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
+}%
+{%
+ \GlossariesWarning{overriding \string\glossarymark}%
+ \@ifclassloaded{memoir}%
+ {
+ \renewcommand{\glossarymark}[1]{%
+ \markboth{\memUChead{#1}}{\memUChead{#1}}%
+ }
+ }
+ {
+ \renewcommand{\glossarymark}[1]{\@mkboth{#1}{#1}}
+ }
+}
+\newcommand*{\setglossarysection}[1]{%
+\setkeys{glossaries.sty}{section=#1}}
+\newcommand*{\@glossarysection}[2]{%
+\ifx\@@glossarysecstar\@empty
+ \csname\@@glossarysec\endcsname{#2}%
+\else
+ \csname\@@glossarysec\endcsname*{#2}%
+ \@gls@toc{#1}{\@@glossarysec}%
+\fi
+\@@glossaryseclabel}
+\newcommand*{\@p@glossarysection}[2]{%
+\glsclearpage
+\phantomsection
+\ifx\@@glossarysecstar\@empty
+ \csname\@@glossarysec\endcsname{#2}%
+\else
+ \@gls@toc{#1}{\@@glossarysec}%
+ \csname\@@glossarysec\endcsname*{#2}%
+\fi
+\@@glossaryseclabel}
+\newcommand*{\gls@doclearpage}{%
+ \ifthenelse{\equal{\@@glossarysec}{chapter}}%
+ {%
+ \ifcsundef{cleardoublepage}{\clearpage}{\cleardoublepage}%
+ }%
+ {}%
+}
+\newcommand*{\glsclearpage}{\gls@doclearpage}
+\newcommand*{\@gls@toc}[2]{%
+\ifglstoc
+ \ifglsnumberline
+ \addcontentsline{toc}{#2}{\numberline{}#1}%
+ \else
+ \addcontentsline{toc}{#2}{#1}%
+ \fi
+\fi}
+\newcommand*{\glsnoxindywarning}[1]{%
+ \GlossariesWarning{Not in xindy mode --- ignoring \string#1}%
+}
+\ifglsxindy
+ \edef\@xdyattributes{\string"default\string"}%
+\fi
+\ifglsxindy
+ \edef\@xdyattributelist{}%
+\fi
+\ifglsxindy
+ \def\@xdylocref{}
+\fi
+\newcommand*{\@gls@ifinlist}[4]{%
+ \def\@do@ifinlist##1,#1,##2\end@doifinlist{%
+ \def\@gls@listsuffix{##2}%
+ \ifx\@gls@listsuffix\@empty
+ #4%
+ \else
+ #3%
+ \fi
+ }%
+ \@do@ifinlist,#2,#1,\end@doifinlist
+}
+\ifglsxindy
+ \newcommand*{\@xdycounters}{\glscounter}
+ \newcommand*\GlsAddXdyCounters[1]{%
+ \@for\@gls@ctr:=#1\do{%
+ \edef\@do@addcounter{%
+ \noexpand\@gls@ifinlist{\@gls@ctr}{\@xdycounters}{}%
+ {%
+ \noexpand\edef\noexpand\@xdycounters{\@xdycounters,%
+ \noexpand\@gls@ctr}%
+ }%
+ }%
+ \@do@addcounter
+ }
+ }
+ \@onlypremakeg\GlsAddXdyCounters
+\else
+ \newcommand*\GlsAddXdyCounters[1]{%
+ \glsnoxindywarning\GlsAddXdyAttribute
+ }
+\fi
+\newcommand*\@disabled@glsaddxdycounters{%
+ \PackageError{glossaries}{\string\GlsAddXdyCounters\space
+ can't be used after \string\GlsAddXdyAttribute}{Move all
+ occurrences of \string\GlsAddXdyCounters\space before the first
+ instance of \string\GlsAddXdyAttribute}%
+}
+\ifglsxindy
+ \newcommand*\@glsaddxdyattribute[2]{%
+ \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string" ^^J
+ \string"#2#1\string"}%
+ \expandafter\toks@\expandafter{\@xdylocref}%
+ \edef\@xdylocref{\the\toks@ ^^J%
+ (markup-locref
+ :open \string"\string~n%
+ \expandafter\string\csname glsX#2X#1\endcsname
+ \string" ^^J
+ :close \string"\string" ^^J
+ :attr \string"#2#1\string")}%
+ \expandafter\gdef\csname glsX#2X#1\endcsname##1##2{%
+ \setentrycounter[##1]{#2}\csname #1\endcsname{##2}%
+ }%
+ }
+ \newcommand*\GlsAddXdyAttribute[1]{%
+ \ifx\@xdyattributelist\@empty
+ \edef\@xdyattributelist{#1}%
+ \else
+ \edef\@xdyattributelist{\@xdyattributelist,#1}%
+ \fi
+ \@for\@this@counter:=\@xdycounters\do{%
+ \protected@edef\gls@do@addxdyattribute{%
+ \noexpand\@glsaddxdyattribute{#1}{\@this@counter}%
+ }
+ \gls@do@addxdyattribute
+ }%
+ \let\GlsAddXdyCounters\@disabled@glsaddxdycounters
+ }
+ \@onlypremakeg\GlsAddXdyAttribute
+\else
+ \newcommand*\GlsAddXdyAttribute[1]{%
+ \glsnoxindywarning\GlsAddXdyAttribute}
+\fi
+\ifglsxindy
+\newcommand*{\@gls@addpredefinedattributes}{%
+ \GlsAddXdyAttribute{glsnumberformat}
+ \GlsAddXdyAttribute{textrm}
+ \GlsAddXdyAttribute{textsf}
+ \GlsAddXdyAttribute{texttt}
+ \GlsAddXdyAttribute{textbf}
+ \GlsAddXdyAttribute{textmd}
+ \GlsAddXdyAttribute{textit}
+ \GlsAddXdyAttribute{textup}
+ \GlsAddXdyAttribute{textsl}
+ \GlsAddXdyAttribute{textsc}
+ \GlsAddXdyAttribute{emph}
+ \GlsAddXdyAttribute{glshypernumber}
+ \GlsAddXdyAttribute{hyperrm}
+ \GlsAddXdyAttribute{hypersf}
+ \GlsAddXdyAttribute{hypertt}
+ \GlsAddXdyAttribute{hyperbf}
+ \GlsAddXdyAttribute{hypermd}
+ \GlsAddXdyAttribute{hyperit}
+ \GlsAddXdyAttribute{hyperup}
+ \GlsAddXdyAttribute{hypersl}
+ \GlsAddXdyAttribute{hypersc}
+ \GlsAddXdyAttribute{hyperemph}
+}
+\else
+ \let\@gls@addpredefinedattributes\relax
+\fi
+\def\@xdyuseralphabets{}
+\ifglsxindy
+ \newcommand*{\GlsAddXdyAlphabet}[2]{%
+ \edef\@xdyuseralphabets{%
+ \@xdyuseralphabets ^^J
+ (define-alphabet "#1" (#2))}}
+\else
+ \newcommand*{\GlsAddXdyAlphabet}[2]{%
+ \glsnoxindywarning\GlsAddXdyAlphabet}
+\fi
+\ifglsxindy
+ \newcommand*{\@gls@xdy@locationlist}{%
+ roman-page-numbers,%
+ Roman-page-numbers,%
+ arabic-page-numbers,%
+ alpha-page-numbers,%
+ Alpha-page-numbers,%
+ Appendix-page-numbers,%
+ arabic-section-numbers%
+ }
+ \protected@edef\@gls@roman{\@roman{0\string"
+ \string"roman-numbers-lowercase\string" :sep \string"}}%
+ \@onelevel@sanitize\@gls@roman
+ \edef\@tmp{\string" \string"roman-numbers-lowercase\string"
+ :sep \string"}%
+ \@onelevel@sanitize\@tmp
+ \ifx\@tmp\@gls@roman
+ \expandafter
+ \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{%
+ \string"roman-numbers-lowercase\string"%
+ }%
+ \else
+ \expandafter
+ \edef\csname @gls@xdy@Lclass@roman-page-numbers\endcsname{
+ :sep \string"\@gls@roman\string"%
+ }%
+ \fi
+ \expandafter\def\csname @gls@xdy@Lclass@Roman-page-numbers\endcsname{%
+ \string"roman-numbers-uppercase\string"%
+ }%
+ \expandafter\def\csname @gls@xdy@Lclass@arabic-page-numbers\endcsname{%
+ \string"arabic-numbers\string"%
+ }%
+ \expandafter\def\csname @gls@xdy@Lclass@alpha-page-numbers\endcsname{%
+ \string"alpha\string"%
+ }%
+ \expandafter\def\csname @gls@xdy@Lclass@Alpha-page-numbers\endcsname{%
+ \string"ALPHA\string"%
+ }%
+ \expandafter\def\csname @gls@xdy@Lclass@Appendix-page-numbers\endcsname{%
+ \string"ALPHA\string"
+ :sep \string"\@glsAlphacompositor\string"
+ \string"arabic-numbers\string"%
+ }
+ \expandafter\def\csname @gls@xdy@Lclass@arabic-section-numbers\endcsname{%
+ \string"arabic-numbers\string"
+ :sep \string"\glscompositor\string"
+ \string"arabic-numbers\string"%
+ }%
+ \def\@xdyuserlocationdefs{}
+ \def\@xdyuserlocationnames{}
+\fi
+\ifglsxindy
+ \newcommand*{\GlsAddXdyLocation}[3][]{%
+ \def\@gls@tmp{#1}%
+ \ifx\@gls@tmp\@empty
+ \edef\@xdyuserlocationdefs{%
+ \@xdyuserlocationdefs ^^J%
+ (define-location-class \string"#2\string"^^J\space\space
+ \space(:sep \string"{}\glsopenbrace\string" #3
+ :sep \string"\glsclosebrace\string"))
+ }%
+ \else
+ \edef\@xdyuserlocationdefs{%
+ \@xdyuserlocationdefs ^^J%
+ (define-location-class \string"#2\string"^^J\space\space
+ \space(:sep "\glsopenbrace"
+ #1
+ :sep "\glsclosebrace\glsopenbrace" #3
+ :sep "\glsclosebrace"))
+ }%
+ \fi
+ \edef\@xdyuserlocationnames{%
+ \@xdyuserlocationnames^^J\space\space\space
+ \string"#1\string"}%
+ }
+ \@onlypremakeg\GlsAddXdyLocation
+\else
+ \newcommand*{\GlsAddXdyLocation}[2]{%
+ \glsnoxindywarning\GlsAddXdyLocation}
+\fi
+\ifglsxindy
+ \edef\@xdylocationclassorder{^^J\space\space\space
+ \string"roman-page-numbers\string"^^J\space\space\space
+ \string"arabic-page-numbers\string"^^J\space\space\space
+ \string"arabic-section-numbers\string"^^J\space\space\space
+ \string"alpha-page-numbers\string"^^J\space\space\space
+ \string"Roman-page-numbers\string"^^J\space\space\space
+ \string"Alpha-page-numbers\string"^^J\space\space\space
+ \string"Appendix-page-numbers\string"
+ \@xdyuserlocationnames^^J\space\space\space
+ \string"see\string"
+ }
+\fi
+\ifglsxindy
+ \newcommand*\GlsSetXdyLocationClassOrder[1]{%
+ \def\@xdylocationclassorder{#1}}
+\else
+ \newcommand*\GlsSetXdyLocationClassOrder[1]{%
+ \glsnoxindywarning\GlsSetXdyLocationClassOrder}
+\fi
+\ifglsxindy
+ \def\@xdysortrules{}
+\fi
+\ifglsxindy
+ \newcommand*\GlsAddSortRule[2]{%
+ \expandafter\toks@\expandafter{\@xdysortrules}%
+ \protected@edef\@xdysortrules{\the\toks@ ^^J
+ (sort-rule \string"#1\string" \string"#2\string")}%
+ }
+\else
+ \newcommand*\GlsAddSortRule[2]{%
+ \glsnoxindywarning\GlsAddSortRule}
+\fi
+\ifglsxindy
+ \def\@xdyrequiredstyles{tex}
+\fi
+\ifglsxindy
+ \newcommand*\GlsAddXdyStyle[1]{%
+ \edef\@xdyrequiredstyles{\@xdyrequiredstyles,#1}}%
+\else
+ \newcommand*\GlsAddXdyStyle[1]{%
+ \glsnoxindywarning\GlsAddXdyStyle}
+\fi
+\ifglsxindy
+ \newcommand*\GlsSetXdyStyles[1]{%
+ \edef\@xdyrequiredstyles{#1}}
+\else
+ \newcommand*\GlsSetXdyStyles[1]{%
+ \glsnoxindywarning\GlsSetXdyStyles}
+\fi
+\ifglsxindy
+ \@ifpackageloaded{babel}{%
+ \def\findrootlanguage{\begingroup
+ \escapechar=-1\relax
+ \edef\languagename{%
+ \expandafter\string\csname\languagename\endcsname}%
+ \def\NeedsTeXFormat##1[##2]{}%
+ \def\ProvidesPackage##1[##2]{}%
+ \let\LdfInit\relax
+ \def\languageattribute##1##2{}%
+ \def\DeclareOption##1##2{%
+ \ifx##1*\expandafter\endinput\else
+ \edef\testlanguage{\expandafter\string\csname##1\endcsname}%
+ \ifx\testlanguage\languagename##2\fi
+ \fi}
+ \def\input##1{\stripldf##1}%
+ \def\stripldf##1.ldf{\gdef\rootlanguagename{##1}}%
+ \@@input babel.sty
+ \endgroup}%
+ }{%
+ \@ifpackageloaded{ngerman}{%
+ \def\findrootlanguage{%
+ \def\rootlanguagename{german}}%
+ }{%
+ \def\findrootlanguage{%
+ \def\rootlanguagename{english}}%
+ }%
+ }%
+\fi
+\def\rootlanguagename{english}
+\def\@xdylanguage#1#2{}
+\ifglsxindy
+ \newcommand*\GlsSetXdyLanguage[2][\glsdefaulttype]{%
+ \ifglossaryexists{#1}{%
+ \expandafter\def\csname @xdy@#1@language\endcsname{#2}%
+ }{%
+ \PackageError{glossaries}{Can't set language type for
+ glossary type `#1' --- no such glossary}{%
+ You have specified a glossary type that doesn't exist}}}
+\else
+ \newcommand*\GlsSetXdyLanguage[2][]{%
+ \glsnoxindywarning\GlsSetXdyLanguage}
+\fi
+\def\@gls@codepage#1#2{}
+\ifglsxindy
+ \newcommand*{\GlsSetXdyCodePage}[1]{%
+ \renewcommand*{\gls@codepage}{#1}%
+ }
+\else
+ \newcommand*{\GlsSetXdyCodePage}[1]{%
+ \glsnoxindywarning\GlsSetXdyCodePage}
+\fi
+\ifglsxindy
+ \ifgls@xindy@glsnumbers
+ \def\@xdylettergroups{(define-letter-group
+ \string"glsnumbers\string"^^J\space\space\space
+ :prefixes (\string"0\string" \string"1\string"
+ \string"2\string" \string"3\string" \string"4\string"
+ \string"5\string" \string"6\string" \string"7\string"
+ \string"8\string" \string"9\string")^^J\space\space\space
+ :before \string"\@glsfirstletter\string")}
+ \else
+ \def\@xdylettergroups{}
+ \fi
+\fi
+ \newcommand*\GlsAddLetterGroup[2]{%
+ \expandafter\toks@\expandafter{\@xdylettergroups}%
+ \protected@edef\@xdylettergroups{\the\toks@^^J%
+ (define-letter-group \string"#1\string"^^J\space\space\space#2)}%
+ }%
+\newcommand*{\forallglossaries}[3][\@glo@types]{%
+ \@for#2:=#1\do{\ifx#2\@empty\else#3\fi}%
+}
+\newcommand*{\forglsentries}[3][\glsdefaulttype]{%
+ \edef\@@glo@list{\csname glolist@#1\endcsname}%
+ \@for#2:=\@@glo@list\do{\ifx#2\@empty\else#3\fi}%
+}
+\newcommand*{\forallglsentries}[3][\@glo@types]{%
+\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{%
+\forglsentries[\@@this@glo@]{#2}{#3}}}
+\newcommand{\ifglossaryexists}[3]{%
+ \ifcsundef{@glotype@#1@out}{#3}{#2}%
+}
+\newcommand{\ifglsentryexists}[3]{%
+ \ifcsundef{glo@#1@name}{#3}{#2}%
+}
+\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}}
+\newcommand{\glsdoifexists}[2]{%
+ \ifglsentryexists{#1}{#2}{%
+ \PackageError{glossaries}{Glossary entry `#1' has not been
+ defined}{You need to define a glossary entry before you
+ can use it.}}%
+}
+\newcommand{\glsdoifnoexists}[2]{%
+ \ifglsentryexists{#1}{%
+ \PackageError{glossaries}{Glossary entry `#1' has already
+ been defined}{}}{#2}%
+}
+\newcommand*{\@glo@types}{,}
+\newcommand*{\newglossary}[5][glg]{%
+\ifglossaryexists{#2}{%
+ \PackageError{glossaries}{Glossary type `#2' already exists}{%
+ You can't define a new glossary called `#2' because it already
+ exists}%
+}{%
+ \ifx\glsdefaulttype\relax
+ \gdef\glsdefaulttype{#2}%
+ \fi
+ \toks@{#2}\edef\@glo@types{\@glo@types\the\toks@,}%
+ \expandafter\gdef\csname glolist@#2\endcsname{,}%
+ \expandafter\def\csname @glotype@#2@in\endcsname{#3}%
+ \expandafter\def\csname @glotype@#2@out\endcsname{#4}%
+ \expandafter\def\csname @glotype@#2@title\endcsname{#5}%
+ \protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}%
+ \ifcsundef{gls@#2@display}%
+ {%
+ \expandafter\gdef\csname gls@#2@display\endcsname{\glsdisplay}%
+ }%
+ {}%
+ \ifcsundef{gls@#2@displayfirst}%
+ {%
+ \expandafter\gdef\csname gls@#2@displayfirst\endcsname{%
+ \glsdisplayfirst
+ }%
+ }%
+ {}%
+ \@gls@defsortcount{#2}%
+ \@ifnextchar[{\@gls@setcounter{#2}}%
+ {\@gls@setcounter{#2}[\glscounter]}}%
+}
+\newcommand*{\altnewglossary}[3]{%
+ \newglossary[#2-glg]{#1}{#2-gls}{#2-glo}{#3}%
+}
+\@onlypreamble{\newglossary}
+\@onlypremakeg\newglossary
+\newcommand*{\@newglossary}[4]{}
+\def\@gls@setcounter#1[#2]{%
+ \expandafter\def\csname @glotype@#1@counter\endcsname{#2}%
+ \ifglsxindy
+ \GlsAddXdyCounters{#2}%
+ \fi
+}
+\newcommand*{\@gls@getcounter}[1]{%
+\csname @glotype@#1@counter\endcsname}
+\glsdefmain
+\define@key{glossentry}{name}{%
+\def\@glo@name{#1}%
+}
+\define@key{glossentry}{description}{%
+\def\@glo@desc{#1}%
+}
+\define@key{glossentry}{descriptionplural}{%
+\def\@glo@descplural{#1}%
+}
+\define@key{glossentry}{sort}{%
+\def\@glo@sort{#1}}
+\define@key{glossentry}{text}{%
+\def\@glo@text{#1}%
+}
+\define@key{glossentry}{plural}{%
+\def\@glo@plural{#1}%
+}
+\define@key{glossentry}{first}{%
+\def\@glo@first{#1}%
+}
+\define@key{glossentry}{firstplural}{%
+\def\@glo@firstplural{#1}%
+}
+\define@key{glossentry}{symbol}{%
+\def\@glo@symbol{#1}%
+}
+\define@key{glossentry}{symbolplural}{%
+\def\@glo@symbolplural{#1}%
+}
+\define@key{glossentry}{type}{%
+\def\@glo@type{#1}}
+\define@key{glossentry}{counter}{%
+ \ifcsundef{c@#1}%
+ {%
+ \PackageError{glossaries}%
+ {There is no counter called `#1'}%
+ {%
+ The counter key should have the name of a valid counter
+ as its value%
+ }%
+ }%
+ {%
+ \def\@glo@counter{#1}%
+ }%
+}
+\define@key{glossentry}{see}{%
+ \def\@glo@see{#1}%
+ \@glo@seeautonumberlist
+}
+\define@key{glossentry}{parent}{%
+\def\@glo@parent{#1}}
+\define@choicekey{glossentry}{nonumberlist}[\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\@glo@prefix{\glsnonextpages}%
+ \else
+ \def\@glo@prefix{\glsnextpages}%
+ \fi
+}
+\define@key{glossentry}{user1}{%
+ \def\@glo@useri{#1}%
+}
+\define@key{glossentry}{user2}{%
+ \def\@glo@userii{#1}%
+}
+\define@key{glossentry}{user3}{%
+ \def\@glo@useriii{#1}%
+}
+\define@key{glossentry}{user4}{%
+ \def\@glo@useriv{#1}%
+}
+\define@key{glossentry}{user5}{%
+ \def\@glo@userv{#1}%
+}
+\define@key{glossentry}{user6}{%
+ \def\@glo@uservi{#1}%
+}
+\define@key{glossentry}{short}{%
+ \def\@glo@short{#1}%
+}
+\define@key{glossentry}{shortplural}{%
+ \def\@glo@shortpl{#1}%
+}
+\define@key{glossentry}{long}{%
+ \def\@glo@long{#1}%
+}
+\define@key{glossentry}{longplural}{%
+ \def\@glo@longpl{#1}%
+}
+\newcommand*{\@glsnoname}{%
+ \PackageError{glossaries}{name key required in
+ \string\newglossaryentry\space for entry `\@glo@label'}{You
+ haven't specified the entry name}}
+\newcommand*{\@glsdefaultplural}{\@glo@text\glspluralsuffix}
+\newcommand*{\@glsdefaultsort}{\@glo@name}
+\newcount\gls@level
+\newrobustcmd{\newglossaryentry}[2]{%
+\glsdoifnoexists{#1}{%
+\def\@glo@label{#1}%
+\let\@glo@name\@glsnoname
+\def\@glo@desc{\PackageError{glossaries}{description key required in
+\string\newglossaryentry\space for entry `\@glo@label'}{You haven't specified the entry description}}%
+\def\@glo@descplural{\@glo@desc}%
+\def\@glo@type{\glsdefaulttype}%
+\def\@glo@symbol{\relax}%
+\def\@glo@symbolplural{\@glo@symbol}%
+\def\@glo@text{\@glo@name}%
+\let\@glo@plural\@glsdefaultplural
+\let\@glo@first\relax
+\let\@glo@firstplural\relax
+\let\@glo@sort\@glsdefaultsort
+\def\@glo@counter{\@gls@getcounter{\@glo@type}}%
+\def\@glo@see{}%
+\def\@glo@parent{}%
+\def\@glo@prefix{}%
+\def\@glo@useri{}%
+\def\@glo@userii{}%
+\def\@glo@useriii{}%
+\def\@glo@useriv{}%
+\def\@glo@userv{}%
+\def\@glo@uservi{}%
+\def\@glo@short{}%
+\def\@glo@shortpl{}%
+\def\@glo@long{}%
+\def\@glo@longpl{}%
+ \@newglossaryentryprehook
+\setkeys{glossentry}{#2}%
+\ifcsundef{glolist@\@glo@type}%
+{%
+ \PackageError{glossaries}%
+ {Glossary type '\@glo@type' has not been defined}%
+ {You need to define a new glossary type, before making entries
+ in it}%
+}%
+{%
+ \protected@edef\@glolist@{\csname glolist@\@glo@type\endcsname}%
+ \expandafter\xdef\csname glolist@\@glo@type\endcsname{\@glolist@{#1},}%
+}%
+\gls@level=0\relax
+\ifx\@glo@parent\@empty
+ \expandafter\gdef\csname glo@#1@parent\endcsname{}%
+\else
+ \ifthenelse{\equal{#1}{\@glo@parent}}{%
+ \PackageError{glossaries}{Entry `#1' can't be its own parent}{}%
+ \def\@glo@parent{}%
+ \expandafter\gdef\csname glo@#1@parent\endcsname{}%
+ }{%
+ \ifglsentryexists{\@glo@parent}{%
+ \expandafter\xdef\csname glo@#1@parent\endcsname{\@glo@parent}%
+ \gls@level=\csname glo@\@glo@parent @level\endcsname\relax
+ \advance\gls@level by 1\relax
+ \ifx\@glo@name\@glsnoname
+ \expandafter\let\expandafter\@glo@name
+ \csname glo@\@glo@parent @name\endcsname
+ \ifx\@glo@plural\@glsdefaultplural
+ \expandafter\let\expandafter\@glo@plural
+ \csname glo@\@glo@parent @plural\endcsname
+ \fi
+ \fi
+ }{%
+ \PackageError{glossaries}{Invalid parent `\@glo@parent'
+ for entry `#1' - parent doesn't exist}{Parent entries
+ must be defined before their children}%
+ \def\@glo@parent{}%
+ \expandafter\gdef\csname glo@#1@parent\endcsname{}%
+ }%
+ }%
+\fi
+\expandafter\xdef\csname glo@#1@level\endcsname{\number\gls@level}%
+\ifx\relax\@glo@firstplural
+ \ifx\relax\@glo@first
+ \def\@glo@firstplural{\@glo@plural}%
+ \def\@glo@first{\@glo@text}%
+ \else
+ \def\@glo@firstplural{\@glo@first\glspluralsuffix}%
+ \fi
+\else
+ \ifx\relax\@glo@first
+ \def\@glo@first{\@glo@text}%
+ \fi
+\fi
+\expandafter
+ \protected@xdef\csname glo@#1@text\endcsname{\@glo@text}%
+\expandafter
+ \protected@xdef\csname glo@#1@plural\endcsname{\@glo@plural}%
+\expandafter
+ \protected@xdef\csname glo@#1@first\endcsname{\@glo@first}%
+\expandafter
+ \protected@xdef\csname glo@#1@firstpl\endcsname{\@glo@firstplural}%
+\expandafter
+ \protected@xdef\csname glo@#1@type\endcsname{\@glo@type}%
+\expandafter
+ \protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}%
+\expandafter
+ \protected@xdef\csname glo@#1@useri\endcsname{\@glo@useri}%
+\expandafter
+ \protected@xdef\csname glo@#1@userii\endcsname{\@glo@userii}%
+\expandafter
+ \protected@xdef\csname glo@#1@useriii\endcsname{\@glo@useriii}%
+\expandafter
+ \protected@xdef\csname glo@#1@useriv\endcsname{\@glo@useriv}%
+\expandafter
+ \protected@xdef\csname glo@#1@userv\endcsname{\@glo@userv}%
+\expandafter
+ \protected@xdef\csname glo@#1@uservi\endcsname{\@glo@uservi}%
+\expandafter
+ \protected@xdef\csname glo@#1@short\endcsname{\@glo@short}%
+\expandafter
+ \protected@xdef\csname glo@#1@shortpl\endcsname{\@glo@shortpl}%
+\expandafter
+ \protected@xdef\csname glo@#1@long\endcsname{\@glo@long}%
+\expandafter
+ \protected@xdef\csname glo@#1@longpl\endcsname{\@glo@longpl}%
+\@gls@sanitizename
+\expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}%
+\def\@glo@@desc{\@glo@first}%
+\ifx\@glo@desc\@glo@@desc
+ \let\@glo@desc\@glo@first
+\fi
+\@gls@sanitizedesc
+\expandafter\protected@xdef\csname glo@#1@desc\endcsname{\@glo@desc}%
+\expandafter\protected@xdef\csname glo@#1@descplural\endcsname{\@glo@descplural}%
+\@gls@defsort{\@glo@type}{#1}%
+\def\@glo@@symbol{\@glo@text}%
+\ifx\@glo@symbol\@glo@@symbol
+ \let\@glo@symbol\@glo@text
+\fi
+\@gls@sanitizesymbol
+\expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}%
+\expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}%
+\expandafter\gdef\csname glo@#1@flagfalse\endcsname{%
+\expandafter\global\expandafter
+\let\csname ifglo@#1@flag\endcsname\iffalse}%
+\expandafter\gdef\csname glo@#1@flagtrue\endcsname{%
+\expandafter\global\expandafter
+\let\csname ifglo@#1@flag\endcsname\iftrue}%
+\csname glo@#1@flagfalse\endcsname
+\ifx\@glo@see\@empty
+\else
+ \protected@edef\@do@glssee{%
+ \noexpand\@gls@fixbraces\noexpand\@glo@list\@glo@see
+ \noexpand\@nil
+ \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{#1}}%
+ \@do@glssee
+\fi
+}%
+ \do@glo@storeentry{#1}%
+ \@newglossaryentryposthook
+}
+\newcommand*{\@newglossaryentryprehook}{}
+\newcommand*{\@newglossaryentryposthook}{}
+\ifglsxindy
+ \newcommand*{\@glossaryentryfield}{\string\\glossaryentryfield}
+\else
+ \newcommand*{\@glossaryentryfield}{\string\glossaryentryfield}
+\fi
+\ifglsxindy
+ \newcommand*{\@glossarysubentryfield}{%
+ \string\\glossarysubentryfield}
+\else
+ \newcommand*{\@glossarysubentryfield}{%
+ \string\glossarysubentryfield}
+\fi
+\newcommand{\@glo@storeentry}[1]{%
+\protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}%
+\@gls@checkmkidxchars\@glo@sort
+\protected@edef\@@glo@name{\csname glo@#1@name\endcsname}%
+\@gls@checkmkidxchars\@@glo@name
+\ifglsxindy
+ \protected@edef\@glo@name{\string\\glsnamefont{\@@glo@name}}%
+\else
+ \protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}%
+\fi
+\protected@edef\@glo@desc{\csname glo@#1@desc\endcsname}%
+\@gls@checkmkidxchars\@glo@desc
+\protected@edef\@glo@symbol{\csname glo@#1@symbol\endcsname}%
+\@gls@checkmkidxchars\@glo@symbol
+\@gls@checkmkidxchars\@glo@prefix
+\edef\@glo@parent{\csname glo@#1@parent\endcsname}%
+\ifglsxindy
+ \ifx\@glo@parent\@empty
+ \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
+ (\string"\@glo@sort\string" %
+ \string"\@glo@prefix\@glossaryentryfield{#1}{\@glo@name
+ }{\@glo@desc}{\@glo@symbol}\string") %
+ }%
+ \else
+ \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
+ \csname glo@\@glo@parent @index\endcsname
+ (\string"\@glo@sort\string" %
+ \string"\@glo@prefix\@glossarysubentryfield%
+ {\csname glo@#1@level\endcsname}{#1}{\@glo@name
+ }{\@glo@desc}{\@glo@symbol}\string") %
+ }%
+ \fi
+\else
+ \ifx\@glo@parent\@empty
+ \@onelevel@sanitize\@glo@prefix
+ \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
+ \@glo@sort\@gls@actualchar\@glo@prefix
+ \@glossaryentryfield{#1}{\@glo@name}{\@glo@desc
+ }{\@glo@symbol}%
+ }%
+ \else
+ \expandafter\protected@xdef\csname glo@#1@index\endcsname{%
+ \csname glo@\@glo@parent @index\endcsname\@gls@levelchar
+ \@glo@sort\@gls@actualchar\@glo@prefix
+ \@glossarysubentryfield
+ {\csname glo@#1@level\endcsname}{#1}{\@glo@name}{\@glo@desc
+ }{\@glo@symbol}%
+ }%
+ \fi
+\fi
+}
+\newcommand*{\glsreset}[1]{%
+\glsdoifexists{#1}{%
+\expandafter\global\csname glo@#1@flagfalse\endcsname}}
+\newcommand*{\glslocalreset}[1]{%
+\glsdoifexists{#1}{%
+\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}}
+\newcommand*{\glsunset}[1]{%
+\glsdoifexists{#1}{%
+\expandafter\global\csname glo@#1@flagtrue\endcsname}}
+\newcommand*{\glslocalunset}[1]{%
+\glsdoifexists{#1}{%
+\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}}
+\newcommand*{\glsresetall}[1][\@glo@types]{%
+\forallglsentries[#1]{\@glsentry}{%
+\glsreset{\@glsentry}}}
+\newcommand*{\glslocalresetall}[1][\@glo@types]{%
+\forallglsentries[#1]{\@glsentry}{%
+\glslocalreset{\@glsentry}}}
+\newcommand*{\glsunsetall}[1][\@glo@types]{%
+\forallglsentries[#1]{\@glsentry}{%
+\glsunset{\@glsentry}}}
+\newcommand*{\glslocalunsetall}[1][\@glo@types]{%
+\forallglsentries[#1]{\@glsentry}{%
+\glslocalunset{\@glsentry}}}
+\newcommand*{\loadglsentries}[2][\@gls@default]{%
+\let\@gls@default\glsdefaulttype
+\def\glsdefaulttype{#1}\input{#2}%
+\let\glsdefaulttype\@gls@default}
+\@onlypreamble{\loadglsentries}
+\newcommand*{\glstextformat}[1]{#1}
+\newcommand*{\glsdisplayfirst}[4]{#1#4}
+\newcommand*{\glsdisplay}[4]{#1#4}
+\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{%
+\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}}
+\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{%
+\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}}
+\define@key{glslink}{counter}{%
+ \ifcsundef{c@#1}%
+ {%
+ \PackageError{glossaries}%
+ {There is no counter called `#1'}%
+ {%
+ The counter key should have the name of a valid counter
+ as its value%
+ }%
+ }%
+ {%
+ \def\@gls@counter{#1}%
+ }%
+}
+\define@key{glslink}{format}{%
+\def\@glsnumberformat{#1}}
+\define@boolkey{glslink}{hyper}[true]{}
+\newrobustcmd*{\glslink}{%
+\@ifstar\@sgls@link\@gls@@link}
+\newcommand*{\@sgls@link}[1][]{\@gls@@link[hyper=false,#1]}
+\newcommand*{\@gls@@link}[3][]{%
+ \ifglsentryexists{#2}%
+ {%
+ \@gls@link[#1]{#2}{#3}%
+ }{%
+ \PackageError{glossaries}{Glossary entry `#2' has not been
+ defined}{You need to define a glossary entry before you
+ can use it.}%
+ \glstextformat{#3}%
+ }%
+}
+\def\@gls@link[#1]#2#3{%
+ \leavevmode
+ \def\glslabel{#2}%
+ \def\@glsnumberformat{glsnumberformat}%
+ \edef\@gls@counter{\csname glo@#2@counter\endcsname}%
+ \KV@glslink@hypertrue
+ \setkeys{glslink}{#1}%
+ \@gls@saveentrycounter
+ \@gls@setsort{#2}%
+ \@do@wrglossary{#2}%
+ \ifKV@glslink@hyper
+ \@glslink{glo:#2}{\glstextformat{#3}}%
+ \else
+ \glstextformat{#3}\relax
+ \fi
+}
+\newcommand*{\@gls@saveentrycounter}{%
+ \def\@gls@Hcounter{}%
+ \ifthenelse{\equal{\@gls@counter}{equation}}%
+ {
+ \ifcsundef{xatlevel@}%
+ {%
+ \edef\theglsentrycounter{\expandafter\noexpand
+ \csname the\@gls@counter\endcsname}%
+ }%
+ {%
+ \ifx\xatlevel@\@empty
+ \edef\theglsentrycounter{\expandafter\noexpand
+ \csname the\@gls@counter\endcsname}%
+ \else
+ \savecounters@
+ \advance\c@equation by 1\relax
+ \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}%
+ \ifcsundef{theH\@gls@counter}%
+ {%
+ \def\@gls@Hcounter{\theglsentrycounter}%
+ }%
+ {%
+ \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}%
+ }%
+ \protected@edef\theHglsentrycounter{\@gls@Hcounter}%
+ \restorecounters@
+ \fi
+ }%
+ }%
+ {%
+ \edef\theglsentrycounter{\expandafter\noexpand
+ \csname the\@gls@counter\endcsname}%
+ }%
+ \ifx\@gls@Hcounter\@empty
+ \ifcsundef{theH\@gls@counter}%
+ {%
+ \def\theHglsentrycounter{\theglsentrycounter}%
+ }%
+ {%
+ \protected@edef\theHglsentrycounter{\expandafter\noexpand
+ \csname theH\@gls@counter\endcsname}%
+ }%
+ \fi
+}
+\def\@set@glo@numformat#1#2#3#4{%
+ \expandafter\@glo@check@mkidxrangechar#3\@nil
+ \protected@edef#1{%
+ \@glo@prefix setentrycounter[#4]{#2}%
+ \expandafter\string\csname\@glo@suffix\endcsname
+ }%
+ \@gls@checkmkidxchars#1%
+}
+\def\@glo@check@mkidxrangechar#1#2\@nil{%
+\if#1(\relax
+ \def\@glo@prefix{(}%
+ \if\relax#2\relax
+ \def\@glo@suffix{glsnumberformat}%
+ \else
+ \def\@glo@suffix{#2}%
+ \fi
+\else
+ \if#1)\relax
+ \def\@glo@prefix{)}%
+ \if\relax#2\relax
+ \def\@glo@suffix{glsnumberformat}%
+ \else
+ \def\@glo@suffix{#2}%
+ \fi
+ \else
+ \def\@glo@prefix{}\def\@glo@suffix{#1#2}%
+ \fi
+\fi}
+\newcommand*{\@gls@escbsdq}[1]{%
+ \def\@gls@checkedmkidx{}%
+ \let\gls@xdystring=#1\relax
+ \@onelevel@sanitize\gls@xdystring
+ \edef\do@gls@xdycheckbackslash{%
+ \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil
+ \@backslashchar\@backslashchar\noexpand\null}%
+ \do@gls@xdycheckbackslash
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}%
+ \let#1=\gls@xdystring
+}
+\newcommand{\@gls@checkmkidxchars}[1]{%
+\ifglsxindy
+ \@gls@escbsdq{#1}%
+\else
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkquote#1\@nil""\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkescquote#1\@nil\"\"\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkescactual#1\@nil\?\?\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkactual#1\@nil??\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkbar#1\@nil||\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checkescbar#1\@nil\|\|\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+ \def\@gls@checkedmkidx{}%
+ \expandafter\@gls@checklevel#1\@nil!!\null
+ \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}%
+\fi
+}
+\def\@gls@updatechecked#1\@nil#2{\def#2{#1}}
+\newtoks\@gls@tmpb
+\def\@gls@checkquote#1"#2"#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkquote{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}%
+ \def\@@gls@checkquote{\@gls@checkquote#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@quotechar}%
+ \ifx\null#3\null
+ \def\@@gls@checkquote{\@gls@checkquote#2""\null}%
+ \else
+ \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}%
+ \fi
+\fi
+\@@gls@checkquote}
+\def\@gls@checkescquote#1\"#2\"#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkescquote{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@quotechar
+ \@gls@quotechar\string\"\@gls@quotechar}%
+ \def\@@gls@checkescquote{\@gls@checkescquote#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@quotechar}%
+ \ifx\null#3\null
+ \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}%
+ \else
+ \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}%
+ \fi
+\fi
+\@@gls@checkescquote}
+\def\@gls@checkescactual#1\?#2\?#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkescactual{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@actualchar
+ \@gls@quotechar\string\"\@gls@actualchar}%
+ \def\@@gls@checkescactual{\@gls@checkescactual#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@actualchar}%
+ \ifx\null#3\null
+ \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}%
+ \else
+ \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}%
+ \fi
+\fi
+\@@gls@checkescactual}
+\def\@gls@checkescbar#1\|#2\|#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkescbar{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@encapchar
+ \@gls@quotechar\string\"\@gls@encapchar}%
+ \def\@@gls@checkescbar{\@gls@checkescbar#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@encapchar}%
+ \ifx\null#3\null
+ \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}%
+ \else
+ \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}%
+ \fi
+\fi
+\@@gls@checkescbar}
+\def\@gls@checkesclevel#1\!#2\!#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkesclevel{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@levelchar
+ \@gls@quotechar\string\"\@gls@levelchar}%
+ \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\string\"\@gls@levelchar}%
+ \ifx\null#3\null
+ \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}%
+ \else
+ \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}%
+ \fi
+\fi
+\@@gls@checkesclevel}
+\def\@gls@checkbar#1|#2|#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkbar{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}%
+ \def\@@gls@checkbar{\@gls@checkbar#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@encapchar}%
+ \ifx\null#3\null
+ \def\@@gls@checkbar{\@gls@checkbar#2||\null}%
+ \else
+ \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}%
+ \fi
+\fi
+\@@gls@checkbar}
+\def\@gls@checklevel#1!#2!#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checklevel{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}%
+ \def\@@gls@checklevel{\@gls@checklevel#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@levelchar}%
+ \ifx\null#3\null
+ \def\@@gls@checklevel{\@gls@checklevel#2!!\null}%
+ \else
+ \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}%
+ \fi
+\fi
+\@@gls@checklevel}
+\def\@gls@checkactual#1?#2?#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@checkactual{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}%
+ \def\@@gls@checkactual{\@gls@checkactual#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \@gls@quotechar\@gls@actualchar}%
+ \ifx\null#3\null
+ \def\@@gls@checkactual{\@gls@checkactual#2??\null}%
+ \else
+ \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}%
+ \fi
+\fi
+\@@gls@checkactual}
+\def\@gls@xdycheckquote#1"#2"#3\null{%
+\@gls@tmpb=\expandafter{\@gls@checkedmkidx}%
+\toks@={#1}%
+\ifx\null#2\null
+ \ifx\null#3\null
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}%
+ \def\@@gls@xdycheckquote{\relax}%
+ \else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \string\"\string\"}%
+ \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}%
+ \fi
+\else
+ \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@
+ \string\"}%
+ \ifx\null#3\null
+ \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}%
+ \else
+ \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}%
+ \fi
+\fi
+\@@gls@xdycheckquote
+}
+\edef\def@gls@xdycheckbackslash{%
+ \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar
+ ##2\@backslashchar##3\noexpand\null{%
+ \noexpand\@gls@tmpb=\noexpand\expandafter
+ {\noexpand\@gls@checkedmkidx}%
+ \noexpand\toks@={##1}%
+ \noexpand\ifx\noexpand\null##2\noexpand\null
+ \noexpand\ifx\noexpand\null##3\noexpand\null
+ \noexpand\edef\noexpand\@gls@checkedmkidx{%
+ \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}%
+ \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}%
+ \noexpand\else
+ \noexpand\edef\noexpand\@gls@checkedmkidx{%
+ \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@
+ \@backslashchar\@backslashchar\@backslashchar\@backslashchar}%
+ \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
+ \noexpand\@gls@xdycheckbackslash##3\noexpand\null}%
+ \noexpand\fi
+ \noexpand\else
+ \noexpand\edef\noexpand\@gls@checkedmkidx{%
+ \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@
+ \@backslashchar\@backslashchar}%
+ \noexpand\ifx\noexpand\null##3\noexpand\null
+ \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
+ \noexpand\@gls@xdycheckbackslash##2\@backslashchar
+ \@backslashchar\noexpand\null}%
+ \noexpand\else
+ \noexpand\def\noexpand\@@gls@xdycheckbackslash{%
+ \noexpand\@gls@xdycheckbackslash##2\@backslashchar
+ ##3\noexpand\null}%
+ \noexpand\fi
+ \noexpand\fi
+ \noexpand\@@gls@xdycheckbackslash
+ }%
+}
+\def@gls@xdycheckbackslash
+\ifcsundef{hyperlink}%
+{%
+ \gdef\@glslink#1#2{#2}%
+}%
+{%
+ \gdef\@glslink#1#2{\hyperlink{#1}{#2}}%
+}
+\newlength\gls@tmplen
+\ifcsundef{hypertarget}%
+{%
+ \gdef\@glstarget#1#2{#2}%
+}%
+{%
+ \gdef\@glstarget#1#2{%
+ \settoheight{\gls@tmplen}{#2}%
+ \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2%
+ }%
+}
+\newcommand{\glsdisablehyper}{%
+\renewcommand*\@glslink[2]{##2}%
+\renewcommand*\@glstarget[2]{##2}}
+\newcommand{\glsenablehyper}{%
+\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}%
+\renewcommand*\@glstarget[2]{%
+ \settoheight{\gls@tmplen}{##2}%
+ \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}}
+\newrobustcmd*{\gls}{\@ifstar\@sgls\@gls}
+\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]}
+\newcommand*{\@gls}[2][]{%
+\new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}}
+\def\@gls@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\ifglsused{#2}%
+{%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}%
+}%
+{%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}%
+}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{\@glo@text}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }{%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\Gls}{\@ifstar\@sGls\@Gls}
+\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]}
+\newcommand*{\@Gls}[2][]{%
+\new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}}
+\def\@Gls@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\def\glslabel{#2}%
+\ifglsused{#2}%
+{%
+ \protected@edef\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {\glsentrytext{#2}}{\glsentrydesc{#2}}%
+ {\glsentrysymbol{#2}}{#3}}%
+}%
+{%
+ \protected@edef\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {\glsentryfirst{#2}}{\glsentrydesc{#2}}%
+ {\glsentrysymbol{#2}}{#3}}%
+}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+ }{%
+ \@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\GLS}{\@ifstar\@sGLS\@GLS}
+\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]}
+\newcommand*{\@GLS}[2][]{%
+\new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}}
+\def\@GLS@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\ifglsused{#2}{\def\@glo@text{%
+\csname gls@\@glo@type @display\endcsname
+{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{%
+\def\@glo@text{%
+\csname gls@\@glo@type @displayfirst\endcsname
+{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
+ }{%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\glspl}{\@ifstar\@sglspl\@glspl}
+\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]}
+\newcommand*{\@glspl}[2][]{%
+\new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}}
+\def\@glspl@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\ifglsused{#2}%
+{%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {\glsentryplural{#2}}{\glsentrydescplural{#2}}%
+ {\glsentrysymbolplural{#2}}{#3}}%
+}%
+{%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}%
+ {\glsentrysymbolplural{#2}}{#3}}%
+}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{\@glo@text}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }{%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\Glspl}{\@ifstar\@sGlspl\@Glspl}
+\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]}
+\newcommand*{\@Glspl}[2][]{%
+\new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}}
+\def\@Glspl@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\def\glslabel{#2}%
+\ifglsused{#2}%
+{%
+ \protected@edef\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {\glsentryplural{#2}}{\glsentrydescplural{#2}}%
+ {\glsentrysymbolplural{#2}}{#3}}%
+}%
+{%
+ \protected@edef\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}%
+ {\glsentrysymbolplural{#2}}{#3}}%
+}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+ }{%
+ \@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl}
+\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]}
+\newcommand*{\@GLSpl}[2][]{%
+\new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}}
+\def\@GLSpl@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\def\@gls@link@opts{#1}%
+\def\@gls@link@label{#2}%
+\ifglsused{#2}{\def\@glo@text{%
+\csname gls@\@glo@type @display\endcsname
+{\glsentryplural{#2}}{\glsentrydescplural{#2}}{%
+\glsentrysymbolplural{#2}}{#3}}}{%
+\def\@glo@text{%
+\csname gls@\@glo@type @displayfirst\endcsname
+{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{%
+\glsentrysymbolplural{#2}}{#3}}}%
+\ifglsused{#2}{%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+}{%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}{%
+ \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}%
+ }{%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}%
+ }%
+}%
+\glsunset{#2}}%
+}
+\newrobustcmd*{\glsdisp}{\@ifstar\@sglsdisp\@glsdisp}
+\newcommand*{\@sglsdisp}[1][]{\@glsdisp[hyper=false,#1]}
+\newcommand*{\@glsdisp}[3][]{%
+ \glsdoifexists{#2}{%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \def\@gls@link@opts{#1}%
+ \def\@gls@link@label{#2}%
+ \ifglsused{#2}%
+ {%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @display\endcsname
+ {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
+ }%
+ {%
+ \def\@glo@text{%
+ \csname gls@\@glo@type @displayfirst\endcsname
+ {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}%
+ }%
+ \ifglsused{#2}%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ {%
+ \gls@checkisacronymlist\@glo@type
+ \ifthenelse{\(\boolean{@glsisacronymlist}\AND
+ \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}%
+ {%
+ \@gls@link[#1,hyper=false]{#2}{\@glo@text}%
+ }%
+ {%
+ \@gls@link[#1]{#2}{\@glo@text}%
+ }%
+ }%
+ \glsunset{#2}%
+ }%
+}
+\newrobustcmd*{\glstext}{\@ifstar\@sglstext\@glstext}
+\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]}
+\newcommand*{\@glstext}[2][]{%
+\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}}
+\def\@glstext@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrytext{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\GLStext}{\@ifstar\@sGLStext\@GLStext}
+\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]}
+\newcommand*{\@GLStext}[2][]{%
+\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}}
+\def\@GLStext@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrytext{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\Glstext}{\@ifstar\@sGlstext\@Glstext}
+\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]}
+\newcommand*{\@Glstext}[2][]{%
+\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}}
+\def\@Glstext@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrytext{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst}
+\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]}
+\newcommand*{\@glsfirst}[2][]{%
+\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}}
+\def\@glsfirst@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirst{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst}
+\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]}
+\newcommand*{\@Glsfirst}[2][]{%
+\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}}
+\def\@Glsfirst@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirst{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst}
+\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]}
+\newcommand*{\@GLSfirst}[2][]{%
+\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}}
+\def\@GLSfirst@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirst{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsplural}{\@ifstar\@sglsplural\@glsplural}
+\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#1]}
+\newcommand*{\@glsplural}[2][]{%
+\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}}
+\def\@glsplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryplural{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural}
+\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]}
+\newcommand*{\@Glsplural}[2][]{%
+\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}}
+\def\@Glsplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryplural{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural}
+\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]}
+\newcommand*{\@GLSplural}[2][]{%
+\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}}
+\def\@GLSplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryplural{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural}
+\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]}
+\newcommand*{\@glsfirstplural}[2][]{%
+\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}}
+\def\@glsfirstplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural}
+\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]}
+\newcommand*{\@Glsfirstplural}[2][]{%
+\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}}
+\def\@Glsfirstplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural}
+\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]}
+\newcommand*{\@GLSfirstplural}[2][]{%
+\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}}
+\def\@GLSfirstplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryfirstplural{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsname}{\@ifstar\@sglsname\@glsname}
+\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]}
+\newcommand*{\@glsname}[2][]{%
+\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}}
+\def\@glsname@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryname{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsname}{\@ifstar\@sGlsname\@Glsname}
+\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]}
+\newcommand*{\@Glsname}[2][]{%
+\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}}
+\def\@Glsname@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryname{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSname}{\@ifstar\@sGLSname\@GLSname}
+\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]}
+\newcommand*{\@GLSname}[2][]{%
+\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}}
+\def\@GLSname@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryname{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc}
+\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]}
+\newcommand*{\@glsdesc}[2][]{%
+\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}}
+\def\@glsdesc@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydesc{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc}
+\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]}
+\newcommand*{\@Glsdesc}[2][]{%
+\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}}
+\def\@Glsdesc@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydesc{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc}
+\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]}
+\newcommand*{\@GLSdesc}[2][]{%
+\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}}
+\def\@GLSdesc@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydesc{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural}
+\newcommand*{\@sglsdescplural}[1][]{\@glsdescplural[hyper=false,#1]}
+\newcommand*{\@glsdescplural}[2][]{%
+\new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}}
+\def\@glsdescplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydescplural{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural}
+\newcommand*{\@sGlsdescplural}[1][]{\@Glsdescplural[hyper=false,#1]}
+\newcommand*{\@Glsdescplural}[2][]{%
+\new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}}
+\def\@Glsdescplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydescplural{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural}
+\newcommand*{\@sGLSdescplural}[1][]{\@GLSdescplural[hyper=false,#1]}
+\newcommand*{\@GLSdescplural}[2][]{%
+\new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}}
+\def\@GLSdescplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrydescplural{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol}
+\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]}
+\newcommand*{\@glssymbol}[2][]{%
+\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}}
+\def\@glssymbol@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbol{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol}
+\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]}
+\newcommand*{\@Glssymbol}[2][]{%
+\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}}
+\def\@Glssymbol@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbol{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol}
+\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]}
+\newcommand*{\@GLSsymbol}[2][]{%
+\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}}
+\def\@GLSsymbol@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbol{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural}
+\newcommand*{\@sglssymbolplural}[1][]{\@glssymbolplural[hyper=false,#1]}
+\newcommand*{\@glssymbolplural}[2][]{%
+\new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}}
+\def\@glssymbolplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural}
+\newcommand*{\@sGlssymbolplural}[1][]{\@Glssymbolplural[hyper=false,#1]}
+\newcommand*{\@Glssymbolplural}[2][]{%
+\new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}}
+\def\@Glssymbolplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural}
+\newcommand*{\@sGLSsymbolplural}[1][]{\@GLSsymbolplural[hyper=false,#1]}
+\newcommand*{\@GLSsymbolplural}[2][]{%
+\new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}}
+\def\@GLSsymbolplural@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentrysymbolplural{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuseri}{\@ifstar\@sglsuseri\@glsuseri}
+\newcommand*{\@sglsuseri}[1][]{\@glsuseri[hyper=false,#1]}
+\newcommand*{\@glsuseri}[2][]{%
+\new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}}
+\def\@glsuseri@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseri{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuseri}{\@ifstar\@sGlsuseri\@Glsuseri}
+\newcommand*{\@sGlsuseri}[1][]{\@Glsuseri[hyper=false,#1]}
+\newcommand*{\@Glsuseri}[2][]{%
+\new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}}
+\def\@Glsuseri@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseri{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuseri}{\@ifstar\@sGLSuseri\@GLSuseri}
+\newcommand*{\@sGLSuseri}[1][]{\@GLSuseri[hyper=false,#1]}
+\newcommand*{\@GLSuseri}[2][]{%
+\new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}}
+\def\@GLSuseri@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseri{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuserii}{\@ifstar\@sglsuserii\@glsuserii}
+\newcommand*{\@sglsuserii}[1][]{\@glsuserii[hyper=false,#1]}
+\newcommand*{\@glsuserii}[2][]{%
+\new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}}
+\def\@glsuserii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserii{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuserii}{\@ifstar\@sGlsuserii\@Glsuserii}
+\newcommand*{\@sGlsuserii}[1][]{\@Glsuserii[hyper=false,#1]}
+\newcommand*{\@Glsuserii}[2][]{%
+\new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}}
+\def\@Glsuserii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserii{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuserii}{\@ifstar\@sGLSuserii\@GLSuserii}
+\newcommand*{\@sGLSuserii}[1][]{\@GLSuserii[hyper=false,#1]}
+\newcommand*{\@GLSuserii}[2][]{%
+\new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}}
+\def\@GLSuserii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserii{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuseriii}{\@ifstar\@sglsuseriii\@glsuseriii}
+\newcommand*{\@sglsuseriii}[1][]{\@glsuseriii[hyper=false,#1]}
+\newcommand*{\@glsuseriii}[2][]{%
+\new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}}
+\def\@glsuseriii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriii{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuseriii}{\@ifstar\@sGlsuseriii\@Glsuseriii}
+\newcommand*{\@sGlsuseriii}[1][]{\@Glsuseriii[hyper=false,#1]}
+\newcommand*{\@Glsuseriii}[2][]{%
+\new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}}
+\def\@Glsuseriii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriii{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuseriii}{\@ifstar\@sGLSuseriii\@GLSuseriii}
+\newcommand*{\@sGLSuseriii}[1][]{\@GLSuseriii[hyper=false,#1]}
+\newcommand*{\@GLSuseriii}[2][]{%
+\new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}}
+\def\@GLSuseriii@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriii{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuseriv}{\@ifstar\@sglsuseriv\@glsuseriv}
+\newcommand*{\@sglsuseriv}[1][]{\@glsuseriv[hyper=false,#1]}
+\newcommand*{\@glsuseriv}[2][]{%
+\new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}}
+\def\@glsuseriv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriv{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuseriv}{\@ifstar\@sGlsuseriv\@Glsuseriv}
+\newcommand*{\@sGlsuseriv}[1][]{\@Glsuseriv[hyper=false,#1]}
+\newcommand*{\@Glsuseriv}[2][]{%
+\new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}}
+\def\@Glsuseriv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriv{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuseriv}{\@ifstar\@sGLSuseriv\@GLSuseriv}
+\newcommand*{\@sGLSuseriv}[1][]{\@GLSuseriv[hyper=false,#1]}
+\newcommand*{\@GLSuseriv}[2][]{%
+\new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}}
+\def\@GLSuseriv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuseriv{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuserv}{\@ifstar\@sglsuserv\@glsuserv}
+\newcommand*{\@sglsuserv}[1][]{\@glsuserv[hyper=false,#1]}
+\newcommand*{\@glsuserv}[2][]{%
+\new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}}
+\def\@glsuserv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserv{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuserv}{\@ifstar\@sGlsuserv\@Glsuserv}
+\newcommand*{\@sGlsuserv}[1][]{\@Glsuserv[hyper=false,#1]}
+\newcommand*{\@Glsuserv}[2][]{%
+\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}}
+\def\@Glsuserv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserv{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuserv}{\@ifstar\@sGLSuserv\@GLSuserv}
+\newcommand*{\@sGLSuserv}[1][]{\@GLSuserv[hyper=false,#1]}
+\newcommand*{\@GLSuserv}[2][]{%
+\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}}
+\def\@GLSuserv@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuserv{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\glsuservi}{\@ifstar\@sglsuservi\@glsuservi}
+\newcommand*{\@sglsuservi}[1][]{\@glsuservi[hyper=false,#1]}
+\newcommand*{\@glsuservi}[2][]{%
+\new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}}
+\def\@glsuservi@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuservi{#2}}%
+\@gls@link[#1]{#2}{\@glo@text#3}%
+}%
+}
+\newrobustcmd*{\Glsuservi}{\@ifstar\@sGlsuservi\@Glsuservi}
+\newcommand*{\@sGlsuservi}[1][]{\@Glsuservi[hyper=false,#1]}
+\newcommand*{\@Glsuservi}[2][]{%
+\new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}}
+\def\@Glsuservi@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuservi{#2}}%
+\@gls@link[#1]{#2}{%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3}%
+}%
+}
+\newrobustcmd*{\GLSuservi}{\@ifstar\@sGLSuservi\@GLSuservi}
+\newcommand*{\@sGLSuservi}[1][]{\@GLSuservi[hyper=false,#1]}
+\newcommand*{\@GLSuservi}[2][]{%
+\new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}}
+\def\@GLSuservi@#1#2[#3]{%
+\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}%
+\protected@edef\@glo@text{\glsentryuservi{#2}}%
+\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+}%
+}
+\newrobustcmd*{\acrshort}{\@ifstar\s@acrshort\ns@acrshort}
+\newcommand*{\s@acrshort}[2][]{%
+ \new@ifnextchar[{\@acrshort{hyper=false,#1}{#2}}%
+ {\@acrshort{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@acrshort}[2][]{%
+ \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}%
+}
+\def\@acrshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshort{#2}}%
+ \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}%
+ }%
+}
+\newrobustcmd*{\Acrshort}{\@ifstar\s@Acrshort\ns@Acrshort}
+\newcommand*{\s@Acrshort}[2][]{%
+ \new@ifnextchar[{\@Acrshort{hyper=false,#1}{#2}}%
+ {\@Acrshort{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@Acrshort}[2][]{%
+ \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}%
+}
+\def\@Acrshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshort{#2}}%
+ \@gls@link[#1]{#2}%
+ {%
+ \acronymfont{\expandafter\makefirstuc\expandafter{\@glo@text}}#3%
+ }%
+ }%
+}
+\newrobustcmd*{\ACRshort}{\@ifstar\s@ACRshort\ns@ACRshort}
+\newcommand*{\s@ACRshort}[2][]{%
+ \new@ifnextchar[{\@ACRshort{hyper=false,#1}{#2}}%
+ {\@ACRshort{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@ACRshort}[2][]{%
+ \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}%
+}
+\def\@ACRshort#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshort{#2}}%
+ \@gls@link[#1]{#2}{\acronymfont{\MakeUppercase{\@glo@text#3}}}%
+ }%
+}
+\newrobustcmd*{\acrshortpl}{\@ifstar\s@acrshortpl\ns@acrshortpl}
+\newcommand*{\s@acrshortpl}[2][]{%
+ \new@ifnextchar[{\@acrshortpl{hyper=false,#1}{#2}}%
+ {\@acrshortpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@acrshortpl}[2][]{%
+ \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}%
+}
+\def\@acrshortpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshortpl{#2}}%
+ \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}%
+ }%
+}
+\newrobustcmd*{\Acrshortpl}{\@ifstar\s@Acrshortpl\ns@Acrshortpl}
+\newcommand*{\s@Acrshortpl}[2][]{%
+ \new@ifnextchar[{\@Acrshortpl{hyper=false,#1}{#2}}%
+ {\@Acrshortpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@Acrshortpl}[2][]{%
+ \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}%
+}
+\def\@Acrshortpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshortpl{#2}}%
+ \@gls@link[#1]{#2}%
+ {%
+ \acronymfont{\expandafter\makefirstuc\expandafter{\@glo@text}}#3%
+ }%
+ }%
+}
+\newrobustcmd*{\ACRshortpl}{\@ifstar\s@ACRshortpl\ns@ACRshortpl}
+\newcommand*{\s@ACRshortpl}[2][]{%
+ \new@ifnextchar[{\@ACRshortpl{hyper=false,#1}{#2}}%
+ {\@ACRshortpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@ACRshortpl}[2][]{%
+ \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}%
+}
+\def\@ACRshortpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentryshortpl{#2}}%
+ \@gls@link[#1]{#2}{\acronymfont{\MakeUppercase{\@glo@text#3}}}%
+ }%
+}
+\newrobustcmd*{\acrlong}{\@ifstar\s@acrlong\ns@acrlong}
+\newcommand*{\s@acrlong}[2][]{%
+ \new@ifnextchar[{\@acrlong{hyper=false,#1}{#2}}%
+ {\@acrlong{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@acrlong}[2][]{%
+ \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}%
+}
+\def\@acrlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylong{#2}}%
+ \@gls@link[#1]{#2}{\@glo@text#3}%
+ }%
+}
+\newrobustcmd*{\Acrlong}{\@ifstar\s@Acrlong\ns@Acrlong}
+\newcommand*{\s@Acrlong}[2][]{%
+ \new@ifnextchar[{\@Acrlong{hyper=false,#1}{#2}}%
+ {\@Acrlong{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@Acrlong}[2][]{%
+ \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}%
+}
+\def\@Acrlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylong{#2}}%
+ \@gls@link[#1]{#2}%
+ {%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3%
+ }%
+ }%
+}
+\newrobustcmd*{\ACRlong}{\@ifstar\s@ACRlong\ns@ACRlong}
+\newcommand*{\s@ACRlong}[2][]{%
+ \new@ifnextchar[{\@ACRlong{hyper=false,#1}{#2}}%
+ {\@ACRlong{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@ACRlong}[2][]{%
+ \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}%
+}
+\def\@ACRlong#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylong{#2}}%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+ }%
+}
+\newrobustcmd*{\acrlongpl}{\@ifstar\s@acrlongpl\ns@acrlongpl}
+\newcommand*{\s@acrlongpl}[2][]{%
+ \new@ifnextchar[{\@acrlongpl{hyper=false,#1}{#2}}%
+ {\@acrlongpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@acrlongpl}[2][]{%
+ \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}%
+}
+\def\@acrlongpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylongpl{#2}}%
+ \@gls@link[#1]{#2}{\@glo@text#3}%
+ }%
+}
+\newrobustcmd*{\Acrlongpl}{\@ifstar\s@Acrlongpl\ns@Acrlongpl}
+\newcommand*{\s@Acrlongpl}[2][]{%
+ \new@ifnextchar[{\@Acrlongpl{hyper=false#1}{#2}}%
+ {\@Acrlongpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@Acrlongpl}[2][]{%
+ \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}%
+}
+\def\@Acrlongpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylongpl{#2}}%
+ \@gls@link[#1]{#2}%
+ {%
+ \expandafter\makefirstuc\expandafter{\@glo@text}#3%
+ }%
+ }%
+}
+\newrobustcmd*{\ACRlongpl}{\@ifstar\s@ACRlongpl\ns@ACRlongpl}
+\newcommand*{\s@ACRlongpl}[2][]{%
+ \new@ifnextchar[{\@ACRlongpl{hyper=false,#1}{#2}}%
+ {\@ACRlongpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*{\ns@ACRlongpl}[2][]{%
+ \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}%
+}
+\def\@ACRlongpl#1#2[#3]{%
+ \glsdoifexists{#2}%
+ {%
+ \edef\@glo@type{\glsentrytype{#2}}%
+ \protected@edef\@glo@text{\glsentrylongpl{#2}}%
+ \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}%
+ }%
+}
+\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname}
+\newcommand*{\Glsentryname}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@name\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname}
+\newcommand*{\Glsentrydesc}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@desc\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrydescplural}[1]{%
+\csname glo@#1@descplural\endcsname}
+\newcommand*{\Glsentrydescplural}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname}
+\newcommand*{\Glsentrytext}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@text\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname}
+\newcommand*{\Glsentryplural}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname}
+\newcommand*{\Glsentrysymbol}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrysymbolplural}[1]{%
+\csname glo@#1@symbolplural\endcsname}
+\newcommand*{\Glsentrysymbolplural}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname}
+\newcommand*{\Glsentryfirst}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@first\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryfirstplural}[1]{%
+\csname glo@#1@firstpl\endcsname}
+\newcommand*{\Glsentryfirstplural}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname}
+\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname}
+\newcommand*{\glsentryuseri}[1]{\csname glo@#1@useri\endcsname}
+\newcommand*{\Glsentryuseri}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@useri\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryuserii}[1]{\csname glo@#1@userii\endcsname}
+\newcommand*{\Glsentryuserii}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@userii\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryuseriii}[1]{\csname glo@#1@useriii\endcsname}
+\newcommand*{\Glsentryuseriii}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@useriii\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryuseriv}[1]{\csname glo@#1@useriv\endcsname}
+\newcommand*{\Glsentryuseriv}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@useriv\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryuserv}[1]{\csname glo@#1@userv\endcsname}
+\newcommand*{\Glsentryuserv}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@userv\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryuservi}[1]{\csname glo@#1@uservi\endcsname}
+\newcommand*{\Glsentryuservi}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@uservi\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryshort}[1]{\csname glo@#1@short\endcsname}
+\newcommand*{\Glsentryshort}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@short\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryshortpl}[1]{\csname glo@#1@shortpl\endcsname}
+\newcommand*{\Glsentryshortpl}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@shortpl\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrylong}[1]{\csname glo@#1@long\endcsname}
+\newcommand*{\Glsentrylong}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@long\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentrylongpl}[1]{\csname glo@#1@longpl\endcsname}
+\newcommand*{\Glsentrylongpl}[1]{%
+\protected@edef\@glo@text{\csname glo@#1@longpl\endcsname}%
+\expandafter\makefirstuc\expandafter{\@glo@text}}
+\newcommand*{\glsentryfull}[1]{%
+ \glsentrylong{#1}\space(\glsentryshort{#1})%
+}
+\newcommand*{\Glsentryfull}[1]{%
+ \Glsentrylong{#1}\space(\glsentryshortpl{#1})%
+}
+\newcommand*{\glsentryfullpl}[1]{%
+ \glsentrylongpl{#1}\space(\glsentryshort{#1})%
+}
+\newcommand*{\Glsentryfullpl}[1]{%
+ \Glsentrylongpl{#1}\space(\glsentryshortpl{#1})%
+}
+\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{%
+\def\@glo@label{#2}%
+\@glslink{glo:#2}{#1}}
+\define@key{glossadd}{counter}{\def\@gls@counter{#1}}
+\define@key{glossadd}{format}{\def\@glsnumberformat{#1}}
+\define@key{glossadd}{types}{\def\@glo@type{#1}}
+\newrobustcmd*{\glsadd}[2][]{%
+ \glsdoifexists{#2}%
+ {%
+ \def\@glsnumberformat{glsnumberformat}%
+ \edef\@gls@counter{\csname glo@#2@counter\endcsname}%
+ \setkeys{glossadd}{#1}%
+ \@gls@saveentrycounter
+ \@do@wrglossary{#2}%
+ }%
+}
+\newrobustcmd*{\glsaddall}[1][]{%
+\edef\@glo@type{\@glo@types}%
+\setkeys{glossadd}{#1}%
+\forallglsentries[\@glo@type]{\@glo@entry}{%
+\glsadd[#1]{\@glo@entry}}%
+}
+\edef\glsopenbrace{\expandafter\@gobble\string\{}
+\edef\glsclosebrace{\expandafter\@gobble\string\}}
+\edef\glsquote#1{\string"#1\string"}
+\ifglsxindy
+ \newcommand*{\@glsfirstletter}{A}
+\fi
+\ifglsxindy
+ \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{%
+ \renewcommand*{\@glsfirstletter}{#1}}
+\else
+ \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{%
+ \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits}
+\fi
+\newcommand*{\@glsminrange}{2}
+\ifglsxindy
+ \newcommand*{\GlsSetXdyMinRangeLength}[1]{%
+ \renewcommand*{\@glsminrange}{#1}}
+\else
+ \newcommand*{\GlsSetXdyMinRangeLength}[1]{%
+ \glsnoxindywarning\GlsSetXdyMinRangeLength}
+\fi
+
+\ifglsxindy
+ \def\writeist{%
+ \@gls@addpredefinedattributes
+ \openout\glswrite=\istfilename
+ \write\glswrite{;; xindy style file created by the glossaries
+ package}%
+ \write\glswrite{;; for document '\jobname' on
+ \the\year-\the\month-\the\day}%
+ \write\glswrite{^^J; required styles^^J}
+ \@for\@xdystyle:=\@xdyrequiredstyles\do{%
+ \ifx\@xdystyle\@empty
+ \else
+ \protected@write\glswrite{}{(require
+ \string"\@xdystyle.xdy\string")}%
+ \fi
+ }%
+ \write\glswrite{^^J%
+ ; list of allowed attributes (number formats)^^J}%
+ \write\glswrite{(define-attributes ((\@xdyattributes)))}%
+ \write\glswrite{^^J; user defined alphabets^^J}%
+ \write\glswrite{\@xdyuseralphabets}%
+ \write\glswrite{^^J; location class definitions^^J}%
+ \@for\@gls@classI:=\@gls@xdy@locationlist\do{%
+ \protected@write\glswrite{}{(define-location-class
+ \string"\@gls@classI\string"^^J\space\space\space
+ (
+ :sep "{}{"
+ \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space
+ :sep "}"
+ )
+ ^^J\space\space\space
+ :min-range-length \@glsminrange^^J%
+ )
+ }%
+ {%
+ \@for\@gls@classII:=\@gls@xdy@locationlist\do{%
+ \protected@write\glswrite{}{(define-location-class
+ \string"\@gls@classII-\@gls@classI\string"
+ ^^J\space\space\space
+ (
+ :sep "{"
+ \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space
+ :sep "}{"
+ \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space
+ :sep "}"
+ )
+ ^^J\space\space\space
+ :min-range-length \@glsminrange^^J%
+ )
+ }%
+ }%
+ }%
+ }%
+ \write\glswrite{^^J; user defined location classes}%
+ \write\glswrite{\@xdyuserlocationdefs}%
+ \write\glswrite{^^J; define cross-reference class^^J}%
+ \write\glswrite{(define-crossref-class \string"see\string"
+ :unverified )}%
+ \write\glswrite{(markup-crossref-list
+ :class \string"see\string"^^J\space\space\space
+ :open \string"\string\glsseeformat\string"
+ :close \string"{}\string")}%
+ \write\glswrite{^^J; define the order of the location classes}%
+ \write\glswrite{(define-location-class-order
+ (\@xdylocationclassorder))}%
+ \write\glswrite{^^J; define the glossary markup^^J}%
+ \write\glswrite{(markup-index^^J\space\space\space
+ :open \string"\string
+ \glossarysection[\string\glossarytoctitle]{\string
+ \glossarytitle}\string\glossarypreamble}%
+ \@for\@this@ctr:=\@xdycounters\do{%
+ {%
+ \@for\@this@attr:=\@xdyattributelist\do{%
+ \protected@write\glswrite{}{\string\providecommand*%
+ \expandafter\string
+ \csname glsX\@this@ctr X\@this@attr\endcsname[2]%
+ {%
+ \string\setentrycounter
+ [\expandafter\@gobble\string\#1]{\@this@ctr}%
+ \expandafter\string
+ \csname\@this@attr\endcsname
+ {\expandafter\@gobble\string\#2}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \write\glswrite{%
+ \string\begin
+ {theglossary}\string\glossaryheader\string~n\string" ^^J\space
+ \space\space:close \string"\expandafter\@gobble
+ \string\%\string~n\string
+ \end{theglossary}\string\glossarypostamble
+ \string~n\string" ^^J\space\space\space
+ :tree)}%
+ \write\glswrite{(markup-letter-group-list
+ :sep \string"\string\glsgroupskip\string~n\string")}%
+ \write\glswrite{(markup-indexentry
+ :open \string"\string\relax \string\glsresetentrylist
+ \string~n\string")}%
+ \write\glswrite{(markup-locclass-list :open
+ \string"\glsopenbrace\string\glossaryentrynumbers
+ \glsopenbrace\string\relax\space \string"^^J\space\space\space
+ :sep \string", \string"
+ :close \string"\glsclosebrace\glsclosebrace\string")}%
+ \write\glswrite{(markup-locref-list
+ :sep \string"\string\delimN\space\string")}%
+ \write\glswrite{(markup-range
+ :sep \string"\string\delimR\space\string")}%
+ \@onelevel@sanitize\gls@suffixF
+ \@onelevel@sanitize\gls@suffixFF
+ \ifx\gls@suffixF\@empty
+ \else
+ \write\glswrite{(markup-range
+ :close "\gls@suffixF" :length 1 :ignore-end)}%
+ \fi
+ \ifx\gls@suffixFF\@empty
+ \else
+ \write\glswrite{(markup-range
+ :close "\gls@suffixFF" :length 2 :ignore-end)}%
+ \fi
+ \write\glswrite{^^J; define format to use for locations^^J}%
+ \write\glswrite{\@xdylocref}%
+ \write\glswrite{^^J; define letter group list format^^J}%
+ \write\glswrite{(markup-letter-group-list
+ :sep \string"\string\glsgroupskip\string~n\string")}%
+ \write\glswrite{^^J; letter group headings^^J}%
+ \write\glswrite{(markup-letter-group
+ :open-head \string"\string\glsgroupheading
+ \glsopenbrace\string"^^J\space\space\space
+ :close-head \string"\glsclosebrace\string")}%
+ \write\glswrite{^^J; additional letter groups^^J}%
+ \write\glswrite{\@xdylettergroups}%
+ \write\glswrite{^^J; additional sort rules^^J}
+ \write\glswrite{\@xdysortrules}%
+ \closeout\glswrite
+ \let\writeist\relax
+ }
+\else
+ \edef\@gls@actualchar{\string?}
+ \edef\@gls@encapchar{\string|}
+ \edef\@gls@levelchar{\string!}
+ \edef\@gls@quotechar{\string"}
+ \def\writeist{\relax
+ \openout\glswrite=\istfilename
+ \write\glswrite{\expandafter\@gobble\string\% makeindex style file
+ created by the glossaries package}
+ \write\glswrite{\expandafter\@gobble\string\% for document
+ '\jobname' on \the\year-\the\month-\the\day}
+ \write\glswrite{actual '\@gls@actualchar'}
+ \write\glswrite{encap '\@gls@encapchar'}
+ \write\glswrite{level '\@gls@levelchar'}
+ \write\glswrite{quote '\@gls@quotechar'}
+ \write\glswrite{keyword \string"\string\\glossaryentry\string"}
+ \write\glswrite{preamble \string"\string\\glossarysection[\string
+ \\glossarytoctitle]{\string\\glossarytitle}\string
+ \\glossarypreamble\string\n\string\\begin{theglossary}\string
+ \\glossaryheader\string\n\string"}
+ \write\glswrite{postamble \string"\string\%\string\n\string
+ \\end{theglossary}\string\\glossarypostamble\string\n
+ \string"}
+ \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n
+ \string"}
+ \write\glswrite{item_0 \string"\string\%\string\n\string"}
+ \write\glswrite{item_1 \string"\string\%\string\n\string"}
+ \write\glswrite{item_2 \string"\string\%\string\n\string"}
+ \write\glswrite{item_01 \string"\string\%\string\n\string"}
+ \write\glswrite{item_x1
+ \string"\string\\relax \string\\glsresetentrylist\string\n
+ \string"}
+ \write\glswrite{item_12 \string"\string\%\string\n\string"}
+ \write\glswrite{item_x2
+ \string"\string\\relax \string\\glsresetentrylist\string\n
+ \string"}
+ \write\glswrite{delim_0 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_1 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_2 \string"\string\{\string
+ \\glossaryentrynumbers\string\{\string\\relax \string"}
+ \write\glswrite{delim_t \string"\string\}\string\}\string"}
+ \write\glswrite{delim_n \string"\string\\delimN \string"}
+ \write\glswrite{delim_r \string"\string\\delimR \string"}
+ \write\glswrite{headings_flag 1}
+ \write\glswrite{heading_prefix
+ \string"\string\\glsgroupheading\string\{\string"}
+ \write\glswrite{heading_suffix
+ \string"\string\}\string\\relax
+ \string\\glsresetentrylist \string"}
+ \write\glswrite{symhead_positive \string"glssymbols\string"}
+ \write\glswrite{numhead_positive \string"glsnumbers\string"}
+ \write\glswrite{page_compositor \string"\glscompositor\string"}
+ \@gls@escbsdq\gls@suffixF
+ \@gls@escbsdq\gls@suffixFF
+ \ifx\gls@suffixF\@empty
+ \else
+ \write\glswrite{suffix_2p \string"\gls@suffixF\string"}
+ \fi
+ \ifx\gls@suffixFF\@empty
+ \else
+ \write\glswrite{suffix_3p \string"\gls@suffixFF\string"}
+ \fi
+ \closeout\glswrite
+ \let\writeist\relax
+ }
+\fi
+\newcommand{\noist}{%
+ \@gls@addpredefinedattributes
+ \let\writeist\relax
+}
+\newcommand*{\@makeglossary}[1]{%
+ \ifglossaryexists{#1}%
+ {%
+ \ifglssavewrites
+ \expandafter\newtoks\csname glo@#1@filetok\endcsname
+ \else
+ \expandafter\newwrite\csname glo@#1@file\endcsname
+ \expandafter\@glsopenfile\csname glo@#1@file\endcsname{#1}%
+ \fi
+ \@gls@renewglossary
+ \writeist
+ }%
+ {%
+ \PackageError{glossaries}%
+ {Glossary type `#1' not defined}%
+ {New glossaries must be defined before using \string\makeglossary}%
+ }%
+}
+\newcommand*{\@glsopenfile}[2]{%
+ \immediate\openout#1=\jobname.\csname @glotype@#2@out\endcsname
+ \PackageInfo{glossaries}{Writing glossary file
+ \jobname.\csname @glotype@#2@out\endcsname}%
+}
+\newcommand*{\warn@nomakeglossaries}{%
+ \GlossariesWarningNoLine{\string\makeglossaries\space
+ hasn't been used,^^Jthe glossaries will not be updated}%
+}
+\newcommand*{\makeglossaries}{%
+ \protected@write\@auxout{}{\string\@istfilename{\istfilename}}%
+ \protected@write\@auxout{}{\string\@glsorder{\glsorder}}
+ \@for\@glo@type:=\@glo@types\do{%
+ \ifthenelse{\equal{\@glo@type}{}}{}{%
+ \@makeglossary{\@glo@type}}%
+ }%
+ \renewcommand*\newglossary[4][]{%
+ \PackageError{glossaries}{New glossaries
+ must be created before \string\makeglossaries}{You need
+ to move \string\makeglossaries\space after all your
+ \string\newglossary\space commands}}%
+ \let\@makeglossary\relax
+ \let\makeglossary\relax
+ \let\makeglossaries\relax
+ \@disable@onlypremakeg
+ \let\warn@nomakeglossaries\relax
+}
+\let\makeglossary\makeglossaries
+\AtEndDocument{%
+ \warn@nomakeglossaries
+ \warn@noprintglossary
+}
+\newwrite\glswrite
+\def\istfile{\glswrite}
+\AtEndDocument{%
+ \glswritefiles
+}
+\ifglssavewrites
+ \newcommand*{\glswritefiles}{%
+ \forallglossaries{\@glo@type}{%
+ \edef\gls@tmp{\expandafter\the\csname glo@\@glo@type
+@filetok\endcsname}%
+ \ifx\gls@tmp\@empty
+ \ifx\@glo@type\glsdefaulttype
+ \GlossariesWarningNoLine{Glossary `\@glo@type' has no
+ entries.^^JRemember to use package option `nomain' if
+you
+ don't want to^^Juse the main glossary}%
+ \else
+ \GlossariesWarningNoLine{Glossary `\@glo@type' has no
+ entries}%
+ \fi
+ \else
+ \@glsopenfile{\glswrite}{\@glo@type}%
+ \immediate\write\glswrite{%
+ \expandafter\the\csname glo@\@glo@type
+@filetok\endcsname}%
+ \immediate\closeout\glswrite
+ \fi
+ }%
+ }
+\else
+ \let\glswritefiles\relax
+\fi
+\renewcommand*{\glossary}[1][\glsdefaulttype]{%
+\@glossary[#1]}
+\def\@glossary[#1]{\index}
+\newcommand{\@gls@renewglossary}{%
+ \gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}%
+ \let\@gls@renewglossary\@empty
+}
+\renewcommand*{\@wrglossary}[2]{%
+ \ifglssavewrites
+ \protected@edef\@gls@tmp{\the\csname glo@#1@filetok\endcsname#2}%
+ \expandafter\global\expandafter\csname glo@#1@filetok\endcsname
+ \expandafter{\@gls@tmp^^J}%
+ \else
+ \expandafter\protected@write\csname glo@#1@file\endcsname{}{#2}%
+ \fi
+ \endgroup\@esphack
+}
+\newcommand{\@do@wrglossary}[1]{%
+ \protected@edef\@glslocref{\theglsentrycounter}%
+ \@gls@checkmkidxchars\@glslocref
+ \expandafter\ifx\theHglsentrycounter\theglsentrycounter
+ \def\@glo@counterprefix{}%
+ \else
+ \protected@edef\@glsHlocref{\theHglsentrycounter}%
+ \@gls@checkmkidxchars\@glsHlocref
+ \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix
+ {\@glslocref}{\@glsHlocref}%
+ }%
+ \@do@gls@getcounterprefix
+ \fi
+\ifglsxindy
+ \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil
+ \def\@glo@range{}%
+ \expandafter\if\@glo@prefix(\relax
+ \def\@glo@range{:open-range}%
+ \else
+ \expandafter\if\@glo@prefix)\relax
+ \def\@glo@range{:close-range}%
+ \fi
+ \fi
+ \glossary[\csname glo@#1@type\endcsname]{%
+ (indexentry :tkey (\csname glo@#1@index\endcsname)
+ :locref \string"{\@glo@counterprefix}{\@glslocref}\string" %
+ :attr \string"\@gls@counter\@glo@suffix\string"
+ \@glo@range
+ )
+ }%
+\else
+ \@set@glo@numformat{\@glo@numfmt}{\@gls@counter}{\@glsnumberformat}%
+ {\@glo@counterprefix}%
+ \glossary[\csname glo@#1@type\endcsname]{%
+ \string\glossaryentry{\csname glo@#1@index\endcsname
+ \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}%
+\fi
+}
+\newcommand*\@gls@getcounterprefix[2]{%
+ \edef\@gls@thisloc{#1}\edef\@gls@thisHloc{#2}%
+ \ifx\@gls@thisloc\@gls@thisHloc
+ \def\@glo@counterprefix{}%
+ \else
+ \def\@gls@get@counterprefix##1.#1##2\end@getprefix{%
+ \def\@glo@tmp{##2}%
+ \ifx\@glo@tmp\@empty
+ \def\@glo@counterprefix{}%
+ \else
+ \def\@glo@counterprefix{##1}%
+ \fi
+ }%
+ \@gls@get@counterprefix#2.#1\end@getprefix
+ \fi
+}
+\newcommand{\@do@seeglossary}[2]{%
+\def\@gls@xref{#2}%
+\@onelevel@sanitize\@gls@xref
+\@gls@checkmkidxchars\@gls@xref
+\ifglsxindy
+ \glossary[\csname glo@#1@type\endcsname]{%
+ (indexentry
+ :tkey (\csname glo@#1@index\endcsname)
+ :xref (\string"\@gls@xref\string")
+ :attr \string"see\string"
+ )
+ }%
+\else
+ \glossary[\csname glo@#1@type\endcsname]{%
+ \string\glossaryentry{\csname glo@#1@index\endcsname
+ \@gls@encapchar glsseeformat\@gls@xref}{Z}}%
+\fi
+}
+\def\@gls@fixbraces#1#2#3\@nil{%
+ \ifx#2[\relax
+ \def#1{#2#3}%
+ \else
+ \def#1{{#2#3}}%
+ \fi
+}
+\newcommand*{\glssee}[3][\seename]{%
+ \@do@seeglossary{#2}{[#1]{#3}}}
+\newcommand*{\@glssee}[3][\seename]{%
+ \glssee[#1]{#3}{#2}}
+\newcommand*{\glsseeformat}[3][\seename]{\emph{#1} \glsseelist{#2}}
+\newcommand*{\glsseelist}[1]{%
+ \let\@gls@dolast\relax
+ \let\@gls@donext\relax
+ \@for\@gls@thislabel:=#1\do{%
+ \ifx\@xfor@nextelement\@nnil
+ \@gls@dolast
+ \else
+ \@gls@donext
+ \fi
+ \glsseeitem{\@gls@thislabel}%
+ \let\@gls@dolast\glsseelastsep
+ \let\@gls@donext\glsseesep
+ }%
+}
+\newcommand*{\glsseelastsep}{\space\andname\space}
+\newcommand*{\glsseesep}{, }
+\newcommand*{\glsseeitem}[1]{\glshyperlink[\glsseeitemformat{#1}]{#1}}
+\newcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}}
+\def\warn@noprintglossary{\GlossariesWarningNoLine{No
+ \string\printglossary\space or \string\printglossaries\space
+ found.^^JThis document will not have a glossary}}
+\ifcsundef{printglossary}{}%
+{%
+ \GlossariesWarning{Overriding \string\printglossary}%
+ \undef\printglossary
+}
+\newcommand*{\printglossary}[1][type=\glsdefaulttype]{%
+ \ifglsxindy\findrootlanguage\fi
+ \def\@glo@type{\glsdefaulttype}%
+ \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}%
+ \let\org@glossarytitle\glossarytitle
+ \def\@glossarystyle{}%
+ \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}%
+ \let\@org@glossaryentrynumbers\glossaryentrynumbers
+ \bgroup
+ \setkeys{printgloss}{#1}%
+ \ifx\glossarytitle\org@glossarytitle
+ \else
+ \expandafter\let\csname @glotype@\@glo@type @title\endcsname
+ \glossarytitle
+ \fi
+ \let\currentglossary\@glo@type
+ \let\org@glossaryentrynumbers\glossaryentrynumbers
+ \let\glsnonextpages\@glsnonextpages
+ \let\glsnextpages\@glsnextpages
+ \let\nopostdesc\@nopostdesc
+ \gls@dotoctitle
+ \@glossarystyle
+ \makeatletter
+ \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}%
+\IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}{}%
+{\null}%
+ \ifglsxindy
+ \ifcsundef{@xdy@\@glo@type @language}%
+ {%
+ \protected@write\@auxout{}{%
+ \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}%
+ }%
+ {%
+ \protected@write\@auxout{}{%
+ \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type
+ @language\endcsname}}%
+ }%
+ \protected@write\@auxout{}{%
+ \string\@gls@codepage{\@glo@type}{\gls@codepage}}%
+ \fi
+ \egroup
+ \global\let\glossaryentrynumbers\@org@glossaryentrynumbers
+ \global\let\warn@noprintglossary\relax
+}
+\newcommand*{\printglossaries}{%
+\forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}}
+\define@key{printgloss}{type}{\def\@glo@type{#1}}
+\define@key{printgloss}{title}{\def\glossarytitle{#1}}
+\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}%
+\let\gls@dotoctitle\relax
+}
+\define@key{printgloss}{style}{%
+ \ifcsundef{@glsstyle@#1}%
+ {%
+ \PackageError{glossaries}%
+ {Glossary style `#1' undefined}{}%
+ }%
+ {%
+ \def\@glossarystyle{\csname @glsstyle@#1\endcsname}%
+ }%
+}
+\define@choicekey{printgloss}{numberedsection}[\val\nr]{%
+false,nolabel,autolabel}[nolabel]{%
+\ifcase\nr\relax
+ \renewcommand*{\@@glossarysecstar}{*}%
+ \renewcommand*{\@@glossaryseclabel}{}%
+\or
+ \renewcommand*{\@@glossarysecstar}{}%
+ \renewcommand*{\@@glossaryseclabel}{}%
+\or
+ \renewcommand*{\@@glossarysecstar}{}%
+ \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}%
+\fi}
+\define@boolkey{printgloss}[gls]{nonumberlist}[true]{%
+\ifglsnonumberlist
+ \def\glossaryentrynumbers##1{}%
+\else
+ \def\glossaryentrynumbers##1{##1}%
+\fi}
+\newcommand*{\@glsnonextpages}{%
+ \gdef\glossaryentrynumbers##1{%
+ \glsresetentrylist}}
+\newcommand*{\@glsnextpages}{%
+ \gdef\glossaryentrynumbers##1{%
+ ##1\glsresetentrylist}}
+\newcommand*{\glsresetentrylist}{%
+ \global\let\glossaryentrynumbers\org@glossaryentrynumbers}
+\newcommand*{\glsnonextpages}{}
+\newcommand*{\glsnextpages}{}
+\ifglsentrycounter
+ \ifx\@gls@counterwithin\@empty
+ \newcounter{glossaryentry}
+ \else
+ \newcounter{glossaryentry}[\@gls@counterwithin]
+ \fi
+ \def\theHglossaryentry{\currentglossary.\theglossaryentry}
+\fi
+\ifglssubentrycounter
+ \ifglsentrycounter
+ \newcounter{glossarysubentry}[glossaryentry]
+ \else
+ \newcounter{glossarysubentry}
+ \fi
+ \def\theHglossarysubentry{\currentglssubentry.\theglossarysubentry}
+\fi
+\ifglssubentrycounter
+ \newcommand*{\glsresetsubentrycounter}{%
+ \setcounter{glossarysubentry}{0}%
+ }
+\else
+ \newcommand*{\glsresetsubentrycounter}{}
+\fi
+\ifglsentrycounter
+ \newcommand*{\glsstepentry}[1]{%
+ \refstepcounter{glossaryentry}%
+ \label{glsentry-#1}%
+ }
+\else
+ \newcommand*{\glsstepentry}[1]{}
+\fi
+\ifglssubentrycounter
+ \newcommand*{\glsstepsubentry}[1]{%
+ \def\currentglssubentry{#1}%
+ \refstepcounter{glossarysubentry}%
+ \label{glsentry-#1}%
+ }
+\else
+ \newcommand*{\glsstepsubentry}[1]{}
+\fi
+\ifglsentrycounter
+ \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}}
+\else
+ \ifglssubentrycounter
+ \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}}
+ \else
+ \newcommand*{\glsrefentry}[1]{\gls{#1}}
+ \fi
+\fi
+\ifglsentrycounter
+ \newcommand*{\glsentrycounterlabel}{\theglossaryentry.\space}
+\else
+ \newcommand*{\glsentrycounterlabel}{}
+\fi
+\ifglssubentrycounter
+ \newcommand*{\glssubentrycounterlabel}{\theglossarysubentry)\space}
+\else
+ \newcommand*{\glssubentrycounterlabel}{}
+\fi
+\ifglsentrycounter
+ \newcommand*{\glsentryitem}[1]{%
+ \glsstepentry{#1}\glsentrycounterlabel
+ }
+\else
+ \newcommand*{\glsentryitem}[1]{\glsresetsubentrycounter}
+\fi
+\ifglssubentrycounter
+ \newcommand*{\glssubentryitem}[1]{%
+ \glsstepsubentry{#1}\glssubentrycounterlabel
+ }
+\else
+ \newcommand*{\glssubentryitem}[1]{}
+\fi
+\ifcsundef{theglossary}%
+{%
+ \newenvironment{theglossary}{}{}%
+}%
+{%
+ \GlossariesWarning{overriding `theglossary' environment}%
+ \renewenvironment{theglossary}{}{}%
+}
+\newcommand*{\glossaryheader}{}
+\newcommand*{\glstarget}[2]{\@glstarget{glo:#1}{#2}}
+\newcommand*{\glossaryentryfield}[5]{%
+\noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par}
+\newcommand*{\glossarysubentryfield}[6]{%
+\glstarget{#2}{\strut}#4. #6\par}
+\newcommand*{\glsgroupskip}{}
+\newcommand*{\glsgroupheading}[1]{}
+\newcommand*{\glsgetgrouptitle}[1]{%
+ \ifcsundef{#1groupname}{#1}{\csname #1groupname\endcsname}%
+}
+\newcommand*{\glsgetgrouplabel}[1]{%
+\ifthenelse{\equals{#1}{\glssymbolsgroupname}}{glssymbols}{%
+\ifthenelse{\equals{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}}
+\newcommand*{\setentrycounter}[2][]{%
+ \def\@glo@counterprefix{#1}%
+ \ifx\@glo@counterprefix\@empty
+ \def\@glo@counterprefix{.}%
+ \else
+ \def\@glo@counterprefix{.#1.}%
+ \fi
+ \def\glsentrycounter{#2}%
+}
+\newcommand*{\glossarystyle}[1]{%
+ \ifcsundef{@glsstyle@#1}%
+ {%
+ \PackageError{glossaries}{Glossary style `#1' undefined}{}%
+ }%
+ {%
+ \csname @glsstyle@#1\endcsname
+ }%
+}
+\newcommand{\newglossarystyle}[2]{%
+ \ifcsundef{@glsstyle@#1}%
+ {%
+ \expandafter\def\csname @glsstyle@#1\endcsname{#2}%
+ }%
+ {%
+ \PackageError{glossaries}{Glossary style `#1' is already defined}{}%
+ }%
+}
+\newcommand*{\glsnamefont}[1]{#1}
+\ifcsundef{hyperlink}%
+{%
+ \def\glshypernumber#1{#1}%
+}%
+{%
+ \def\glshypernumber#1{\@glshypernumber#1\nohyperpage{}\@nil}
+}
+\def\@glshypernumber#1\nohyperpage#2#3\@nil{%
+ \ifx\\#1\\%
+ \else
+ \@delimR#1\delimR\delimR\\%
+ \fi
+ \ifx\\#2\\%
+ \else
+ #2%
+ \fi
+ \ifx\\#3\\%
+ \else
+ \@glshypernumber#3\@nil
+ \fi
+}
+\def\@delimR#1\delimR #2\delimR #3\\{%
+\ifx\\#2\\%
+ \@delimN{#1}%
+\else
+ \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}%
+\fi}
+\def\@delimN#1{\@@delimN#1\delimN \delimN\\}
+\def\@@delimN#1\delimN #2\delimN#3\\{%
+\ifx\\#3\\%
+ \@gls@numberlink{#1}%
+\else
+ \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}%
+\fi
+}
+\def\@gls@numberlink#1{%
+\begingroup
+ \toks@={}%
+ \@gls@removespaces#1 \@nil
+\endgroup}
+\def\@gls@removespaces#1 #2\@nil{%
+ \toks@=\expandafter{\the\toks@#1}%
+ \ifx\\#2\\%
+ \edef\x{\the\toks@}%
+ \ifx\x\empty
+ \else
+ \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}%
+ {\the\toks@}%
+ \fi
+ \else
+ \@gls@ReturnAfterFi{%
+ \@gls@removespaces#2\@nil
+ }%
+ \fi
+}
+\long\def\@gls@ReturnAfterFi#1\fi{\fi#1}
+\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}}
+\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}}
+\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}}
+\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}}
+\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}}
+\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}}
+\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}}
+\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}}
+\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}}
+\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}}
+\ifglsacronym
+ \newglossary[alg]{acronym}{acr}{acn}{\acronymname}
+ \renewcommand*{\acronymtype}{acronym}
+\fi
+\newcommand{\oldacronym}[4][\gls@label]{%
+ \def\gls@label{#2}%
+ \newacronym[#4]{#1}{#2}{#3}%
+ \ifcsundef{xspace}%
+ {%
+ \expandafter\edef\csname#1\endcsname{%
+ \noexpand\@ifstar{\noexpand\Gls{#1}}{\noexpand\gls{#1}}%
+ }%
+ }%
+ {%
+ \expandafter\edef\csname#1\endcsname{%
+ \noexpand\@ifstar{\noexpand\Gls{#1}\noexpand\xspace}{%
+ \noexpand\gls{#1}\noexpand\xspace}%
+ }%
+ }%
+}
+ \newcommand{\newacronym}[4][]{}
+\newcommand*{\acrpluralsuffix}{\glspluralsuffix}
+\newcommand*{\glsshortkey}{short}
+\newcommand*{\glsshortpluralkey}{shortplural}
+\newcommand*{\glslongkey}{long}
+\newcommand*{\glslongpluralkey}{longplural}
+\newrobustcmd*{\acrfull}{%
+ \@ifstar\s@acrfull\ns@acrfull
+}
+\newcommand*\s@acrfull[2][]{%
+ \new@ifnextchar[{\@acrfull{hyper=false,#1}{#2}}%
+ {\@acrfull{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@acrfull[2][]{%
+ \new@ifnextchar[{\@acrfull{#1}{#2}}%
+ {\@acrfull{#1}{#2}[]}%
+}
+\def\@acrfull#1#2[#3]{%
+ \acrlinkfullformat{\@acrlong}{\@acrshort}{#1}{#2}{#3}%
+}
+\newcommand{\acrlinkfullformat}[5]{%
+ \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}%
+}
+\newcommand{\acrfullformat}[2]{#1\space(#2)}
+\newrobustcmd*{\Acrfull}{%
+ \@ifstar\s@Acrfull\ns@Acrfull
+}
+\newcommand*\s@Acrfull[2][]{%
+ \new@ifnextchar[{\@Acrfull{hyper=false,#1}{#2}}%
+ {\@Acrfull{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@Acrfull[2][]{%
+ \new@ifnextchar[{\@Acrfull{#1}{#2}}%
+ {\@Acrfull{#1}{#2}[]}%
+}
+\def\@Acrfull#1#2[#3]{%
+ \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}%
+}
+\newrobustcmd*{\ACRfull}{%
+ \@ifstar\s@ACRfull\ns@ACRfull
+}
+\newcommand*\s@ACRfull[2][]{%
+ \new@ifnextchar[{\@ACRfull{hyper=false,#1}{#2}}%
+ {\@ACRfull{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@ACRfull[2][]{%
+ \new@ifnextchar[{\@ACRfull{#1}{#2}}%
+ {\@ACRfull{#1}{#2}[]}%
+}
+\def\@ACRfull#1#2[#3]{%
+ \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}%
+}
+\newrobustcmd*{\acrfullpl}{%
+ \@ifstar\s@acrfullpl\ns@acrfullpl
+}
+\newcommand*\s@acrfullpl[2][]{%
+ \new@ifnextchar[{\@acrfullpl{hyper=false,#1}{#2}}%
+ {\@acrfullpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@acrfullpl[2][]{%
+ \new@ifnextchar[{\@acrfullpl{#1}{#2}}%
+ {\@acrfullpl{#1}{#2}[]}%
+}
+\def\@acrfullpl#1#2[#3]{%
+ \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}%
+}
+\newrobustcmd*{\Acrfullpl}{%
+ \@ifstar\s@Acrfullpl\ns@Acrfullpl
+}
+\newcommand*\s@Acrfullpl[2][]{%
+ \new@ifnextchar[{\@Acrfullpl{hyper=false,#1}{#2}}%
+ {\@Acrfullpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@Acrfullpl[2][]{%
+ \new@ifnextchar[{\@Acrfullpl{#1}{#2}}%
+ {\@Acrfullpl{#1}{#2}[]}%
+}
+\def\@Acrfullpl#1#2[#3]{%
+ \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}%
+}
+\newrobustcmd*{\ACRfullpl}{%
+ \@ifstar\s@ACRfullpl\ns@ACRfullpl
+}
+\newcommand*\s@ACRfullpl[2][]{%
+ \new@ifnextchar[{\@ACRfullpl{hyper=false,#1}{#2}}%
+ {\@ACRfullpl{hyper=false,#1}{#2}[]}%
+}
+\newcommand*\ns@ACRfullpl[2][]{%
+ \new@ifnextchar[{\@ACRfullpl{#1}{#2}}%
+ {\@ACRfullpl{#1}{#2}[]}%
+}
+\def\@ACRfullpl#1#2[#3]{%
+ \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}%
+}
+\newcommand{\acronymfont}[1]{#1}
+\newcommand{\firstacronymfont}[1]{\acronymfont{#1}}
+\newcommand*{\acrnameformat}[2]{\acronymfont{#1}}
+\newtoks\glskeylisttok
+\newtoks\glslabeltok
+\newtoks\glsshorttok
+\newtoks\glslongtok
+\newcommand*{\newacronymhook}{}
+\newcommand*{\SetDefaultAcronymDisplayStyle}[1]{%
+ \defglsdisplay[#1]{##1##4}%
+ \defglsdisplayfirst[#1]{##1##4}%
+}
+\newcommand*{\DefaultNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\the\glsshorttok},%
+ sort={\the\glsshorttok},%
+ text={\the\glsshorttok},%
+ first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ firstplural={\acrfullformat{\noexpand\@glo@longpl}%
+ {\noexpand\@glo@shortpl}},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\the\glslongtok},%
+ descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetDefaultAcronymStyle}{%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetDefaultAcronymDisplayStyle{\@gls@type}%
+ }%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetDefaultAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \DefaultNewAcronymDef
+ }%
+ \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}%
+}
+\newcommand*{\acrfootnote}[3]{\acrlinkfootnote{#1}{#2}{#3}}
+\newcommand*{\acrlinkfootnote}[3]{%
+ \footnote{\glslink[#1]{#2}{#3}}%
+}
+\newcommand*{\acrnolinkfootnote}[3]{%
+ \footnote{#3}%
+}
+\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{%
+ \defglsdisplayfirst[#1]{%
+ \firstacronymfont{##1}##4%
+ \expandafter\protect\expandafter\acrfootnote\expandafter
+ {\@gls@link@opts}{\@gls@link@label}{##3}
+ }%
+ \defglsdisplay[#1]{\acronymfont{##1}##4}%
+}
+\newcommand*{\DescriptionFootnoteNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ sort={\the\glsshorttok},%
+ text={\the\glsshorttok},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ symbol={\the\glslongtok},%
+ symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetDescriptionFootnoteAcronymStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \DescriptionFootnoteNewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}%
+ }%
+ \ifglsacrsmallcaps
+ \renewcommand*{\acronymfont}[1]{\textsc{##1}}%
+ \renewcommand*{\acrpluralsuffix}{%
+ \textup{\glspluralsuffix}}%
+ \else
+ \ifglsacrsmaller
+ \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}%
+ \fi
+ \fi
+ \ifglsacrdua
+ \PackageError{glossaries}{Option clash: `footnote' and `dua'
+ can't both be set}{}%
+ \fi
+}%
+\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{%
+ \defglsdisplay[#1]{##1##4}%
+ \defglsdisplayfirst[#1]{##1##4}%
+}
+\newcommand*{\DescriptionDUANewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\the\glslongtok},%
+ sort={\the\glslongtok},
+ text={\the\glslongtok},%
+ plural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ symbol={\the\glsshorttok},%
+ symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetDescriptionDUAAcronymStyle}{%
+ \ifglsacrsmallcaps
+ \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
+ can't both be set}{}%
+ \else
+ \ifglsacrsmaller
+ \PackageError{glossaries}{Option clash: `smaller' and `dua'
+ can't both be set}{}%
+ \fi
+ \fi
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \DescriptionDUANewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}%
+ }%
+}%
+\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{%
+ \defglsdisplayfirst[#1]{%
+ ##1##4 (\firstacronymfont{##3})}%
+ \defglsdisplay[#1]{\acronymfont{##1}##4}%
+}
+\newcommand*{\DescriptionNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand
+ \acrnameformat{\the\glsshorttok}{\the\glslongtok}},%
+ sort={\the\glsshorttok},%
+ first={\the\glslongtok},%
+ firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ text={\the\glsshorttok},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ symbol={\noexpand\@glo@text},%
+ symbolplural={\noexpand\@glo@plural},%
+ \the\glskeylisttok}%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetDescriptionAcronymStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetDescriptionAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \DescriptionNewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetDescriptionAcronymDisplayStyle{\@gls@type}%
+ }%
+ \ifglsacrsmallcaps
+ \renewcommand{\acronymfont}[1]{\textsc{##1}}
+ \renewcommand*{\acrpluralsuffix}{%
+ \textup{\glspluralsuffix}}%
+ \else
+ \ifglsacrsmaller
+ \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}%
+ \fi
+ \fi
+}%
+\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{%
+ \defglsdisplayfirst[#1]{%
+ \firstacronymfont{##1}##4%
+ \expandafter\protect\expandafter\acrfootnote\expandafter
+ {\@gls@link@opts}{\@gls@link@label}{##2}%
+ }%
+ \defglsdisplay[#1]{\acronymfont{##1}##4}%
+}
+\newcommand*{\FootnoteNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ sort={\the\glsshorttok},%
+ text={\the\glsshorttok},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\the\glslongtok},%
+ descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetFootnoteAcronymStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetFootnoteAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \FootnoteNewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetFootnoteAcronymDisplayStyle{\@gls@type}%
+ }%
+ \ifglsacrsmallcaps
+ \renewcommand*{\acronymfont}[1]{\textsc{##1}}%
+ \renewcommand*{\acrpluralsuffix}{%
+ \textup{\glspluralsuffix}}%
+ \else
+ \ifglsacrsmaller
+ \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}%
+ \fi
+ \fi
+ \ifglsacrdua
+ \PackageError{glossaries}{Option clash: `footnote' and `dua'
+ can't both be set}{}%
+ \fi
+}%
+\newcommand*{\SetSmallAcronymDisplayStyle}[1]{%
+ \defglsdisplayfirst[#1]{##1##4 (\firstacronymfont{##3})}
+ \defglsdisplay[#1]{\acronymfont{##1}##4}%
+}
+\newcommand*{\SmallNewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\noexpand\acronymfont{\the\glsshorttok}},%
+ sort={\the\glsshorttok},%
+ text={\noexpand\@glo@symbol},%
+ plural={\noexpand\@glo@symbolplural},%
+ first={\the\glslongtok},%
+ firstplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\noexpand\@glo@first},%
+ descriptionplural={\noexpand\@glo@firstplural},%
+ symbol={\the\glsshorttok},%
+ symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetSmallAcronymStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetSmallAcronymDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \SmallNewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetSmallAcronymDisplayStyle{\@gls@type}%
+ }%
+ \ifglsacrsmallcaps
+ \renewcommand*{\acronymfont}[1]{\textsc{##1}}
+ \renewcommand*{\acrpluralsuffix}{%
+ \textup{\glspluralsuffix}}%
+ \else
+ \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}
+ \fi
+ \ifglsacrdua
+ \ifglsacrsmallcaps
+ \PackageError{glossaries}{Option clash: `smallcaps' and `dua'
+ can't both be set}{}%
+ \else
+ \PackageError{glossaries}{Option clash: `smaller' and `dua'
+ can't both be set}{}%
+ \fi
+ \fi
+}%
+\newcommand*{\SetDUADisplayStyle}[1]{%
+ \defglsdisplay[#1]{##1##4}%
+ \defglsdisplayfirst[#1]{##1##4}%
+}
+\newcommand*{\DUANewAcronymDef}{%
+ \edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ name={\the\glsshorttok},%
+ text={\the\glslongtok},%
+ plural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ description={\the\glslongtok},%
+ symbol={\the\glsshorttok},%
+ symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetDUAStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetDUADisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \DUANewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetDUADisplayStyle{\@gls@type}%
+ }%
+}
+\newcommand*{\SetAcronymStyle}{%
+ \SetDefaultAcronymStyle
+ \ifglsacrdescription
+ \ifglsacrfootnote
+ \SetDescriptionFootnoteAcronymStyle
+ \else
+ \ifglsacrdua
+ \SetDescriptionDUAAcronymStyle
+ \else
+ \SetDescriptionAcronymStyle
+ \fi
+ \fi
+ \else
+ \ifglsacrfootnote
+ \SetFootnoteAcronymStyle
+ \else
+ \ifthenelse{\boolean{glsacrsmallcaps}\OR
+ \boolean{glsacrsmaller}}%
+ {%
+ \SetSmallAcronymStyle
+ }%
+ {%
+ \ifglsacrdua
+ \SetDUAStyle
+ \fi
+ }%
+ \fi
+ \fi
+}
+\SetAcronymStyle
+\newcommand*{\SetCustomDisplayStyle}[1]{%
+ \defglsdisplay[#1]{##1##4}%
+ \defglsdisplayfirst[#1]{##1##4}%
+}
+\newcommand*{\CustomAcronymFields}{%
+ name={\the\glsshorttok},%
+ description={\the\glslongtok},%
+ first={\noexpand\acrfullformat{\the\glslongtok}{\the\glsshorttok}},%
+ firstplural={\noexpand\acrfullformat
+ {\the\glslongtok\noexpand\acrpluralsuffix}{\the\glsshorttok}}%
+ text={\the\glsshorttok},%
+ plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
+}
+\newcommand*{\CustomNewAcronymDef}{%
+ \protected@edef\@do@newglossaryentry{%
+ \noexpand\newglossaryentry{\the\glslabeltok}%
+ {%
+ type=\acronymtype,%
+ short={\the\glsshorttok},%
+ shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ long={\the\glslongtok},%
+ longplural={\the\glslongtok\noexpand\acrpluralsuffix},%
+ user1={\the\glsshorttok},%
+ user2={\the\glsshorttok\noexpand\acrpluralsuffix},%
+ user3={\the\glslongtok},%
+ user4={\the\glslongtok\noexpand\acrpluralsuffix},%
+ \CustomAcronymFields,%
+ \the\glskeylisttok
+ }%
+ }%
+ \@do@newglossaryentry
+}
+\newcommand*{\SetCustomStyle}{%
+ \renewcommand{\newacronym}[4][]{%
+ \ifx\@glsacronymlists\@empty
+ \def\@glo@type{\acronymtype}%
+ \setkeys{glossentry}{##1}%
+ \DeclareAcronymList{\@glo@type}%
+ \SetCustomDisplayStyle{\@glo@type}%
+ \fi
+ \glskeylisttok{##1}%
+ \glslabeltok{##2}%
+ \glsshorttok{##3}%
+ \glslongtok{##4}%
+ \newacronymhook
+ \CustomNewAcronymDef
+ }%
+ \@for\@gls@type:=\@glsacronymlists\do{%
+ \SetCustomDisplayStyle{\@gls@type}%
+ }%
+}
+\newcommand*{\DefineAcronymSynonyms}{%
+ \let\acs\acrshort
+ \let\Acs\Acrshort
+ \let\acsp\acrshortpl
+ \let\Acsp\Acrshortpl
+ \let\acl\acrlong
+ \let\aclp\acrlongpl
+ \let\Acl\Acrlong
+ \let\Aclp\Acrlongpl
+ \let\acf\acrfull
+ \let\acfp\acrfullpl
+ \let\Acf\Acrfull
+ \let\Acfp\Acrfullpl
+ \let\ac\gls
+ \let\Ac\Gls
+ \let\acp\glspl
+ \let\Acp\Glspl
+}
+\ifglsacrshortcuts
+ \DefineAcronymSynonyms
+\fi
+\RequirePackage{glossary-hypernav}
+\@gls@loadlist
+\@gls@loadlong
+\@gls@loadsuper
+\@gls@loadtree
+\ifx\@glossary@default@style\relax
+\else
+ \glossarystyle{\@glossary@default@style}
+\fi
+\newcommand*{\showgloparent}[1]{%
+ \expandafter\show\csname glo@#1@parent\endcsname
+}
+\newcommand*{\showglolevel}[1]{%
+ \expandafter\show\csname glo@#1@level\endcsname
+}
+\newcommand*{\showglotext}[1]{%
+ \expandafter\show\csname glo@#1@text\endcsname
+}
+\newcommand*{\showgloplural}[1]{%
+ \expandafter\show\csname glo@#1@plural\endcsname
+}
+\newcommand*{\showglofirst}[1]{%
+ \expandafter\show\csname glo@#1@first\endcsname
+}
+\newcommand*{\showglofirstpl}[1]{%
+ \expandafter\show\csname glo@#1@firstpl\endcsname
+}
+\newcommand*{\showglotype}[1]{%
+ \expandafter\show\csname glo@#1@type\endcsname
+}
+\newcommand*{\showglocounter}[1]{%
+ \expandafter\show\csname glo@#1@counter\endcsname
+}
+\newcommand*{\showglouseri}[1]{%
+ \expandafter\show\csname glo@#1@useri\endcsname
+}
+\newcommand*{\showglouserii}[1]{%
+ \expandafter\show\csname glo@#1@userii\endcsname
+}
+\newcommand*{\showglouseriii}[1]{%
+ \expandafter\show\csname glo@#1@useriii\endcsname
+}
+\newcommand*{\showglouseriv}[1]{%
+ \expandafter\show\csname glo@#1@useriv\endcsname
+}
+\newcommand*{\showglouserv}[1]{%
+ \expandafter\show\csname glo@#1@userv\endcsname
+}
+\newcommand*{\showglouservi}[1]{%
+ \expandafter\show\csname glo@#1@uservi\endcsname
+}
+\newcommand*{\showgloname}[1]{%
+ \expandafter\show\csname glo@#1@name\endcsname
+}
+\newcommand*{\showglodesc}[1]{%
+ \expandafter\show\csname glo@#1@desc\endcsname
+}
+\newcommand*{\showglodescplural}[1]{%
+ \expandafter\show\csname glo@#1@descplural\endcsname
+}
+\newcommand*{\showglosort}[1]{%
+ \expandafter\show\csname glo@#1@sort\endcsname
+}
+\newcommand*{\showglosymbol}[1]{%
+ \expandafter\show\csname glo@#1@symbol\endcsname
+}
+\newcommand*{\showglosymbolplural}[1]{%
+ \expandafter\show\csname glo@#1@symbolplural\endcsname
+}
+\newcommand*{\showgloindex}[1]{%
+ \expandafter\show\csname glo@#1@index\endcsname
+}
+\newcommand*{\showgloflag}[1]{%
+ \expandafter\show\csname ifglo@#1@flag\endcsname
+}
+\newcommand*{\showacronymlists}{%
+ \show\@glsacronymlists
+}
+\newcommand*{\showglossaries}{%
+ \show\@glo@types
+}
+\newcommand*{\showglossaryin}[1]{%
+ \expandafter\show\csname @glotype@#1@in\endcsname
+}
+\newcommand*{\showglossaryout}[1]{%
+ \expandafter\show\csname @glotype@#1@out\endcsname
+}
+\newcommand*{\showglossarytitle}[1]{%
+ \expandafter\show\csname @glotype@#1@title\endcsname
+}
+\newcommand*{\showglossarycounter}[1]{%
+ \expandafter\show\csname @glotype@#1@counter\endcsname
+}
+\newcommand*{\showglossaryentries}[1]{%
+ \expandafter\show\csname @glolist@#1\endcsname
+}
+\csname ifglscompatible-2.07\endcsname
+ \RequirePackage{glossaries-compatible-207}
+\fi
+\endinput
+%%
+%% End of file `glossaries.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-hypernav.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-hypernav.sty
new file mode 100644
index 0000000000..3483dd5d9e
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-hypernav.sty
@@ -0,0 +1,96 @@
+%%
+%% This is file `glossary-hypernav.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-hypernav.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-hypernav}[2007/07/04 v1.01 (NLCT)]
+\newcommand*{\glsnavhyperlink}[3][\@glo@type]{%
+ \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}%
+ \@glslink{glsn:#1@#2}{#3}}
+\newcommand*{\glsnavhypertarget}[3][\@glo@type]{%
+ \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}%
+ \@glstarget{glsn:#1@#2}{#3}%
+ \expandafter\let
+ \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname
+ \@for\@gls@elem:=\@gls@list\do{%
+ \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}%
+ \if@endfor
+ \else
+ \GlossariesWarningNoLine{Navigation panel
+ for glossary type `#1'^^Jmissing group `#2'}%
+ \gdef\gls@hypergrouprerun{%
+ \GlossariesWarningNoLine{Navigation panel
+ has changed. Rerun LaTeX}}%
+ \fi
+}
+\let\gls@hypergrouprerun\relax
+\AtEndDocument{\gls@hypergrouprerun}
+\newcommand*{\@gls@hypergroup}[2]{%
+\@ifundefined{@gls@hypergrouplist@#1}{%
+ \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}%
+}{%
+ \expandafter\let\expandafter\@gls@tmp
+ \csname @gls@hypergrouplist@#1\endcsname
+ \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{%
+ \@gls@tmp,#2}%
+}%
+}
+\newcommand*{\glsnavigation}{%
+\def\@gls@between{}%
+\@ifundefined{@gls@hypergrouplist@\@glo@type}{%
+ \def\@gls@list{}%
+}{%
+ \expandafter\let\expandafter\@gls@list
+ \csname @gls@hypergrouplist@\@glo@type\endcsname
+}%
+\@for\@gls@tmp:=\@gls@list\do{%
+ \@gls@between
+ \glsnavhyperlink{\@gls@tmp}{\glsgetgrouptitle{\@gls@tmp}}%
+ \let\@gls@between\glshypernavsep%
+}%
+}
+\newcommand*{\glshypernavsep}{\space\textbar\space}
+\newcommand*{\glssymbolnav}{%
+\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}%
+\glshypernavsep
+\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}%
+\glshypernavsep
+}
+\endinput
+%%
+%% End of file `glossary-hypernav.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-list.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-list.sty
new file mode 100644
index 0000000000..8b773da64a
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-list.sty
@@ -0,0 +1,104 @@
+%%
+%% This is file `glossary-list.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-list.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-list}[2011/03/28 v3.0 (NLCT)]
+\newglossarystyle{list}{%
+ \renewenvironment{theglossary}%
+ {\begin{description}}{\end{description}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \item[\glsentryitem{##1}\glstarget{##1}{##2}]
+ ##3\glspostdescription\space ##5}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}%
+ \renewcommand*{\glsgroupskip}{\indexspace}%
+}
+\newglossarystyle{listgroup}{%
+ \glossarystyle{list}%
+ \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
+\newglossarystyle{listhypergroup}{%
+ \glossarystyle{list}%
+ \renewcommand*{\glossaryheader}{%
+ \item[\glsnavigation]}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
+\newglossarystyle{altlist}{%
+ \glossarystyle{list}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \item[\glsentryitem{##1}\glstarget{##1}{##2}]\mbox{}\newline
+ ##3\glspostdescription\space ##5}%
+ \renewcommand{\glossarysubentryfield}[6]{%
+ \par
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6}%
+}
+\newglossarystyle{altlistgroup}{%
+ \glossarystyle{altlist}%
+ \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}}
+\newglossarystyle{altlisthypergroup}{%
+ \glossarystyle{altlist}%
+ \renewcommand*{\glossaryheader}{%
+ \item[\glsnavigation]}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}}
+\newglossarystyle{listdotted}{%
+ \glossarystyle{list}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \item[]\makebox[\glslistdottedwidth][l]{%
+ \glsentryitem{##1}\glstarget{##1}{##2}%
+ \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ \item[]\makebox[\glslistdottedwidth][l]{%
+ \glssubentryitem{##2}%
+ \glstarget{##2}{##3}%
+ \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}%
+}
+\newlength\glslistdottedwidth
+\setlength{\glslistdottedwidth}{.5\hsize}
+\newglossarystyle{sublistdotted}{%
+ \glossarystyle{listdotted}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \item[\glsentryitem{##1}\glstarget{##1}{##2}]}%
+}
+\endinput
+%%
+%% End of file `glossary-list.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-long.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-long.sty
new file mode 100644
index 0000000000..756eef5dcb
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-long.sty
@@ -0,0 +1,182 @@
+%%
+%% This is file `glossary-long.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-long.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-long}[2011/03/28 v3.0 (NLCT)]
+\RequirePackage{longtable}
+\@ifundefined{glsdescwidth}{%
+ \newlength\glsdescwidth
+ \setlength{\glsdescwidth}{0.6\hsize}
+}{}
+\@ifundefined{glspagelistwidth}{%
+ \newlength\glspagelistwidth
+ \setlength{\glspagelistwidth}{0.1\hsize}
+}{}
+\newglossarystyle{long}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{lp{\glsdescwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & \\}%
+}
+\newglossarystyle{longborder}{%
+ \glossarystyle{long}%
+ \renewenvironment{theglossary}{%
+ \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{longheader}{%
+ \glossarystyle{long}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries \entryname & \bfseries \descriptionname\\\endhead}%
+}
+\newglossarystyle{longheaderborder}{%
+ \glossarystyle{longborder}%
+ \renewcommand*{\glossaryheader}{%
+ \hline\bfseries \entryname & \bfseries \descriptionname\\\hline
+ \endhead
+ \hline\endfoot}%
+}
+\newglossarystyle{long3col}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & &\\}%
+}
+\newglossarystyle{long3colborder}{%
+ \glossarystyle{long3col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{long3colheader}{%
+ \glossarystyle{long3col}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\\\endhead}%
+}
+\newglossarystyle{long3colheaderborder}{%
+ \glossarystyle{long3colborder}%
+ \renewcommand*{\glossaryheader}{%
+ \hline
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\\\hline\endhead
+ \hline\endfoot}%
+}
+\newglossarystyle{long4col}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{llll}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##5 & ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & & &\\}%
+}
+\newglossarystyle{long4colheader}{%
+ \glossarystyle{long4col}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries \symbolname&
+ \bfseries\pagelistname\\\endhead}%
+}
+\newglossarystyle{long4colborder}{%
+ \glossarystyle{long4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|l|l|l|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{long4colheaderborder}{%
+ \glossarystyle{long4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|l|l|l|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{%
+ \hline\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries \symbolname&
+ \bfseries\pagelistname\\\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{altlong4col}{%
+ \glossarystyle{long4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
+ {\end{longtable}}%
+}
+\newglossarystyle{altlong4colheader}{%
+ \glossarystyle{long4colheader}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
+ {\end{longtable}}%
+}
+\newglossarystyle{altlong4colborder}{%
+ \glossarystyle{long4colborder}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+}
+\newglossarystyle{altlong4colheaderborder}{%
+ \glossarystyle{long4colheaderborder}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+}
+\endinput
+%%
+%% End of file `glossary-long.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-longragged.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-longragged.sty
new file mode 100644
index 0000000000..a05e4bd1a2
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-longragged.sty
@@ -0,0 +1,174 @@
+%%
+%% This is file `glossary-longragged.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-longragged.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-longragged}[2011/03/28 v3.0 (NLCT)]
+\RequirePackage{array}
+\RequirePackage{longtable}
+\@ifundefined{glsdescwidth}{%
+ \newlength\glsdescwidth
+ \setlength{\glsdescwidth}{0.6\hsize}
+}{}
+\@ifundefined{glspagelistwidth}{%
+ \newlength\glspagelistwidth
+ \setlength{\glspagelistwidth}{0.1\hsize}
+}{}
+\newglossarystyle{longragged}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5%
+ \tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6%
+ \tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & \tabularnewline}%
+}
+\newglossarystyle{longraggedborder}{%
+ \glossarystyle{longragged}%
+ \renewenvironment{theglossary}{%
+ \begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{longraggedheader}{%
+ \glossarystyle{longragged}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries \entryname & \bfseries \descriptionname
+ \tabularnewline\endhead}%
+}
+\newglossarystyle{longraggedheaderborder}{%
+ \glossarystyle{longraggedborder}%
+ \renewcommand*{\glossaryheader}{%
+ \hline\bfseries \entryname & \bfseries \descriptionname
+ \tabularnewline\hline
+ \endhead
+ \hline\endfoot}%
+}
+\newglossarystyle{longragged3col}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##6\tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & &\tabularnewline}%
+}
+\newglossarystyle{longragged3colborder}{%
+ \glossarystyle{longragged3col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{longragged3colheader}{%
+ \glossarystyle{longragged3col}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\tabularnewline\endhead}%
+}
+\newglossarystyle{longragged3colheaderborder}{%
+ \glossarystyle{longragged3colborder}%
+ \renewcommand*{\glossaryheader}{%
+ \hline
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\tabularnewline\hline\endhead
+ \hline\endfoot}%
+}
+\newglossarystyle{altlongragged4col}{%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & & &\tabularnewline}%
+}
+\newglossarystyle{altlongragged4colheader}{%
+ \glossarystyle{altlongragged4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{%
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries \symbolname&
+ \bfseries\pagelistname\tabularnewline\endhead}%
+}
+\newglossarystyle{altlongragged4colborder}{%
+ \glossarystyle{altlongragged4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}%
+}
+\newglossarystyle{altlongragged4colheaderborder}{%
+ \glossarystyle{altlongragged4col}%
+ \renewenvironment{theglossary}%
+ {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{longtable}}%
+ \renewcommand*{\glossaryheader}{%
+ \hline\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries \symbolname&
+ \bfseries\pagelistname\tabularnewline\hline\endhead
+ \hline\endfoot}%
+}
+\endinput
+%%
+%% End of file `glossary-longragged.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-super.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-super.sty
new file mode 100644
index 0000000000..7831f9b008
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-super.sty
@@ -0,0 +1,210 @@
+%%
+%% This is file `glossary-super.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-super.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-super}[2011/03/28 v3.0 (NLCT)]
+\RequirePackage{supertabular}
+\@ifundefined{glsdescwidth}{%
+ \newlength\glsdescwidth
+ \setlength{\glsdescwidth}{0.6\hsize}
+}{}
+\@ifundefined{glspagelistwidth}{%
+ \newlength\glspagelistwidth
+ \setlength{\glspagelistwidth}{0.1\hsize}
+}{}
+\newglossarystyle{super}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}}}%
+ {\end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & \\}%
+}
+\newglossarystyle{superborder}{%
+ \glossarystyle{super}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|p{\glsdescwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superheader}{%
+ \glossarystyle{super}%
+\renewenvironment{theglossary}%
+ {\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}%
+ \tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superheaderborder}{%
+ \glossarystyle{super}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline\bfseries \entryname &
+ \bfseries \descriptionname\\\hline}%
+ \tabletail{\hline}
+ \begin{supertabular}{|l|p{\glsdescwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super3col}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & &\\}%
+}
+\newglossarystyle{super3colborder}{%
+ \glossarystyle{super3col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super3colheader}{%
+ \glossarystyle{super3col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\\}\tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super3colheaderborder}{%
+ \glossarystyle{super3colborder}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\\\hline}%
+ \tabletail{\hline}%
+ \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super4col}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{llll}}{%
+ \end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##5 & ##6\\}%
+ \renewcommand*{\glsgroupskip}{ & & &\\}%
+}
+\newglossarystyle{super4colheader}{%
+ \glossarystyle{super4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\symbolname &
+ \bfseries\pagelistname\\}%
+ \tabletail{}%
+ \begin{supertabular}{llll}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super4colborder}{%
+ \glossarystyle{super4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|l|l|l|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{super4colheaderborder}{%
+ \glossarystyle{super4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\symbolname &
+ \bfseries\pagelistname\\\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|l|l|l|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuper4col}{%
+ \glossarystyle{super4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuper4colheader}{%
+ \glossarystyle{super4colheader}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\symbolname &
+ \bfseries\pagelistname\\}\tabletail{}%
+ \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuper4colborder}{%
+ \glossarystyle{super4colborder}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}%
+ {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuper4colheaderborder}{%
+ \glossarystyle{super4colheaderborder}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline
+ \bfseries\entryname &
+ \bfseries\descriptionname &
+ \bfseries\symbolname &
+ \bfseries\pagelistname\\\hline}%
+ \tabletail{\hline}%
+ \begin{supertabular}%
+ {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\endinput
+%%
+%% End of file `glossary-super.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-superragged.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-superragged.sty
new file mode 100644
index 0000000000..2c02e10e42
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-superragged.sty
@@ -0,0 +1,189 @@
+%%
+%% This is file `glossary-superragged.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-superragged.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-superragged}[2011/03/28 v3.0 (NLCT)]
+\RequirePackage{array}
+\RequirePackage{supertabular}
+\@ifundefined{glsdescwidth}{%
+ \newlength\glsdescwidth
+ \setlength{\glsdescwidth}{0.6\hsize}
+}{}
+\@ifundefined{glspagelistwidth}{%
+ \newlength\glspagelistwidth
+ \setlength{\glspagelistwidth}{0.1\hsize}
+}{}
+\newglossarystyle{superragged}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}%
+ {\end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5%
+ \tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4\glspostdescription\space ##6%
+ \tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & \tabularnewline}%
+}
+\newglossarystyle{superraggedborder}{%
+ \glossarystyle{superragged}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superraggedheader}{%
+ \glossarystyle{superragged}%
+\renewenvironment{theglossary}%
+ {\tablehead{\bfseries \entryname & \bfseries \descriptionname
+ \tabularnewline}%
+ \tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superraggedheaderborder}{%
+ \glossarystyle{superragged}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline\bfseries \entryname &
+ \bfseries \descriptionname\tabularnewline\hline}%
+ \tabletail{\hline}
+ \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superragged3col}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##6\tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & &\tabularnewline}%
+}
+\newglossarystyle{superragged3colborder}{%
+ \glossarystyle{superragged3col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superragged3colheader}{%
+ \glossarystyle{superragged3col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\tabularnewline}\tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{superragged3colheaderborder}{%
+ \glossarystyle{superragged3colborder}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline
+ \bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\pagelistname\tabularnewline\hline}%
+ \tabletail{\hline}%
+ \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuperragged4col}{%
+ \renewenvironment{theglossary}%
+ {\tablehead{}\tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand*{\glossaryentryfield}[5]{%
+ \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ &
+ \glssubentryitem{##2}%
+ \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}%
+ \renewcommand*{\glsgroupskip}{ & & &\tabularnewline}%
+}
+\newglossarystyle{altsuperragged4colheader}{%
+ \glossarystyle{altsuperragged4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\bfseries\entryname&\bfseries\descriptionname&
+ \bfseries\symbolname &
+ \bfseries\pagelistname\tabularnewline}\tabletail{}%
+ \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l%
+ >{\raggedright}p{\glspagelistwidth}}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuperragged4colborder}{%
+ \glossarystyle{altsuper4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline}\tabletail{\hline}%
+ \begin{supertabular}%
+ {|l|>{\raggedright}p{\glsdescwidth}|l|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\newglossarystyle{altsuperragged4colheaderborder}{%
+ \glossarystyle{altsuperragged4col}%
+ \renewenvironment{theglossary}%
+ {\tablehead{\hline
+ \bfseries\entryname &
+ \bfseries\descriptionname &
+ \bfseries\symbolname &
+ \bfseries\pagelistname\tabularnewline\hline}%
+ \tabletail{\hline}%
+ \begin{supertabular}%
+ {|l|>{\raggedright}p{\glsdescwidth}|l|%
+ >{\raggedright}p{\glspagelistwidth}|}}%
+ {\end{supertabular}}%
+}
+\endinput
+%%
+%% End of file `glossary-superragged.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/glossary-tree.sty b/support/makeglossariesgui/src/tests/old-version-301/glossary-tree.sty
new file mode 100644
index 0000000000..490ad13ea6
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/glossary-tree.sty
@@ -0,0 +1,264 @@
+%%
+%% This is file `glossary-tree.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `glossary-tree.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\ProvidesPackage{glossary-tree}[2011/03/28 v3.0 (NLCT)]
+\newglossarystyle{index}{%
+ \renewenvironment{theglossary}%
+ {\setlength{\parindent}{0pt}%
+ \setlength{\parskip}{0pt plus 0.3pt}%
+ \let\item\@idxitem}%
+ {}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+\renewcommand*{\glossaryentryfield}[5]{%
+\item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
+ \ifx\relax##4\relax
+ \else
+ \space(##4)%
+ \fi
+ \space ##3\glspostdescription \space ##5}%
+ \renewcommand*{\glossarysubentryfield}[6]{%
+ \ifcase##1\relax
+ % level 0
+ \item
+ \or
+ % level 1
+ \subitem
+ \glssubentryitem{##2}%
+ \else
+ % all other levels
+ \subsubitem
+ \fi
+ \textbf{\glstarget{##2}{##3}}%
+ \ifx\relax##5\relax
+ \else
+ \space(##5)%
+ \fi
+ \space##4\glspostdescription\space ##6}%
+ \renewcommand*{\glsgroupskip}{\indexspace}}
+\newglossarystyle{indexgroup}{%
+ \glossarystyle{index}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \item\textbf{\glsgetgrouptitle{##1}}\indexspace}%
+}
+\newglossarystyle{indexhypergroup}{%
+ \glossarystyle{index}%
+ \renewcommand*{\glossaryheader}{%
+ \item\textbf{\glsnavigation}\indexspace}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \item\textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}%
+ \indexspace}%
+}
+\newglossarystyle{tree}{%
+ \renewenvironment{theglossary}%
+ {\setlength{\parindent}{0pt}%
+ \setlength{\parskip}{0pt plus 0.3pt}}%
+ {}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand{\glossaryentryfield}[5]{%
+ \hangindent0pt\relax
+ \parindent0pt\relax
+ \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
+ \ifx\relax##4\relax
+ \else
+ \space(##4)%
+ \fi
+ \space ##3\glspostdescription \space ##5\par}%
+ \renewcommand{\glossarysubentryfield}[6]{%
+ \hangindent##1\glstreeindent\relax
+ \parindent##1\glstreeindent\relax
+ \ifnum##1=1\relax
+ \glssubentryitem{##2}%
+ \fi
+ \textbf{\glstarget{##2}{##3}}%
+ \ifx\relax##5\relax
+ \else
+ \space(##5)%
+ \fi
+ \space##4\glspostdescription\space ##6\par}%
+ \renewcommand*{\glsgroupskip}{\indexspace}}
+\newglossarystyle{treegroup}{%
+ \glossarystyle{tree}%
+ \renewcommand{\glsgroupheading}[1]{\par
+ \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
+}
+\newglossarystyle{treehypergroup}{%
+ \glossarystyle{tree}%
+ \renewcommand*{\glossaryheader}{%
+ \par\noindent\textbf{\glsnavigation}\par\indexspace}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \par\noindent
+ \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
+ \indexspace}%
+}
+\newlength\glstreeindent
+\setlength{\glstreeindent}{10pt}
+\newglossarystyle{treenoname}{%
+ \renewenvironment{theglossary}%
+ {\setlength{\parindent}{0pt}%
+ \setlength{\parskip}{0pt plus 0.3pt}}%
+ {}%
+ \renewcommand*{\glossaryheader}{}%
+\renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand{\glossaryentryfield}[5]{%
+ \hangindent0pt\relax
+ \parindent0pt\relax
+ \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
+ \ifx\relax##4\relax
+ \else
+ \space(##4)%
+ \fi
+ \space ##3\glspostdescription \space ##5\par}%
+ \renewcommand{\glossarysubentryfield}[6]{%
+ \hangindent##1\glstreeindent\relax
+ \parindent##1\glstreeindent\relax
+ \ifnum##1=1\relax
+ \glssubentryitem{##2}%
+ \fi
+ \glstarget{##2}{\strut}%
+ ##4\glspostdescription\space ##6\par}%
+ \renewcommand*{\glsgroupskip}{\indexspace}%
+}
+\newglossarystyle{treenonamegroup}{%
+ \glossarystyle{treenoname}%
+ \renewcommand{\glsgroupheading}[1]{\par
+ \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
+}
+\newglossarystyle{treenonamehypergroup}{%
+ \glossarystyle{treenoname}%
+ \renewcommand*{\glossaryheader}{%
+ \par\noindent\textbf{\glsnavigation}\par\indexspace}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \par\noindent
+ \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
+ \indexspace}%
+}
+\newcommand*{\glssetwidest}[2][0]{%
+ \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{%
+ #2}%
+}
+\newcommand*{\@glswidestname}{}
+\newglossarystyle{alttree}{%
+ \renewenvironment{theglossary}%
+ {\def\@gls@prevlevel{-1}%
+ \mbox{}\par}%
+ {\par}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{}%
+ \renewcommand{\glossaryentryfield}[5]{%
+ \ifnum\@gls@prevlevel=0\relax
+ \else
+ \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}%
+ \hangindent\glstreeindent
+ \parindent\glstreeindent
+ \fi
+ \makebox[0pt][r]{\makebox[\glstreeindent][l]{%
+ \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}%
+ \ifx\relax##4\relax
+ \else
+ (##4)\space
+ \fi
+ ##3\glspostdescription \space ##5\par
+ \def\@gls@prevlevel{0}%
+ }%
+ \renewcommand{\glossarysubentryfield}[6]{%
+ \ifnum##1=1\relax
+ \glssubentryitem{##2}%
+ \fi
+ \ifnum\@gls@prevlevel=##1\relax
+ \else
+ \@ifundefined{@glswidestname\romannumeral##1}{%
+ \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{%
+ \settowidth{\gls@tmplen}{\textbf{%
+ \csname @glswidestname\romannumeral##1\endcsname\space}}}%
+ \ifnum\@gls@prevlevel<##1\relax
+ \setlength\glstreeindent\gls@tmplen
+ \addtolength\glstreeindent\parindent
+ \parindent\glstreeindent
+ \else
+ \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{%
+ \settowidth{\glstreeindent}{\textbf{%
+ \@glswidestname\space}}}{%
+ \settowidth{\glstreeindent}{\textbf{%
+ \csname @glswidestname\romannumeral\@gls@prevlevel
+ \endcsname\space}}}%
+ \addtolength\parindent{-\glstreeindent}%
+ \setlength\glstreeindent\parindent
+ \fi
+ \fi
+ \hangindent\glstreeindent
+ \makebox[0pt][r]{\makebox[\gls@tmplen][l]{%
+ \textbf{\glstarget{##2}{##3}}}}%
+ \ifx##5\relax\relax
+ \else
+ (##5)\space
+ \fi
+ ##4\glspostdescription\space ##6\par
+ \def\@gls@prevlevel{##1}%
+ }%
+ \renewcommand*{\glsgroupskip}{\indexspace}%
+}
+\newglossarystyle{alttreegroup}{%
+ \glossarystyle{alttree}%
+ \renewcommand{\glsgroupheading}[1]{\par
+ \def\@gls@prevlevel{-1}%
+ \hangindent0pt\relax
+ \parindent0pt\relax
+ \textbf{\glsgetgrouptitle{##1}}\par\indexspace}%
+}
+\newglossarystyle{alttreehypergroup}{%
+ \glossarystyle{alttree}%
+ \renewcommand*{\glossaryheader}{%
+ \par
+ \def\@gls@prevlevel{-1}%
+ \hangindent0pt\relax
+ \parindent0pt\relax
+ \textbf{\glsnavigation}\par\indexspace}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \par
+ \def\@gls@prevlevel{-1}%
+ \hangindent0pt\relax
+ \parindent0pt\relax
+ \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par
+ \indexspace}}
+\endinput
+%%
+%% End of file `glossary-tree.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/mfirstuc.sty b/support/makeglossariesgui/src/tests/old-version-301/mfirstuc.sty
new file mode 100644
index 0000000000..15f7333030
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/mfirstuc.sty
@@ -0,0 +1,94 @@
+%%
+%% This is file `mfirstuc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% glossaries.dtx (with options: `mfirstuc.sty,package')
+%%
+%% glossaries.dtx
+%% Copyright 2011 Nicola Talbot
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license of (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Nicola Talbot.
+%%
+%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl.
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{mfirstuc}[2011/04/02 v1.05 (NLCT)]
+\newif\if@glscs
+\newtoks\@glsmfirst
+\newtoks\@glsmrest
+\def\makefirstuc#1{%
+ \def\gls@argi{#1}%
+ \ifx\gls@argi\@empty
+ \else
+ \def\@gls@tmp{\ #1}%
+ \@onelevel@sanitize\@gls@tmp
+ \expandafter\@gls@checkcs\@gls@tmp\relax\relax
+ \if@glscs
+ \@gls@getbody #1{}\@nil
+ \ifx\@gls@rest\@empty
+ \glsmakefirstuc{#1}%
+ \else
+ \expandafter\@gls@split\@gls@rest\@nil
+ \ifx\@gls@first\@empty
+ \glsmakefirstuc{#1}%
+ \else
+ \expandafter\@glsmfirst\expandafter{\@gls@first}%
+ \expandafter\@glsmrest\expandafter{\@gls@rest}%
+ \edef\@gls@domfirstuc{\noexpand\@gls@body
+ {\noexpand\glsmakefirstuc\the\@glsmfirst}%
+ \the\@glsmrest}%
+ \@gls@domfirstuc
+ \fi
+ \fi
+ \else
+ \glsmakefirstuc{#1}%
+ \fi
+ \fi
+}
+\def\@gls@split#1#2\@nil{%
+ \def\@gls@first{#1}\def\@gls@rest{#2}%
+}
+\def\@gls@checkcs#1 #2#3\relax{%
+ \def\@gls@argi{#1}\def\@gls@argii{#2}%
+ \ifx\@gls@argi\@gls@argii
+ \@glscstrue
+ \else
+ \@glscsfalse
+ \fi
+}
+\def\@gls@makefirstuc#1{\MakeUppercase #1}
+\newcommand*{\glsmakefirstuc}[1]{\@gls@makefirstuc{#1}}
+\def\@gls@getbody#1#{\def\@gls@body{#1}\@gls@gobbletonil}
+\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}}
+\newcommand*{\xmakefirstuc}[1]{%
+\expandafter\makefirstuc\expandafter{#1}}
+\endinput
+%%
+%% End of file `mfirstuc.sty'.
diff --git a/support/makeglossariesgui/src/tests/old-version-301/old-version-301.tex b/support/makeglossariesgui/src/tests/old-version-301/old-version-301.tex
new file mode 100644
index 0000000000..b31bc39392
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/old-version-301/old-version-301.tex
@@ -0,0 +1,63 @@
+%\documentclass{article}
+\documentclass{beamer}
+
+\usepackage[automake,style=tree]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\newglossaryentry{another}{name={another sample},
+ description={another example}}
+
+\newglossaryentry{long-sample}{name={long sample},
+ description={Lorem ipsum dolor sit amet, consectetuer
+ adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
+ adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
+ libero, nonummy eget, consectetuer id, vulputate a, magna. Donec
+ vehicula augue eu neque. Pellentesque habitant morbi tristique
+ senectus et netus et malesuada fames ac turpis egestas. Mauris ut
+ leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum
+urna
+ fringilla ultrices. Phasellus eu tellus sit amet tortor gravida
+ placerat. Integer sapien est, iaculis in, pretium quis, viverra
+ac,
+ nunc. Praesent eget sem vel leo ultrices bibendum. Aenean
+faucibus.
+ Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla.
+ Curabitur auctor semper nulla. Donec varius orci eget risus. Duis
+ nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
+ eget orci sit amet orci dignissim rutrum. Nam dui ligula,
+fringilla a, euismod sodales,
+ sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus
+ libero, pretium at, lobortis vitae, ultricies et, tellus. Donec
+ aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna,
+ vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit
+ mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla.
+ Cum sociis natoque penatibus et magnis dis parturient montes,
+ nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper
+ vestibulum turpis. Pellentesque cursus luctus mauris. Nulla
+malesuada porttitor diam. Donec felis
+ erat, congue non, volutpat at, tincidunt tristique, libero.
+Vivamus
+ viverra fermentum felis. Donec nonummy pellentesque ante.
+Phasellus
+ adipiscing semper elit. Proin fermentum massa ac quam. Sed diam
+ turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas
+ lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a,
+ ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat
+ lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt purus
+ vel magna. Integer non enim. Praesent euismod nunc eu purus. Donec
+ bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et
+mi.
+ Nam vulputate metus eu enim. Vestibulum pellentesque felis eu
+ massa.}}
+
+\begin{document}
+A \gls{sample} document with a \gls{long-sample}.
+\Gls{another}.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/restricted-doc-defs/restricted-doc-defs.tex b/support/makeglossariesgui/src/tests/restricted-doc-defs/restricted-doc-defs.tex
new file mode 100644
index 0000000000..b0c84cb90d
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/restricted-doc-defs/restricted-doc-defs.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage[docdef=restricted]{glossaries-extra}
+
+\makeglossaries
+
+\begin{document}
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-babel/sample-babel.tex b/support/makeglossariesgui/src/tests/sample-babel/sample-babel.tex
new file mode 100644
index 0000000000..53b251a54b
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-babel/sample-babel.tex
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage[interlingua]{babel}
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-bib2gls-hybrid/sample-bib2gls-hybrid.tex b/support/makeglossariesgui/src/tests/sample-bib2gls-hybrid/sample-bib2gls-hybrid.tex
new file mode 100644
index 0000000000..959712a085
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-bib2gls-hybrid/sample-bib2gls-hybrid.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage[record=alsoindex]{glossaries-extra}
+
+\makeglossaries
+
+\GlsXtrLoadResources[src=example-glossaries-brief]
+
+\begin{document}
+
+\gls{lorem}.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-bib2gls/sample-bib2gls.tex b/support/makeglossariesgui/src/tests/sample-bib2gls/sample-bib2gls.tex
new file mode 100644
index 0000000000..79b4aab5a9
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-bib2gls/sample-bib2gls.tex
@@ -0,0 +1,13 @@
+\documentclass{article}
+
+\usepackage[record]{glossaries-extra}
+
+\GlsXtrLoadResources[src=example-glossaries-brief]
+
+\begin{document}
+
+\gls{lorem}.
+
+\printunsrtglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-fragile/sample-fragile.tex b/support/makeglossariesgui/src/tests/sample-fragile/sample-fragile.tex
new file mode 100644
index 0000000000..67d07f1d63
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-fragile/sample-fragile.tex
@@ -0,0 +1,23 @@
+\batchmode
+\documentclass{beamer}
+
+\usepackage{glossaries}
+
+%\glsnoexpandfields
+
+\makeglossaries
+
+\newglossaryentry{sample}{name=sample,first={\textit{sample}},
+ description={an example}}
+
+\begin{document}
+
+\begin{frame}
+\gls{sample}
+\end{frame}
+
+\begin{frame}
+\printglossary
+\end{frame}
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-german/sample-german.tex b/support/makeglossariesgui/src/tests/sample-german/sample-german.tex
new file mode 100644
index 0000000000..83ae53abca
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-german/sample-german.tex
@@ -0,0 +1,19 @@
+\documentclass{article}
+
+\usepackage[ngerman]{babel}
+\usepackage{glossaries}
+
+\GlsSetQuote{+}% requires glossaries v4.24
+
+\makeglossaries
+
+\newglossaryentry{Uberlingen}{name={{\"U}berlingen},
+ sort={"Uberlingen},
+ description={a place}}
+
+\begin{document}
+
+\gls{Uberlingen}
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-include/gloss.tex b/support/makeglossariesgui/src/tests/sample-include/gloss.tex
new file mode 100644
index 0000000000..4a2d0681e5
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-include/gloss.tex
@@ -0,0 +1,5 @@
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
diff --git a/support/makeglossariesgui/src/tests/sample-include/main.tex b/support/makeglossariesgui/src/tests/sample-include/main.tex
new file mode 100644
index 0000000000..1d4df60998
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-include/main.tex
@@ -0,0 +1,2 @@
+A \gls{sample} document.
+
diff --git a/support/makeglossariesgui/src/tests/sample-include/sample-include.tex b/support/makeglossariesgui/src/tests/sample-include/sample-include.tex
new file mode 100644
index 0000000000..177f901a1a
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-include/sample-include.tex
@@ -0,0 +1,12 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\include{gloss}
+
+\begin{document}
+\include{main}
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1-makeindex.tex b/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1-makeindex.tex
new file mode 100644
index 0000000000..784195827a
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1-makeindex.tex
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+\usepackage[portuguese]{babel}
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{tomorrow}{name={amanhã},description={tomorrow}}
+
+\begin{document}
+\gls{tomorrow}
+
+\printglossary
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1.tex b/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1.tex
new file mode 100644
index 0000000000..2053a64311
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-latin1/sample-latin1.tex
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+\usepackage[portuguese]{babel}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{tomorrow}{name={amanhã},description={tomorrow}}
+
+\begin{document}
+\gls{tomorrow}
+
+\printglossary
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-noidx/sample-noidx.tex b/support/makeglossariesgui/src/tests/sample-noidx/sample-noidx.tex
new file mode 100644
index 0000000000..cd105dc306
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-noidx/sample-noidx.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makenoidxglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printnoidxglossary
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists-xindy.tex b/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists-xindy.tex
new file mode 100644
index 0000000000..fd0a275d79
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists-xindy.tex
@@ -0,0 +1,23 @@
+% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample1}{name={sample1},description={first example}}
+\newglossaryentry{sample2}{name={sample2},description={second example},
+nonumberlist}
+\newglossaryentry{sample3}{name={sample3},description={third example},
+nonumberlist=false
+}
+
+\begin{document}
+\gls{sample1}, \gls{sample2} and \gls{sample3}.
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists.tex b/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists.tex
new file mode 100644
index 0000000000..c341ec2301
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/sample-nonumberlists/sample-nonumberlists.tex
@@ -0,0 +1,21 @@
+% arara: pdflatex
+% arara: makeglossaries
+% arara: pdflatex
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample1}{name={sample1},description={first example}}
+\newglossaryentry{sample2}{name={sample2},description={second example},
+nonumberlist}
+\newglossaryentry{sample3}{name={sample3},description={third example},
+nonumberlist=false
+}
+
+\begin{document}
+\gls{sample1}, \gls{sample2} and \gls{sample3}.
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/unsupported-enc/unsupported-enc.tex b/support/makeglossariesgui/src/tests/unsupported-enc/unsupported-enc.tex
new file mode 100644
index 0000000000..c1d321b3ea
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/unsupported-enc/unsupported-enc.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+
+% makeindex doesn't support UTF-8, so this will break
+\usepackage[style=indexgroup]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{elite}{name={élite},description={select group}}
+
+\begin{document}
+\gls{elite}
+
+\printglossary
+\end{document}
+
diff --git a/support/makeglossariesgui/src/tests/utf8-label/utf8-label.tex b/support/makeglossariesgui/src/tests/utf8-label/utf8-label.tex
new file mode 100644
index 0000000000..f3f7bebc26
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/utf8-label/utf8-label.tex
@@ -0,0 +1,19 @@
+\batchmode
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+% This will fail:
+\newglossaryentry{Ãœberlingen}{name={Ãœberlingen},
+ description={a place}}
+
+\begin{document}
+
+\gls{Ãœberlingen}
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/working-examples/working-sample-makeindex.tex b/support/makeglossariesgui/src/tests/working-examples/working-sample-makeindex.tex
new file mode 100644
index 0000000000..f1a3a6c453
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/working-examples/working-sample-makeindex.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage[colorlinks]{hyperref}
+\usepackage[acronym]{glossaries}
+
+\makeglossaries
+
+\loadglsentries{example-glossaries-brief}
+\loadglsentries[acronym]{example-glossaries-acronym}
+
+\begin{document}
+\glsaddall
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/working-examples/working-sample-xindy.tex b/support/makeglossariesgui/src/tests/working-examples/working-sample-xindy.tex
new file mode 100644
index 0000000000..a77c6e5d71
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/working-examples/working-sample-xindy.tex
@@ -0,0 +1,17 @@
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[colorlinks]{hyperref}
+\usepackage[acronym,xindy]{glossaries}
+
+\makeglossaries
+
+\loadglsentries{example-glossaries-brief}
+\loadglsentries[acronym]{example-glossaries-acronym}
+
+\begin{document}
+\glsaddall
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/wrong-type/wrong-type.tex b/support/makeglossariesgui/src/tests/wrong-type/wrong-type.tex
new file mode 100644
index 0000000000..8ed0605c00
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/wrong-type/wrong-type.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossary[type=acronym]
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/xindy-english/xindy-english.tex b/support/makeglossariesgui/src/tests/xindy-english/xindy-english.tex
new file mode 100644
index 0000000000..5d2cdf8bbb
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/xindy-english/xindy-english.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage[xindy,automake]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{sample}{name={sample},
+ description={an example}}
+
+\begin{document}
+A \gls{sample} document.
+
+\printglossaries
+
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/xindy-german-xetex/xindy-german-xetex.tex b/support/makeglossariesgui/src/tests/xindy-german-xetex/xindy-german-xetex.tex
new file mode 100644
index 0000000000..9fc8912dfe
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/xindy-german-xetex/xindy-german-xetex.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+
+\usepackage{fontspec}
+\usepackage{polyglossia}
+\setmainlanguage[spelling=new]{german}
+\usepackage[xindy]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{Ãœberlingen}{name={Ãœberlingen},
+ description={a place}}
+
+\begin{document}
+
+\gls{Ãœberlingen}
+
+\printglossaries
+\end{document}
diff --git a/support/makeglossariesgui/src/tests/xindy-german/xindy-german.tex b/support/makeglossariesgui/src/tests/xindy-german/xindy-german.tex
new file mode 100644
index 0000000000..f66b60eb34
--- /dev/null
+++ b/support/makeglossariesgui/src/tests/xindy-german/xindy-german.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[ngerman]{babel}
+\usepackage[xindy,automake]{glossaries}
+
+\makeglossaries
+
+\newglossaryentry{Uberlingen}{name={{Ü}berlingen},
+ description={a place}}
+
+\begin{document}
+
+\gls{Uberlingen}
+
+\printglossaries
+\end{document}