Note also that makeindex has a restriction on the maximum sub-entry depth. To arrange a glossary with hierarchical categories, you need to first define the category and then define the sub-entries using the relevant category entry as the value of the parent key.
For example, suppose I want a glossary of mathematical symbols that are divided into Greek letters and Roman letters. Then I can define the categories as follows:. This gives a blank description and suppresses the description terminator. So first define the parent entry:. You can use the subentrycounter package option to automatically number the first-level child entries.
In the above example, the plural form for both of the child entries is the same as the parent entry, so the plural key was not required for the child entries. However, if the sub-entries have different plurals, they will need to be specified. For example, suppose I have a file called myentries.
For example, if my file myacronyms. If you have used the acronym package option, there are two possible solutions to this problem:. Note that only those entries that have been used in the text will appear in the relevant glossaries. Note that no check is performed to determine the existence of the target glossary. This means that you can, for example, move an entry to an undefined glossary so you can use the entry in the document text but not have it listed in any of the glossaries.
If you move an entry to an undefined glossary and you have hyperlinked entries, the link will point to an undefined target. Also, you will get warnings about no file defined for that glossary unless you use the nowarn package option. Unpredictable results may occur if you move an entry to a different glossary from its parent or children. Both makeindex and xindy concatenate a sequence of 3 or more consecutive pages into a range. With both makeindex and xindy , you can replace the separator and the closing number in the range using:.
Note that if you use xindy , you will also need to set the minimum range length to 1 if you want to change these suffixes:. The text which appears at that point in the document when using one of these commands is referred to as the link text even if there are no hyperlinks. The commands in this section also add a line to an external file that is used by makeindex or xindy to generate the relevant entry in the glossary.
This information includes an associated location that is added to the number list for that entry. By default, the location refers to the page number. The above warning is particularly important if you are using the glossaries package in conjunction with the hyperref package. The way the link text is displayed depends on. For example, to make all link text appear in a sans-serif font, do:.
Each entry has an associated conditional referred to as the first use flag. So if you use xindy with the above example, you would need to add:.
Instead, the glossaries package provides number formats listed in table 6. If you want to make a new format, you will need to define a command which takes one argument and use that. Remember that if you use xindy , you will need to add this to the list of location attributes:. Similarly, all the following commands described in this section also have a starred version that disables the hyperlink. If the entry has been marked as having been used , the value of the text key will be used, otherwise the value of the first key will be used.
These determine the link text from the plural and firstplural keys supplied when the entry was first defined.
As before, these commands also have a starred version that disable the hyperlink. Be careful when you use glossary entries in math mode especially if you are using hyperref as it can affect the spacing of subscripts and superscripts. For example, suppose you have defined the following entry:. Instead, you can use:. The same is true for all the following commands described in this section.
Note: if you want to use this command and the name key contains commands, you will have to disable the sanitization of the name key and protect fragile commands.
Note: if you want to use this command and the symbol key contains commands, you will have to disable the sanitization of the symbol key and protect fragile commands. Note: if you want to use this command and the description key contains commands, you will have to disable the sanitization of the description key and protect fragile commands.
Similarly for the other user keys:. The remaining arguments are ignored. For example, suppose you want a glossary of measurements and units, you can use the symbol key to store the unit:. So if you do, say:. If you only want the change to affect entries for a given glossary, then you need to use. For example, suppose you have created a new glossary called notation and you want to change the way the entry is displayed on first use so that it includes the symbol, you can do:.
Remember that if you use the symbol key, you need to use a glossary style that displays the symbol, as many of the styles ignore it. In addition, if you want either the description or symbol to appear in the link text , you will have to disable the sanitization of these keys and protect fragile commands. You can disable or enable links using:.
The effect can be localised by placing the commands within a group. For example, to add a page range to the glossary number list for the entry whose label is given by set :. This should be a comma separated list. See sections 2. The sample file sample-dual. This example sets up the list of acronyms using the acronym package option:. If you switch off the description sanitization , you must protect fragile commands: 1.
In both cases 2 and 3 above, the cross-referenced information appears in the number list , whereas in case 1, the cross-referenced information appears in the description. See the sample-crossref. The entries are separated by. The list entry text is displayed using:. If you want them added with that location, you can do:.
The next two commands are only available with the savenumberlist package option:. It only works when the default counter format is used that is, when the format key is set to glsnumberformat. The following keys are available:. Numbered sectional units can be obtained using the numberedsection package option.
Information can be added to the start of the glossary after the title and before the main body of the glossary by redefining. For example: suppose you are using the superheaderborder style 1 , and you want the glossary to be in two columns, but after the glossary you want to switch back to one column mode, you could do:. This command is always used regardless of the glossary style. The hierarchical glossary styles defined in the glossary-tree style file also set the name in bold.
For example, suppose you want all the entry names to appear in medium weight small caps, then you can do:. If you want to use xindy to sort the glossary, you must use the package option xindy :. This ensures that the glossary information is written in xindy syntax. This section covers the commands provided by the glossaries package that allow you to adjust the xindy style file.
To assist writing information to the xindy style file, the glossaries package provides the following commands:. In addition, if you are using a package that makes the double quote character active e. This document assumes that the double quote character has not been made active, so the examples just use " for clarity. If you want greater control over the xindy style file than is available through the L A T E X commands provided by the glossaries package, you will need to edit the xindy style file.
For additional information about xindy , read the xindy documentation. When you use xindy , you need to specify the language and encoding used unless you have written your own custom xindy style file that defines the relevant alphabet and sort rules. The optional argument can be used if you have multiple glossaries in different languages. Alternatively, you can specify the encoding using:. If you write your own custom xindy style file that includes the language settings, you need to set the language to nothing:.
If you call xindy without makeglossaries you need to remember to set the language and encoding using the -L and -C switches. If you use xindy , the glossaries package needs to know which counters you will be using in the number list in order to correctly format the xindy style file. The most likely attributes used in the format key textrm , hyperrm etc are automatically added to the xindy style file, but if you want to use another attribute, you need to add it using:.
For example, suppose I want a bold, italic, hyperlinked location. I first need to define a command that will do this:. The above example is illustrated in the accompanying sample file samplexdy2.
Another example: suppose you want the page numbers written as words rather than digits and you use the fmtcount package to do this. This means that you need to define a new location that has that form:. The sample file samplexdy. In the number list , the locations are sorted according to type.
The default ordering is: roman-page-numbers e. I , Alpha-page-numbers e. A , Appendix-page-numbers e. This ordering can be changed using:. If a number list consists of a sequence of consecutive numbers, the range will be concatenated. The number of consecutive locations that causes a range formation defaults to 2, but can be changed using:.
The argument may also be the keyword none , to indicate that there should be no range formations. See the xindy manual for further details on range formations. The glossary is divided into groups according to the first letter of the sort key. The glossaries package also adds a number group by default, unless you suppress it in the xindy package option.
If you are not using a Roman alphabet, you can change this using:. The first optional argument specifies the extension for the makeindex or xindy transcript file this information is only used by makeglossaries which picks up the information from the auxiliary file. Using the acronym package option is equivalent to:. Note that if you are using the main glossary as your list of acronyms, you need to declare it as a list of acronyms using the package option acronymlists.
This provides a useful means to define acronyms. For convenience, the glossaries package defines the command:. If the acronym package option has been used, this will be acronym , otherwise it will be main. The acronyms can then be used in exactly the same way as any other glossary entry.
If you want more than one list of acronyms, you must identify the others using the package options acronymlists. This ensures that options such as footnote and smallcaps work for the additional lists of acronyms.
If you want to use the smallcaps package option, you need to use lower case characters for the shortened form:. For example, if you want acronyms in a normal font on first use and emphasized on subsequent use, do:. Note that it is for this reason that the relsize package is not automatically loaded when selecting the smaller package option. There is also a starred version to suppress the hyperlink.
There are also analogous upper case variants:. The optional arguments are the same as before. If you find the above commands too cumbersome to write, you can use the shortcuts package option to activate the shorter command names listed in table Some of the acronym-related package options may be combined.
Listed below are the effects of different combinations. Note that on first use , it is the long form in the footnote that links to the relevant glossary entry where hyperlinks are enabled , whereas on subsequent use, the acronym links to the relevant glossary entry.
You can suppress the long form link by setting:. The different acronym-related package options store different information in the name , description and symbol keys. Table Note that the description package option uses the following command in the name :. For example, if I use the package options description and footnote , then the name field will contain the abbreviation and the symbol field will contain the long form.
In this case you can define your own style. This is done by redefining the following commands:. This command is typically used to set the name , first , firstplural , text and plural keys. It may also be used to set the symbol or description keys depending on your requirements. Note that you may still use the shortcuts package option with your custom style.
You must set up the custom style before defining new acronyms. As an example, suppose I want my acronym on first use to have the short form in the text and the long form with the description in a footnote. Suppose also that I want the short form to be put in small caps in the main body of the document, but I want it in normal capitals in the list of acronyms.
In my list of acronyms, I want the long form as the name with the short form in brackets followed by the description. I want the long form to be stored in the name and the short form to be stored in text. In addition, I want to use a glossary style that displays the symbol. Therefore, in my preamble I have:. Users of the obsolete glossary package may recall that the syntax used to define new acronyms has changed with the replacement glossaries package.
In order to facilitate migrating from the old package to the new one, the glossaries package 2 provides the command:. Recall that, in general, L A T E X ignores spaces following command names consisting of alphabetical characters. It should be put in your personal dictionary instead as in the example below. See the translator documentation for further details. Now with beamer documentation. You may prefer to have a dictionary for a particular type of document. If you want to share your custom dictionary, you can upload it to CTAN.
See Section 11 for further details. You can ignore this section if you have chosen Option 1. In order to generate a sorted glossary with compact number lists, it is necessary to use an external indexing application as an intermedi- ate step unless you have chosen Option 1.
It is this application that creates the file containing the code that typesets the glossary. If this step is omitted, the glossaries will not appear in your document. As from version 1. Previous versions were designed to be used with makeindex only. Commands that only have an effect when xindy is used are described in Section This is a multi-stage process, but there are methods of automating document compilation using applications such as latexmk and arara.
See Section 1. Perl is stable, cross-platform, open source software that is used by a number of TEX-related applica- tions. Most Unix-like operating systems come with a Perl interpreter. TEX Live also comes with a Perl interpreter. This will hopefully pro- vide more helpful messages in some cases. There is also a Java GUI alternative called makeglossariesgui, distributed separately, that has diagnostic tools. Whilst it is strongly recommended that you use the makeglossaries script or makeglossariesgui, it is possible to use the glossaries package without using either application.
These are listed in ta- ble 1. Note that if any of your entries use an entry that is not ref- erenced outside the glossary, you will need to do an additional makeglossaries, makeindex or xindy run, as appropriate. For example, suppose you have defined the following entries:3 3 As from v3.
For exam- ple, if the document is called myDoc. For example, if the page numbering is not reset after the table of contents, the insertion of the table of contents on the second LATEX run may push glossary entries across page boundaries, which means that the number lists in the glossary may need updating.
The examples in this document assume that you are accessing makeglossaries, xindy or makeindex via a terminal. Alternatively, your text editor may have the facility to create a func- tion that will call the required application. Section 1. If any problems occur, remember to check the transcript files e. For example, if your document is called myDoc. MiKTeX also provides a wrapper makeglossaries.
SX site. Alternatively, there is a batch file called makeglossaries. This just explicitly loads the script into Perl.
If you move the. You can specify in which directory the. If you want, you can create a man page for makeglossaries using pod2man and move the resulting file onto the man path. Al- ternatively do makeglossaries --help for a list of all options or makeglossaries --version for the version number.
When upgrading the glossaries package, make sure you also upgrade your version of makeglossaries. The current version is 2. However MikTEX users can install it. This causes the glossary entries to be writ- ten in raw xindy format, so you need to use -I xindy not -I tex. To run xindy type the following in your terminal all on one line : xindy -L hlanguagei -C hencodingi -I xindy -M hstylei -t hbasei. The default name for this style file is hbasei. You may need to specify the full path name depending on the current working directory.
If any of the file names contain spaces, you must delimit them using double-quotes. You need to do the same for each of the other glossaries including the list of acronyms if you have used the acronym package option , substituting. For example, if you have used the acronym package option, then you would need to do: xindy -L english -C utf8 -I xindy -M myDoc -t myDoc. Note that if you use makeglossaries instead, you can replace all those calls to xindy with just one call to makeglossaries: makeglossaries myDoc Note also that some commands and package options have no effect if you use xindy explicitly instead of using makeglossaries.
These are listed in table 1. To run makeindex, type the follow- ing in your terminal: makeindex -s hstylei. By de- fault, this is hbasei. Note that there are other options, such as -l letter ordering.
See the makeindex manual for further details. If you have additional glossaries for example, if you have used the acronym package option then you must call makeindex for each glossary, substituting. For example, if you have used the acronym package option, then you need to type the fol- lowing in your terminal: makeindex -s myDoc. Note that if you use makeglossaries instead, you can replace all those calls to makeindex with just one call to makeglossaries: makeglossaries myDoc Note also that some commands and package options have no effect if you use makeindex explicitly instead of using makeglossaries.
This section describes how the information is stored in the auxiliary file. The label for the glossary is also given for information purposes only, but is not required by the indexing applications. These com- mands are omitted if makeindex should be used. If Option 1 has been used, the. This includes options where the hvaluei part may be omitted, such as acronym. This is a general limitation not restricted to the glossaries package.
Other warnings will still be issued unless you use the nowarn option described above. Note that if you use this op- tion, you must create another glossary in which to put all your entries either via the acronym or acronyms package option de- scribed in Section 2. If, on the other hand, you want the sort value ex- panded, you need to switch off the sanitization. If savewrites is set, the glossary information will be stored in token registers until the end of the document when they will be writ- ten to the external files.
If you run out of token registers, you can use etex. This option can significantly slow document compilation. As an alternative, you can use the scrwfile package part of the KOMA-Script bundle and not use this option.
You can also reduce the number of write registers by using Op- tion 1 or by ensuring you define all your glossary entries in the preamble. You can modify the translations by providing your own dictionary. If polyglossia has been loaded, glossaries-polyglossia will be loaded.
Instead load glossaries-babel. Note that this applies to all glossary types. It may be that you only want to apply this to just the acronyms where the first use explains the meaning of the acronym but not for ordinary glossary entries where the first use is identical to subsequent uses. Make sure you enclose the value in braces if it contains any commas. See Section 6 for further details. This is always true if you use Option 1.
This will align the table of contents entry with the numbered section titles. Note that this option has no effect if the toc option is omitted. If toc is used without numberline, the title will be aligned with the section numbers rather than the section titles. Its value should be the name of a sectional unit e.
This will make the glossaries ap- pear in the named sectional unit, otherwise each glossary will appear in a chapter, if chapters exist, otherwise in a section. Un- numbered sectional units will be used by default. This may cause an unwanted blank page to appear before each glossary. The textcase package is automatically loaded by glossaries.
Each glos- sary uses the unstarred form of a sectioning command e. If set, each main level 0 glossary entry will be numbered when using the standard glossary styles. This option creates glossaryentry the counter glossaryentry.
If set, each level 1 glossary entry will be numbered when using the standard glossary styles. This option creates the counter glossarysubentry glossarysubentry. The counter is reset with each main level 0 entry. Note that this package option is independent of en- trycounter. Its value should be the name of the glossary style to use.
This reduces overhead by not defining un- wanted styles and commands. This reduces overhead by not defining unwanted styles and commands. This reduces overhead by not defining un- wanted styles. Note that since the default style is list, you will also need to use the style option to set the style to something else.
If you use this option, you need to load a glossary style pack- age such as glossary-mcols. For further details see Section 8. The value should be the name of the default counter to use in the number lists see Section 5. If no value is specified, true is assumed. When set to true, this option suppresses the default post description dot used by some of the predefined styles. When set to true, this option suppresses the default vertical gap between groups used by some of the predefined styles.
The other arguments, htypei and hlabeli, are the glossary type and the entry label for the current entry. For a com- plete document, see the sample file sampleSort. The default is word ordering. If you use makeglossaries, it will automatically detect that it needs to call makeindex. The indexing style file will been given a. You may omit this package option if you are using Option 2 as this is the default. If you use makeglossaries, it will automatically detect that it needs to call xindy.
This defaults to true, but can be suppressed. See Section 11 for further details on using xindy with the glossaries package. If you have other lists of acronyms, you can specify them as a comma-separated list in the value of acronymlists. This will add the glossaries given in hlisti to the list of glossaries that are identified as lists of acronyms. See Section 13 for further details. Either use glossaries for the indexing or use a custom indexing package, such as makeidx, index or imakeidx.
You can, of course, load one of those packages and load glossaries without the index package option. If you need to use this command, use it as soon as possible after loading glossaries otherwise you might end up using it too late for the change to take effect. For example, if you try changing the acronym styles such as smallcaps after you have started defining your acronyms, you are likely to get unexpected results. If you try changing the sort option after you have started to define entries, you may get unexpected results.
This sets up the internal commands required to make Option 1 work. Note that if you have a custom. Each glossary entry is assigned a number list that lists all the lo- cations in the document where that entry was used. By default, the location refers to the page number but this may be overridden using the counter package option.
The default form of the location number assumes a full stop compositor e. For example, if you want number lists containing a mixture of A-1 and 2. See Section 4. Only those entries that are referenced in the document using any of the commands described in Section 6, Section 7 or Section 8 will appear in the glossary.
See Section 10 to find out how to display the glossary. Note that this command may only be used in the pream- ble. Be careful of unwanted spaces. For all the above commands, the first argument, hlabeli, must be a unique label with which to identify this entry. There are two required fields: description and either name or parent. Available fields are listed below: name The name of the entry as it will appear in the glossary.
However, note that not all glossary styles support multi-line descriptions. Note that the parent entry must be defined before its sub-entries.
If omitted, the value is set to the same as the description key. If this field is omitted, the value of the name key is used. If this field is omitted, the value of the text key is used. Note: prior to version 1. Note that not all glossary styles display the symbol. If omitted, the value is set to the same as the symbol key. Take care with xindy Option 3 : if you have entries with the same sort value they will be treated as the same entry. Take care if you use Option 1 and the name contains fragile commands.
For example, an associated dimension or an alternative plural or some other grammat- ical construct. Other keys are also provided by the glossaries-prefix Section 17 and glossaries-accsupp Sec- tion 18 packages.
If the value is missing or is true, this will suppress the number list just for this entry. See Section 5. Using the see key will automati- cally add this entry to the glossary, but will not automatically add the cross-referenced entry. The referenced entry should be supplied as the value to this key. Alter- natively, you can use the seeautonumberlist package option. For further details, see Section 8. Additional keys are provided by the glossaries-prefix Section 17 and the glossaries-accsupp Section 18 packages.
You can also define your own custom keys see Section 4. You can, of course, define an easy to remember synonym. However, this must be done before the entries are defined. For a complete document, see the sample file sample-newkeys. In most cases, this is the same as the name of the key except for those listed in table 4.
This should be used before you define the entries. These may be used to order the glossary into categories, in which case the sub- entry will have a different name to its parent entry, or it may be used to distinguish different definitions for the same word, in which case the sub-entries will have the same name as the parent entry. Note that not all glossary styles support hierarchical entries and may display all the entries in a flat format. Therefore you need to ensure that you use a suitable style.
See Section 15 for a list of predefined styles. As from version 3. Note that the parent entry will automatically be added to the glos- sary if any of its child entries are used in the document.
If the parent entry is not referenced in the document, it will not have a number list. Note also that makeindex has a restriction on the maximum sub-entry depth. This gives a blank description and suppresses the description terminator. You can use the subentrycounter package option to automatically number the first-level child entries. See Section 2. In the above example, the plural form for both of the child entries is the same as the parent entry, so the plural key was not required for the child entries.
However, if the sub-entries have different plurals, they will need to be specified. This is a preamble-only command. For example, if my file myacronyms. Change myacronyms. Suppose, for example, one document may require a more detailed description. For example, suppose your file called, say, terms. Note that no check is performed to determine the existence of the target glossary.
This means that you can, for example, move an entry to an undefined glossary so you can use the entry in the document text but not have it listed in any of the glossaries. If you move an entry to an undefined glossary and you have hyperlinked entries, the link will point to an undefined target. Also, you will get warnings about no file defined for that glossary unless you use the nowarn package option.
Unpredictable results may occur if you move an entry to a different glossary from its parent or children. I reluctantly removed this restriction in ver- sion 1. If you define an entry mid-way through your document, but subsequently shuffle sections around, you could end up using an entry before it has been defined.
Entry information is required when displaying the glossary. If this occur at the start of the document, the entry details are be- ing looked up before the entry has been defined.
To overcome these problems, as from version 4. This means that the entry can now be looked up in the glossary, even if the glos- sary occurs at the beginning of the document.
This section focuses on good writing practice. The main reason cited by users wanting to define entries within the document environment rather than in the preamble is that they want to write the definition as they type in their document text. If you plan in advance, you should have a fairly good idea of the type of terminology that your document will contain, so while you are planning, create a new file with all your entry definitions.
Most text editors have the ability to have more than one file open at a time. The other advantage to this ap- proach is that if you forget the label, you can look it up in the defini- tion file rather than searching through your document text to find the definition. By default, these numbers refer to the pages on which that entry has been used using any of the commands described in Section 6 and Section 7. The number list can be suppressed using the nonumberlist package option, or an alternative counter can be set as the default using the counter package option.
The number list is also referred to as the loca- tion list. Both makeindex and xindy Options 2 and 3 concatenate a se- quence of 3 or more consecutive pages into a range. The third ar- gument is the control sequence to use for any cross-references in the list. The text which appears at that point in the document when using one of these commands is referred to as the link text even if there are no hyperlinks.
The commands in this section also add a line to an external file that is used to generate the relevant entry in the glossary. This information includes an associated location that is added to the number list for that entry. By default, the location refers to the page number.
For further information on num- ber lists, see Section 5. The above warning is particularly important if you are using the glossaries package in conjunction with the hyperref package. It may be that you only want terms in certain glossaries to have links, but not for other glossaries.
For example, suppose your document contains lots of technical acronyms that the reader might not know, but it also contains some very common acronyms that most read- ers will recognise. So you might want two acronym lists, but only the technical list will get displayed in your document. The user may define new glossary styles, and preambles and postambles can be specified. There is provision for loading a database of terms, but only terms used in the text will be added to the relevant glossary.
The package uses an indexing program to provide the actual glossary; either makeindex or xindy may serve this purpose, and a Perl script is provided to serve as interface. Download the contents of this package in one zip archive 7. Login Join Settings Help.
0コメント