diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/glosstex |
Initial commit
Diffstat (limited to 'support/glosstex')
39 files changed, 5117 insertions, 0 deletions
diff --git a/support/glosstex/.depend b/support/glosstex/.depend new file mode 100644 index 0000000000..77a5984707 --- /dev/null +++ b/support/glosstex/.depend @@ -0,0 +1,8 @@ +database.o: database.c glosstex.h config.h error.h list.h database.h \ + labels.h +error.o: error.c glosstex.h config.h error.h list.h +labels.o: labels.c glosstex.h config.h error.h list.h labels.h +list.o: list.c list.h +main.o: main.c glosstex.h config.h error.h list.h database.h labels.h \ + version.h +version.o: version.c diff --git a/support/glosstex/COPYING b/support/glosstex/COPYING new file mode 100644 index 0000000000..e77696ae8d --- /dev/null +++ b/support/glosstex/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey 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) 19yy <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 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. diff --git a/support/glosstex/Changes b/support/glosstex/Changes new file mode 100644 index 0000000000..7e893b2526 --- /dev/null +++ b/support/glosstex/Changes @@ -0,0 +1,72 @@ +$Id: Changes,v 1.6 1997/12/03 18:05:40 volkan Exp $ + +* 0.3 to 0.4 + +- glosstex.mst is now called glosstex.ist. + +- The .glx-file is automatically included \AtBeginDocument to make it + possible to use all commands without actually producing a list. + +- GlossTeX now uses 2 passes to process the .gdf-files. Cross + references should work now properly. + +- Fixed some minor layout problems in the typeset lists. + +- These commands have extended functionality: + + \ac,lparen,rparen,<form>(list)[pageref-mode]{item} + \acf,lparen,rparen,<form>(list)[pageref-mode]{item} + +- new options itemfirst, longfirst, text, footnote, roundparen and + squareparen + +- \AtEndOfDocument, the user is told wether there were undefined terms. + +- There is a new sh-wrapper around glosstex.bin which provides some + kpathsea functionlity + +- The output files .gxg and .gxs are removed if the .gdf-files are + missing. + +- Documentation updated, moving most of the information out of the + READMEs into the .dvi-file. + +- Removed various harmless bugs. + +* 0.2 to 0.3 + +- GlossTeX now supports $n$ independent lists. Default is a glossary + and a list of acronyms. \glosstex{*} and \acronym{*} insert all + terms from the given .gdf-files into the according list, just like + BibTeX's \nocite{*}. Cross references are really usable now, use + \glxref and \glxref* instead of \glosstexxref. GlossTeX is much more + configurable. + +- .gdf-file syntax slightly changed: `%' at BEGINNING OF LINE is + recognized as comment character. A term consists of label, item, + long-form and text which can be accessed within the document in + several ways, just like acronym.sty. + +- now the .aux-file is used instead of the .glo-file. Also, no + \makeglossary is necessary any more. Also works with \include'd + .aux-files caused by \include{foo.tex} + +- package is documented using the `docstrip' utility, LaTeX-source + cleaned up and documentation updated + +- Makefile is now more standard and should also work with non-GNU make + +* 0.1 to 0.2 + +- GlossTeX now works together with nomencl: glosstex.gst is now named + glosstex.ist, \printglosstex includes \glosstexname to produce + glossary heading, \printglosstex uses \jobname.glx instead of + \jobname.gls + +- Documentation updated + + +;;; Local Variables: +;;; mode: indented-text +;;; mode: outline-minor +;;; End: diff --git a/support/glosstex/LIESMICH b/support/glosstex/LIESMICH new file mode 100644 index 0000000000..58a6ab8a54 --- /dev/null +++ b/support/glosstex/LIESMICH @@ -0,0 +1,78 @@ +$Id: README.m4,v 1.5 1997/11/15 14:55:30 volkan Exp $ + + + +* Einleitung + +GlossTeX ist ein Tool für die automatische Erstellung eines +Glossars, Abk"urzungsverzeichnisses oder sortierten Listen im +Allgemeinen. Es wird zusammen mit LaTeX und MakeIndex verwendet. Um +GlossTeX zu compilieren ist ein ANSI C Compiler notwendig. + +GlossTeX kombiniert die Funktionalität von acronym, nomencl und +GloTeX. Es verwendet dasselbe Format f"ur die Glossar-Datenbank wie +GloTeX. Trotzdem kann GlossTeX zusammen mit nomencl verwendet werden. + +Ein Begriff besteht aus einem <label> zur Identifikation, einem +<item> für die Darstellung, einer optionalen ausgeschriebenen Form +(<long-form>) (z.B. bei Abk"urzungen) und einem beschreibenden +Text. Diese Elemente k"onnen innerhalb des Dokumentes auf vielf"altige +Weise angesprochen werden. Au"serdem ist es m"oglich, +Seitenreferenzen sowie Querverweise zwischen Begriffen zu +verwenden. Es sind beliebig viele unabh"angige Listen m"oglich. + +Die aktuellste Version findet sich immer auf +CTAN:/support/glosstex. Inoffizielle Entwicklerversionen sind +evtl. "uber meine Homepage (http://webrum.uni-mannheim.de/ba/yavuzv/) +erhältlich. + +F"ur GlossTeX wird KEINERLEI Gew"ahrleistung "ubernommen. Es +unterliegt der GNU General Public License (siehe Datei COPYING). + + Copyright (C) 1997 Volkan Yavuz + + +* Verwendung + +Folgendes kommt in die LaTeX-Datei: + + \documentclass{article} + \usepackage{glosstex} + \begin{document} + + \printglosstex(acr) + This document is typeset using \gls{LaTeX}. + + The database file\glosstex{gdf-file} for use with + \gls{GlossTeX} is a flat \ac{ASCII} file. + + \printglosstex(glo) + \end{document} + + +Die .gdf-Datei enth"alt die Definitionen der Begriffe, die im Glossar +erscheinen. + + @entry{LaTeX, \LaTeX{}} \LaTeX{} ist ein \TeX{}-Format. + + @entry{ASCII, ASCII, American Standard Code for Information + Interchange} ASCII ist eine Zeichensatzkodierung. Siehe auch + \glxref{EBCDIC}. + + +Um das Glossar zu erstellen, werden latex, glosstex, makeindex und +schlie"slich ein weiteres Mal latex aufgerufen. Es kann n"otig sein, +dies bis zu 4 Mal zu wiederholen, bis alle Referenzen aufgel"ost sind. + + +* Dokumentation + +Vollst"andige Installations- und Gebrauchsanweisungen befinden sich in +glosstex.dvi. + + +* Kommentare + +Bei Anregungen, Kommentaren und sonstigem, bitte Mail an: + + yavuzv@rumms.uni-mannheim.de diff --git a/support/glosstex/Makefile b/support/glosstex/Makefile new file mode 100644 index 0000000000..fc6077d3c8 --- /dev/null +++ b/support/glosstex/Makefile @@ -0,0 +1,155 @@ +# -*- Makefile -*- +# automatically generated from Makefile.m4 + +# ====================================================================== +# you may need to set some of these +# ====================================================================== + + +include Release + +CFLAGS += -Wall -ansi -pedantic + +DEBUG = +THISDIR = ./ + +ifdef DEBUG + CFLAGS += -g + LDFLAGS += -g +endif + + + +M4 = m4 + +LATEXENV = TEXINPUTS=.: +LATEX = $(LATEXENV) latex + +MAKEINDEX = makeindex +GLOSSTEX = $(THISDIR)glosstex$(EXE) +MV = mv +RM = rm -f + + +# ====================================================================== +# you shouldn't need to touch anything below +# ====================================================================== + +TEXAUX = *.aux *.lof *.lot *.log *.toc *.glo +GLOSSTEXAUX = *.gxs *.gxg +MAKEINDEXAUX = *.glg *.glx *.ilg *.ind + +MAKEFILESX=\ + Makefile\ + Makefile.os2\ + Makefile.unx + +READMES=\ + README\ + LIESMICH + +O=\ + database.o\ + error.o\ + labels.o\ + list.o\ + main.o\ + version.o + +DTX=\ + glosstex.sty\ + glosstex.std\ + glosstex.ist\ + glosstex.gdf + +C=$(O:%.o=%.c) + +all: glosstex$(EXE) $(DTX) + +glosstex: $(O) + $(CC) $(LDFLAGS) $(O) $(LOADLIBS) -o $@ + + + +$(DTX): glosstex.dtx glosstex.ins + $(LATEX) glosstex.ins + + +doc: glosstex$(EXE) glosstex.dvi + +glosstex.dvi: $(DTX) glosstex.dtx + +%.dvi: %.dtx + $(LATEX) $< + $(GLOSSTEX) $*.aux $*.gdf + $(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist + $(LATEX) $< + $(GLOSSTEX) $*.aux $*.gdf + $(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist + $(LATEX) $< + +clean: + $(RM) $(O) $(TEXAUX) $(MAKEINDEXAUX) $(GLOSSTEXAUX) $(DTX) *~ + +proper: clean + $(RM) $(GLOSSTEX) glosstex.dvi + +makefiles: $(MAKEFILESX) + +Makefile: Makefile.m4 + $(M4) -P -DMASTER $< > $@ + +Makefile.os2: Makefile.m4 + $(M4) -P -DOSTYPE=OS2 $< > $@ + +Makefile.unx: Makefile.m4 + $(M4) -P -DOSTYPE=UNX $< > $@ + +readmes: $(READMES) + +README: README.m4 + $(M4) -P -DENGLISH $< > README + +LIESMICH: README.m4 + $(M4) -P -DGERMAN $< > LIESMICH + +dist: makefiles dep all $(READMES) doc + @UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown;\ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown;\ + UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown;\ + SYSTEM=$$UNAME_MACHINE-$$UNAME_SYSTEM-$$UNAME_RELEASE;\ + mkdir /tmp/glosstex-$$$$;\ + mkdir /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + cp -rp * .depend /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + pushd /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + rm -rf CVS bin/CVS test;\ + mv glosstex$(EXE) bin/glosstex-$$SYSTEM;\ + $(MAKE) clean;\ + cd ..;\ + tar czf glosstex-$(RELEASE).tar.gz glosstex-$(RELEASE);\ + popd;\ + mv /tmp/glosstex-$$$$/glosstex-$(RELEASE).tar.gz ..;\ + echo released glosstex-$(RELEASE) for $$SYSTEM + +dep: + $(CPP) -MM $(INCDIR) $(C) > .depend + +lint: + lint $(C) + +version.c : Release + $(MV) $@ $@.in + sed < $@.in > $@ -e 's/version .*\\n/version $(RELEASE)\\n/' + $(RM) $@.in + +glosstex.dtx : Release + $(MV) $@ $@.in + sed < $@.in > $@\ + -e 's/\\def\\fileversion{.*}/\\def\\fileversion{$(RELEASE)}/'\ + -e 's/\\def\\filedate{.*}/\\def\\filedate{'`date '+%Y\/%m\/%d'`'}/' + $(RM) $@.in + +ifeq (.depend, $(wildcard .depend)) +include .depend +endif + diff --git a/support/glosstex/Makefile.m4 b/support/glosstex/Makefile.m4 new file mode 100644 index 0000000000..9417a77f4d --- /dev/null +++ b/support/glosstex/Makefile.m4 @@ -0,0 +1,197 @@ +# -*- Makefile -*- +m4_ifelse(1, 1, +# automatically generated from Makefile.m4 +, +# $Id: Makefile.m4,v 1.35 1998/01/06 18:08:49 volkan Exp $ + +# GlossTeX, a tool for the automatic preparation of glossaries. +# Copyright (C) 1997 Volkan Yavuz + +# 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.[,] 675 Mass Ave[,] Cambridge[,] MA 02139[,] USA. + +# Volkan Yavuz[,] yavuzv@rumms.uni-mannheim.de +) +# ====================================================================== +# you may need to set some of these +# ====================================================================== + +m4_changequote([,]) +m4_ifdef([MASTER], +include Release +) +CFLAGS += -Wall -ansi -pedantic + +m4_ifdef([MASTER], +DEBUG = +THISDIR = ./ + +ifdef DEBUG + CFLAGS += -g + LDFLAGS += -g +endif +) +m4_ifelse(OSTYPE, [UNX], +CC = cc +SHELL = /bin/bash +THISDIR = ./ +) +m4_ifelse(OSTYPE, [OS2], +CC = gcc +SHELL = sh +EXE = .exe +EMXBIND = emxbind +) +m4_ifdef([MASTER], +M4 = m4 +) +LATEXENV = TEXINPUTS=.: +LATEX = $(LATEXENV) latex + +m4_ifdef([MASTER], +MAKEINDEX = makeindex +GLOSSTEX = $(THISDIR)glosstex$(EXE) +MV = mv +RM = rm -f +) + +# ====================================================================== +# you shouldn't need to touch anything below +# ====================================================================== + +TEXAUX = *.aux *.lof *.lot *.log *.toc *.glo +GLOSSTEXAUX = *.gxs *.gxg +MAKEINDEXAUX = *.glg *.glx *.ilg *.ind + +m4_ifdef([MASTER], +MAKEFILESX=\ + Makefile\ + Makefile.os2\ + Makefile.unx + +READMES=\ + README\ + LIESMICH +) +O=\ + database.o\ + error.o\ + labels.o\ + list.o\ + main.o\ + version.o + +DTX=\ + glosstex.sty\ + glosstex.std\ + glosstex.ist\ + glosstex.gdf + +C=$(O:%.o=%.c) + +all: glosstex$(EXE) $(DTX) + +glosstex: $(O) + $(CC) $(LDFLAGS) $(O) $(LOADLIBS) -o $@ + +m4_ifelse(OSTYPE, [OS2], +glosstex$(EXE): glosstex + $(EMXBIND) $< + $(EMXBIND) -s $< + $(RM) glosstex +) + +$(DTX): glosstex.dtx glosstex.ins + $(LATEX) glosstex.ins + + +m4_ifdef([MASTER], +doc: glosstex$(EXE) glosstex.dvi + +glosstex.dvi: $(DTX) glosstex.dtx + +%.dvi: %.dtx + $(LATEX) $< + $(GLOSSTEX) $*.aux $*.gdf + $(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist + $(LATEX) $< + $(GLOSSTEX) $*.aux $*.gdf + $(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist + $(LATEX) $< + +clean: + $(RM) $(O) $(TEXAUX) $(MAKEINDEXAUX) $(GLOSSTEXAUX) $(DTX) *~ + +proper: clean + $(RM) $(GLOSSTEX) glosstex.dvi + +makefiles: $(MAKEFILESX) + +Makefile: Makefile.m4 + $(M4) -P -DMASTER $< > $@ + +Makefile.os2: Makefile.m4 + $(M4) -P -DOSTYPE=OS2 $< > $@ + +Makefile.unx: Makefile.m4 + $(M4) -P -DOSTYPE=UNX $< > $@ + +readmes: $(READMES) + +README: README.m4 + $(M4) -P -DENGLISH $< > README + +LIESMICH: README.m4 + $(M4) -P -DGERMAN $< > LIESMICH + +dist: makefiles dep all $(READMES) doc + @UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown;\ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown;\ + UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown;\ + SYSTEM=$$UNAME_MACHINE-$$UNAME_SYSTEM-$$UNAME_RELEASE;\ + mkdir /tmp/glosstex-$$$$;\ + mkdir /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + cp -rp * .depend /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + pushd /tmp/glosstex-$$$$/glosstex-$(RELEASE);\ + rm -rf CVS bin/CVS test;\ + mv glosstex$(EXE) bin/glosstex-$$SYSTEM;\ + $(MAKE) clean;\ + cd ..;\ + tar czf glosstex-$(RELEASE).tar.gz glosstex-$(RELEASE);\ + popd;\ + mv /tmp/glosstex-$$$$/glosstex-$(RELEASE).tar.gz ..;\ + echo released glosstex-$(RELEASE) for $$SYSTEM + +dep: + $(CPP) -MM $(INCDIR) $(C) > .depend + +lint: + lint $(C) + +version.c : Release + $(MV) $@ $@.in + sed < $@.in > $@ -e 's/version .*\\n/version $(RELEASE)\\n/' + $(RM) $@.in + +glosstex.dtx : Release + $(MV) $@ $@.in + sed < $@.in > $@\ + -e 's/\\def\\fileversion{.*}/\\def\\fileversion{$(RELEASE)}/'\ + -e 's/\\def\\filedate{.*}/\\def\\filedate{'`date '+%Y\/%m\/%d'`'}/' + $(RM) $@.in + +ifeq (.depend, $(wildcard .depend)) +include .depend +endif +) diff --git a/support/glosstex/Makefile.os2 b/support/glosstex/Makefile.os2 new file mode 100644 index 0000000000..a69046925b --- /dev/null +++ b/support/glosstex/Makefile.os2 @@ -0,0 +1,65 @@ +# -*- Makefile -*- +# automatically generated from Makefile.m4 + +# ====================================================================== +# you may need to set some of these +# ====================================================================== + + + +CFLAGS += -Wall -ansi -pedantic + + + +CC = gcc +SHELL = sh +EXE = .exe +EMXBIND = emxbind + + +LATEXENV = TEXINPUTS=.: +LATEX = $(LATEXENV) latex + + + +# ====================================================================== +# you shouldn't need to touch anything below +# ====================================================================== + +TEXAUX = *.aux *.lof *.lot *.log *.toc *.glo +GLOSSTEXAUX = *.gxs *.gxg +MAKEINDEXAUX = *.glg *.glx *.ilg *.ind + + +O=\ + database.o\ + error.o\ + labels.o\ + list.o\ + main.o\ + version.o + +DTX=\ + glosstex.sty\ + glosstex.std\ + glosstex.ist\ + glosstex.gdf + +C=$(O:%.o=%.c) + +all: glosstex$(EXE) $(DTX) + +glosstex: $(O) + $(CC) $(LDFLAGS) $(O) $(LOADLIBS) -o $@ + +glosstex$(EXE): glosstex + $(EMXBIND) $< + $(EMXBIND) -s $< + $(RM) glosstex + + +$(DTX): glosstex.dtx glosstex.ins + $(LATEX) glosstex.ins + + + diff --git a/support/glosstex/Makefile.unx b/support/glosstex/Makefile.unx new file mode 100644 index 0000000000..8492c5476f --- /dev/null +++ b/support/glosstex/Makefile.unx @@ -0,0 +1,60 @@ +# -*- Makefile -*- +# automatically generated from Makefile.m4 + +# ====================================================================== +# you may need to set some of these +# ====================================================================== + + + +CFLAGS += -Wall -ansi -pedantic + + +CC = cc +SHELL = /bin/bash +THISDIR = ./ + + + +LATEXENV = TEXINPUTS=.: +LATEX = $(LATEXENV) latex + + + +# ====================================================================== +# you shouldn't need to touch anything below +# ====================================================================== + +TEXAUX = *.aux *.lof *.lot *.log *.toc *.glo +GLOSSTEXAUX = *.gxs *.gxg +MAKEINDEXAUX = *.glg *.glx *.ilg *.ind + + +O=\ + database.o\ + error.o\ + labels.o\ + list.o\ + main.o\ + version.o + +DTX=\ + glosstex.sty\ + glosstex.std\ + glosstex.ist\ + glosstex.gdf + +C=$(O:%.o=%.c) + +all: glosstex$(EXE) $(DTX) + +glosstex: $(O) + $(CC) $(LDFLAGS) $(O) $(LOADLIBS) -o $@ + + + +$(DTX): glosstex.dtx glosstex.ins + $(LATEX) glosstex.ins + + + diff --git a/support/glosstex/README b/support/glosstex/README new file mode 100644 index 0000000000..26f4807a02 --- /dev/null +++ b/support/glosstex/README @@ -0,0 +1,77 @@ +$Id: README.m4,v 1.5 1997/11/15 14:55:30 volkan Exp $ + + +* Introduction + +GlossTeX is a tool for the automatic preparation of glossaries, lists +of acronyms and sorted lists in general for use with LaTeX and +MakeIndex. In order to build GlossTeX, you need an ANSI C +compiler. + +GlossTeX in some kind combines the functionality of acronym, nomencl +and GloTeX. Like GloTeX, it uses the same format glossary definition +files. GlossTeX can be used together with nomencl, nevertheless. + +A term consists of a label which is used to identify it, an optional +typeset representation, an optional long-form (e.g. when it's an +acronym) and the actual text describing it. These elements can all be +accessed in several ways within the document. It is also possible to +place cross-references from one term to another and include +page-references into the produced lists. You can produce as many +independent lists as you like. + +The most recent official release can always be found on +CTAN:/support/glosstex. Inofficial development releases may be found +on my homepage at http://webrum.uni-mannheim.de/ba/yavuzv/. + +GlossTeX comes with absolutely no warranty and is covered by the GNU +General Public License (see the file COPYING). + + Copyright (C) 1997 Volkan Yavuz + + +* Usage + +In your LaTeX-source, type: + + + \documentclass{article} + \usepackage{glosstex} + \begin{document} + + \printglosstex(acr) + This document is typeset using \gls{LaTeX}. + + The database file\glosstex{gdf-file} for use with + \gls{GlossTeX} is a flat \ac{ASCII} file. + + \printglosstex(glo) + \end{document} + +You need a .gdf-file that contains the definitions of the terms you +want to appear in the glossary. For example: + + @entry{LaTeX, \LaTeX{}} \LaTeX{} is a \TeX{}-format. + + @entry{ASCII, ASCII, American Standard Code for Information + Interchange} ASCII is a character encoding. See also + \glxref{EBCDIC}. + + +You then run latex, glosstex, makeindex and latex again to build the +glossary. It may be necessary to use up to 4 iterations until all +references are resolved. + + +* Documentation + +Complete installation instructions and the user manual +can be found in glosstex.dvi. + + +* Comments + +If you have any comments, suggestions, mail me at + + + yavuzv@rumms.uni-mannheim.de diff --git a/support/glosstex/README.emx b/support/glosstex/README.emx new file mode 100644 index 0000000000..9205ccae48 --- /dev/null +++ b/support/glosstex/README.emx @@ -0,0 +1,62 @@ +This is the readme file for the OS/2 binary of Volkan Yavuz's glosstex. +The latest distribution with the sources, makefile (also for OS/2) and +documentation can always be found at the CTAN site near you, for +instance: + + ftp.tex.ac.uk and ftp.dante.de + +and a boatload of mirrors out there like wcarchive.cdrom.com etc. + +The binary was built using gcc version 2.7.1 from the emx09c development +package by Eberhard Mattes. It is at emxfix level 2. +So, in order to run the code you will need at least the emx runtime +library contained in emxrt.zip. + +You may well have that already when you have Eberhard Mattes excellent +emTeX implementation installed. Otherwise get the file emxrt.zip for +instance from ftp-os2.nmsu.edu (hobbes) or ftp-os2.cdrom.com (walnut +creek archive) or ftp.leo.org (LEO archive in Munich, Germany) and +install it according to its readme. + +There are two executables: + + -rwxa-- 65540 Jun 11 12:36 glossteu.exe + -rwxa-- 43800 Jun 10 15:47 glosstex.exe + +The first one is already stripped to reduce its size and runs fine on +OS/2 Warp 3 and Warp 4 and has a good chance to work on OS/2 2.x as +well. It should even work on DOS and, using the rsx DOS extender, +probably even on Windoze (3.1/95/NT). I haven't tested those though and +frankly, I don't really care. It doesn't on CP/M either. Anyway, if you +use this just rename it to glosstex.exe. + +The second binary has been compressed using LXLite version 1.14 which +saves about 23 kB of its size, while keeping all of its functionality. +This is the one I use here. However, it will probably not run on OS/2 +2.x (since support for executable compression was introduced in Warp 3) +and it is almost certain that it won't run on Mickey$oft DOG nor on +Micro$loth Winbloats anymore, even when using the rsx extender. I don't +think that that will matter much since bloated software fits the mindset + +So, have fun, and just in case: The copyright and disclaimers of the +original glosstx distribution apply, you use this at your own risk and +no warranties, explicit or implied are given. + +Have fun! Stefan A. Deutscher (sad@utk.edu) 11-June-1997 + +---------------- + +Note that glossteu.exe (rename it to glosstex.exe) will also run under +vanilla DOG and in OS/2 and a M$ DOG-box using rsx and emxrt, +respectively. They can be found on CTAN, too: + + tex/systems/msdos/dpmigcc/rsx...zip for DOG-boxes + tex/systems/msdos/emtex/emxrsx.zip for DOG-boxes + tex/systems/os2/web2c-6.1/binary/emxrt for OS/2 and vanilla DOG + +Happy TeXing, Volkan Yavuz <yavuzv@rumms.uni-mannheim.de> 1997/06/11 + +;;; Local Variables: +;;; mode: indented-text +;;; mode: outline-minor +;;; End: diff --git a/support/glosstex/README.m4 b/support/glosstex/README.m4 new file mode 100644 index 0000000000..1ce37ca3ab --- /dev/null +++ b/support/glosstex/README.m4 @@ -0,0 +1,144 @@ +$Id: README.m4,v 1.5 1997/11/15 14:55:30 volkan Exp $ + +m4_changequote([,]) +m4_ifdef([ENGLISH], +* Introduction + +GlossTeX is a tool for the automatic preparation of glossaries[,] lists +of acronyms and sorted lists in general for use with LaTeX and +MakeIndex. In order to build GlossTeX[,] you need an ANSI C +compiler. + +GlossTeX in some kind combines the functionality of acronym[,] nomencl +and GloTeX. Like GloTeX[,] it uses the same format glossary definition +files. GlossTeX can be used together with nomencl[,] nevertheless. + +A term consists of a label which is used to identify it[,] an optional +typeset representation[,] an optional long-form (e.g. when it's an +acronym) and the actual text describing it. These elements can all be +accessed in several ways within the document. It is also possible to +place cross-references from one term to another and include +page-references into the produced lists. You can produce as many +independent lists as you like. + +The most recent official release can always be found on +CTAN:/support/glosstex. Inofficial development releases may be found +on my homepage at http://webrum.uni-mannheim.de/ba/yavuzv/. + +GlossTeX comes with absolutely no warranty and is covered by the GNU +General Public License (see the file COPYING). + + Copyright (C) 1997 Volkan Yavuz +) +m4_ifdef([GERMAN], +* Einleitung + +GlossTeX ist ein Tool für die automatische Erstellung eines +Glossars[,] Abk"urzungsverzeichnisses oder sortierten Listen im +Allgemeinen. Es wird zusammen mit LaTeX und MakeIndex verwendet. Um +GlossTeX zu compilieren ist ein ANSI C Compiler notwendig. + +GlossTeX kombiniert die Funktionalität von acronym[,] nomencl und +GloTeX. Es verwendet dasselbe Format f"ur die Glossar-Datenbank wie +GloTeX. Trotzdem kann GlossTeX zusammen mit nomencl verwendet werden. + +Ein Begriff besteht aus einem <label> zur Identifikation[,] einem +<item> für die Darstellung[,] einer optionalen ausgeschriebenen Form +(<long-form>) (z.B. bei Abk"urzungen) und einem beschreibenden +Text. Diese Elemente k"onnen innerhalb des Dokumentes auf vielf"altige +Weise angesprochen werden. Au"serdem ist es m"oglich[,] +Seitenreferenzen sowie Querverweise zwischen Begriffen zu +verwenden. Es sind beliebig viele unabh"angige Listen m"oglich. + +Die aktuellste Version findet sich immer auf +CTAN:/support/glosstex. Inoffizielle Entwicklerversionen sind +evtl. "uber meine Homepage (http://webrum.uni-mannheim.de/ba/yavuzv/) +erhältlich. + +F"ur GlossTeX wird KEINERLEI Gew"ahrleistung "ubernommen. Es +unterliegt der GNU General Public License (siehe Datei COPYING). + + Copyright (C) 1997 Volkan Yavuz +) +m4_ifdef([ENGLISH], +* Usage + +In your LaTeX-source[,] type: +) +m4_ifdef([GERMAN], +* Verwendung + +Folgendes kommt in die LaTeX-Datei: +) + \documentclass{article} + \usepackage{glosstex} + \begin{document} + + \printglosstex(acr) + This document is typeset using \gls{LaTeX}. + + The database file\glosstex{gdf-file} for use with + \gls{GlossTeX} is a flat \ac{ASCII} file. + + \printglosstex(glo) + \end{document} + +m4_ifdef([ENGLISH], +You need a .gdf-file that contains the definitions of the terms you +want to appear in the glossary. For example: + + @entry{LaTeX[,] \LaTeX{}} \LaTeX{} is a \TeX{}-format. + + @entry{ASCII[,] ASCII[,] American Standard Code for Information + Interchange} ASCII is a character encoding. See also + \glxref{EBCDIC}. +) +m4_ifdef([GERMAN], +Die .gdf-Datei enth"alt die Definitionen der Begriffe[,] die im Glossar +erscheinen. + + @entry{LaTeX[,] \LaTeX{}} \LaTeX{} ist ein \TeX{}-Format. + + @entry{ASCII[,] ASCII[,] American Standard Code for Information + Interchange} ASCII ist eine Zeichensatzkodierung. Siehe auch + \glxref{EBCDIC}. +) +m4_ifdef([ENGLISH], +You then run latex[,] glosstex[,] makeindex and latex again to build the +glossary. It may be necessary to use up to 4 iterations until all +references are resolved. +) +m4_ifdef([GERMAN], +Um das Glossar zu erstellen[,] werden latex[,] glosstex[,] makeindex und +schlie"slich ein weiteres Mal latex aufgerufen. Es kann n"otig sein[,] +dies bis zu 4 Mal zu wiederholen[,] bis alle Referenzen aufgel"ost sind. +) +m4_ifdef([ENGLISH], +* Documentation + +Complete installation instructions and the user manual +can be found in glosstex.dvi. +) +m4_ifdef([GERMAN], +* Dokumentation + +Vollst"andige Installations- und Gebrauchsanweisungen befinden sich in +glosstex.dvi. +) +m4_ifdef([ENGLISH], +* Comments + +If you have any comments[,] suggestions[,] mail me at +) +m4_ifdef([GERMAN], +* Kommentare + +Bei Anregungen[,] Kommentaren und sonstigem[,] bitte Mail an: +) + yavuzv@rumms.uni-mannheim.de +m4_ifdef([MASTER], +;;; Local Variables: +;;; mode: indented-text +;;; mode: outline-minor +;;; End: +)
\ No newline at end of file diff --git a/support/glosstex/Release b/support/glosstex/Release new file mode 100644 index 0000000000..ec6db5879c --- /dev/null +++ b/support/glosstex/Release @@ -0,0 +1 @@ +RELEASE=0.4 diff --git a/support/glosstex/TAGS b/support/glosstex/TAGS new file mode 100644 index 0000000000..47d84fde21 --- /dev/null +++ b/support/glosstex/TAGS @@ -0,0 +1,123 @@ + +database.c,227 +enum e_pass e_pass37,1129 + PASS_1 38,1143 + PASS_1 = 0, PASS_2 38,1143 +static unsigned int lineno 41,1172 +read_databases 54,1634 +process_file 76,2187 +process_line 131,3489 +write_line 220,5825 +glo_parse_item 255,7464 + +error.c,58 +#define BUFSIZE 33,1045 +error 36,1072 +printlog 61,1527 + +labels.c,155 +#define KEYWORDSIZE 36,1087 +#define INPUTWORDSIZE 37,1128 +read_labels 44,1298 +find_label 165,4962 +show_unresolved_labels 184,5564 +get_label 204,6052 + +list.c,17 +list_add 31,991 + +main.c,689 +enum e_loglevel loglevel 38,1146 +s_list labels;40,1184 +s_list databases;41,1232 +char *progname 43,1280 +char *inname 45,1339 +char *outname 46,1395 +char *logname 47,1441 +FILE *outfile;49,1484 +FILE *logfile;50,1499 +unsigned int count_label_parsing 52,1515 +unsigned int count_label_defined 53,1574 +unsigned int count_label_override 54,1640 +unsigned int count_label_success 55,1702 +unsigned int count_label_unresolved 56,1754 +unsigned int count_gdf_parsing;58,1820 +unsigned int count_gdf_defined;59,1873 +unsigned int count_gdf_success;60,1932 +char usage[62,1979 +main 70,2266 +parse_commandline 119,3512 +open_files 151,4384 +check_extension 171,4791 +build_filename 189,5180 + +version.c,21 +char version[27,928 + +config.h,99 +#define __CONFIG_H27,945 +#define __USE_FIXED_PROTOTYPES__30,1030 +#define _HAVE_STRERROR_33,1135 + +database.h,28 +#define __DATABASE_H27,950 + +error.h,411 +#define __ERROR_H27,942 +enum e_loglevel e_loglevel29,961 + ERROR 30,979 + ERROR = 0, WARNING,30,979 + ERROR = 0, WARNING, PROGRESS,30,979 + ERROR = 0, WARNING, PROGRESS, INFORMATION,30,979 + ERROR = 0, WARNING, PROGRESS, INFORMATION, VERBOSE,30,979 + ERROR = 0, WARNING, PROGRESS, INFORMATION, VERBOSE, DEBUG30,979 +enum e_output_to e_output_to32,1042 + STDOUT 33,1061 + STDOUT = 1, LOGFILE 33,1061 + +glosstex.h,761 +#define __GLOSSTEX_H28,951 +#define EXIT_FAILURE 36,1071 +#define LINESIZE 39,1102 +#define WORDSIZE 40,1124 +extern enum e_loglevel loglevel;42,1146 +extern s_list labels;44,1180 +extern s_list databases;45,1202 +extern char *inname;47,1228 +extern char *outname;48,1249 +extern char *logname;49,1271 +extern FILE *infile;51,1294 +extern FILE *outfile;52,1315 +extern FILE *logfile;53,1337 +extern char *progname;55,1360 +extern unsigned int count_label_parsing;57,1384 +extern unsigned int count_label_defined;58,1425 +extern unsigned int count_label_override;59,1466 +extern unsigned int count_label_success;60,1508 +extern unsigned int count_gdf_parsing;61,1549 +extern unsigned int count_gdf_defined;62,1588 +extern unsigned int count_gdf_success;63,1627 + +labels.h,286 +#define __LABELS_H27,946 +enum e_label_flag e_label_flag33,1033 + UNRESOLVED 34,1053 + UNRESOLVED = 0, RESOLVED34,1053 +enum e_find_mode e_find_mode36,1083 + FIND_FIRST,37,1102 + FIND_FIRST, FIND_NEXT37,1102 +typedef struct s_label_s s_label_s40,1130 +} s_label;s_label47,1267 + +list.h,260 +#define __LIST_H27,942 +typedef struct s_node_s s_node_s29,960 +} s_node;s_node32,1024 +typedef struct s_list_s s_list_s34,1035 +} s_list;s_list37,1092 +typedef struct s_list_iterator_s s_list_iterator_s39,1103 +} s_list_iterator;s_list_iterator42,1173 + +version.h,55 +#define __VERSION_H27,946 +extern char version[29,967 diff --git a/support/glosstex/TODO b/support/glosstex/TODO new file mode 100644 index 0000000000..861b32bbaa --- /dev/null +++ b/support/glosstex/TODO @@ -0,0 +1,291 @@ +$Id: TODO,v 1.66 1997/12/03 18:08:22 volkan Exp $ + +* BUGS + +** the .gdf-files to be used should be designated within the document + and so put into the .aux-file, not designated on the commandline. + The same way as it is done with BibTeX and \bibliography{foo, + bar}. Problem: this would break the UI. + +* `FEATURES' + +** A Makeindex input line cannot exceed 1024 characters on one side, + but an argument cannot span more than one line. Seems as though we + should have a look at xindy. Another way around this is to change + the makeindex sources (#define ARGUMENT_MAX in mkind.h) and + recompile. This should be noted in the documentation of glosstex. + +** while scanning the input (.aux)-files, glosstex is limited to an + arbitrary number of characters per entry (constant argument to + sscanf). this can be circumvented by using the GNU version of + sscanf, which automatically malloc's the needed memory. + +** LaTeX produces a nasty error `! LaTeX Error: Something's + wrong--perhaps a missing \item.' when the .glx-file is empty. + +* TODO + +** \GLX@output@short and \GLX@output@long both should get called with + <paren> and <form> to allow for greater flexibility. Or + alternatively, provide \GLX@output@short@lt, lf, it, if. That way, + we wouldn't need to parse the <form>-stuff. Just pass <paren>. + +** document all the `.' and `o' that are output. + +** An "Die TeXnische Komödie" article about GlossTeX would be nice. + +** add support for xindy + +* MAYBE + +** include functionality of nomencl, à la include references produced + by \ref and not only \pageref, or eq-ref. problem: too much + features. it's not easy to deterimine the environment we're + currently in. Also, nomencl and glosstex complement each other + well, don't they? + +** include a test-suite with files foo.glx.expect to be able to test + each version during development whether it's still fully + functional. that'd be hard to do, since we expect DVI-files, don't + we? we may produce some expected GXS or GLX files. + +** each list should be able to produce independent lists on + part/chapter/section-level. problem: hard to implement, featurism, + not really necessary. + +** it should be possible to make a list with the terms sorted in order + of appearance. We wouldn't need MakeIndex in this case. This may + lead to a future release which doesn't rely on MakeIndex + anymore. Something like BibTeX which has it's own language for it's + .bst-files. Or reimplement GlossTeX using a .bst for BibTeX. + +* DONE + +** make sure that the following lines don't appear in glosstex.mst + (which btw should really be called glosstex.ist) + + \def\filename{glosstex} + \def\fileversion{0.4a} + \def\filedate{1997/06/12} + \let\docdate=\filedate + +** TDS: glosstex.mst should be called glosstex.ist (which is more + common in the TeX world) and moved to texmf/makeindex + +** Damit die Acronym-expansion funktionieren kann, muß die .glx-Datei + mindestens einmal abgearbeitet werden, auch wenn gar keine Liste + erwünscht ist. Abhilfe: \printglosstex(foo) oder neuen Befehl + \printglosstex* einführen, der keine Ausgabe erzeugt. + + Put something into \AtEndOfPackage{\printglosstex{foobarkazong}} or + better, with \AtBeginDocument + +** use README.m4 as source for README and LICENSE + +** ist ein begriff explizit in irgendeiner liste explizit angefordert, + wird dieser aber per "*" etwa in einer anderen liste auch + angefordert, taucht er dort nicht auf. möglichkeit: wildcards + werden in einem 2. pass eingetragen, da explizite referenzen + priorität haben. 1.37 ist halbwegs korrekte version, bei der dieser + bug noch auftritt. + +** the endmark \glosstexpage := \hfill\page doesn't work reliably. see + thmmarks.sty (I can't seem to find it) and ntheorem.sty for a + better solution. Or avoid this problem at all. There are also some + minor layout problems due to formatting the output. + +** was genau passiert, wenn irgendwelche einträge mit "*" angefordert + werden, dieselben einträge aber auch explizit? in welchen listen + tauchen die ganzen einträge dann auf? Das sollte genauestens + Dokumentiert werden, auch im Source! + + Die Sache ist erledigt. Alles läuft jetzt in 2 passes! Änderungen + v.a. in database.c + + +** (from sad@utk.edu) Die Fu"snotenidee mag ich. Die Package option + auch, aber vielleicht w"urde ich es dennoch als zwei getrennt + erreichbare Versionen implementieren, also z.B. + + \acf (entweder als ' (<item>) <long-form>' oder als + '<long-form> (<item>)', je nach package option, und + entweder im text oder als footnote, je nach package option) + \acft (entweder als ' (<item>) <long-form>' oder + '<long-form> (<item>)', je nach package option, aber im + text) + \acftl (immer als '<long-form> (<item>)' aber im text) + \acfti (immer als '(<item>) <long-form>' aber im text) + \acff (wie \acft{} aber als footnote) + \acffl (wie oben, aber als footnote) + \acffi (wie oben, aber als footnote) + + +Das gibt die gr"o"ste Freiheit f"ur's Formatieren, denn manchmal klingt, +vor allem im Deutschen mit diesen W"ortern, die zwei Kapitel spannen und +immer noch dreizeilige Acronyme produzieren, '<long-form> (<item>)' +einfach traurig, vor allem, wenn 'long-form' irgendwelche grammatischen +Schn"orkel beinhaltet. Hm, Beispiel, an den Haaren herbeigezogen: + + Wir waren in 'Die nordamerikanische Tomatenschlacht' (DNATS) + +klingt trauriger als das meiner Meinung nach bessere jedoch +sich dem glosstex Ansatz entziehende + + Wir waren in der 'nordamerikanischen Tomatenschlacht' (DNATS) + +w"ahrend + + Wir waren in DNATS ('Die nordamerikanische Tomatenschlacht') + +das umgeht ohne den Filmtitel zu ver"andern. + +Da f"allt dann noch eine andere M"oglichkeit f"ur optionen a la +Makeindex auf: Wahlweise 'open quote' 'close quote' Symbole um die +Langform, sagen wir mal per default als blanks wenn vorangestellt und +als '(' und ')' wenn hinten an, aber einstellbar als alles m"ogliche, +z.~B. als die folgenden Paare (einzeln ansprechbar) + + ' ' + " " + ` ` + ` ' + `` '' + ( ) + [ ] + \{ \} + -- -- + --- --- + , , + +oder auch beliebige andere folgen, wie + + (' ') + --- oder ausf"uhrlicher geschreiben, , selbst wenn sich das ziemlich + beschissen liest --- + + +usw. :-) Dann vielleicht noch ein bi"schen Feinkontrolle "uber's +Erscheinungsbild des Textes (sagen wir mal, \textbf{}. \textsc{}. +\text{tt} usw) getrennt f"ur beide Teile, und alle interessanten +M"oglichkeiten sollten ersch"opft sein. Ich f"ande das ganz sch"on, auch +wenn man das nat"urlich schon itzo per Hand mit ein paar Macros machen +kann. (Nat"urlich sollte glosstex dann tcp/ip enabled sein und einen +report per sendmail zu Dir schicken, falls irgendwer au"ser mir +diese Schn"orkel wirklich benutzt :->). + +** in \GLX@do@acf die Klammern () durch Macros ersetzen, abhängig von + <list> + +** removed little bug in database.c that caused failure while parsing + a <long-form> containing a ``,``. + +** there's a strange bug in the Makefile that causes on recursive + invocation of $(MAKE) Makefile.os2 and Makefile.unx to be read + additionally to Makefile. dev only. This should be worth a + bug-report, but first construct this bug on a minimal makefile. + + Oh man, I am so stupid. MAKEFILES is a special variable in + make. RTFM! + + Have a look at the Makefile from doc++ in /usr/local/lib/doc++/src, + especially the "release" target. + +** write a kpathsea sh-wrapper around glosstex.bin to be used with + teTeX + + or + + call MakeIndex from within GlossTeX with exec(). Should also work + with DOS (process.h instead of unistd.h in UNIX). name of MakeIndex + binary should be configureable. in DOS, it's called makeindx, + AFAIK. + + or + + some path searching functionality to find .gdf-files and .mst files + (in combination with the above). maybe a sh-kpathsea-wrapper like + makeindex and makeindex.bin in teTeX? Drawback: only functional + under Unix (so what!). Another solution: combine this with the + kpathsea sh-wrapper, something similar to texi2dvi, which also + calls makeindex and so forth. + + note: kpse is some kind of black magic to me (at least at the + moment), so the instructions below may be complete nonsense, + nonstandard and absolutely ridiculous. but they work for me. + + check wether "kpsetool -v -n glosstex '$GDFINPUTS'" or "kpsetool + -v -n tex '$GDFINPUTS'" do what you want, i.e. their output + should be equal. These won't find your teTeX texmf tree (where + your texmf.cnf file lives) if glosstex is not in something like + teTeX/bin or "teTeX/bin/foo-bar". in these cases, replace + "TETEXDIR = $SELFAUTOPARENT" in texmf.cnf with something like + "TETEXDIR = /usr/local/lib/teTeX". this makes sure that the + proper texmf tree is found, even if glosstex is not in the teTeX + texmf tree but in your local TeX tree. + + You also need symbolic links from + /usr/local/lib/localTeX/texmf.cnf to your teTeX texmf.cnf. This + is because kpatsea looks for texmf.cnf in the tree where the + binary was found. + +** when glosstex is called with non-existant files, the output files + .gxg and gxs are created nevertheless. Maybe we should unlink them + before exiting? + +** do some stuff with autoconf and automake to automatically generate + glosstex-i486-unknown-linux binaries for distrib. + + done this with uname -something. + +** parenl und parenr auch auf item-ebene festlegen. done using + \ac,lparen,rparen,<form>(list)[pageref-mode]{item} + +** \newcommand{\glosstexgroup} for use with lethead_prefix in + MakeIndex, similar to \nomgroup. not really necessary. what is this + good for, anyhow? + + This wont work, since glosstex produces list_item, to embed all + items from all lists into one list for makeindex. makeindex would + only recognize a new group based on the first letter or the list, + which is not what we want. + +** some macros have to be declared \long (\newcommand*) to be able to + accept whole paragraphs as arguments. Especially those who define + the begin environment stuff + +** update documentation. new user-level commands: + + options: itemfirst, longfirst, text, footnote, roundparen, + squareparen + + <i> : item/short-form first oder <l>: long-form first + <t> : inline in text oder <g>: as footnote + + new commands: + \ac<form>(list)[pageref-mode]{item} + \acf<form>(list)[pageref-mode]{item} + + glxitemorderdefault[list]{i|l}, glxitemplacementdefault[list]{t|f}, + glxparendefault[list]{left}{right} + +** clean up the documentation: + + use more logical markup in documentation instead of visual. also + make the documentation and source more consistent with respect to + terminology ** check that at EOL, there is always a % in .dtx + + document each macro in dtx, especially the arguments + +** move most of the info from the READMES into the main + documentation. The README should only contain the most basic idea + on what glosstex is. + +** \AtEndOfDocument tell user, that there were undefined terms and + that she should run glosstex. + +** contact the maintainer of the latex catalogue + +;;; Local Variables: +;;; mode: indented-text +;;; mode: outline-minor +;;; End: diff --git a/support/glosstex/bin/README.emx b/support/glosstex/bin/README.emx new file mode 100644 index 0000000000..2849633df9 --- /dev/null +++ b/support/glosstex/bin/README.emx @@ -0,0 +1,64 @@ +This is the readme file for the OS/2 binary of Volkan Yavuz's glosstex. +The latest distribution with the sources, makefile (also for OS/2) and +documentation can always be found at the CTAN site near you, for +instance: + + ftp.tex.ac.uk and ftp.dante.de + +and a boatload of mirrors out there like wcarchive.cdrom.com etc. + +The binary was built using gcc version 2.7.1 from the emx09c development +package by Eberhard Mattes. The used installation is at emxfix level 2. +So, in order to run the code you will need at least the emx runtime +library contained in emxrt.zip. + +You may well have that already when you have Eberhard Mattes excellent +emTeX implementation installed. Otherwise get the file emxrt.zip for +instance from ftp-os2.nmsu.edu (hobbes) or ftp-os2.cdrom.com (walnut +creek archive) or ftp.leo.org (LEO archive in Munich, Germany) and +install it according to its readme. + +There are two executables in the bin directory, simply rename the one +you are going to use to glosstex.exe and move it in a directory in your +PATH: + +-rwxa-- 65540 Feb 6 00:40 bin/glossteu-i386-os2-4.0.exe* +-rwxa-- 44127 Feb 6 00:40 bin/glosstex-i386-os2-4.0.exe* + +The first one is already stripped to reduce its size and runs fine on +OS/2 Warp 3 and Warp 4 and has a good chance to work on OS/2 2.x as +well. It should even work on DOS and, using the rsx DOS extender, +probably even on Windoze (3.1/95/NT). I haven't tested those though and +frankly, I don't really care. It doesn't on CP/M either. + +The second binary has been compressed using LXLite version 1.14 which +saves about 20 kB of its size, while keeping all of its functionality. +This is the one I use here. However, it will probably not run on OS/2 +2.x (since support for executable compression was introduced in Warp 3) +and it is almost certain that it won't run on Mickey$oft DOG nor on +Micro$loth Winbloats anymore, even when using the rsx extender. I don't +think that that will matter much since bloated software fits the mindset +of M$ and its customers better anyway. + +So, have fun, and just in case: The copyright and disclaimers of the +original glosstx distribution apply, you use this at your own risk and +no warranties, explicit or implied are given. + +Have fun! Stefan A. Deutscher (sad@utk.edu) 06-Feb-1998 + +---------------- + +Note that glossteu.exe (rename it to glosstex.exe) will also run under +vanilla DOG and in OS/2 and a M$ DOG-box using rsx and emxrt, +respectively. They can be found on CTAN, too: + + tex/systems/msdos/dpmigcc/rsx...zip for DOG-boxes + tex/systems/msdos/emtex/emxrsx.zip for DOG-boxes + tex/systems/os2/web2c-6.1/binary/emxrt for OS/2 and vanilla DOG + +Happy TeXing, Volkan Yavuz <yavuzv@rumms.uni-mannheim.de> 1997/06/11 + +;;; Local Variables: +;;; mode: indented-text +;;; mode: outline-minor +;;; End: diff --git a/support/glosstex/bin/glosstex-i486-Linux-2.0.30 b/support/glosstex/bin/glosstex-i486-Linux-2.0.30 Binary files differnew file mode 100755 index 0000000000..d016241ee7 --- /dev/null +++ b/support/glosstex/bin/glosstex-i486-Linux-2.0.30 diff --git a/support/glosstex/bin/glosstex-i486-msdos-6.2 b/support/glosstex/bin/glosstex-i486-msdos-6.2 Binary files differnew file mode 100755 index 0000000000..dcbee7de10 --- /dev/null +++ b/support/glosstex/bin/glosstex-i486-msdos-6.2 diff --git a/support/glosstex/bin/glosstex-sun4c-SunOS-4.1.3 b/support/glosstex/bin/glosstex-sun4c-SunOS-4.1.3 Binary files differnew file mode 100755 index 0000000000..4b017b5663 --- /dev/null +++ b/support/glosstex/bin/glosstex-sun4c-SunOS-4.1.3 diff --git a/support/glosstex/bin/glosstex-sun4u-SunOS-5.5.1 b/support/glosstex/bin/glosstex-sun4u-SunOS-5.5.1 Binary files differnew file mode 100755 index 0000000000..f875bc0c6f --- /dev/null +++ b/support/glosstex/bin/glosstex-sun4u-SunOS-5.5.1 diff --git a/support/glosstex/config.h b/support/glosstex/config.h new file mode 100644 index 0000000000..c71a6ddb0c --- /dev/null +++ b/support/glosstex/config.h @@ -0,0 +1,45 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: config.h,v 1.5 1997/12/24 18:11:11 volkan Exp $ */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* needed for some of the includes that came with gcc-2.7.2.1 */ +#define __USE_FIXED_PROTOTYPES__ + +/* set this to 1 if your libc has strerror (defined in string.h) + otherwise, we may go along with extern char* sys_errlist[] + this is necessary on SunOS 4.1.3 which has no strerror */ +#define _HAVE_STRERROR_ 1 + +/* set this to 1 if your libc has an ANSI C conforming int + fflush(FILE* fp). ANSI C conforming in this case means that fflush + should be able a accept a NULL pointer which causes all open + streams to be flushed instead of just fp. If your libc isn't ANSI + conforming (like e.g. SunOS 4.1.3) passing fflush a NULL pointer + will cause a core dump. */ +#define _HAVE_ANSI_C_FFLUSH_ 1 + +#endif /* not __CONFIG_H */ diff --git a/support/glosstex/database.c b/support/glosstex/database.c new file mode 100644 index 0000000000..594aac8219 --- /dev/null +++ b/support/glosstex/database.c @@ -0,0 +1,335 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: database.c,v 1.45 1997/12/13 16:06:54 volkan Exp $ */ + +#include "glosstex.h" +#include "database.h" +#include "error.h" +#include "list.h" +#include "labels.h" +#include <assert.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> + +enum e_pass { + PASS_1 = 0, PASS_2 = 1 +}; + +static unsigned int lineno = 0; + +static void process_file (enum e_pass pass, FILE * infile, char *inname); +static void process_line (enum e_pass pass, char *inname, char *line); +static void write_line (FILE * outfile, + char* inname, + char *list, char *label, char *item, char *longform, + char *line, char *list_mode, char *pageref_mode, + char *page); +static int glo_parse_item (char *line, char *label, + char *item, char *longform, int *ptr); + +void +read_databases (void) +{ + FILE *dbfile; + enum e_pass pass = PASS_1; + s_node *filename = databases.root; + + for (pass = PASS_1; pass <= PASS_2; pass++) { + while (filename != 0) { + if ((dbfile = fopen (filename->ptr, "r")) == NULL) { + error ("database %s", (char *) filename->ptr); + } else { + printlog (PROGRESS, STDOUT, "(%s ", (char *) filename->ptr); + process_file (pass, dbfile, (char *) filename->ptr); + printlog (PROGRESS, STDOUT, ")"); + } + filename = filename->next; + } + filename = databases.root; + } +} + +static void +process_file (enum e_pass pass, FILE * dbfile, char *inname) +{ + enum e_state { + HEADER, BODY + }; + + int status; + char buf[LINESIZE]; + enum e_state state = HEADER; + char *line = 0; + + while (fgets (buf, LINESIZE, dbfile) != 0) { + if (buf[strlen (buf) - 1] == '\n') + lineno++; + + status = strncmp (buf, "@entry{", 7); + if ((state == HEADER) && (status != 0)) { + ; /* ignore heading garbage */ + } else { + state = BODY; + if (status == 0) { /* begin new entry */ + + /* process current entry before starting new entry */ + if (line != 0) { + process_line (pass, inname, line); + free (line); + } + line = (char *) malloc (strlen (buf) + 1); + assert (line != 0); + strcpy (line, buf); + + if (line[strlen (line) - 1] == '\n') + line[strlen (line) - 1] = ' '; + + } else if (strncmp (buf, "%", 1) == 0) { + ; /* skip comments */ + } else { /* add lines to current entry */ + size_t len = strlen (line); /* LINT: null is ok here */ + line = (char *) realloc (line, len + strlen (buf) + 1); + assert (line != 0); + strcpy (&line[len], buf); + if (line[strlen (line) - 1] == '\n') + line[strlen (line) - 1] = ' '; + } + } + } + + /* process last pending line in file */ + if (line != 0) { + process_line (pass, inname, line); + free (line); + } +} + +static void +process_line (enum e_pass pass, char *inname, char *line) +{ + char label[LINESIZE]; + char item[LINESIZE]; + char longform[LINESIZE]; + size_t index; + int ptr = 0; + s_list_iterator iter; + s_list_iterator iter2; + s_label *node; + s_label *node2; + + iter.root = labels.root; + iter.current = labels.root; + iter2.root = labels.root; + iter2.current = labels.root; + + if (glo_parse_item (line, label, item, longform, &ptr) != 0) { + printlog (PROGRESS, STDOUT, "x"); + printlog (WARNING, LOGFILE, "\n%s:%u parse error: %s", + inname, lineno, line); + count_gdf_parsing++; + return; + } + /* remove all trailing spaces */ + index = strlen (&line[ptr]); + index--; + + while (line[ptr + index] == ' ') { + line[ptr + index] = '\0'; + index--; + } + + switch (pass) { + case PASS_1: + /* is there a reference to <label> in any list? */ + node = find_label (&iter, FIND_FIRST, label, 0); + + if (node != 0) { + /* explicit reference to <label> found + process references to <label> in each <list> */ + while (node != 0) { + switch ((enum e_label_flag) node->flag) { + case UNRESOLVED: + write_line (outfile, inname, + node->list, label, item, longform, &line[ptr], + node->list_mode, node->pageref_mode, node->page); + node->flag = RESOLVED; + break; + + case RESOLVED: + printlog (PROGRESS, STDOUT, "i"); + printlog (INFORMATION, LOGFILE, + "\n%s:%u %s already resolved", + inname, lineno, label); + count_gdf_defined++; + break; + } + node = find_label (&iter, FIND_NEXT, label, 0); + } + } + break; + case PASS_2: + /* now look for wildcard in any list */ + node = find_label (&iter, FIND_FIRST, "*", 0); + + if (node == 0) { + printlog (PROGRESS, STDOUT, "."); + printlog (DEBUG, LOGFILE, "\n%s:%u %s@%s(%s) not needed", + inname, lineno, label, item, longform); + } else { + /* check for wildcard in every list */ + while (node != 0) { + /* wurde <label> in <node->list> schon explicit angefordert? */ + if ((node2 = + find_label (&iter2, FIND_FIRST, label, node->list)) == 0) { + write_line (outfile, inname, + node->list, label, item, longform, &line[ptr], + node->list_mode, node->pageref_mode, node->page); + node->flag = RESOLVED; + } + node = find_label (&iter, FIND_NEXT, "*", 0); + } + } + break; + } +} + +static void +write_line (FILE * outfile, + char* inname, + char *list, char *label, char *item, char *longform, + char *line, char *list_mode, char *pageref_mode, char *page) +{ + fprintf (outfile, + "\\GlossTeXEntry{%s%s@{%s}{%s}{%s}{%s}{%s}{%s}" + "{\\GlossTeXPage{%s}{%s}}|GlossTeXNull}{0}\n", + list, label, label, item, longform, line, + list, list_mode, pageref_mode, page); + printlog (PROGRESS, STDOUT, "o"); + printlog (VERBOSE, LOGFILE, "\n%s:%u %s@%s(%s) used *", + inname, lineno, label, item, longform); + count_gdf_success++; +} + +/* #module GloScan "2-001" + *********************************************************************** + * * + * The software was developed at the Monsanto Company and is provided * + * "as-is". Monsanto Company and the auther disclaim all warranties * + * on the software, including without limitation, all implied warran- * + * ties of merchantabilitiy and fitness. * + * * + * This software does not contain any technical data or information * + * that is proprietary in nature. It may be copied, modified, and * + * distributed on a non-profit basis and with the inclusion of this * + * notice. * + * * + *********************************************************************** + */ + +/* this has been slightly modified by volkan yavuz 1996/12/18 */ + +static int +glo_parse_item (char *line, char *label, char *item, char *longform, int *ptr) +{ + int i, brace; + char x; + + /* Copy the label to the output string. */ + i = 0; + brace = 1; + *ptr = 7; + while (1) { + x = line[(*ptr)++]; + if (x == '\0') + return 1; + if (x == '{') + if (line[*ptr - 2] != '\\') + brace++; + if (x == '}') { + if (line[*ptr - 2] != '\\') + brace--; + if (brace <= 0) + break; + } + if (x == ',') + break; + label[i++] = x; + } + label[i] = '\0'; + + /* Find the beginning of the item string. */ + while (isspace (line[*ptr]) != 0) + (*ptr)++; + + /* Copy the item to the output string. */ + i = 0; + while (brace > 0) { + x = line[(*ptr)++]; + if (x == '\0') + return 1; + if (x == '{') + if (line[*ptr - 2] != '\\') + brace++; + if (x == '}') { + if (line[*ptr - 2] != '\\') + brace--; + if (brace <= 0) + break; + } + if (x == ',') + break; + item[i++] = x; + } + item[i] = '\0'; + + /* Check to see if the item is missing. If it is, default to the label. */ + if (i == 0) + (void) strcpy (item, label); /* FIXME: lint code error */ + + while (isspace (line[*ptr]) != 0) + (*ptr)++; + + /* Copy the long-form to the output string. */ + i = 0; + while (brace > 0) { + x = line[(*ptr)++]; + if (x == '\0') + return 1; + if (x == '{') + if (line[*ptr - 2] != '\\') + brace++; + if (x == '}') { + if (line[*ptr - 2] != '\\') + brace--; + if (brace <= 0) + break; + } + longform[i++] = x; + } + longform[i] = '\0'; + + return 0; /* it's all ok */ +} diff --git a/support/glosstex/database.h b/support/glosstex/database.h new file mode 100644 index 0000000000..b2ee71763e --- /dev/null +++ b/support/glosstex/database.h @@ -0,0 +1,33 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: database.h,v 1.11 1997/06/02 17:58:12 yavuzv Exp $ */ + +#ifndef __DATABASE_H +#define __DATABASE_H + +#include <stdio.h> + +void read_databases (void); + +#endif /* not __DATABASE_H */ diff --git a/support/glosstex/error.c b/support/glosstex/error.c new file mode 100644 index 0000000000..508d17bfd7 --- /dev/null +++ b/support/glosstex/error.c @@ -0,0 +1,79 @@ +/* -*- c-*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: error.c,v 1.16 1997/12/24 18:09:18 volkan Exp $ */ + +#include "glosstex.h" +#include "error.h" +#include <errno.h> +#include <stdarg.h> +#include <stdio.h> +#include <string.h> + +#define BUFSIZE 4096 + +extern char* sys_errlist[]; + +void +error (const char *fmt,...) +{ + char buf[BUFSIZE]; + int errno_save = errno; + + va_list ap; + va_start (ap, fmt); + + sprintf (buf, "\n%s: ", progname); + (void) vsprintf (buf + strlen (buf), fmt, ap); + +#if _HAVE_STRERROR_ + sprintf (buf + strlen (buf), ": %s\n", strerror (errno_save)); +#else + sprintf (buf + strlen (buf), ": %s\n", sys_errlist[errno_save]); +#endif + + (void) fflush (stdout); + (void) fputs (buf, stderr); + +#if _HAVE_ANSI_C_FFLUSH_ + (void) fflush (0); /* flush all streams */ +#else + (void) fflush (stdout); + (void) fflush (stderr); +#endif + + va_end (ap); +} + +void +printlog (enum e_loglevel level, int output_to, const char *fmt,...) +{ + va_list ap; + va_start (ap, fmt); + + if ((level <= loglevel) && (output_to & STDOUT)) + (void) vfprintf (stdout, fmt, ap); + + if ((level <= loglevel + 1) && (output_to & LOGFILE)) + (void) vfprintf (logfile, fmt, ap); +} diff --git a/support/glosstex/error.h b/support/glosstex/error.h new file mode 100644 index 0000000000..fbef6f2bed --- /dev/null +++ b/support/glosstex/error.h @@ -0,0 +1,39 @@ +/* -*- c-*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: error.h,v 1.8 1997/06/09 19:54:10 yavuzv Exp $ */ + +#ifndef __ERROR_H +#define __ERROR_H + +enum e_loglevel { + ERROR = 0, WARNING, PROGRESS, INFORMATION, VERBOSE, DEBUG +}; +enum e_output_to { + STDOUT = 1, LOGFILE = 2 +}; + +void error (const char *fmt,...); +void printlog (enum e_loglevel, int output_to, const char *fmt,...); + +#endif /* not __ERROR_H */ diff --git a/support/glosstex/glosstex.aux.bak b/support/glosstex/glosstex.aux.bak new file mode 100644 index 0000000000..8efda6115a --- /dev/null +++ b/support/glosstex/glosstex.aux.bak @@ -0,0 +1,73 @@ +\relax +\GLX@newterm{ASCII}{ASCII}{American Standard Code for Information Interchange} +\GLX@newterm{EBCDIC}{EBCDIC}{Extended Binary Coded Decimals Interchange Code} +\GLX@newterm{gdf-file}{\texttt {.gdf}-file}{} +\GLX@newterm{glg-file}{\texttt {.glg}-file}{} +\GLX@newterm{glx-file}{\texttt {.glx}-file}{} +\GLX@newterm{gxg-file}{\texttt {.gxg}-file}{} +\GLX@newterm{gxs-file}{\texttt {.gxs}-file}{} +\GLX@newterm{ist-file}{\texttt {.ist}-file}{} +\GLX@newterm{ASCII}{ASCII}{American Standard Code for Information Interchange} +\GLX@entry{EBCDIC}{n}{acr}{a}{2} +\GLX@newterm{EBCDIC}{EBCDIC}{Extended Binary Coded Decimals Interchange Code} +\GLX@entry{ASCII}{n}{acr}{a}{2} +\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{2}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Purpose}{2}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}History}{2}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Legalise}{3}} +\@writefile{toc}{\contentsline {section}{\numberline {2}Building and Installation}{3}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}A Goodie for \textrm {te}T\kern -.1667em\lower .5ex\hbox {E}\kern -.125emX\spacefactor \@m {} User}{3}} +\@writefile{toc}{\contentsline {section}{\numberline {3}Usage}{4}} +\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Package options.}}{4}} +\newlabel{tab:options}{{1}{4}} +\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Overview of the different sets of commands.}}{5}} +\newlabel{tab:commands}{{2}{5}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}The Glossary Definition File}{5}} +\GLX@entry{gdf-file}{p}{glo}{a}{5} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Invocation}{6}} +\GLX@entry{gxs-file}{p}{glo}{a}{7} +\GLX@entry{gxg-file}{p}{glo}{a}{7} +\GLX@entry{glx-file}{p}{glo}{a}{7} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Page References}{7}} +\newlabel{sec:page_references}{{3.3}{7}} +\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Options controlling the appearance of page references.}}{8}} +\newlabel{tab:references}{{3}{8}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}The Appearance of \meta {full}}{8}} +\newlabel{sec:format}{{3.4}{8}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4.1}The \meta {order} of \meta {item}s}{8}} +\newlabel{sec:order}{{3.4.1}{8}} +\@writefile{lot}{\contentsline {table}{\numberline {4}{\ignorespaces Options controlling \meta {item-order}.}}{8}} +\newlabel{tab:item-order}{{4}{8}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4.2}Placement of footnotes and \meta {form}}{8}} +\newlabel{sec:footnotes}{{3.4.2}{8}} +\@writefile{lot}{\contentsline {table}{\numberline {5}{\ignorespaces Options controlling \meta {item-placement}.}}{9}} +\newlabel{tab:item-placement}{{5}{9}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4.3}Encapsulation}{9}} +\newlabel{sec:parentheses}{{3.4.3}{9}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Cross-References}{9}} +\GLX@entry{ASCII}{n}{acr}{a}{9} +\GLX@entry{EBCDIC}{n}{acr}{n}{9} +\GLX@entry{ASCII}{n}{acr}{a}{9} +\GLX@entry{EBCDIC}{n}{acr}{n}{9} +\GLX@entry{ASCII}{n}{acr}{a}{9} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.6}GlossT\kern -.1667em\lower .5ex\hbox {E}\kern -.125emX\spacefactor \@m {} and \textsf {nomencl}}{9}} +\@writefile{toc}{\contentsline {section}{\numberline {4}Customizing}{10}} +\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Global}{10}} +\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Local}{11}} +\newlabel{sec:customizing_local}{{4.2}{11}} +\@writefile{toc}{\contentsline {section}{\numberline {5}Some Details}{12}} +\@writefile{toc}{\contentsline {section}{\numberline {6}Acknowledgments}{12}} +\@writefile{toc}{\contentsline {section}{\numberline {7}The Implementation}{12}} +\@writefile{toc}{\contentsline {subsection}{\numberline {7.1}The Package \textsf {glosstex.sty}}{12}} +\@writefile{toc}{\contentsline {subsection}{\numberline {7.2}The \textsc {MakeIndex}{} Style-File \texttt {glosstex.ist}}{25}} +\GLX@entry{ist-file}{p}{glo}{a}{25} +\GLX@newterm{ASCII}{ASCII}{American Standard Code for Information Interchange} +\GLX@newterm{EBCDIC}{EBCDIC}{Extended Binary Coded Decimals Interchange Code} +\GLX@newterm{gdf-file}{\texttt {.gdf}-file}{} +\GLX@newterm{glg-file}{\texttt {.glg}-file}{} +\GLX@entry{gxg-file}{n}{glo}{a}{26} +\GLX@newterm{glx-file}{\texttt {.glx}-file}{} +\GLX@newterm{gxg-file}{\texttt {.gxg}-file}{} +\GLX@entry{glg-file}{n}{glo}{a}{26} +\GLX@newterm{gxs-file}{\texttt {.gxs}-file}{} +\GLX@newterm{ist-file}{\texttt {.ist}-file}{} diff --git a/support/glosstex/glosstex.cfg b/support/glosstex/glosstex.cfg new file mode 100644 index 0000000000..3f59b74a40 --- /dev/null +++ b/support/glosstex/glosstex.cfg @@ -0,0 +1,62 @@ +%% +%% This is file `glosstex.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% glosstex.dtx (with options: `cfg') +%% +%% GlossTeX, a tool for the automatic preparation of glossaries. +%% Copyright (C) 1997 Volkan Yavuz +%% +%% 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%% +%% Volkan Yavuz, yavuzv@rumms.uni-mannheim.de +%% +%% Please note, that if you modify these files, do NOT distribute them +%% unless you have renamed the files and clearly stated, WHO has +%% modified the file and WHAT was modified. +%% +%% You are explicitly allowed to modify the file "`glosstex.std"' to +%% incorporate site-specific modifications. But do NOT distribute that +%% file unless you have renamed it and clearly stated, WHO has +%% modified the file and WHAT was modified. +%% +%% \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 \~} +%% +\def\filename{glosstex} +\def\fileversion{0.4} +\def\filedate{1997/12/13} +\let\docdate=\filedate +\renewcommand{\GLX@output@short}[3]{% + \ifthenelse{\equal{#2}{\GLX@acdef@list}}{% + \textsc{#3}}{#3}\index{#1=#3}} +\endinput +%% +%% End of file `glosstex.cfg'. diff --git a/support/glosstex/glosstex.dtx b/support/glosstex/glosstex.dtx new file mode 100644 index 0000000000..0a1c20e8de --- /dev/null +++ b/support/glosstex/glosstex.dtx @@ -0,0 +1,1769 @@ +% \iffalse -*- latex -*- +% +% $Id: glosstex.dtx,v 1.57 1997/12/24 18:48:47 volkan Exp $ +% +% GlossTeX, a tool for the automatic preparation of glossaries. +% Copyright (C) 1997 Volkan Yavuz +% +% 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., 675 Mass Ave, Cambridge, MA 02139, USA. +% +% Volkan Yavuz, yavuzv@rumms.uni-mannheim.de +% +%% \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 \~} +%% +%<*!ist> +\def\filename{glosstex} +\def\fileversion{0.4} +\def\filedate{1997/12/13} +\let\docdate=\filedate +%</!ist> +%<*driver> +\documentclass{ltxdoc} +\usepackage{array} +\usepackage{glosstex} + +\OnlyDescription +\CodelineIndex +%\EnableCrossrefs + +\setlength{\arrayrulewidth}{0.4pt} +\setlength{\doublerulesep}{0pt} + +\newcommand{\GloTeX}{Glo\TeX} +\newcommand{\MakeIndex}{\textsc{MakeIndex}} +\newcommand{\unix}{\textsc{Unix}} +\newcommand{\package}[1]{\textsf{#1}} +\newcommand{\file}[1]{\texttt{#1}} +\newcommand{\opt}[1]{$[$#1$]$} +\newcommand{\teTeX}{\textrm{te}\TeX} + +\newenvironment{definition}{\begin{quote}}{\end{quote}} +\newenvironment{example}{\begin{quote}}{\end{quote}} + +\begin{document} +\DocInput{glosstex.dtx} +%\PrintIndex +\end{document} +%</driver> +% +% \fi +% +% \CheckSum{1369} +% +% \title{\GlossTeX{} \fileversion} +% \author{\scshape Volkan Yavuz\footnote{e-mail: yavuzv@rumms.uni-mannheim.de}} +% \date{\filedate} +% \maketitle +% +% \begin{abstract} +% \GlossTeX{} is a tool for the preparation of glossaries, lists of +% acronyms or sorted lists in general. It greatly +% simplifies this task. One or more glossary-definition files serve as +% databases which contain descriptions of terms. These terms are +% identified through labels. Based upon labels set into the +% \TeX{}-source, \GlossTeX{} determines which entries have to appear in +% the typeset list. \GlossTeX{} uses \MakeIndex{} for the sorting of the +% lists. References to the place where a term appears in the text +% can be set in the list. A term consists of a label which is +% used to identify it, an optional item describing the typeset +% output, an optional long-form and the actual text representing +% it. There are many ways to access each of these fields within +% the document. It is also possible to generate cross-references +% to another term. \GlossTeX{} is well customizable in respect to +% the produced output. +% \end{abstract} +% +% \tableofcontents +% \listoftables +% \printglosstex(acr) +% +% \section{Introduction} +% \subsection{Purpose} +% \GlossTeX{} is a tool for the automatic preparation of glossaries, +% lists of acronyms, nomenclature and sorted lists in general. Based +% upon the labels set into the \TeX{}-source, \GlossTeX{} determines +% which entries from a glossary-definition file have to be processed +% to generate the list. \GlossTeX{} then creates an intermediate file +% that has to be processed by \MakeIndex{} for sorting. The output of +% \MakeIndex{} is then included into the \TeX{}-source for +% typesetting. With each term associated is an item representing the +% typeset output, an optional long-form if it's an acronym and an +% optional descriptive text. These elements can all be accessed within +% the document in many ways. +% +% \subsection{History} +% I created \GlossTeX{} because there were no tools for the +% preparation of glossaries that fit my needs. \GlossTeX{} is mainly a +% combination of the features of the packages \package{acronym}, +% \package{nomencl} and \GloTeX{}. The commands starting with |\ac| +% are taken more or less directly from \package{acronym} and the way +% \GlossTeX{} handles page references is almost identical to the way +% \package{nomencl} does. The use of glossary databases is inspired by +% \GloTeX{}. +% +% \subsection{Legalise} +% \GlossTeX{} is provided ``as is'' and comes with absolutely no +% warranty. It is covered by the GNU General Public License (see the +% file |COPYING| that comes with this package). +% +% \begin{center} +% \noindent\copyright\ Volkan Yavuz, 1997 +% \end{center} +% +% \section{Building and Installation} +% First, you need to build glosstex from its C sources. Note that you +% need an ANSI C compiler. If you have +% MAKE and a decent OS (speak \unix{}), typing |make| from the shell +% should build the binary (have a +% look at the various makefiles, namely |Makefile| (which is my rather +% complex development version that may not run on your system setup), +% |Makefile.unx| (which is the most generic one) and +% |Makefile.os2|). Also have a look at the start of the makefiles +% where you will find some variables to be customized. The most +% important ones may be |CC| and |SHELL|. You may also want to have a +% look at |config.h|. +% +% If you don't +% have MAKE get it right now or just issue +% these commands: +% +% \begin{example} +% |cc -c database.c -o database.o|\\ +% |cc -c error.c -o error.o|\\ +% |cc -c labels.c -o labels.o|\\ +% |cc -c list.c -o list.o|\\ +% |cc -c main.c -o main.o|\\ +% |cc -c version.c -o version.o|\\ +% |cc database.o error.o labels.o list.o main.o version.o -o glosstex| +% \end{example} +% +% Now just move the resulting binary to a directory where your other +% binaries live. After that you need to unpack |glosstex.dtx|. Do this +% by invoking +% \begin{example} +% |latex glosstex.ins| +% \end{example} +% +% which will produce some more files. You will have to move them +% to their proper places according to your particular +% \TeX{}-installation. The instructions that will appear on the +% screen should give you a good start. +% +% \subsection{A Goodie for \teTeX{} User} +% If you are using \textsc{Thomas Esser}'s fantastic \teTeX{} system, +% \GlossTeX\ has some good news for you. \GlossTeX\ comes with a +% kpathsea shell-wrapper which supports path searching. For this to +% work, rename |glosstex| to |glosstex.bin| and |glosstex.sh| to +% |glosstex|. Put them somewhere convenient. Now add a line of the +% form +% \begin{example} +% |GDFINPUTS = $KPSE_DOT:$TEXMFS/glosstex//| +% \end{example} +% in you |texmf.cnf| file. That's it! +% +% If you get problems, the following notes may help you. +% First check whether +% \begin{example} +% |kpsetool -v -n glosstex '$GDFINPUTS'| +% \end{example} +% and +% \begin{example} +% |kpsetool -v -n tex '$GDFINPUTS'| +% \end{example} +% +% do what you want, i.e.\ their output +% should be equal. These won't find your \teTeX{} |texmf| tree (where +% your |texmf.cnf| file lives) if |glosstex| is not in something like +% |teTeX/bin| or |teTeX/bin/i386-linux|. In these cases, replace +% \begin{example} +% |TETEXDIR = $SELFAUTOPARENT| +% \end{example} +% in |texmf.cnf| with something like +% \begin{example} +% |TETEXDIR = /usr/local/lib/teTeX|. +% \end{example} +% This makes sure that the proper |texmf| tree is found, even if +% |glosstex| is not in the \teTeX{} +% |texmf| tree but in your local |texmf| tree. +% +% You also need symbolic links from e.\,g.\ +% |/usr/local/lib/localTeX/texmf.cnf| to your \teTeX{} |texmf.cnf|. This +% is because kpathsea looks for |texmf.cnf| in the tree where the +% binary was found. +% +% These instructions should apply to \teTeX{} version 0.4 or newer. +% +% \section{Usage} +% The \LaTeX{}-macros needed by \GlossTeX{} have to be included into +% the source using +% +% \begin{example} +% |\usepackage|\opt{|[|\meta{options}|]|}|{glosstex}| +% \end{example} +% +% Valid \meta{options} are listed in table \ref{tab:options}. +% +% \begin{table}[htbp] +% \begin{center} +% \begin{tabular}{>{\ttfamily}ll} +% \hline\hline +% \rmfamily Option & Discussed in section\\ +% \hline +% refpage, \textit{norefpage} &\ref{sec:page_references}\\ +% \textit{itemfirst}, longfirst &\ref{sec:order}\\ +% \textit{text}, footnote &\ref{sec:footnotes}\\ +% \textit{roundparen}, squareparen&\ref{sec:parentheses}\\ +% \hline\hline +% \end{tabular} +% \caption[Package options.]{Package options. Defaults are set in +% \textit{italics}.} +% \label{tab:options} +% \end{center} +% \end{table} +% +% Whenever you want a term to appear in the glossary, you insert +% \DescribeMacro{\glosstex} +% \begin{definition} +% |\glosstex|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% +% into the text. \meta{label} references the entry and the optional +% arguments \meta{pageref-mode} and \meta{list} determine the mode for +% page references\footnote{Page references are described in section +% \ref{sec:page_references}. \meta{pageref-mode} works in conjunction +% with the optional arguments |refpage| and |norefpage| to the package +% and defaults to |p|. \meta{list} defaults to |glo|.} and the list +% the referenced term should appear in. +% +% But you can create $n$ independent lists and make each \meta{label} +% appear in any \meta{list}, each appearance independent of the other +% ones. To facilitate the creation of multiple \meta{list}s and +% especially make it easy to achieve the most likely usage, there are +% actually two sets of commands. One set starting with |\gl| defaults +% to \meta{list} |glo| (which stands for glossary) and +% \meta{pageref-mode} |p|, the other set starting with |\ac| defaults +% to \meta{list} |acr| (list of acronyms) and \meta{pageref-mode} +% |n|. The following is the equivalent to |\glosstex| for acronyms: +% +% \DescribeMacro{\acronym} +% \begin{definition} +% |\acronym|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% +% These two commands can also be called as |\glosstex{*}| and +% |\acronym{*}| to include all terms found in the |.gdf|-files into +% the corresponding \meta{list}. This is similar to the command +% |\nocite{*}| in \BibTeX{} and is primarily meant for debugging +% purposes. But do \emph{not} use something like |\gls{*}| (see +% below). +% +% There is another set of commands that produce both an entry in the +% list (this is optional) and typeset output. +% +% \DescribeMacro{\gls} +% \DescribeMacro{\gls*} +% \begin{definition} +% |\gls|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% +% |\gls| typesets \meta{item} and produces a list entry (\meta{list} +% defaults to |glo|). The starred version |\gls*| just produces +% typeset output without a list-entry.\footnote{To be honest, a +% list-entry is produced, but it never appears in the output. The +% starred version implicitly produces entries with \meta{list-mode} +% |n| (never appear in typeset \meta{list}) while the unstarred +% versions set \meta{list-mode} to |a| (always appear). There is no +% other way of specifying the \meta{list-mode} of an \meta{label}.} +% +% \DescribeMacro{\ac} +% \DescribeMacro{\ac*} +% \DescribeMacro{\acs} +% \DescribeMacro{\acs*} +% \DescribeMacro{\acl} +% \DescribeMacro{\acl*} +% \DescribeMacro{\acf} +% \DescribeMacro{\acf*} +% \begin{definition} +% |\ac|\opt{|*|}\opt{|,|\meta{lparen}|,|\meta{rparen}|,|}\opt{|<|\meta{form}|>|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% |\acs|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% |\acl|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% |\acf|\opt{|*|}\opt{|,|\meta{lparen}|,|\meta{rparen}|,|}\opt{|<|\meta{form}|>|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% +% These all produce typeset output. |\acs| typesets \meta{item}, +% |\acl| typesets \meta{long-form} and |\acf| typesets \meta{full} +% (see section \ref{sec:format}). |\ac| works like |\acf| at it's first +% invocation and like |\acs| on all subsequent ones. Using |\ac| you +% can make sure that an acronym is always spelled out at least once in +% your document while safely using the short form whenever +% possible. Note that the use of |\acf| has no effect on subsequent +% invocations of |\ac|. The starred versions |\ac*|, |\acs*|, |\acl*| +% and |\acf*| +% just produce typeset output. Table~\ref{tab:commands} gives an +% overview of all this. +% +% \begin{table}[htbp] +% \begin{center} +% \begin{tabular}{rllll} +% \hline\hline +% defaults & list & list and text & text & output\\ +% \hline +% |(glo)[p]| & |\glosstex| & |\gls| & |\gls*| & \meta{item}\\ +% |(acr)[n]| & |\acronym| & |\ac| & |\ac*| +% & \meta{item} or \meta{full}\\ +% |(acr)[n]| & & |\acs| & |\acs*| & \meta{item}\\ +% |(acr)[n]| & & |\acl| & |\acl*| & \meta{long-form}\\ +% |(acr)[n]| & & |\acf| & |\acf*| & \meta{full}\\ +% \hline\hline +% \end{tabular} +% \caption{Overview of the different sets of commands.} +% \label{tab:commands} +% \end{center} +% \end{table} +% +% In the most simple case, \meta{full} will look like ``\meta{item} +% |(|\meta{long-form}|)|''. You can switch the order of \meta{item} +% and \meta{long-form} by using the options |itemfirst| and +% |longfirst|. If you rather like either in a footnote, try the option +% |footnote| instead of the default |text|. If you don't like the +% round parentheses, just use the optional arguments \meta{lparen}, +% \meta{rparen} which are also described in section \ref{sec:format}. +% +% \subsection{The Glossary Definition File} +% A glossary-definition file\glosstex{gdf-file} (suffix |.gdf|) is +% needed which serves as a database for \GlossTeX{}, holding the +% actual descriptions of all terms. You can have $m$ |.gdf|-files that +% contain the definitions to the \meta{label}s you reference in your +% documents. Entries have the form +% \begin{definition} +% |@entry{|\meta{label}\opt{|,|\meta{item}\opt{|,|\meta{long-form}}}|}| \opt{\meta{text}} +% \end{definition} +% +% where \meta{label} is used to identify the entry and \meta{text} may +% contain any amount of \TeX{}-source, being the actual definition of +% the item. You should know that \meta{label} is used to construct +% \TeX{}-macros, so it shouldn't contain funny characters or you will +% most likely get funny errors. The optional argument \meta{item} +% describes the appearance of the item in the produced list. If +% omitted, it defaults to \meta{label}. It can be used when some +% special form of typesetting is wanted. \meta{item} can contain any +% \TeX{}-construct, as long as each ``|{|'' has a corresponding +% ``|}|'' or \GlossTeX{} will get confused. The same applies +% to \meta{long-form}, except that it defaults into an empty string if +% not specified. +% +% Following is the |.gdf|-file used for this documentation. Note the use of +% ``|~|'' as the quote-character. Also note that all lines +% until the first line starting with |@entry{| are +% ignored. Additionally, all lines starting with ``|%|'' are ignored, +% too. Thus they +% can serve as comments. +% \begin{macrocode} +%<*gdf> +% -*- latex -*- + +This is a database file for GlossTeX. + +@entry{ist-file, \texttt{.ist}-file} Style file for \MakeIndex{}, +describing the input and output format of read and written files. + +@entry{gdf-file, \texttt{.gdf}-file} This file is the database file +containing definitions for Gloss\TeX{}. + +@entry{gxs-file, \texttt{.gxs}-file} Intermediate file produced by +\GlossTeX{} to be processed by \MakeIndex{}. + +@entry{glx-file, \texttt{.glx}-file} This file contains the sorted +lists, ready to be read by \LaTeX{}. + +@entry{gxg-file, \texttt{.gxg}-file} This is the log-file produced by +the \GlossTeX{}-run. See also \glxref{glg-file}. + +@entry{glg-file, \texttt{.glg}-file} This is the log-file produced by +the \MakeIndex{}-run. See also \glxref{gxg-file}. + +@entry{ASCII, ASCII, American Standard Code for Information Interchange} +A character encoding. See also \glxref{EBCDIC}. + +@entry{EBCDIC, EBCDIC, Extended Binary Coded Decimals Interchange Code} +A character encoding exclusively used on mainframes. See also +\glxref{ASCII}. +%</gdf> +% \end{macrocode} +% +% \subsection{Invocation} +% After the first run of \LaTeX{}, the |.aux|-file contains all +% necessary information for the preparation of the glossary. \GlossTeX\ +% is then invoked to read one or more |.gdf|-files and outputs all +% definitions that are referenced in the |.aux|-file. The output of +% \GlossTeX{} is then processed by \MakeIndex{} for sorting. +% +% \GlossTeX{} is invoked in a \unix{}-like environment using the +% following command +% +%\begin{example} +% |glosstex |\meta{aux-file}| |\meta{gdf-file}| |\opt{\meta{gdf-file}\opt{...}}| |\opt{|-v|\opt{|0|\ldots|5|}} +% \end{example} +% +% This produces 2 files as output, one \gls{gxs-file} to be input into +% \MakeIndex{} and a log-file with extension |.gxg|\glosstex{gxg-file} +% which contains more detailed information. The |-v| option selects +% how verbose \GlossTeX{} should be when writing the log-file. |-v| is +% equal to |-v4| and |-v2| is the default. |-v0| makes \GlossTeX{} +% shut his mouth and only report errors and |-v5| makes \GlossTeX{} +% really talkative. +% +% \MakeIndex{} has to be invoked in this way +% +% \begin{example} +% |makeindex |\meta{gxs-file}| -o |\meta{glx-file}| -s |glosstex.ist| |\opt{|-t |\meta{glg-file}} +% \end{example} +% +% The commands +% +% \begin{example} +% |glosstex thesis thesis.gdf master.gdf|\\ +% |makeindex thesis.gxs -o thesis.glx -s glosstex.ist| +% \end{example} +% +% produce the final \gls{glx-file} which is then included by +% \DescribeMacro{\printglosstex} +% \begin{definition} +% |\printglosstex|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|} +% \end{definition} +% during the next \LaTeX{}-run. The argument \meta{pageref-mode} +% supersedes the one given to the entries individually for each +% \meta{list} and defaults to |p|. You can turn on page references +% unconditionally for each \meta{list} individually by using +% \meta{pageref-mode} |a| and turn it off by using +% \meta{pageref-mode} |n| as argument to |\printglosstex|. See also +% table~\ref{tab:references} for an overview of these options. +% +% Note that, no matter of how many \meta{list}s you produce, there is +% always exactly \emph{one} |.glx|-file which contains the entries of +% \emph{all} produced lists. +% +% Depending on whether you use \meta{item} +% or \meta{long-form} in your text or you have cross-references, it +% may be necessary to run \LaTeX{} and \GlossTeX{} up to 4 times until +% all references are resolved. Watch out for warnings from +% \package{glosstex} during a \LaTeX{} run. Messages about unresolved +% \meta{label}s from \GlossTeX{} are caused by missing definitions in +% the |.gdf|-files. +% +% \subsection{Page References} +% \label{sec:page_references} +% You may want a reference in the list to the place where the term +% first appears in the text. This can be done using the optional +% argument \meta{pageref-mode} on \meta{item}-level and +% \meta{list}-level. These arguments in combination with the option to +% |\usepackage| control page references. Table \ref{tab:references} +% gives an overview of all possible combinations of these 3 +% arguments. +% +% \begin{table}[htbp] +% \begin{center} +% \begin{tabular}{l|ccc|ccc} +% \hline\hline +% \hfill list & & |refpage| & & & |norefpage|\\ +% entry & |a| & |p| & |n| & |a| & |p| & |n|\\ +% \hline +% |a| & $\times$ & $\times$ & $-$ & $\times$ & $\times$ & $-$\\ +% |p| & $\times$ & $\times$ & $-$ & $\times$ & $-$ & $-$\\ +% |n| & $\times$ & $-$ & $-$ & $\times$ & $-$ & $-$\\ +% \hline\hline +% \end{tabular} +% \caption[Options controlling the appearance of page +% references.]{Options controlling the appearance of page +% references. A ``$\times$'' indicates that a reference is +% produced.} +% \label{tab:references} +% \end{center} +% \end{table} +% +% One possible usage of this feature: while debugging a document, turn +% on page references by using the option |refpage| to the +% package. Every entry included with the modes |a| (always) or the +% default |p| (package) will contain a reference. After debugging, +% remove the option |refpage| and only those entries that were +% included with mode |a| will still have a reference. +% +% \subsection{The Appearance of \protect\meta{full}} +% \label{sec:format} +% \meta{full} stands for the appearance of the typeset term in the +% text. The appearance of \meta{full} is controlled through the +% optional arguments \meta{lparen}, \meta{rparen} and \meta{form} to +% |\ac| and |\acf|. Additionally, these arguments work together with +% defaults set forth on \meta{list}-level and package level. The +% following sections shall shed some light on this topic. +% +% \subsubsection{The \protect\meta{order} of \protect\meta{item}s} +% \label{sec:order} +% \DescribeMacro{\glxitemorderdefault} +% The options |itemfirst| and |longfirst| control which one of +% \meta{item} and \meta{long-form} should be typeset first. On +% \meta{list}-level, \meta{item-order} can be set using +% \begin{definition} +% |\glxitemorderdefault||{|\meta{list}|}||{|\meta{item-order}|}| +% \end{definition} +% \meta{item-order} may be either ``|i|'', +% ``|l|'' or empty. |i| first typesets \meta{item}, |l| first typesets +% \meta{long-form}. Omitting \meta{item-order} lets the defaults take +% effect. Table \ref{tab:item-order} gives an overview over each +% combination of the options for \meta{item-order}. +% +% \begin{table}[htbp] +% \begin{center} +% \begin{tabular}{l|ccc|ccc} +% \hline\hline +% \hfill list & & |itemfirst| & & & |longfirst|\\ +% entry & |i| & $-$& |l| & |i| & $-$ & |l|\\ +% \hline +% |i| & |i| & |i| & |l| & |i| & |i| & |l|\\ +% $-$ & |i| & |i| & |l| & |i| & |l| & |l|\\ +% |l| & |i| & |l| & |l| & |i| & |l| & |l|\\ +% \hline\hline +% \end{tabular} +% \caption{Options controlling \protect\meta{item-order}.} +% \label{tab:item-order} +% \end{center} +% \end{table} +% +% \subsubsection{Placement of footnotes and \protect\meta{form}} +% \label{sec:footnotes} +% \DescribeMacro{\glxitemplacementdefault} +% The options |text| and |footnote| control where the second typeset +% output should go, either into the text or into a footnote. +% \begin{definition} +% |\glxitemplacementdefault||{|\meta{list}|}||{|\meta{item-placement}|}| +% \end{definition} +% sets this option on \meta{list}-level. \meta{item-placement} may be +% either |t|, |f| or empty. |t| typesets both parts into the text, |f| +% puts one part into a footnote. Omitting \meta{item-placement} lets +% the defaults for \meta{item-placement} take effect. See also table +% \ref{tab:item-placement} for an overview of all possible +% combinations. +% +% \begin{table}[htbp] +% \begin{center} +% \begin{tabular}{l|ccc|ccc} +% \hline\hline +% \hfill list & & |text| & & & |footnote|\\ +% entry & |t| & $-$& |f| & |t| & $-$ & |f|\\ +% \hline +% |t| & |t| & |t| & |f| & |t| & |t| & |f|\\ +% $-$ & |t| & |t| & |f| & |t| & |f| & |f|\\ +% |f| & |t| & |f| & |f| & |t| & |f| & |f|\\ +% \hline\hline +% \end{tabular} +% \caption{Options controlling \protect\meta{item-placement}.} +% \label{tab:item-placement} +% \end{center} +% \end{table} +% +% The aforementioned \meta{form} is built by simply concatenating +% \meta{item-order} and \meta{item-placement}. You supply the +% \meta{form} argument to |\ac| and |\acf| by enclosing it in angle +% brackets, just like |\ac<if>{foo}| or |\ac<t>{bar}|. Please note that +% \meta{item-order} is specified \emph{before} \meta{item-placement}. +% +% \subsubsection{Encapsulation} \label{sec:parentheses} +% \DescribeMacro{\glxparendefault} +% \DescribeMacro{\glxparenlistdefault} +% When using |t| for \meta{item-placement}, the second part is +% encapsulated within \meta{lparen} on the left and \meta{rparen} on +% the right. +% \begin{definition} +% |\glxparendefault{|\meta{list}|}{|\meta{lparen}|}{|\meta{rparen}|}| +% \end{definition} +% sets this option on package level. The options |roundparen| and +% |squareparen| may be used as well. +% \begin{definition} +% |\glxparenlistdefault{|\meta{list}|}{|\meta{lparen}|}{|\meta{rparen}|}| +% \end{definition} +% sets this option on \meta{list}-level. On \meta{item}-level these +% are supplied to |\ac| and |\acf| just like |\ac,(,),{foo}| or +% |\acf,--,--,<lt>{bar}|. It may look strange, but I was out of +% parentheses. +% +% \subsection{Cross-References} +% \DescribeMacro{\glxref} +% \DescribeMacro{\glxref*} +% \begin{definition} +% |\glxref|\opt{|*|}|{|\meta{item}|}| +% \end{definition} +% It may be useful to use cross-references in entries. Assume +% you have referenced |\glosstex{ascii}| which describes the term +% \ac{ASCII}. You may also want to include \ac*{EBCDIC} as an +% example for another character encoding. To achieve this, write this +% into the definition of \ac{ASCII} +% +% \begin{example} +% |See also \glxref{ebcdic}.| +% \end{example} +% +% and \GlossTeX{} then produces ``See also EBCDIC'' and also includes +% the definition for \ac*{EBCDIC} into the same list \ac{ASCII} +% appears in. Note +% that |\glxref| is only available within the \meta{text} argument in +% the |.gdf|-file since it only makes sense within a +% \meta{list}. There is also a starred version |\glxref*| that doesn't +% produce typeset output. +% +% \subsection{\GlossTeX{} and \package{nomencl}} +% It is possible to use \package{nomencl} and \GlossTeX{} in one +% document without problems. The following commands show how to deal with documents using both +% \GlossTeX{} and \textsf{nomencl}. +% \begin{example} +% |latex thesis|\\ +% |glosstex thesis thesis.gdf |\\ +% |makeindex thesis.gxs -o thesis.glx -s glosstex.ist|\\ +% |makeindex thesis.glo -o thesis.gls -s nomencl.ist|\\ +% |latex thesis| +% \end{example} +% +% \section{Customizing} +% \subsection{Global} +% \GlossTeX{} can be customized by using the file |glosstex.cfg| which +% is automatically loaded if it is present. The file |glosstex.std| is +% the default configuration file that is absolutely mandatory to +% \GlossTeX{}'s proper working. It +% shows all aspects that are meant to be customized, so let's discuss +% it now. +% +% Each term that gets typeset either goes through |\GLX@output@short| +% or |\GLX@output@long|, depending whether it's the \meta{item} or +% \meta{long-form}. These macros each take 3 arguments and get called +% this way: +% \begin{definition} +% |\GLX@output@short{|\meta{label}|}{|\meta{list}|}{|\meta{item}|}|\\ +% |\GLX@output@long{|\meta{label}|}{|\meta{list}|}{|\meta{long-form}|}| +% \end{definition} +% +% \begin{macro}{\GLX@output@short} +% \begin{macro}{\GLX@output@long} +% We just output \meta{item} as it is. See section +% \ref{sec:customizing_local} for some more elaborate implementation +% of this macro. +% \begin{macrocode} +%<*std> +\newcommand{\GLX@output@short}[3]{#3} +\newcommand{\GLX@output@long}[3]{#3} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\glosstexpage} +% This is used to typeset the page at the end of a definition. It uses +% |\pagename| so that should be defined elsewhere. +% \begin{macrocode} +\newcommand{\glosstexpage}[1]{\nobreak{\itshape\pagename~#1}\nobreak} +% \end{macrocode} +% \end{macro} +% +% \DescribeMacro{\glxgldefault} +% \DescribeMacro{\glxacdefault} +% These macros set the defaults for \meta{list} and +% \meta{pageref-mode} which the commands starting with |\gl| (except for +% |\glxref|, of course) and |\ac| are +% using. +% \begin{macrocode} +\glxgldefault{glo}{p} +\glxacdefault{acr}{n} +% \end{macrocode} +% +% \DescribeMacro{\glxitemorderdefault} +% \DescribeMacro{\glxitemplacementdefault} +% These macros set the defaults concerning \meta{item-placement} and +% \meta{item-order} in \meta{list}. We specify no default on +% \meta{list}-level. +% \begin{macrocode} +\glxitemorderdefault{glo}{} +\glxitemplacementdefault{glo}{} +\glxitemorderdefault{acr}{} +\glxitemplacementdefault{acr}{} +% \end{macrocode} +% +% \DescribeMacro{\glxparendefault} +% \DescribeMacro{\glxparenlistdefault} +% These macros set the defaults concerning \meta{lparen} and +% \meta{rparen} on package and \meta{list}-level, respectively. To set +% \meta{paren} on package level, you may as well use the options +% |roundparen| and |squareparen|. Because |roundparen| is the default +% option, this command is not used. As long as there is no +% \meta{paren}-default on \meta{list}-level, the default on +% package-level is used. So therefor, |\glxparenlistdefault| is not +% used here as well. +% \begin{macrocode} +%\glxparendefault{(}{)} +%\glxparenlistdefault{glo}{-*}{*-} +% \end{macrocode} +% +% \begin{macro}{\GLX@benv@glo} +% \begin{macro}{\GLX@eenv@glo} +% \begin{macro}{\GLX@item@glo} +% \begin{macro}{\GLX@benv@acr} +% \begin{macro}{\GLX@eenv@acr} +% \begin{macro}{\GLX@item@acr} +% Each \meta{list} gets embedded into |\GLX@benv@|\meta{list} and +% |\GLX@eenv@|\meta{list}, so these macros should provide a reasonable +% environment. Each line itself is typeset using +% |\GLX@item@|\meta{list} which gets called with 7 arguments. +% \begin{definition} +% |\GLX@item@|\meta{list}|{|\meta{label}|}||{|\meta{list}|}||{|\meta{long-form}|}||{|\meta{text}|}||{|\meta{list}|}||{|\meta{list-mode}|}||{|\meta{page-stuff}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@benv@glo}{\begin{description}} +\newcommand{\GLX@eenv@glo}{\end{description}} +\newcommand{\GLX@item@glo}[7]{% + \item[#2]\ifx#3\empty\else\emph{#3}\space\fi#4\space#7} +\newcommand{\GLX@item@acr@label}[1]{\mbox{#1}\dotfill} +\newcommand{\GLX@benv@acr}{ + \begin{list}{}{% + \renewcommand{\makelabel}{\GLX@item@acr@label}% + \setlength{\labelwidth}{7em}% + \leftmargin\labelwidth \advance\leftmargin by \labelsep}} +\newcommand{\GLX@eenv@acr}{\end{list}} +\newcommand{\GLX@item@acr}[7]{% + \item[\textsc{#2}]% + \ifx#3\empty\else#3\quad\fi\ifx#4\empty\else#4\space\fi#7} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\glossaryname} +% \begin{macro}{\listacronymname} +% \begin{macro}{\pagename} +% These are defined to contain some default strings if they're not +% already defined (|\pagename| e.g.\ is defined trough \package{babel}). +% \begin{macrocode} +\ifx\glossaryname\@undefined + \def\glossaryname{Glossary} +\fi +\ifx\listacronymname\@undefined + \def\listacronymname{List of Acronyms} +\fi +\ifx\pagename\@undefined + \def\pagename{page} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \DescribeMacro{\glxheading} +% Each \meta{list} starts with an appropriate heading which is defined +% by +% \begin{definition} +% |\glxheading[|\meta{list}|]{|\meta{definition}|}|. +% \end{definition} +% \begin{macrocode} +\ifx\chapter\@undefined + \glxheading{glo}{\section*{\glossaryname}} + \glxheading{acr}{\section*{\listacronymname}} +\else + \glxheading{glo}{\chapter*{\glossaryname}} + \glxheading{acr}{\chapter*{\listacronymname}} +\fi +%</std> +% \end{macrocode} +% +% \subsection{Local} +% \label{sec:customizing_local} +% Now we need a local configuration file for this document. This is +% done by using a file named |glosstex.cfg|. +% In |\GLX@output@short| we test whether we are in the list of acronyms +% (|GLX@acdef@list|) and typeset \meta{item} with caps and small caps +% if we are. Otherwise, just typeset \meta{item}. +% We also define a call +% to |\index| in |\GLX@output@short|. As sort-key, we use +% \meta{label}. Instead of the usual |@| we use |=| for designating +% the appearance part of the index entry. +% \begin{macrocode} +%<*cfg> +\renewcommand{\GLX@output@short}[3]{% + \ifthenelse{\equal{#2}{\GLX@acdef@list}}{% + \textsc{#3}}{#3}\index{#1=#3}} +%</cfg> +% \end{macrocode} +% +% \section{Some Details} +% While reading the |.aux|-file, \GlossTeX{} only considers the first +% appearance of one \meta{item} for each \meta{list}. All subsequent +% entries are silently ignored. +% (Almost silently, because the |.gxg|-file will contain detailed +% information about this, and more.) But if the first entry says +% not to produce a page reference and a following one says to do so, then +% the latter will supersede the former. The same applies if a +% term is referenced without the option not to generate a list-entry +% (all commands containing a |*|, e.g.\ |\gl*|), but a following tells +% to do so. +% +% While reading one or more |.gdf|-files, only the first definition is +% used, all other entries are ignored. This fact can be utilised +% in some way. Assume you have a |master.gdf| which contains general +% terms and a file |thesis.gdf| which only contains terms that are +% intended for use in your thesis. Whenever an entry is present in both +% |.gdf|-files, the one from |thesis.gdf| should be taken. To achieve +% this, specify |thesis.gdf| \emph{before} |master.gdf|. +% +% Additionally, see the file |TODO| in this package for +% known bugs (also called features) and not yet implemented features +% (also called bugs). +% +% \section{Acknowledgments} +% I would like to thank these people who have contributed to the +% development of \GlossTeX{}: +% +% {\scshape +% Daniel Courjon, Stefan A.~Deutscher, Michael Friendly, Olaf Michelsson +% } +% +% \StopEventually{\printglosstex[a]} +% +% \section{The Implementation} +% \subsection{The Package \package{glosstex.sty}} +% +% First, we identify ourselves. +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e}[1996/12/01] \ProvidesPackage{glosstex} +[\filedate\space\fileversion\space GlossTeX package] +% \end{macrocode} +% +% The \package{ifthen} package is needed for some |\ifthenelse|-constructs. +% \begin{macrocode} +\RequirePackage{ifthen} +\newif\if@GLX@pagerefmode +\newif\if@GLX@itemfirst +\newif\if@GLX@footnote +\newif\if@GLX@roundparen +\newif\if@GLX@squareparen +% \end{macrocode} +% +% \begin{macro}{\GlossTeX} +% This is used to typeset a nice logo for this package, which looks +% like ``\GlossTeX{}''. +% \begin{macrocode} +\newcommand{\GlossTeX}{Gloss\TeX} +% \end{macrocode} +% \end{macro} +% +% First, we make sure that the |.glx|-file is input in all cases. We +% need this to expand acronyms in case the user generates no typeset +% list. We create a dummy list |GLX@Null@List|. This assumes, of course, that +% you have no entries for list |GLX@Null@List|. But who would, anyhow? +% \begin{macrocode} +\AtBeginDocument{% + \glxheading{GLX@Null@List}{}% + \printglosstex(GLX@Null@List)} +% \end{macrocode} +% +% We want to remind the user to run \GlossTeX\ when there were +% undefined terms in the document. +% \begin{macrocode} +\AtEndDocument{% + \ifx\GLX@undefined@term\@undefined\else % + \PackageWarningNoLine{glosstex}% + {There were undefined terms.\MessageBreak + You should (re)run GlossTeX}\fi} +% \end{macrocode} +% +% \begin{macro}{\GlossTeXPage} +% Call |\glosstexpage| depending on |#1| (\meta{pageref-mode}) for +% each entry, +% |\GLX@theglosstex@pagerefmode| for each list and +% |\if@GLX@pagerefmode| for the whole package. +% \begin{macrocode} +\newcommand{\GlossTeXPage}[2]{\ignorespaces% + \ifthenelse{\boolean{@GLX@pagerefmode}}% + {% refpage true + \ifthenelse{% + \equal{\GLX@theglosstex@pagerefmode}{a}}{\glosstexpage{#2}}{% + \ifthenelse{\equal{\GLX@theglosstex@pagerefmode}{n}}{}{% + \ifthenelse{\equal{#1}{a}}{\glosstexpage{#2}}{}% + \ifthenelse{\equal{#1}{p}}{\glosstexpage{#2}}{}% + \ifthenelse{\equal{#1}{n}}{}{}}}}% + {% refpage false + \ifthenelse{% + \equal{\GLX@theglosstex@pagerefmode}{a}}{\glosstexpage{#2}}{% + \ifthenelse{\equal{\GLX@theglosstex@pagerefmode}{n}}{}{% + \ifthenelse{\equal{#1}{a}}{\glosstexpage{#2}}{}% + \ifthenelse{\equal{#1}{p}}{}{}% + \ifthenelse{\equal{#1}{n}}{}{}}}}% + }% +% \end{macrocode} +% \end{macro} +% +% Now declare the options this package accepts and execute the +% standard options. +% \begin{macrocode} +\DeclareOption{refpage}{\@GLX@pagerefmodetrue} +\DeclareOption{norefpage}{\@GLX@pagerefmodefalse} +\DeclareOption{itemfirst}{\@GLX@itemfirsttrue} +\DeclareOption{longfirst}{\@GLX@itemfirstfalse} +\DeclareOption{text}{\@GLX@footnotefalse} +\DeclareOption{footnote}{\@GLX@footnotetrue} +\DeclareOption{roundparen}{\gdef\GLX@paren@l{(}\gdef\GLX@paren@r{)}} +\DeclareOption{squareparen}{\gdef\GLX@paren@l{[}\gdef\GLX@paren@r{]}} +\ExecuteOptions{norefpage,itemfirst,text,roundparen} +\ProcessOptions +% \end{macrocode} +% +% \begin{macro}{\GlossTeXNull} +% This one is used as a dummy to work around a feature in +% \MakeIndex{}. +% \begin{macrocode} +\newcommand{\GlossTeXNull}[1]{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glosstex} +% \begin{definition} +% |\glosstex|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|. +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\glosstex{\GLX@glosstex} +\newcommand{\GLX@glosstex}{% + \@ifnextchar({\GLX@@glosstexr}{% + \@ifnextchar[{\GLX@@glosstexs(\GLX@gldef@list)}{% + \GLX@@@glosstex(\GLX@gldef@list)[\GLX@gldef@page]}}} +\newcommand{\GLX@@glosstexr}{} +\def\GLX@@glosstexr(#1){% + \@ifnextchar[{\GLX@@glosstexs(#1)}{\GLX@@@glosstex(#1)[\GLX@gldef@page]}} +\newcommand{\GLX@@glosstexs}{} +\def\GLX@@glosstexs(#1)[#2]{% + \GLX@@@glosstex(#1)[#2]} +\newcommand{\GLX@@@glosstex}{} +\def\GLX@@@glosstex(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{a}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\acronym} +% \begin{definition} +% |\acronym|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\acronym{\GLX@acronym} +\newcommand{\GLX@acronym}{% + \@ifnextchar({\GLX@@acronymr}{% + \@ifnextchar[{\GLX@@acronyms(\GLX@acdef@list)}{% + \GLX@@@acronym(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acronymr}{} +\def\GLX@@acronymr(#1){% + \@ifnextchar[{\GLX@@acronyms(#1)}{\GLX@@@acronym(#1)[\GLX@acdef@page]}} +\newcommand{\GLX@@acronyms}{} +\def\GLX@@acronyms(#1)[#2]{% + \GLX@@@acronym(#1)[#2]} +\newcommand{\GLX@@@acronym}{} +\def\GLX@@@acronym(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{a}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\gls} +% \begin{macro}{\gls*} +% \begin{definition} +% |\gls|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\gls{% + \@ifstar{\GLX@glsS}{\GLX@gls}} +\newcommand{\GLX@gls}{% + \@ifnextchar({\GLX@@glsr}{% + \@ifnextchar[{\GLX@@glss(\GLX@gldef@list)}{% + \GLX@@@gls(\GLX@gldef@list)[\GLX@gldef@page]}}} +\newcommand{\GLX@@glsr}{} +\def\GLX@@glsr(#1){% + \@ifnextchar[{\GLX@@glss(#1)}{\GLX@@@gls(#1)[\GLX@gldef@page]}} +\newcommand{\GLX@@glss}{} +\def\GLX@@glss(#1)[#2]{% + \GLX@@@gls(#1)[#2]} +\newcommand{\GLX@@@gls}{} +\def\GLX@@@gls(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{a}\GLX@do@acs{#3}{#1}} +\newcommand{\GLX@glsS}{% + \@ifnextchar({\GLX@@glsSr}{% + \@ifnextchar[{\GLX@@glsSs(\GLX@gldef@list)}{% + \GLX@@@glsS(\GLX@gldef@list)[\GLX@gldef@page]}}} +\newcommand{\GLX@@glsSr}{} +\def\GLX@@glsSr(#1){% + \@ifnextchar[{\GLX@@glsSs(#1)}{\GLX@@@glsS(#1)[\GLX@gldef@page]}} +\newcommand{\GLX@@glsSs}{} +\def\GLX@@glsSs(#1)[#2]{% + \GLX@@@glsS(#1)[#2]} +\newcommand{\GLX@@@glsS}{} +\def\GLX@@@glsS(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{n}\GLX@do@acs{#3}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ac} +% \begin{macro}{\ac*} +% \begin{definition} +% |\ac|\opt{|*|}\opt{|,|\meta{lparen}|,|\meta{rparen}|,|}\opt{|<|\meta{form}|>|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\ac{% + \@ifstar{\GLX@acS}{\GLX@ac}} +\newcommand{\GLX@ac}{% + \@ifnextchar,{\GLX@@acc}{% + \@ifnextchar<{\GLX@@aca,\relax,\relax,}{% + \@ifnextchar({\GLX@@acr,\relax,\relax,<>}{% + \@ifnextchar[{\GLX@@acs,\relax,\relax,<>(\GLX@acdef@list)}{% + \GLX@@@ac,\relax,\relax,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}}} +\newcommand{\GLX@@acc}{} +\def\GLX@@acc,#1,#2,{% + \@ifnextchar<{\GLX@@aca,#1,#2,}{% + \@ifnextchar({\GLX@@acr,#1,#2,<>}{% + \@ifnextchar[{\GLX@@acs,#1,#2,<>(\GLX@acdef@list)}{% + \GLX@@@ac,#1,#2,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}} +\newcommand{\GLX@@aca}{} +\def\GLX@@aca,#1,#2,<#3>{% + \@ifnextchar({\GLX@@acr,#1,#2,<#3>}{% + \@ifnextchar[{\GLX@@acs,#1,#2,<#3>(\GLX@acdef@list)}{% + \GLX@@@ac,#1,#2,<#3>(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acr}{} +\def\GLX@@acr,#1,#2,<#3>(#4){% + \@ifnextchar[{\GLX@@acs,#1,#2,<#3>(#4)}{% + \GLX@@@ac,#1,#2,<#3>(#4)[\GLX@acdef@page]}} +\newcommand{\GLX@@acs}{} +\def\GLX@@acs,#1,#2,<#3>(#4)[#5]{% + \GLX@@@ac,#1,#2,<#3>(#4)[#5]} +\newcommand{\GLX@@@ac}{} +\def\GLX@@@ac,#1,#2,<#3>(#4)[#5]#6{% + \GLX@do@glosstex{#6}{#5}{#4}{a}\GLX@do@ac{#6}{#4}{#3}{#1}{#2}} +\newcommand{\GLX@acS}{% + \@ifnextchar,{\GLX@@acSc}{% + \@ifnextchar<{\GLX@@acSa,\relax,\relax,}{% + \@ifnextchar({\GLX@@acSr,\relax,\relax,<>}{% + \@ifnextchar[{\GLX@@acSs,\relax,\relax,<>(\GLX@acdef@list)}{% + \GLX@@@acS,\relax,\relax,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}}} +\newcommand{\GLX@@acSc}{} +\def\GLX@@acSc,#1,#2,{% + \@ifnextchar<{\GLX@@acSa,#1,#2,}{% + \@ifnextchar({\GLX@@acSr,#1,#2,<>}{% + \@ifnextchar[{\GLX@@acSs,#1,#2,<>(\GLX@acdef@list)}{% + \GLX@@@acS,#1,#2,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}} +\newcommand{\GLX@@acSa}{} +\def\GLX@@acSa,#1,#2,<#3>{% + \@ifnextchar({\GLX@@acSr,#1,#2,<#3>}{% + \@ifnextchar[{\GLX@@acSs,#1,#2,<#3>(\GLX@acdef@list)}{% + \GLX@@@acS,#1,#2,<#3>(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acSr}{} +\def\GLX@@acSr,#1,#2,<#3>(#4){% + \@ifnextchar[{\GLX@@acSs,#1,#2,<#3>(#4)}{% + \GLX@@@acS,#1,#2,<#3>(#4)[\GLX@acdef@page]}} +\newcommand{\GLX@@acSs}{} +\def\GLX@@acSs,#1,#2,<#3>(#4)[#5]{% + \GLX@@@acS,#1,#2,<#3>(#4)[#5]} +\newcommand{\GLX@@@acS}{} +\def\GLX@@@acS,#1,#2,<#3>(#4)[#5]#6{% + \GLX@do@glosstex{#6}{#5}{#4}{n}\GLX@do@ac{#6}{#4}{#3}{#1}{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\acs} +% \begin{macro}{\acs*} +% \begin{definition} +% |\acs|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\acs{% + \@ifstar{\GLX@acsS}{\GLX@acs}} +\newcommand{\GLX@acs}{% + \@ifnextchar({\GLX@@acsr}{% + \@ifnextchar[{\GLX@@acss(\GLX@acdef@list)}{% + \GLX@@@acs(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acsr}{} +\def\GLX@@acsr(#1){% + \@ifnextchar[{\GLX@@acss(#1)}{\GLX@@@acs(#1)[\GLX@acdef@page]}} +\newcommand{\GLX@@acss}{} +\def\GLX@@acss(#1)[#2]{% + \GLX@@@acs(#1)[#2]} +\newcommand{\GLX@@@acs}{} +\def\GLX@@@acs(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{a}\GLX@do@acs{#3}{#1}} +\newcommand{\GLX@acsS}{% + \@ifnextchar({\GLX@@acsSr}{% + \@ifnextchar[{\GLX@@acsSs(\GLX@acdef@list)}{% + \GLX@@@acsS(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acsSr}{} +\def\GLX@@acsSr(#1){% + \@ifnextchar[{\GLX@@acsSs(#1)}{\GLX@@@acsS(#1)[\GLX@acdef@page]}} +\newcommand{\GLX@@acsSs}{} +\def\GLX@@acsSs(#1)[#2]{% + \GLX@@acsS(#1)[#2]} +\newcommand{\GLX@@@acsS}{} +\def\GLX@@@acsS(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{n}\GLX@do@acs{#3}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\acl} +% \begin{macro}{\acl*} +% \begin{definition} +% |\acl|\opt{|*|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}|\\ +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\acl{% + \@ifstar{\GLX@aclS}{\GLX@acl}} +\newcommand{\GLX@acl}{% + \@ifnextchar({\GLX@@aclr}{% + \@ifnextchar[{\GLX@@acls(\GLX@acdef@list)}{% + \GLX@@@acl(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@aclr}{} +\def\GLX@@aclr(#1){% + \@ifnextchar[{\GLX@@acls(#1)}{\GLX@@@acl(#1)[\GLX@acdef@page]}} +\newcommand{\GLX@@acls}{} +\def\GLX@@acls(#1)[#2]{% + \GLX@@@acl(#1)[#2]} +\newcommand{\GLX@@@acl}{} +\def\GLX@@@acl(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{a}\GLX@do@acl{#3}{#1}} +\newcommand{\GLX@aclS}{% + \@ifnextchar({\GLX@@aclSr}{% + \@ifnextchar[{\GLX@@aclSs(\GLX@acdef@list)}{% + \GLX@@@aclS(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@aclSr}{} +\def\GLX@@aclSr(#1){% + \@ifnextchar[{\GLX@@aclSs(#1)}{\GLX@@@aclS(#1)[\GLX@acdef@page]}} +\newcommand{\GLX@@aclSs}{} +\def\GLX@@aclSs(#1)[#2]{% + \GLX@@@aclS(#1)[#2]} +\newcommand{\GLX@@@aclS}{} +\def\GLX@@@aclS(#1)[#2]#3{\GLX@do@glosstex{#3}{#2}{#1}{n}\GLX@do@acl{#3}{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\acf} +% \begin{macro}{\acf*} +% \begin{definition} +% |\acf|\opt{|*|}\opt{|,|\meta{lparen}|,|\meta{rparen}|,|}\opt{|<|\meta{form}|>|}\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|}|{|\meta{label}|}| +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\acf{% + \@ifstar{\GLX@acfS}{\GLX@acf}} +\newcommand{\GLX@acf}{% + \@ifnextchar,{\GLX@@acfc}{% + \@ifnextchar<{\GLX@@acfa,\relax,\relax,}{% + \@ifnextchar({\GLX@@acfr,\relax,\relax,<>}{% + \@ifnextchar[{\GLX@@acfs,\relax,\relax,<>(\GLX@acdef@list)}{% + \GLX@@@acf,\relax,\relax,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}}} +\newcommand{\GLX@@acfc}{} +\def\GLX@@acfc,#1,#2,{% + \@ifnextchar<{\GLX@@acfa,#1,#2,}{% + \@ifnextchar({\GLX@@acfr,#1,#2,<>}{% + \@ifnextchar[{\GLX@@acfs,#1,#2,<>(\GLX@acdef@list)}{% + \GLX@@@acf,#1,#2,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}} +\newcommand{\GLX@@acfa}{} +\def\GLX@@acfa,#1,#2,<#3>{% + \@ifnextchar({\GLX@@acfr,#1,#2,<#3>}{% + \@ifnextchar[{\GLX@@acfs,#1,#2,<#3>(\GLX@acdef@list)}{% + \GLX@@@acf,#1,#2,<#3>(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acfr}{} +\def\GLX@@acfr,#1,#2,<#3>(#4){% + \@ifnextchar[{\GLX@@acfs,#1,#2,<#3>(#4)}{% + \GLX@@@acf,#1,#2,<#3>(#4)[\GLX@acdef@page]}} +\newcommand{\GLX@@acfs}{} +\def\GLX@@acfs,#1,#2,<#3>(#4)[#5]{% + \GLX@@@acf,#1,#2,<#3>(#4)[#5]} +\newcommand{\GLX@@@acf}{} +\def\GLX@@@acf,#1,#2,<#3>(#4)[#5]#6{% + \GLX@do@glosstex{#6}{#5}{#4}{a}\GLX@do@acf{#6}{#4}{#3}{#1}{#2}} +\newcommand{\GLX@acfS}{% + \@ifnextchar,{\GLX@@acfSc}{% + \@ifnextchar<{\GLX@@acfSa,\relax,\relax,}{% + \@ifnextchar({\GLX@@acfSr,\relax,\relax,<>}{% + \@ifnextchar[{\GLX@@acfSs,\relax,\relax,<>(\GLX@acdef@list)}{% + \GLX@@@acfS,\relax,\relax,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}}} +\newcommand{\GLX@@acfSc}{} +\def\GLX@@acfSc,#1,#2,{% + \@ifnextchar<{\GLX@@acfSa,#1,#2,}{% + \@ifnextchar({\GLX@@acfSr,#1,#2,<>}{% + \@ifnextchar[{\GLX@@acfSs,#1,#2,<>(\GLX@acdef@list)}{% + \GLX@@@acfS,#1,#2,<>(\GLX@acdef@list)[\GLX@acdef@page]}}}} +\newcommand{\GLX@@acfSa}{} +\def\GLX@@acfSa,#1,#2,<#3>{% + \@ifnextchar({\GLX@@acfSr,#1,#2,<#3>}{% + \@ifnextchar[{\GLX@@acfSs,#1,#2,<#3>(\GLX@acdef@list)}{% + \GLX@@@acfS,#1,#2,<#3>(\GLX@acdef@list)[\GLX@acdef@page]}}} +\newcommand{\GLX@@acfSr}{} +\def\GLX@@acfSr,#1,#2,<#3>(#4){% + \@ifnextchar[{\GLX@@acfSs,#1,#2,<#3>(#4)}{% + \GLX@@@acfS,#1,#2,<#3>(#4)[\GLX@acdef@page]}} +\newcommand{\GLX@@acfSs}{} +\def\GLX@@acfSs,#1,#2,<#3>(#4)[#5]{% + \GLX@@@acfS,#1,#2,<#3>(#4)[#5]} +\newcommand{\GLX@@@acfS}{} +\def\GLX@@@acfS,#1,#2,<#3>(#4)[#5]#6{% + \GLX@do@glosstex{#6}{#5}{#4}{n}\GLX@do@acf{#6}{#4}{#3}{#1}{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\GLX@entry} +% This is the control-sequence written into the |.aux|-file which is +% to be read by \GlossTeX{}. This +% macro is defined so that it takes 5 arguments and expands to +% |\relax| when the |.aux|-file is reread by \TeX{}. +% \begin{macrocode} +\newcommand{\GLX@entry}[5]{\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@glosstex} +% This macro writes lines of the format +% \begin{definition} +% |\GLX@entry{|\meta{label}|}{|\meta{pageref-mode}|}{|\meta{list}|}{|\meta{list-mode}|}{|\meta{page}|}| +% \end{definition} +% into the |.aux|-file. +% \begin{macrocode} +\newcommand{\GLX@do@glosstex}[4]{% + \protected@write\@auxout{}% + {\string\GLX@entry{#1}{#2}{#3}{#4}{\thepage}}} +% \end{macrocode} +% \end{macro} +% +% The following commands create macros so that |\GLX@term@|\meta{label} contains +% the short-form of \meta{label} |#1|, |\GLX@term@@|\meta{label} contains the \meta{long-form} +% of \meta{label} |#1| and |\GLX@terml@|\meta{label} expands to |x| if the \meta{long-form} of +% \meta{label} |#1| has already been used. This is heavily borrowed from +% \package{acronym}. +% +% \begin{macro}{\GLX@do@acs} +% Output the short-form \meta{item} of \meta{label} |#1| in +% \meta{list} |#2|. +% \begin{macrocode} +\newcommand{\GLX@do@acs}[2]{% + \expandafter\ifx\csname GLX@term@#1\endcsname\relax% + \textbf{#1!}% + \PackageWarning{glosstex}{Term `#1' is not defined}% + \gdef\GLX@undefined@term{x}% + \expandafter\gdef\csname GLX@term@#1\endcsname{\textbf{#1!}}% + \else% + \GLX@output@short{#1}{#2}{\csname GLX@term@#1\endcsname}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acl} +% Output the \meta{long-form} of \meta{label} |#1| in \meta{list} |#2|. +% \begin{macrocode} +\newcommand{\GLX@do@acl}[2]{% + \expandafter\ifx\csname GLX@term@@#1\endcsname\relax% + \textbf{#1!}% + \PackageWarning{glosstex}{Term `#1' has no long form}% + \expandafter\gdef\csname GLX@term@@#1\endcsname{\textbf{#1!}}% + \else% + \GLX@output@long{#1}{#2}{\csname GLX@term@@#1\endcsname}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acf} +% Output \meta{short} |(|\meta{long}|)| of \meta{label} |#1| by calling +% |\GLX@do@acs| and |GLX@do@acl|. +% \begin{definition} +% |\GLX@do@acf||{|\meta{label}|}||{|\meta{list}|}||{|\meta{form}|}||{|\meta{lparen}|}||{|\meta{rparen}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@acf}[5]{% + \begingroup% + \ifthenelse{\equal{#3}{i}}{\def\GLX@il{i}\def\GLX@tf{-}}{% + \ifthenelse{\equal{#3}{l}}{\def\GLX@il{l}\def\GLX@tf{-}}{% + \ifthenelse{\equal{#3}{it}}{\def\GLX@il{i}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{if}}{\def\GLX@il{i}\def\GLX@tf{f}}{% + \ifthenelse{\equal{#3}{lt}}{\def\GLX@il{l}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{lf}}{\def\GLX@il{l}\def\GLX@tf{f}}{% + \ifthenelse{\equal{#3}{t}}{\def\GLX@il{-}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{f}}{\def\GLX@il{-}\def\GLX@tf{f}}{% + \def\GLX@il{-}\def\GLX@tf{-}}% + }}}}}}}% + \ifthenelse{\boolean{@GLX@itemfirst}}% + {% itemfirst true + \ifthenelse{% + \equal{\GLX@itemorder{#2}}{i}}{\def\GLX@itemorder@{i}}{% + \ifthenelse{\equal{\GLX@itemorder{#2}}{l}}{\def\GLX@itemorder@{l}}{% + \ifthenelse{\equal{\GLX@il}{i}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{-}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{l}}{\def\GLX@itemorder@{l}}{}}}}% + {% itemfirst false + \ifthenelse{% + \equal{\GLX@itemorder{#2}}{i}}{\def\GLX@itemorder@{i}}{% + \ifthenelse{\equal{\GLX@itemorder{#2}}{l}}{\def\GLX@itemorder@{l}}{% + \ifthenelse{\equal{\GLX@il}{i}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{-}}{\def\GLX@itemorder@{l}}{}% + \ifthenelse{\equal{\GLX@il}{l}}{\def\GLX@itemorder@{l}}{}}}}% + \ifthenelse{\boolean{@GLX@footnote}}% + {% footnote true + \ifthenelse{% + \equal{\GLX@itemplacement{#2}}{t}}{\def\GLX@itemplacement@{t}}{% + \ifthenelse{\equal{\GLX@itemplacement{#2}}{f}}{\def\GLX@itemplacement@{f}}{% + \ifthenelse{\equal{\GLX@tf}{t}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{-}}{\def\GLX@itemplacement@{f}}{}% + \ifthenelse{\equal{\GLX@tf}{f}}{\def\GLX@itemplacement@{f}}{}}}}% + {% footnote false + \ifthenelse{% + \equal{\GLX@itemplacement{#2}}{t}}{\def\GLX@itemplacement@{t}}{% + \ifthenelse{\equal{\GLX@itemplacement{#2}}{f}}{\def\GLX@itemplacement@{f}}{% + \ifthenelse{\equal{\GLX@tf}{t}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{-}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{f}}{\def\GLX@itemplacement@{f}}{}}}}% + % + \ifthenelse{\equal{\GLX@itemorder@}{i}}% + {% itemorder i + \ifthenelse{\equal{\GLX@itemplacement@}{f}}% + {\GLX@do@acf@if{#1}{#2}}% + {\GLX@do@acf@it{#1}{#2}{#4}{#5}}}% + {% itemorder l + \ifthenelse{\equal{\GLX@itemplacement@}{f}}% + {\GLX@do@acf@lf{#1}{#2}}% + {\GLX@do@acf@lt{#1}{#2}{#4}{#5}}}% + \endgroup}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@ac} +% Either call |\GLX@do@acf| or |\GLX@do@acs|, depending on +% |\GLX@terml@#1| $==$ |x|. +% \begin{definition} +% |\GLX@do@ac||{|\meta{label}|}||{|\meta{list}|}||{|\meta{form}|}||{|\meta{lparen}|}||{|\meta{rparen}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@ac}[5]{% + \begingroup% + \ifthenelse{\equal{#3}{i}}{\def\GLX@il{i}\def\GLX@tf{-}}{% + \ifthenelse{\equal{#3}{l}}{\def\GLX@il{l}\def\GLX@tf{-}}{% + \ifthenelse{\equal{#3}{it}}{\def\GLX@il{i}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{if}}{\def\GLX@il{i}\def\GLX@tf{f}}{% + \ifthenelse{\equal{#3}{lt}}{\def\GLX@il{l}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{lf}}{\def\GLX@il{l}\def\GLX@tf{f}}{% + \ifthenelse{\equal{#3}{t}}{\def\GLX@il{-}\def\GLX@tf{t}}{% + \ifthenelse{\equal{#3}{f}}{\def\GLX@il{-}\def\GLX@tf{f}}{% + \def\GLX@il{-}\def\GLX@tf{-}}% + }}}}}}}% + \ifthenelse{\boolean{@GLX@itemfirst}}% + {% itemfirst true + \ifthenelse{% + \equal{\GLX@itemorder{#2}}{i}}{\def\GLX@itemorder@{i}}{% + \ifthenelse{\equal{\GLX@itemorder{#2}}{l}}{\def\GLX@itemorder@{l}}{% + \ifthenelse{\equal{\GLX@il}{i}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{-}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{l}}{\def\GLX@itemorder@{l}}{}}}}% + {% itemfirst false + \ifthenelse{% + \equal{\GLX@itemorder{#2}}{i}}{\def\GLX@itemorder@{i}}{% + \ifthenelse{\equal{\GLX@itemorder{#2}}{l}}{\def\GLX@itemorder@{l}}{% + \ifthenelse{\equal{\GLX@il}{i}}{\def\GLX@itemorder@{i}}{}% + \ifthenelse{\equal{\GLX@il}{-}}{\def\GLX@itemorder@{l}}{}% + \ifthenelse{\equal{\GLX@il}{l}}{\def\GLX@itemorder@{l}}{}}}}% + \ifthenelse{\boolean{@GLX@footnote}}% + {% footnote true + \ifthenelse{% + \equal{\GLX@itemplacement{#2}}{t}}{\def\GLX@itemplacement@{t}}{% + \ifthenelse{\equal{\GLX@itemplacement{#2}}{f}}{\def\GLX@itemplacement@{f}}{% + \ifthenelse{\equal{\GLX@tf}{t}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{-}}{\def\GLX@itemplacement@{f}}{}% + \ifthenelse{\equal{\GLX@tf}{f}}{\def\GLX@itemplacement@{f}}{}}}}% + {% footnote false + \ifthenelse{% + \equal{\GLX@itemplacement{#2}}{t}}{\def\GLX@itemplacement@{t}}{% + \ifthenelse{\equal{\GLX@itemplacement{#2}}{f}}{\def\GLX@itemplacement@{f}}{% + \ifthenelse{\equal{\GLX@tf}{t}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{-}}{\def\GLX@itemplacement@{t}}{}% + \ifthenelse{\equal{\GLX@tf}{f}}{\def\GLX@itemplacement@{f}}{}}}}% + % + \ifthenelse{\equal{\GLX@itemorder@}{i}}% + {% itemorder i + \ifthenelse{\equal{\GLX@itemplacement@}{f}}% + {\expandafter\ifx\csname GLX@terml@#1\endcsname\relax% + \GLX@do@acf@if{#1}{#2}% + \expandafter\gdef\csname GLX@terml@#1\endcsname{x}% + \else% + \GLX@do@acs{#1}{#2}% + \fi}% + {\expandafter\ifx\csname GLX@terml@#1\endcsname\relax% + \GLX@do@acf@it{#1}{#2}{#4}{#5}% + \expandafter\gdef\csname GLX@terml@#1\endcsname{x}% + \else% + \GLX@do@acs{#1}{#2}% + \fi}}% + {% itemorder l + \ifthenelse{\equal{\GLX@itemplacement@}{f}}% + {\expandafter\ifx\csname GLX@terml@#1\endcsname\relax% + \GLX@do@acf@lf{#1}{#2}% + \expandafter\gdef\csname GLX@terml@#1\endcsname{x}% + \else% + \GLX@do@acs{#1}{#2}% + \fi}% + {\expandafter\ifx\csname GLX@terml@#1\endcsname\relax% + \GLX@do@acf@lt{#1}{#2}{#4}{#5}% + \expandafter\gdef\csname GLX@terml@#1\endcsname{x}% + \else% + \GLX@do@acs{#1}{#2}% + \fi}}% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acf@it} +% \begin{definition} +% |\GLX@do@acf@it||{|\meta{label}|}||{|\meta{list}|}||{|\meta{lparen}|}||{|\meta{rparen}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@acf@it}[4]{% + \GLX@do@acs{#1}{#2}% + \expandafter\ifx\csname GLX@term@@#1\endcsname\relax% + \else\nolinebreak[3]\space% + \ifthenelse{\equal{#3}{\relax}}{% + \expandafter\ifx\csname GLX@paren@l@#2\endcsname\relax% + \GLX@paren@l% + \else% + \expandafter\csname GLX@paren@l@#2\endcsname% + \fi}{#3}% + \GLX@do@acl{#1}{#2}% + \ifthenelse{\equal{#4}{\relax}}{% + \expandafter\ifx\csname GLX@paren@r@#2\endcsname\relax% + \GLX@paren@r% + \else% + \expandafter\csname GLX@paren@r@#2\endcsname% + \fi}{#4}% + \fi}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acf@if} +% \begin{definition} +% |\GLX@do@acf@if||{|\meta{label}|}||{|\meta{list}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@acf@if}[2]{% + \GLX@do@acs{#1}{#2}% + \expandafter\ifx\csname GLX@term@@#1\endcsname\relax% + \else\nolinebreak[3]\footnote{\GLX@do@acl{#1}{#2}}\fi}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acf@lt} +% \begin{definition} +% |\GLX@do@acf@lt||{|\meta{label}|}||{|\meta{list}|}||{|\meta{lparen}|}||{|\meta{rparen}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@acf@lt}[4]{% + \expandafter\ifx\csname GLX@term@@#1\endcsname\relax% + \else\GLX@do@acl{#1}{#2}\fi% + \nolinebreak[3]\space% + \ifthenelse{\equal{#3}{\relax}}{% + \expandafter\ifx\csname GLX@paren@l@#2\endcsname\relax% + \GLX@paren@l% + \else% + \expandafter\csname GLX@paren@l@#2\endcsname% + \fi}{#3}% + \GLX@do@acs{#1}{#2}% + \ifthenelse{\equal{#4}{\relax}}{% + \expandafter\ifx\csname GLX@paren@r@#2\endcsname\relax% + \GLX@paren@r% + \else% + \expandafter\csname GLX@paren@r@#2\endcsname% + \fi}{#4}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@do@acf@lf} +% \begin{definition} +% |\GLX@do@acf@lf||{|\meta{label}|}||{|\meta{list}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@do@acf@lf}[2]{% + \expandafter\ifx\csname GLX@term@@#1\endcsname\relax% + \else\GLX@do@acl{#1}{#2}\fi% + \footnote{\GLX@do@acs{#1}{#2}}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\GLX@newterm} +% This macro defines |\GLX@term@#1| and |\GLX@term@@|\meta{label} so that they expand to +% their appropriate meaning. +% \begin{definition} +% |\GLX@newterm||{|\meta{label}|}||{|\meta{item}|}||{|\meta{long-form}|}| +% \end{definition} +% \begin{macrocode} +\newcommand{\GLX@newterm}[3]{% + \expandafter\gdef\csname GLX@term@#1\endcsname{#2}% + \ifx#3\empty% + \else\expandafter\gdef\csname GLX@term@@#1\endcsname{#3}\fi}% +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{theglosstex} +% This environment is used for typesetting the lists generated by +% \GlossTeX{}. These are the meanings of the parameters: +% +% \begin{description} +% \item[\#1] This \meta{list} +% \item[\#2] This \meta{pageref-mode} +% \item[\#\#1] \meta{label} +% \item[\#\#2] \meta{item} +% \item[\#\#3] \meta{long-form} +% \item[\#\#4] \meta{text} +% \item[\#\#5] \meta{list} +% \item[\#\#6] \meta{list-mode} +% \item[\#\#7] \meta{page-stuff} +% \end{description} +% +% The whole list is encapsulated into the environment defined by the +% macros |\GLX@benv@|\meta{list} and |\GLX@eenv@|\meta{list}. These +% contain |\begin{description}| and |\end{description}| for +% \meta{list} $==$ |glo| as default. Each |\GlossTeXEntry| is only +% processed if its \meta{list} is identical to the environment's +% \meta{list} and it's \meta{list-mode} $==$ +% |a|. |\GLX@item@|\meta{list} is called for each of these entries. +% \begin{definition} +% |theglosstex||{|\meta{list}|}||{|\meta{pageref-mode}|}| +% \end{definition} +% \begin{macrocode} +\newenvironment{theglosstex}[2]{% +% \end{macrocode} +% First, we define some macros which correspond to the arguments given +% to this environment. We need |\GLX@theglosstex@list| when closing the +% current environment. |\GLX@theglosstex@pagerefmode| wouldn't really +% necessary if I weren't that lazy. Having this as global data makes +% |theglosstex| non reentrant, but we don't need nested glossaries. So +% we save passing all these arguments around. +% \begin{macrocode} + \gdef\GLX@theglosstex@list{#1}% + \gdef\GLX@theglosstex@pagerefmode{#2}% +% \end{macrocode} +% Next, we expand |\GLX@benv@|\meta{list} to start the environment. +% \begin{macrocode} + \csname GLX@benv@#1\endcsname% +% \end{macrocode} +% +% \begin{macro}{\glxref} +% \begin{macro}{\glxrefS} +% This one produces an entry in the current \meta{list} (stored in +% |\GLX@theglosstex@list|). +% \begin{definition} +% |\glxref||{|\meta{label}|}| +% \end{definition} +% \begin{macrocode} + \DeclareRobustCommand{\glxref}{% + \@ifstar{\GLX@glxrefS}{\GLX@glxref}}% + \newcommand{\GLX@glxref}[1]{% + \GLX@do@glosstex{##1}{n}{\GLX@theglosstex@list}{a}% + \GLX@do@acs{##1}{\GLX@theglosstex@list}}% + \newcommand{\GLX@glxrefS}[1]{% + \GLX@do@glosstex{##1}{n}{\GLX@theglosstex@list}{a}}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Define the corresponding macros for \meta{label} using \meta{item} +% and \meta{long-form} and also write out the macro call for the +% definition into the |.aux|-file so that they are defined at the next +% run early. Then, check if the current \meta{label} is to appear in +% the active \meta{list} and check if it is to appear in this +% \meta{list} at all. If these checks all succeed, call +% |\GLX@item@|\meta{label} to typeset the current \meta{label}. +% \begin{macrocode} + \newcommand{\GlossTeXEntry}[7]{% + \GLX@newterm{##1}{##2}{##3}% + \write\@auxout{\string\GLX@newterm{##1}{##2}{##3}}% + \ifthenelse{\equal{#1}{##5}}{% + \ifthenelse{\equal{a}{##6}}{% + \csname GLX@item@#1\endcsname% + {##1}{##2}{##3}{##4}{##5}{##6}{##7}}{}% + }{}}}{% + \csname GLX@eenv@\GLX@theglosstex@list\endcsname}% +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\printglosstex} +% The optional arguments are the \meta{list} to be typeset and the +% \meta{pageref-mode}. First, +% |\GLX@heading@|\meta{list} is called (defaults to something like +% |\section{\glossaryname}|) to produce a proper heading. Then, if +% present, the |.glx|-file is included into a |theglosstex| +% environment. +% \begin{definition} +% |\printglosstex|\opt{|(|\meta{list}|)|}\opt{|[|\meta{pageref-mode}|]|} +% \end{definition} +% \begin{macrocode} +\DeclareRobustCommand\printglosstex{\GLX@printglosstex} +\newcommand{\GLX@printglosstex}{% + \@ifnextchar({\GLX@@printglosstexr}{% + \@ifnextchar[{\GLX@@printglosstexs(glo)}{% + \GLX@@@printglosstex[p](glo)}}} +\newcommand{\GLX@@printglosstexr}{} +\def\GLX@@printglosstexr(#1){% + \@ifnextchar[{\GLX@@printglosstexs(#1)}{% + \GLX@@@printglosstex(#1)[p]}} +\newcommand{\GLX@@printglosstexs}{} +\def\GLX@@printglosstexs(#1)[#2]{% + \GLX@@@printglosstex(#1)[#2]} +\newcommand{\GLX@@@printglosstex}{} +\def\GLX@@@printglosstex(#1)[#2]{\GLX@do@printglosstex{#1}{#2}} +\newcommand{\GLX@do@printglosstex}[2]{% + \expandafter\ifx\csname GLX@heading@#1\endcsname\relax% + \textbf{#1!}% + \PackageWarning{glosstex}{Heading for list `#1' is not defined}% + \expandafter\gdef\csname GLX@heading@#1\endcsname{\textbf{#1!}}% + \else% + \csname GLX@heading@#1\endcsname% + \IfFileExists{\jobname.glx}{% + \begin{theglosstex}{#1}{#2}% + \input{\jobname.glx}% + \end{theglosstex}}% + {\typeout{No file \jobname.glx}}% + \fi} +% \end{macrocode} +% \end{macro} +% +% That was the hard part. The following macros are really trivial, so +% lean back now. They are primarily meant for convenience for using +% the |.std| and |.cfg| files. +% +% \begin{macro}{\glxgldefault} +% \begin{macro}{\glxacdefault} +% The commands set the default \meta{list} and \meta{pageref-mode} for +% the commands starting with |\gl| and |\ac| excluding |\glxref|, respectively. +% \begin{macrocode} +\newcommand{\glxgldefault}[2]{% + \gdef\GLX@gldef@list{#1}% + \gdef\GLX@gldef@page{#2}} +\newcommand{\glxacdefault}[2]{% + \gdef\GLX@acdef@list{#1}% + \gdef\GLX@acdef@page{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\glxitemorderdefault} +% \begin{macro}{\glxitemplacementdefault} +% These macros set the defaults concerning \meta{item-placement} and +% \meta{item-order} in \meta{list}. +% \begin{macrocode} +\newcommand{\glxitemorderdefault}[2]{% + \expandafter\gdef\csname GLX@itemorder@#1\endcsname{#2}} +\newcommand{\glxitemplacementdefault}[2]{% + \expandafter\gdef\csname GLX@itemplacement@#1\endcsname{#2}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\GLX@itemorder} +% \begin{macro}{\GLX@itemplacement} +% These expand to |\GLX@itemorder@#1| and |GLX@itemplacement@|\meta{list}. +% \begin{macrocode} +\newcommand{\GLX@itemorder}[1]{% + \expandafter\ifx\csname GLX@itemorder@#1\endcsname\relax% + \PackageWarning{glosstex}{Item order for list `#1' not defined}% + \expandafter\gdef\csname GLX@itemorder@#1\endcsname{\textbf{#1!}}% + \else% + \csname GLX@itemorder@#1\endcsname% + \fi} +\newcommand{\GLX@itemplacement}[1]{% + \expandafter\ifx\csname GLX@itemplacement@#1\endcsname\relax% + \PackageWarning{glosstex}{Item placement for list `#1' not defined}% + \expandafter\gdef\csname GLX@itemplacement@#1\endcsname{\textbf{#1!}}% + \else% + \csname GLX@itemplacement@#1\endcsname% + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\glxparendefault} +% Set the default for \meta{paren} on package-level. +% \begin{macrocode} +\newcommand{\glxparendefault}[2]{% + \gdef\GLX@paren@l{#1}% + \gdef\GLX@paren@r{#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glxparenlistdefault} +% Set the default for \meta{paren} on \meta{list}-level. +% \begin{macrocode} +\newcommand{\glxparenlistdefault}[3]{% + \expandafter\gdef\csname GLX@paren@l@#1\endcsname{#2}% + \expandafter\gdef\csname GLX@paren@r@#1\endcsname{#3}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\glxheading} +% This macro sets the headings to be used typesetting a \meta{list}. +% \begin{macrocode} +\newcommand*{\glxheading}[2]{% + \expandafter\gdef\csname GLX@heading@#1\endcsname{#2}} +% \end{macrocode} +% \end{macro} +% +% And finally, include the mandatory standard configuration file |glosstex.std| +% and an optional |.cfg|-file. +% \begin{macrocode} +\InputIfFileExists{glosstex.std}{% + \typeout{Using the standard configuration file glosstex.std}}{% + \PackageWarning{glosstex}{% + File glosstex.std not found. I can't stand it no more}} +\InputIfFileExists{glosstex.cfg}{% + \typeout{Using the configuration file glosstex.cfg}}{} +%</package> +% \end{macrocode} +% +% \subsection{The \MakeIndex{} Style-File \file{glosstex.ist}} +% +% It is very important to use an appropriate \gls{ist-file} for \MakeIndex\ +% to be able to read and write files in the correct format. \GlossTeX\ +% comes with |glosstex.ist| which has to be used as style-file for +% \MakeIndex{}. The file |glosstex.ist| should not be modified since +% it is tightly coupled to the features of \MakeIndex{}. Note the use +% of ``|~|'' as |quote| to enable german word-ordering using the |-g| +% option to \MakeIndex{}. So if you want a ``|~|'' in your |.gdf|-file, +% you have to type ``|~~|'' +% +% \begin{macrocode} +%<*ist> +keyword "\\GlossTeXEntry" +quote '~' +delim_0 "" +group_skip "\n" +indent_length 0 +indent_space "" +item_0 "\n\\GlossTeXEntry" +postamble "\n" +preamble "\n" +%</ist> +% \end{macrocode} +% +% \Finale +\endinput diff --git a/support/glosstex/glosstex.h b/support/glosstex/glosstex.h new file mode 100644 index 0000000000..bc130cea3a --- /dev/null +++ b/support/glosstex/glosstex.h @@ -0,0 +1,65 @@ + +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: glosstex.h,v 1.14 1997/12/13 16:06:55 volkan Exp $ */ + +#ifndef __GLOSSTEX_H +#define __GLOSSTEX_H + +#include "config.h" +#include "error.h" +#include "list.h" +#include <stdio.h> + +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif + +#define LINESIZE 1024 +#define WORDSIZE 128 + +extern enum e_loglevel loglevel; + +extern s_list labels; +extern s_list databases; + +extern char *inname; +extern char *outname; +extern char *logname; + +extern FILE *infile; +extern FILE *outfile; +extern FILE *logfile; + +extern char *progname; + +extern unsigned int count_label_parsing; +extern unsigned int count_label_defined; +extern unsigned int count_label_override; +extern unsigned int count_label_success; +extern unsigned int count_gdf_parsing; +extern unsigned int count_gdf_defined; +extern unsigned int count_gdf_success; + +#endif /* not __GLOSSTEX_H */ diff --git a/support/glosstex/glosstex.idx b/support/glosstex/glosstex.idx new file mode 100644 index 0000000000..b1f067b2cd --- /dev/null +++ b/support/glosstex/glosstex.idx @@ -0,0 +1,49 @@ +\indexentry{EBCDIC=EBCDIC}{2} +\indexentry{ASCII=ASCII}{2} +\indexentry{glosstex=\verb!*+\glosstex+|usage}{4} +\indexentry{acronym=\verb!*+\acronym+|usage}{4} +\indexentry{gls=\verb!*+\gls+|usage}{5} +\indexentry{gls*=\verb!*+\gls*+|usage}{5} +\indexentry{ac=\verb!*+\ac+|usage}{5} +\indexentry{ac*=\verb!*+\ac*+|usage}{5} +\indexentry{acs=\verb!*+\acs+|usage}{5} +\indexentry{acs*=\verb!*+\acs*+|usage}{5} +\indexentry{acl=\verb!*+\acl+|usage}{5} +\indexentry{acl*=\verb!*+\acl*+|usage}{5} +\indexentry{acf=\verb!*+\acf+|usage}{5} +\indexentry{acf*=\verb!*+\acf*+|usage}{5} +\indexentry{gxs-file=\texttt {.gxs}-file}{7} +\indexentry{glx-file=\texttt {.glx}-file}{7} +\indexentry{printglosstex=\verb!*+\printglosstex+|usage}{7} +\indexentry{glxitemorderdefault=\verb!*+\glxitemorderdefault+|usage}{8} +\indexentry{glxitemplacementdefault=\verb!*+\glxitemplacementdefault+|usage}{8} +\indexentry{glxparendefault=\verb!*+\glxparendefault+|usage}{9} +\indexentry{glxparenlistdefault=\verb!*+\glxparenlistdefault+|usage}{9} +\indexentry{glxref=\verb!*+\glxref+|usage}{9} +\indexentry{glxref*=\verb!*+\glxref*+|usage}{9} +\indexentry{ASCII=ASCII}{9} +\indexentry{EBCDIC=EBCDIC}{9} +\indexentry{ASCII=ASCII}{9} +\indexentry{EBCDIC=EBCDIC}{9} +\indexentry{ASCII=ASCII}{9} +\indexentry{GLX@output@short=\verb!*+\GLX@output@short+|main}{31} +\indexentry{GLX@output@long=\verb!*+\GLX@output@long+|main}{31} +\indexentry{glosstexpage=\verb!*+\glosstexpage+|main}{34} +\indexentry{GLX@benv@glo=\verb!*+\GLX@benv@glo+|main}{43} +\indexentry{GLX@eenv@glo=\verb!*+\GLX@eenv@glo+|main}{43} +\indexentry{GLX@item@glo=\verb!*+\GLX@item@glo+|main}{43} +\indexentry{GLX@benv@acr=\verb!*+\GLX@benv@acr+|main}{43} +\indexentry{GLX@eenv@acr=\verb!*+\GLX@eenv@acr+|main}{43} +\indexentry{GLX@item@acr=\verb!*+\GLX@item@acr+|main}{43} +\indexentry{glxgldefault=\verb!*+\glxgldefault+|usage}{10} +\indexentry{glxacdefault=\verb!*+\glxacdefault+|usage}{10} +\indexentry{glxitemorderdefault=\verb!*+\glxitemorderdefault+|usage}{10} +\indexentry{glxitemplacementdefault=\verb!*+\glxitemplacementdefault+|usage}{10} +\indexentry{glxparendefault=\verb!*+\glxparendefault+|usage}{10} +\indexentry{glxparenlistdefault=\verb!*+\glxparenlistdefault+|usage}{10} +\indexentry{glossaryname=\verb!*+\glossaryname+|main}{57} +\indexentry{listacronymname=\verb!*+\listacronymname+|main}{57} +\indexentry{pagename=\verb!*+\pagename+|main}{57} +\indexentry{glxheading=\verb!*+\glxheading+|usage}{11} +\indexentry{gxg-file=\texttt {.gxg}-file}{12} +\indexentry{glg-file=\texttt {.glg}-file}{12} diff --git a/support/glosstex/glosstex.ins b/support/glosstex/glosstex.ins new file mode 100644 index 0000000000..7aa5d36cbb --- /dev/null +++ b/support/glosstex/glosstex.ins @@ -0,0 +1,69 @@ +% -*- latex -*- +% $Id: glosstex.ins,v 1.13 1997/11/15 17:39:59 volkan Exp $ + +\def\batchfile{glosstex.ins} +\input docstrip.tex +\askforoverwritefalse +\keepsilent + +\preamble + + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + + Please note, that if you modify these files, do NOT distribute them + unless you have renamed the files and clearly stated, WHO has + modified the file and WHAT was modified. + + You are explicitly allowed to modify the file "`glosstex.std"' to + incorporate site-specific modifications. But do NOT distribute that + file unless you have renamed it and clearly stated, WHO has + modified the file and WHAT was modified. + +\endpreamble + +\generate{% + \file{glosstex.sty}{\from{glosstex.dtx}{package}} + \file{glosstex.std}{\from{glosstex.dtx}{std}} + \file{glosstex.ist}{\from{glosstex.dtx}{ist}} + \file{glosstex.gdf}{\from{glosstex.dtx}{gdf}} + \file{glosstex.cfg}{\from{glosstex.dtx}{cfg}} + } + +\Msg{**********************************************************************} +\Msg{*} +\Msg{* You will find the documentation in glosstex.dvi. You may remake it} +\Msg{* by running latex on glosstex.dtx or invoking `make doc'} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files (according to TDS):} +\Msg{*} +\Msg{* glosstex.sty to texmf/tex/latex/glosstex} +\Msg{* glosstex.std to texmf/tex/latex/glosstex} +\Msg{* glosstex.ist to texmf/makeindex} +\Msg{*} +\Msg{* and your own .gdf-files to texmf/glosstex.} +\Msg{*} +\Msg{* The files `glosstex.gdf' and `glosstex.cfg` are meant just for} +\Msg{* this document, so you won't want to install them, normally.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{**********************************************************************} + +\endinput diff --git a/support/glosstex/glosstex.pdf b/support/glosstex/glosstex.pdf Binary files differnew file mode 100644 index 0000000000..f3fdd50bff --- /dev/null +++ b/support/glosstex/glosstex.pdf diff --git a/support/glosstex/glosstex.sh b/support/glosstex/glosstex.sh new file mode 100755 index 0000000000..e4af94658a --- /dev/null +++ b/support/glosstex/glosstex.sh @@ -0,0 +1,105 @@ +#!/bin/sh + +# $Id: glosstex.sh,v 1.4 1997/11/08 14:33:39 volkan Exp $ +# makeindex -- a Kpathsea wrapper for the makindex index processor. +# (C) 1996, Thomas Esser. Idea and first version by Matthias Clasen. +# adaption for glosstex by Volkan Yavuz + +# 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# We need to search for makeindex.bin, since I want to create a +# symlink to it. The reason behind is to call makeindex.bin via +# that symlink (its name will be makeindex) to get "makeindex" +# in the verbose output, rather than "makeindex.bin" + +check_for_binary() +{ + testbin=$1; + set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g; s/:/ /g'`; shift + for i + do + if [ -x "$i/$testbin" ]; then + echo "$i/$testbin" + return 0 + fi + done + return 1 +} + +# for kpsetool and verbose messages: +prog=`basename $0` + +# We search along "kpsetool -w tex ...", so map GDFINPUTS into TEXINPUTS. +GDFINPUTS=`kpsetool -v -n $prog '$GDFINPUTS'` +test -n "$GDFINPUTS" && { TEXINPUTS="$GDFINPUTS"; export TEXINPUTS; } +unset GDFINPUTS + +glsstxbin=`check_for_binary $prog.bin` +if test ! -x "$glsstxbin"; then + echo "$prog: cannot execute $prog.bin. Aborted." >&2 + exit 1 +fi +TEMPDIR=${TMPDIR-/tmp}/glsstx.$$ +trap 'cd /; rm -rf $TEMPDIR' 1 2 15 +test -d $TEMPDIR || mkdir $TEMPDIR +ln -s $glsstxbin $TEMPDIR/$prog + +# The following is needed to handle envvars like GDFINPUTS=~: correctly. +# We put the GDFINPUTS from texmf.cnf into a temp. config file and +# set TEXMFCNF: +echo "TEXINPUTS = `kpsetool -v -n $prog '$GDFINPUTS'`" > $TEMPDIR/texmf.cnf +TEXMFCNF="$TEMPDIR:$TEXMFCNF"; export TEXMFCNF + +# If KPATHSEA_DEBUG is set, do not redirect kpsetool's stderr to /dev/null. +debug= +test "x${KPATHSEA_DEBUG}${KPATHSEA_DEBUG-x}" = xx && debug='2>/dev/null' + +# Analyze the positional arguments. +unset expargs +expargs="$expargs $1" +shift + +while test "x$1" != x; do + case "$1" in + -v*) + expargs="$expargs $1" + shift;; + + *) + case "$1" in + *.gdf) + eval gdffile=\`kpsetool -w -n $prog tex \"$1\" $debug\`;; + *) + eval gdffile=\`kpsetool -w -n $prog tex \"$1.gdf\" $debug\` + { test -n "$gdffile" && test -f "$gdffile"; } || + eval gdffile=\`kpsetool -w -n $prog tex \"$1\" $debug\`;; + esac + + if test -z "$gdffile" || test ! -f "$gdffile"; then + echo "GlossTeX database file $1 not found." >&2 + echo "Usage: $prog aux gdf0 [gdf1 ...] [-v[0-5]]" >&2 + exit 1 + fi + + # remove ./ from the filename: it is part of the verbose messages... + gdffile=`echo "$gdffile" | sed 's/^\.\///'` + expargs="$expargs $gdffile" + shift;; + esac +done + +$TEMPDIR/$prog $expargs +#echo $TEMPDIR/$prog $expargs +rm -rf $TEMPDIR diff --git a/support/glosstex/labels.c b/support/glosstex/labels.c new file mode 100644 index 0000000000..0b3f0d162b --- /dev/null +++ b/support/glosstex/labels.c @@ -0,0 +1,213 @@ + +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: labels.c,v 1.29 1997/12/13 16:06:55 volkan Exp $ */ + +#include "glosstex.h" +#include "labels.h" +#include "list.h" +#include "error.h" +#include <assert.h> +#include <string.h> +#include <stdlib.h> +#include <stdio.h> + +#define KEYWORDSIZE 10 /* \GLX@entry */ +#define INPUTWORDSIZE 7 /* \@input */ + +static int get_label (char buf[], + char *label, char *pageref_mode, + char *list, char *list_mode, char *page); + +int +read_labels (char *inname) +{ + FILE *infile; + char buf[LINESIZE]; + unsigned int lineno = 0; + s_list_iterator iter; + + /* don't forget to update "iter" whenever "labels" changes! */ + iter.root = labels.root; + iter.current = labels.root; + + if ((infile = fopen (inname, "r")) == NULL) { + error ("input-file %s", inname); + return 1; + } + printlog (PROGRESS, STDOUT, "(%s ", inname); + + while (fgets (buf, LINESIZE, infile) != 0) { + if (buf[strlen (buf) - 1] == '\n') + lineno++; + + if ((strncmp (buf, "\\GLX@entry", KEYWORDSIZE)) == 0) { + + s_label *label = (s_label *) malloc (sizeof (s_label)); + s_label *found_label = 0; + assert (label != 0); + + label->label = (char *) malloc (WORDSIZE + 1); + assert (label->label != 0); + + label->pageref_mode = (char *) malloc (WORDSIZE + 1); + assert (label->pageref_mode != 0); + + label->list = (char *) malloc (WORDSIZE + 1); + assert (label->list != 0); + + label->list_mode = (char *) malloc (WORDSIZE + 1); + assert (label->list_mode != 0); + + label->page = (char *) malloc (WORDSIZE + 1); + assert (label->page != 0); + + label->flag = UNRESOLVED; + + if (get_label (&buf[KEYWORDSIZE], + label->label, label->pageref_mode, + label->list, label->list_mode, + label->page) != 0) { + printlog (PROGRESS, STDOUT, "x"); + printlog (WARNING, LOGFILE, "\n%s:%u parse error: %s", + inname, lineno, buf); + count_label_parsing++; + continue; + } + if ((found_label = + find_label (&iter, FIND_FIRST, label->label, label->list)) == 0) { + list_add (&labels, label); + iter.root = labels.root; /* update iter because labels changed */ + printlog (INFORMATION, LOGFILE, "\n%s:%u %s[%s](%s)%s@%s", + inname, lineno, + label->label, label->pageref_mode, + label->list, label->list_mode, label->page); + count_label_success++; + printlog (PROGRESS, STDOUT, "i"); + } else { + if (((strcmp (found_label->pageref_mode, "n") == 0) && + (strcmp (label->pageref_mode, "n") != 0)) || + ((strcmp (found_label->list_mode, "n") == 0) && + (strcmp (label->list_mode, "n") != 0))) { + printlog (INFORMATION, LOGFILE, + "\n%s:%u %s[%s](%s)%s@%s overrides %s[%s](%s)%s@%s", + inname, lineno, + label->label, label->pageref_mode, + label->list, label->list_mode, label->page, + found_label->label, found_label->pageref_mode, + found_label->list, found_label->list_mode, found_label->page); + printlog (PROGRESS, STDOUT, "o"); + free (found_label->label); + free (found_label->pageref_mode); + free (found_label->list); + free (found_label->list_mode); + free (found_label->page); + found_label->label = label->label; + found_label->pageref_mode = label->pageref_mode; + found_label->list = label->list; + found_label->list_mode = label->list_mode; + found_label->page = label->page; + count_label_override++; + free (label); + } else { + printlog (VERBOSE, LOGFILE, "\n%s:%u %s[%s](%s)%s@%s ignored", + inname, lineno, + label->label, label->pageref_mode, + label->list, label->list_mode, label->page); + printlog (PROGRESS, STDOUT, "."); + count_label_defined++; + + free (label->label); + free (label->pageref_mode); + free (label->list); + free (label->list_mode); + free (label->page); + free (label); + } + } + + } else if ((strncmp (buf, "\\@input", INPUTWORDSIZE)) == 0) { + char *new_file_name = (char *) malloc (WORDSIZE + 1); + assert (new_file_name != 0); + + if (sscanf ((char *) (&buf[INPUTWORDSIZE]), + "{%128[^}]}\n", new_file_name) == 1) + read_labels (new_file_name); + } + } + printlog (PROGRESS, STDOUT, ")"); + + return 0; +} + +s_label * +find_label (s_list_iterator * iterator, enum e_find_mode find_mode, + char *label, char *list) +{ + if (find_mode == FIND_FIRST) + iterator->current = iterator->root; + else + iterator->current != 0 ? iterator->current = iterator->current->next : 0; + + while (iterator->current != 0) { + if ((strcmp (((s_label *) (iterator->current->ptr))->label, label) == 0) && + ((list == 0) ? 1 == 1 : + (strcmp (((s_label *) (iterator->current->ptr))->list, list) == 0))) + return ((s_label *) (iterator->current->ptr)); + iterator->current = iterator->current->next; + } + return 0; +} + +unsigned int +show_unresolved_labels (s_list list, FILE * file) +{ + unsigned int i = 0; + s_node *p = list.root; + while (p != 0) { + if ((((s_label *) (p->ptr))->flag) == UNRESOLVED) { + printlog (WARNING, STDOUT | LOGFILE, "\n%s[%s](%s)%s@%s unresolved", + ((s_label *) (p->ptr))->label, + ((s_label *) (p->ptr))->pageref_mode, + ((s_label *) (p->ptr))->list, + ((s_label *) (p->ptr))->list_mode, + ((s_label *) (p->ptr))->page); + ++i; + } + p = p->next; + } + return i; +} + +static int +get_label (char buf[], + char *label, char *pageref_mode, + char *list, char *list_mode, char *page) +{ + int i = sscanf ((char *) (buf), + "{%128[^}]}{%128[^}]}{%128[^}]}{%128[^}]}{%128[^}]}\n", + label, pageref_mode, list, list_mode, page); + + return i != 5 ? 1 : 0; +} diff --git a/support/glosstex/labels.h b/support/glosstex/labels.h new file mode 100644 index 0000000000..d36d3af3d8 --- /dev/null +++ b/support/glosstex/labels.h @@ -0,0 +1,54 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: labels.h,v 1.18 1997/12/13 16:06:56 volkan Exp $ */ + +#ifndef __LABELS_H +#define __LABELS_H + +#include "list.h" +#include <stdio.h> + +/* values for label flags */ +enum e_label_flag { + UNRESOLVED = 0, RESOLVED +}; +enum e_find_mode { + FIND_FIRST, FIND_NEXT +}; + +typedef struct s_label_s { + char *label; + char *pageref_mode; + char *list; + char *list_mode; + char *page; + enum e_label_flag flag; +} s_label; + +int read_labels (char *inname); +s_label *find_label (s_list_iterator * iterator, enum e_find_mode find_mode, + char *label, char *list); +unsigned int show_unresolved_labels (s_list list, FILE * file); + +#endif /* not __LABELS_H */ diff --git a/support/glosstex/list.c b/support/glosstex/list.c new file mode 100644 index 0000000000..7576653c52 --- /dev/null +++ b/support/glosstex/list.c @@ -0,0 +1,81 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: list.c,v 1.12 1997/06/02 17:58:16 yavuzv Exp $ */ + +#include <assert.h> +#include <stdlib.h> +#include "list.h" + +void * +list_add (s_list * list, void *ptr) +{ + s_node *new = 0; + + new = (s_node *) malloc (sizeof (s_node)); + assert (new != 0); + + if (list->root == 0) { + list->root = new; + list->top = new; /* LINT: top == 0 */ + list->top->ptr = ptr; + list->top->next = 0; + } else { + list->top->next = new; /* list->top->next == 0 */ + list->top = new; + list->top->ptr = ptr; + list->top->next = 0; + } + + return new; +} + + +/* FIXME: finish this one day */ +/* void */ +/* list_delete(s_list* list, char* string) */ +/* { */ +/* if (list->root == 0) */ +/* return; */ +/* else if (list->root == list->top) { */ +/* free(list->root->ptr); */ +/* free(list->root->ptr2); */ +/* free(list->root->ptr2); */ +/* free(list->root); */ +/* list->root = list->top = 0; */ +/* return; */ +/* } else { */ +/* s_node* prev = list->root; */ +/* s_node* p = list->root; */ +/* for (;;) { */ +/* if (strcmp((char*)p->ptr, string) == 0) { */ + +/* } else { */ + +/* } */ +/* } */ +/* return; */ +/* } */ +/* } */ + +/* FIXME: lint gives 23 code errors, most of which are not justified */ diff --git a/support/glosstex/list.h b/support/glosstex/list.h new file mode 100644 index 0000000000..4171cbc9fb --- /dev/null +++ b/support/glosstex/list.h @@ -0,0 +1,46 @@ +/* -*- c -*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: list.h,v 1.13 1997/10/26 15:01:03 volkan Exp $ */ + +#ifndef __LIST_H +#define __LIST_H + +typedef struct s_node_s { + void *ptr; + struct s_node_s *next; +} s_node; + +typedef struct s_list_s { + s_node *root; + s_node *top; +} s_list; + +typedef struct s_list_iterator_s { + s_node *root; + s_node *current; +} s_list_iterator; + +extern void *list_add (s_list * list, void *ptr); + +#endif /* not __LIST_H */ diff --git a/support/glosstex/main.c b/support/glosstex/main.c new file mode 100644 index 0000000000..7074b2903f --- /dev/null +++ b/support/glosstex/main.c @@ -0,0 +1,205 @@ +/* -*- c-*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: main.c,v 1.31 1997/12/13 16:06:57 volkan Exp $ */ + +#include "glosstex.h" +#include "database.h" +#include "error.h" +#include "labels.h" +#include "list.h" +#include "version.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +enum e_loglevel loglevel = PROGRESS; + +s_list labels; /* list of all labels found */ +s_list databases; /* list of all databases */ + +char *progname = 0; /* name this prog was called with */ + +char *inname = 0; /* name of root input (.aux) file */ +char *outname = 0; /* name of output file */ +char *logname = 0; /* name of logfile */ + +FILE *outfile; +FILE *logfile; + +unsigned int count_label_parsing = 0; /* parsing failed */ +unsigned int count_label_defined = 0; /* label already defined */ +unsigned int count_label_override = 0; /* label overridden */ +unsigned int count_label_success = 0; /* success */ +unsigned int count_label_unresolved = 0; /* unresolved labels */ + +unsigned int count_gdf_parsing; /* parsing failed */ +unsigned int count_gdf_defined; /* term already defined */ +unsigned int count_gdf_success; /* success */ + +char usage[] = "Usage: %s aux gdf0 [gdf1 ...] [-v[0-5]]\n"; + +static void parse_commandline (int argc, char **argv); +static void open_files (void); +static char *check_extension (const char *string, const char *ext); +static char *build_filename (const char *string, const char *ext); + +int +main (int argc, char *argv[]) +{ + labels.root = labels.top = 0; + databases.root = databases.top = 0; + + assert (argv[0] != 0); + progname = (char *) malloc (strlen (argv[0]) + 1); + + assert (progname != 0); + strcpy (progname, argv[0]); + + printf ("%s\n", version); + + parse_commandline (argc, argv); + + open_files (); + + if (read_labels (inname) != 0) { + if (unlink(outname) != 0) { + error ("output-file %s", outname); + exit (EXIT_FAILURE); + } + if (unlink(logname) != 0) { + error ("logfile %s", outname); + exit (EXIT_FAILURE); + } + exit (EXIT_FAILURE); + } + + printlog (PROGRESS, STDOUT, + "\n(parse errors:%d, overrides: %d, success:%d)\n\n", + count_label_parsing, count_label_override, count_label_success); + + read_databases (); + printlog (PROGRESS, STDOUT, + "\n(parse errors:%d, terms already defined: %d, success:%d)\n", + count_gdf_parsing, count_gdf_defined, count_gdf_success); + + if ((count_label_unresolved = show_unresolved_labels (labels, logfile)) != 0) + printlog (PROGRESS, STDOUT, "\n(unresolved labels: %d)", + count_label_unresolved, logname); + + printlog (PROGRESS, STDOUT, + "\nWrote output-file %s, log-file %s\n", outname, logname); + + return 0; +} + +static void +parse_commandline (int argc, char **argv) +{ + int index; + + if (argc < 3) { + fprintf (stderr, usage, progname); + exit (EXIT_FAILURE); + } + inname = check_extension (argv[1], ".aux"); + + for (index = 2; index < argc; index++) { + if (strncmp (argv[index], "-v0", 3) == 0) + loglevel = ERROR; + else if (strncmp (argv[index], "-v1", 3) == 0) + loglevel = WARNING; + else if (strncmp (argv[index], "-v2", 3) == 0) + loglevel = PROGRESS; + else if (strncmp (argv[index], "-v3", 3) == 0) + loglevel = INFORMATION; + else if (strncmp (argv[index], "-v4", 3) == 0) + loglevel = VERBOSE; + else if (strncmp (argv[index], "-v5", 3) == 0) + loglevel = DEBUG; + else if (strncmp (argv[index], "-v", 2) == 0) + loglevel = VERBOSE; + else + (void) list_add (&databases, check_extension (argv[index], ".gdf")); + } + +} + +static void +open_files (void) +{ + if (outname == 0) + outname = build_filename (inname, ".gxs"); + + if ((outfile = fopen (outname, "w")) == NULL) { + error ("output-file %s", outname); + exit (EXIT_FAILURE); + } + + if (logname == 0) + logname = build_filename (inname, ".gxg"); + + if ((logfile = fopen (logname, "w")) == NULL) { + error ("log-file %s", logname); + exit (EXIT_FAILURE); + } +} + +static char * +check_extension (const char *string, const char *ext) +{ + char *new = 0; + + if (strchr (string, '.') == 0) { + new = (char *) malloc (strlen (string) + strlen (ext) + 1); + assert (new != 0); + strcpy (new, string); + strcat (new, ext); + } else { + new = (char *) malloc (strlen (string) + 1); + assert (new != 0); + strcpy (new, string); + } + return new; +} + +static char * +build_filename (const char *string, const char *ext) +{ + char *filename = 0; + size_t len; + + len = strcspn (string, "."); + assert (len != 0); + + filename = (char *) malloc (len + strlen (ext) + 1); + assert (filename != 0); + + strncpy (filename, string, len); + filename[len] = '\0'; /* mark end of string */ + strcat (filename, ext); + + return filename; +} diff --git a/support/glosstex/version.c b/support/glosstex/version.c new file mode 100644 index 0000000000..51c7eb8ab1 --- /dev/null +++ b/support/glosstex/version.c @@ -0,0 +1,28 @@ + +/* -*- c-*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: version.c,v 1.31 1997/12/05 06:08:53 volkan Exp $ */ + +char version[] = "This is GlossTeX, version 0.4\n" +"GlossTeX comes with ABSOLUTELY NO WARRANTY. (C)opyright 1996, 97 Volkan Yavuz"; diff --git a/support/glosstex/version.h b/support/glosstex/version.h new file mode 100644 index 0000000000..52e7fc0540 --- /dev/null +++ b/support/glosstex/version.h @@ -0,0 +1,31 @@ +/* -*- c-*- */ + +/* + GlossTeX, a tool for the automatic preparation of glossaries. + Copyright (C) 1997 Volkan Yavuz + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + Volkan Yavuz, yavuzv@rumms.uni-mannheim.de + */ + +/* $Id: version.h,v 1.8 1997/06/02 17:58:18 yavuzv Exp $ */ + +#ifndef __VERSION_H +#define __VERSION_H + +extern char version[]; + +#endif /* not __VERSION_H */ |