next up previous
Next: glossaries FAQ Up: FAQ for Nicola Talbot's Previous: fmtcount FAQ

glossary FAQ

This package is now obsolete and has been replaced by the glossaries package, please use that instead. Any bugs that remain in the glossary package will not be fixed as it is no longer maintained.

Top


Subsections



Unexpected Output

My glossary hasn't appeared (or hasn't been updated).

Check the following:

If you have defined a new glossary type, have you checked all the analogous commands to the above?

Top

My list of acronyms hasn't appeared.

Have you used the acronym=true package option? If no, check the answers to the previous item, if yes, make sure you have used \makeacronym and \printacronym. Have you used any of the acronyms you have defined? Remember that \acrsh, \acrln, \<acr-name>short and \<acr-name>long don't generate entries in the list of acronyms, where \<acr-name> is the name of an acronym command.

Top

One of more of my glossary entries hasn't appeared.

Check the following

Check the makeindex log file to see if there are any error messages. (This will be the file ending .glg for the main glossary, .alg if the list of acronyms is separate from the main glossary, or whatever you defined it to be if it's for a secondary glossary.)

Top

Some of my acronyms haven't appeared in the glossary

The acronyms are implicitly entered in the glossary either by the \glossary command or the \acronym command which works in the same way, so check the answer to the previous FAQ item. Pay particular attention to any acronyms that contain an umlaute as " is a makeindex special character. For example:

\newacronym{RNA}{Ribonukleins\"aure}{name=Ribonukleins\""aure (RNA)}
Note that the name key has to be explicitly used in this example because in the document text, \" is required but in the glossary entry \"" is required.

Have you used any of the acronyms you have defined? Remember that \acrsh, \acrln, \<acr-name>short and \<acr-name>long don't generate entries in the list of acronyms, where \<acr-name> is the name of an acronym command.

Top

The space after my acronym has disappeared.

Remember that LaTeX ignores all spaces after command names, so the space after, say, \RNA will be ignored. To force a space, either put an empty set of braces after the command, e.g. \RNA{} or use \ (backslash followed by a space), e.g. \RNA\ .

As from version 2.22, if you load the xspace package before loading the glossary package, \xspace will be appended to acronym commands.

Top

I get spaces where there shouldn't be any when using the xspace package

This has been fixed in version 2.28. Please download and reinstall.

Top

My glossary entries haven't been sorted properly

Use the sort key.

Top

Why are there numbers after my glossary entries?

These are the page numbers where the corresponding \glossary command has been used. Use the package option number=none if you don't want the page numbers to appear.

Top

My glossary has duplicate entries on separate lines.

LaTeX treats multiple spaces equivalent to a single space, but makeindex takes spaces into account when determining whether two entries are identical. For example:

\glossary{name=Identity matrix,
description=diagonal matrix with 1's along the diagonal}
and
\glossary{name=Identity  matrix,
description=diagonal matrix with 1's along the diagonal}
will be treated as different entries by makeindex, because the first has only one space between "Identity" and "matrix" and the second has two. The easiest way to ensure consistency is to use \storeglosentry together with \useglosentry, \useGlosentry or \gls.

Top

I've used the hyper option, but nothing happens when I click on the numbers in the glossary.

Check the following:

  1. Have you used PDFLaTeX, or a driver/previewer that understands hyperlinks?
  2. Have you remembered to use the hyperref or html package (these packages must be loaded before the glossary package)?
  3. Have you remembered to use a formatting command which uses \hyperlink? (E.g. using hyperbf instead of textbf)? Remember to check the format key in your \glossary commands, and the glsnumformat key in the \setglossary command.
  4. What application are you using to view the PDF file? Ghostview can display a PDF file, but ignores the links. If you are using Windows, try using Adobe's Acrobat Reader, or if you are using UNIX or Linux, try using xpdf or acroread.

Top

The delimiters between the page numbers have disappeared for some of my glossary entries

This has been fixed in version 2.25. Please download and install the latest version.

Top

The optional argument to \useacronym doesn't have any effect

This has been fixed in version 2.26. Please download and install the latest version.

Top

My acronym has been expanded twice

By default, if any of your acronym commands occur within a group (this includes environments which form implicit grouping) the effect will be local to that group. You can either unset the acronym outside the group using \unsetacronym, or use the global package option. (New to version 2.31.)

Top

The description key in \newacronym has been ignored

This is probably because you have used \setacronymdescfmt without including \glodesc (see manual for further details).

Top

My glossary has ended up wider than my page.

This may occur if you have long entry names, and you are using either the style=long or style=super options. The width of the description column is proportional to the line width (in fact, it's 0.6\linewidth) but the first column is as wide as the widest entry name. You can either redefine \glossaryalignment to change the column specifications, or use one of the list-type styles.

Top

The glossary section in my table of contents says the glossary is on the page before it actually is

If you are using the hypertoc package option, check you are using a least version 2.38.

Top

The page numbers in my glossary don't match up with the actual page numbers where the entry was defined.

You may need to LaTeX your document again (just as you have to do with \tableofcontents, \listoffigures etc).

If the page numbers are still out by 1 for entries or acronyms that occur in the first paragraph of a page, then this is a bug. It has been fixed in the new glossaries package, but not for the obsolete glossary package. It is strongly recommended that you upgrade to the new glossaries package, but you are reluctant to upgrade due to time constraints, you can fix it as follows:

  1. Copy glossary.sty to another name.
  2. Search for
    \edef\@@glo@num{\csname the\@glo@num\endcsname}
    
    and replace with
    \expandafter\noexpand\edef\@@glo@num{\csname the\@glo@num\endcsname}
    
  3. Change "glossary" in \ProvidesPackage{glossary} to the base name of the edited file created in step 1.

Top

When I have different page numbering (e.g. arabic and roman) the links in the glossary go to the wrong page

This is also likely to be true for the table of contents! If you are using the hyperref package, and you have more than one page with the same numerical value (e.g. a page i and a page 1), you need to use the hyperref package option plainpages=false (note that you should also have hypertexnames=true--which should be true by default).

Top

Sometimes a page break occurs between the name and the description when using altlist style

This has been fixed in version 2.36.

Top

I redefined \glossaryname, but it's gone back to its default definition

You are probably using another package which redefines \glossaryname (e.g. babel). Try redefining it immediately before \printglossary (or immediately before \tableofcontents if you are using the package option toc=true.)

Top

I tried redefining \glossaryalignment but it had no effect.

This bug was fixed in version 2.34. Please download and install the latest version.

Top

The hypertoc option doesn't work when the glossary is part of a section

This has been fixed in version 2.37. Please download and install the latest version.

Top

The hyperlinks to the glossary don't work with babel[french/frenchb]

This has been fixed in version 2.42. Please download and install the latest version.

Top

Package Errors

I get an error when using the command \saveglosentry.

Don't use this command it's obsolete, use \storeglosentry instead.

Top

I get an error when using displaymath within \storeglosentry

This has been fixed in version 2.4. Please download and install the latest version.

Top

I'm getting a hyperlink error (or an error occurs when using commands such as \mathrm in the name key)

Each glossary entry is given a label generated from the sort key, if provided, or the name key if the sort key is omitted, this enables a hyperlink from the term in the document to its corresponding entry in the glossary. If your name key contains commands, e.g.

\glossary{name={\ensuremath{\log}},description={The logarithm}}
then this may cause problems with constructing the label (and it will also cause makeindex problems sorting the entries). Under such circumstances, it is recommended that you use the sort key, e.g.
\glossary{name={\ensuremath{\log}},description={The logarithm},sort={log}}

Top

I had an error, fixed it, but I keep getting the same error message.

Suppose you've made an error in the \glossary command. For example:

\glossary{name=Java,description=A programming language,format=texbf}
In this case textbf has been mis-spelt. This error will be copied to the glo file, which in turn will be copied to the gls file by makeindex. A subsequent run of LaTeX will read this error in. If you fix the error in your main document, the error will still be read in from the gls file. The best thing to do is to delete the gls file, and try again.

Top

I get an error when I have a space or percent character in \glossary

This has been fixed in version 2.4. Please download and install the latest version.

Top

I get an error when I have a comma in my description

Group your description. See next item.

Top

I'm getting a keyval error.

The glossary package uses the keyval package to extract the information from <key>=<value> comma separated lists. You need to make sure the syntax is correct. If your <value> contains a comma, you will need to enclose <value> in curly braces. See the keyval documentation for further information5.

If you get an error message when using a comma within \newacronym, please download and install the latest version of the glossary package. (This error was fixed in version 2.33).

Top

I get an error when starting a new paragraph within the glossary description

You can't have paragraph breaks when using key-value pairs. If you really feel the need to have a new paragraph within a description, try \newline\hspace*{15pt} instead, but be aware that makeindex only has a limited buffer--if the description is too long the entry will be discarded.

Top

I get the error \gloitem already defined

You are using the glossary package with another package or class file that supports glossaries (e.g. memoir).

Top

The glossary package conflicts with the datetime package.

This has been fixed in version 2.01. Please download and install the latest version.

Top

I get an error when using certain commands, such as \cite or ~ in \newacronym.

This has been fixed in version 2.1. Please download and install the latest version.

Top

The glossary package conflicts with the array/tabular/tabularx package.

The glossary package used to conflict with the array package. This was fixed in version 2.1, and improved in version 2.3. Please download and install the latest version.

Top

I get an error when I try to define a new glossary type called acronym

Acronyms are already built in to the glossary package. If you want a list of acronyms separate to the main glossary, use the package option acronym=true.

Top

Acronyms cause a problem in chapter or section headings

I get the following error:

Use of \@chapter doesn't match its definition
or
! Argument of \@sect has an extra }
or something similar.

If you want to use an acronym command in a moving argument (such as a chapter heading) you need to \protect it first. Note that if you do put an acronym in a chapter etc heading, it will be expanded for the first time in the table of contents, not in the chapter heading. The best way to get around this is to use the optional argument, e.g.

\chapter[Introduction to Kernel Support Vector Machines]{Introduction 
to \protect\KSVM}
You will also need to do this if you are using bookmarks in a PDF document.

Alternatively, you can do:

\resetacronym{KSVM}
\chapter{Introduction to \protect\KSVM}
or if you are using PDFLaTeX:
\resetacronym{KSVM}
\chapter{Introduction to \texorpdfstring{\protect\KSVM}{KSVM}}
or just use either \acrsh or \acrln (which won't generate an entry in the glossary).

Top


The glossary package conflicts with ngerman.

This problem is caused by the fact that ngerman redefines the effect of the double quote character, but this character is used in the creation of the ist makeindex style file. Try one of the following methods:

  1. Include the ngerman package after the \makeglossary command:
    \usepackage{glossary}
    \makeglossary
    \usepackage{ngerman}
    

  2. First omit the ngerman package and include \makeglossary then LaTeX your document. This will create the ist file. Then include the ngerman package, and insert \noist before the \makeglossary command, this will prevent further attempts to generate the ist file.
    \usepackage{ngerman}
    \usepackage{glossary}
    \noist\makeglossary
    

  3. Use \noist, as above, and create the ist file in an ordinary text editor. The file should contain the following lines:
    keyword "\\glossaryentry"
    preamble "\\begin{theglossary}"
    postamble "\n\\end{theglossary}\n"
    group_skip "\\gloskip "
    item_0 "\n\\gloitem "
    delim_0 "\n\\glodelim "
    page_compositor "-"
    delim_n "\\delimN "
    delim_r "\\delimR "
    
It is possible that there may be other packages which will also cause a problem, if so, try any of the above.

Top

I get the error \acronymname already defined

This has been fixed in version 2.34. Please download and install the latest version.

Top

I get an error when using verbatim text in a glossary entry

As a general rule, you can't use verbatim text in an argument. This applies to all commands defined in the glossary package. Try using \texttt instead.

Top

I get an error when I try to redefine \glossaryheader

As from version 2.4, you should use \newcommand when defining \glossaryheader, as the glossary package no longer defines this command. The glossary package checks to see if this command is defined. If it is it is used, otherwise the style-specific header is used.

Top

I get the message: ! pdfTeX warning (dest): name{...} has been referenced but does not exist

This is not an error, but a warning. This just means that PDFLaTeX can't find the given target. Since all the targets defined by the glossary package will be placed in the files created when you use makeglos.pl, you will always get these messages the first time you LaTeX your document. Once you have successfully run makeglos.pl, these warnings should go away. If you still get them, then it's possible that one or more of your glossary entries had an error which prevented them from being written to the .glo (or equivalent) file. Check the makeindex transcript file (.glg or equivalent) for errors.

Top

I get an error when I redefine \glogroupA etc

There is an error in the manual. It should read:

For example, if you are using one of the list styles, the following will print the appropriate heading in bold, followed by a gap:

\renewcommand{\glogroupSymbols}{\item[Symbols]\indexspace}
\renewcommand{\glogroupNumbers}{\item[Numbers]\indexspace}
\renewcommand{\glogroupA}{\item[A]\indexspace}
....% similar lines omitted
\renewcommand{\glosgroupZ}{\item[Z]\indexspace}

Alternatively, if you are using one of the tabular styles with two columns, you will need to do something like

\renewcommand{\glogroupSymbols}{\textbf{Symbols} & \\}
etc.

I may get around to providing an easier interface to do this when I have time.

Top

I get a keyval error: glofont undefined

The glofont key was only defined in version 2.43, you are probably using an old version of the glossary package.

Top

General Queries

How do I format my acronyms in a different font?

As from version 2.22 you can redefined \acronymfont. For example, to make all the acronyms appear in a small caps font, do:

\renewcommand{\acronymfont}[1]{\textsc{#1}}

Top

Why are my acronyms displayed in bold in the glossary?

This is probably because you are using the list or altlist style which display the entry name in bold by default. You can redefine the acronym format using \setacronymnamefmt, e.g.

\setacronymnamefmt{\textmd{\glolong\ (\gloshort)}}

Top

Why do my terms appear in bold in the glossary?

This is probably because you are using the list or altlist style which display the entry name in bold by default. As from version 2.43, you can change the font using the glofont key in \setglossary. For example, to make the entry name appear in a slanted san-serif font in the main glossary, do:

\setglossary{glofont={\sffamily\slshape}}

Top

How can I change the font in which the name key is displayed in the glossary?

See the answer to the above. As from version 2.44, you can use a command that takes an argument as the last name bit of glofont. For example:

\setglossary{glofont={\sffamily\textsl}}
Note that you will have to take care if you want to use \MakeUppercase, otherwise you will get expansion problems. For example, to make the first letter of the glossary term uppercase, do:
\newcommand{\myglofont}[1]{\MakeUppercase#1}
\setglossary{glofont={\protect\myglofont}}
Note the use of \protect. In the above example, care will have to be taken if the first letter has an accent, in which case the accented letter will need to be grouped, for example:
\storeglosentry{elite}{name={{\'e}lite},description={Size of letters
in typewriting}}

Top

How do I get my acronyms to appear in a separate glossary?

As from version 2.17 you can use the package option acronym to do this, however if you do this you must remember to use the commands \makeacronym and \printacronym.

Top

How do I reset an acronym?

As from version 2.14, you can use the command \resetacronym{<name>}.

Top

How do I reset all acronyms with a single command?

As from version 2.21, you can use the command \resetallacronyms.

Top

How do I align my list of acronyms in a table so that the acronym appears in the first column and the long form appears in the second column?

As from version 2.32, you can do:

\setacronymnamefmt{\gloshort}
\setacronymdescfmt{\glolong}
(Note that this will ignore the description key used in \newacronym.)

If you have a list of acronyms separate from the main glossary (by using the acronym=true package option), you will need to specify the style of the list of acronyms using

\setglossarystyle[acronym]{style=long}
if this style is different to the style of the main glossary.

Top

I have multiple glossaries, can they have different formats?

As from version 2.3, you can set the style for individual glossaries using the final optional argument to \newglossarytype. For example, if you want a new type of glossary called notation, and you want it formatted using the long style with borders, then you can do:

\newglossarytype{notation}{not}{ntn}[style=long,border=true]

or you can set the style later using \setglossarystyle, for example:

\setglossarystyle[notation]{style=long,border=true}

If you have used the package option acronym=true, you can also use this command to change the format of the list of acronyms. For example:

\setglossarystyle[acronym]{style=long,border=true}

Top

I have a second glossary, how do I make it have a different title from the first glossary?

If you have defined a second glossary, <type>, then you can define the commands \<type>name and \short<type>name, which are analogous to \glossaryname and \shortglossaryname. For example, if you have defined a glossary called, say, notation, then define the commands \notationname for the main heading and, optionally, \shortnotationname for the table of contents entry.

Top

How do I prevent the page numbers appearing in the glossary?

Use the package option number=none.

Top

How can I get section/equation etc numbers instead of page numbers in the glossary?

Use the package option number=<counter>, where <counter> is the name of the relevant counter. For example, to use section numbers, do: number=section. (Versions prior to version 2.4, only allowed number=page, number=section and number=none. As from version 2.4 you can use any LaTeX counter.)

Top

How do I change the title "Glossary" to another language?

If you use babel, this should be done automatically, otherwise you will need to redefine \glossaryname, e.g.

\renewcommand{\glossaryname}{Glossar}
If you place this command in a file called glossary.cfg and place it somewhere on TEX's search path it will become the default definition.

Top

How do I get my glossary to appear in the table of contents?

Use the package option toc or hypertoc. (The hypertoc option will place the anchor before the glossary title, the toc option will place the anchor immediately after the glossary title.) Note that the hypertoc option should only be used if you are using the hyperref package, as it uses the command \phantomsection.

Top

How do I make my glossary title different from the running header/table of contents entry?

Define \glossaryname to be the text for the main glossary title, and define \shortglossaryname to be the text for the running header or table of contents. Example:

\renewcommand{\glossaryname}{Glossary of Notation}
\renewcommand{\shortglossaryname}{Notation}

Top

How do I insert text at the start of the glossary?

Redefine \glossarypreamble to be the text you want inserted. If you have multiple glossaries, redefine \glossarypreamble before each \print<type> command.

Top

How can I change the horizontal placement of the table in the glossary?

If you are using the package option style=long (the default), the longtable environment will be used (defined in David Carlisle's longtable package.) The horizontal position of a longtable can be changed by changing the lengths \LTleft and \LTright. For example, to make the table flushleft, do:

\setlength{\LTleft}{0pt}
\setlength{\LTright}{\fill}

If you are using the package option style=super, the supertabular environment will be used (defined in the supertab package, originally by Theo Jurriens, revised by Johannes Braams.) I don't know how to change the horizontal placement of a supertabular table.

Top

How do I customise my glossary so that it has, say, 4 columns instead of 3?

See the sample file, sample4col.tex that comes with version 2.34 and above.

Top

Is it possible to merge several glossary entries that have the same name but different descriptions?

Use the makeglos.pl Perl script with the -m option.

Top

Is it possible to have an unsorted glossary?

It's makeindex that sorts the glossary entries, not the glossary package. As far as I know, makeindex doesn't have the facility to produce unsorted output, but you could use the sort key to change the sort order.

Top

How do I include all entries defined using \storeglosentry in one go?

As from version 2.36, you can use the command \useglosentry{*}. (Note that this option is not available for \useGlosentry and \gls.

Top

Is it possible to insert a block of text between groups in the glossary?

As from version 2.4, you can insert text between groups by redefining the commands \glogroupSymbols, \glogroupNumbers, \glogroupA ... \glogroupZ. For example, if you are using one of the list styles, the following will print the appropriate heading in bold, followed by a gap:

\renewcommand{\glogroupSymbols}{\textbf{Symbols}\indexspace}
\renewcommand{\glogroupNumbers}{\textbf{Numbers}\indexspace}
\renewcommand{\glogroupA}{\textbf{A}\indexspace}
....% similar lines omitted
\renewcommand{\glosgroupZ}{\textbf{Z}\indexspace}

Or if you are using one of the tabular styles with two columns, you could do something like

\renewcommand{\glogroupSymbols}{\multicolumn{3}{l}{\bfseries Symbols}\\}
% etc

Top

Why does my log file say that it can't find glossary.cfg?

This isn't an error, it's merely a piece of information. The glossary package looks for a file called glossary.cfg, if it exists it loads it, otherwise it simply uses the standard defaults. This facility is provided so that you can configure the glossary package for your local system if required. The file glossary.cfg is not provided by the glossary package, however you can create it if needed. For example, if you do not write in English, and you want to have a list of acronyms, you will need to create a file called glossary.cfg and type in the correct definition for \acronymname. For example:

\newcommand{\acronymname}{Akronyme}
You will then need to save it to a directory on TEX's path, for example, the same directory as the file glossary.sty. (Remember to refresh the database using texhash (UNIX/Linux) or whatever method is appropriate for your system.)

Top


How do I get TeXnicCenter to use makeglos.bat?

  1. Make sure you have at least version 2.35 of the glossary package (earlier versions have a bug in makeglos.bat.)

  2. Select the menu item Build->Output Profiles...

  3. Select the desired output profile from the box on the left (e.g. LaTeX => DVI)

  4. Select the "Postprocessor" tab from the box on the right.

  5. Click on the "New (insert)" icon.

  6. Type in the name of the postprocessor (e.g. makeglos)

  7. Type in the full pathname of makeglos.bat into the executable box (e.g. C:\texmf\miktex\bin\makeglos.bat) or use the ellipsis button on the right to browse the filing system.

  8. Type "%bm" in the arguments box. (See figure 1)

  9. Repeat for each output profile as desired.

  10. Click on okay.

Figure 1: Setting the Post Processor in TeXnicCenter
 
Image of TeXnicCenter's output profile dialog box

Top

Can you help me upgrade my document from using the old glossary package to the new glossaries package?

Try reading Upgrading from the glossary package to the glossaries package

Top

makeglos.pl Errors

makeglos.pl error: unable to extract name from glossary item

You are using an old version of makeglos.pl with a new version of the glossary package. You will need to update your version of makeglos.pl. Please download and reinstall.

Top

makeglos.bat error: file makeglos.bat.pl not found

This has been fixed in version 2.35 of the glossary package. Please download and reinstall makeglos.bat.

Top

I get an error when I use makeglos.bat when I have spaces in my path

This has been fixed in version 2.43.

Top

makeindex Errors

makeindex complains that the entry is too long

If you have a very long description, you can exceed makeindex's buffer. You can get around this by defining a command that contains the description for a given entry, and use that command in the description. For example:

\newcommand{\sampledescription}{A very long description...}
\storeglosentry{sample}{name={sample},description={\sampledescription}}

Top



Footnotes

... information5
This should be in the directory texmf/doc/latex/graphics/

next up previous
Next: glossaries FAQ Up: FAQ for Nicola Talbot's Previous: fmtcount FAQ
Nicola L. C. Talbot. School of Computing Sciences. University of East Anglia. Last Modified: 2011-11-18