# glossaries FAQ (v1.81 2013-11-16)

## Error Messages

### I get an error when using a fragile command in my glossary entry

As from version 4.0, use \glssetnoexpandfield to suppress expansion for a particular field. For older versions, use \protect. See also Why must I protect fragile commands in the name key?

### I get an error when using one of the commands that convert the first letter to upper case

As from version 4.0, commands such as \Glsentryname are robust. (Although, as they aren't expandable, they can't be used in PDF bookmarks.) For earlier versions of glossaries commands like \Glsentryname were fragile and therefore need to be protected when used in a moving argument.

### I get the error: "perl not found" when I use makeglossaries.bat

You don't have Perl installed or your path is not set up correctly.

If you don't have Perl installed or are otherwise unable to run makeglossaries, you can run makeindex on each of your glossaries. For example, to create the main glossary (assuming your file is called myfile.tex):

makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo

If you have used the acronym package option, you will need to create the list of acronyms file as follows:
makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn

Repeat this procedure for each glossary that you have defined.

Alternatively you could try using the MakeGlossariesGUI Java application.

### 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 glossaries package will be placed in the files created when you use makeglossaries, you will always get these messages the first time you LaTeX your document. Once you have successfully run makeglossaries, 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.

### I get an error when using a glossary entry in a chapter/section heading or caption

This occurs when you try to do something like:

\section{\gls{sample}}

If you are not using the hyperref package, you can fix this with \protect:
\section{\protect\gls{sample}}

However, it's generally not a good idea to use commands like \gls or \glslink in chapter or section titles:
1. If you have a table of contents, the relevant line in the TOC will also have a link to the glossary, and the entry's page list will include the table of contents page. (Same applies for \caption and the list of figures/tables.)
2. If you are using a page style that adds the chapter/section title to the page header, then each page header for that section will generate a link to the glossary.
3. If you are using the hyperref, you will have a nested link in the table of contents and you will cause a problem for the bookmarks.
It is therefore better to use the non-link creating commands, such as \glsentryname instead of \gls. For example:
\section{\glsentryname{sample}}

\section[\glsentryname{sample}]{\gls{sample}}

The same applies for captions. For versions prior to v4.0, if you get unexpected output in your page headers (e.g. something like ACRONYMNAME SAMPLE), then use the package option sanitize=none and protect fragile commands.

Note that prior to version 4.0, the commands that convert the first letter to upper case were all fragile and so required \protect:

\section{\protect\Glsentryname{sample}}

If you use the hyperref package, you'll need to use \texorpdfstring:
\section{\texorpdfstring{\protect\Glsentryname{sample}}{Sample}}

For version 4.0 and above, you don't need \protect, but you still need to provide an alternative for the PDF bookmarks:
\section{\texorpdfstring{\Glsentryname{sample}}{Sample}}


### makeindex complains that the entry is too long

As from glossaries version 4.0, this should no longer be an issue. For earlier versions, if you have a very long description, it is possible that you may exceed makeindex's buffer. In which case, try defining a command that stores the long description, and use that when you define the entry. For example:

\newcommand{\mylongdescription}{A very long description}
\newglossaryentry{example}{name={example},
description={\mylongdescription}}

Note that if you've used sanitize=description=false (which automatically occurs with certain acronym styles), then you need to use \protect:
\newcommand{\mylongdescription}{A very long description}
\newglossaryentry{example}{name={example},
description={\protect\mylongdescription}}


Alternative, try using xindy instead of makeindex. See the section on xindy in the glossaries documentation.

### I get a "missing }" error with v1.17 when using babel with the glossaries package

This was fixed in v1.18.

### I get an error saying that \glspagewidthlist is undefined

This was fixed in v1.18.

### I get an error when using glossaries with fancyhdr

This is a problem with xfor v1.04. You need to upgrade to xfor v1.05.

### I get an error saying that \glossarymark is already defined

As from version 2.03, the glossaries package checks to see if \glossarymark is already defined, and now just prints a warning message that \glossarymark is being redefined.

As from version 4.0, \glossarymark has been replace by \glsglossarymark to avoid conflict with memoir.

### I get the error ! Argument of \hyper@link has an extra }.

This was a problem with hyperref rather than glossaries. It was fixed in hyperref 6.83g.

### xindy can't find module for language german

If you are using makeglossaries see bug report. If you are using xindy without the makeglossaries script, you'll need to specify either -C duden-utf8 or -C din5007-utf8, depending on your preferences.

### I get the Xindy error PROGN: variable FILENAME.XDY has no value

This seems to be a bug that's appeared in a new release of xindy and is therefore out of my control. (See [tex-live] xindy with "-I xindy" broke with the latest update on linux for a fix.)

• I get an error using glossaries with the new version of babel

## Translating Fixed Names

#### I've used the babel package, but the fixed names haven't been translated.

The glossaries package currently only supports the following languages: Danish, Dutch, English, French, German, Irish, Italian, Hungarian, Polish and Spanish. If you want to add another language, send me the translations, and I'll add them to the next version.

#### How do I change the default translations provided by the glossaries package?

If you are using the babel package, the translator package will be loaded by the glossaries package (if it's installed). If the translator package is loaded, you need to provide your own custom dictionary to change the translations, otherwise you need to use babel's \addto.

If you are using polyglossia, the translator package won't automatically be loaded. Instead, glossaries-polyglossia will be loaded.

1. The following changes the fixed names using the translator package. First create a file called, say, my-personal-dictionary-English.dict that contains the following:
\ProvidesDictionary{my-personal-dictionary}{English}
\deftranslation{Acronym}{List of Acronyms}
\deftranslation{Glossary}{List of Terms}

Remember to use this dictionary in your document:
\documentclass[english]{article}
\usepackage{babel}
\usepackage[toc,acronym]{glossaries}

\usedictionary{my-personal-dictionary}

\newglossaryentry{sample}{name=sample,description={An example}}
\newacronym{sa}{SA}{Sample Acronym}

\makeglossaries

\begin{document}

\tableofcontents

\section{Sample}

\gls{sample}. \gls{sa}.

\printglossaries
\end{document}


2. The following suppresses the automatic loading the translator package using via package option translate=babel. (If you are using a version of glossaries before version 4.0, you need to use glossaries package option translate=false and then explicitly load glossaries-babel.)
\documentclass[english]{article}
\usepackage{babel}
\usepackage[toc,translate=babel]{glossaries}

\newglossaryentry{sample}{name=sample,description={An example}}

\makeglossaries

\begin{document}
\tableofcontents

\section{Sample}
\gls{sample}.

\printglossary
\end{document}

3. The following is another way of preventing the automatic loading of the translator package.
\documentclass[english]{article}
\usepackage[toc]{glossaries}
\usepackage{babel}
\usepackage{glossaries-babel}

\newglossaryentry{sample}{name=sample,description={An example}}

\makeglossaries

\begin{document}
\tableofcontents

\section{Sample}
\gls{sample}.

\printglossary
\end{document}

4. The following sets the information in the optional argument to \printglossary:
\documentclass[english]{article}
\usepackage{babel}
\usepackage[toc]{glossaries}

\makeglossaries

\newglossaryentry{sample}{name=sample,description={An example}}

\begin{document}
\tableofcontents

\section{Sample}
\gls{sample}.

\printglossary[title=List of Terms,toctitle=List of Terms]
\end{document}


If you have any queries regarding the babel or translator package, please address them to the authors of those packages (after first checking the UK TeX FAQ and comp.text.tex archives).

## Unexpected Output

### Unexpected Output in the Main Document Text

#### When I display an entry's description using \glsentrydesc it doesn't come out right

This should no longer be an issue with glossaries version 4.0. For older versions, if your description contains commands, you will have to switch off the sanitization for the description, using the package option sanitize={description=false}. You must then protect any fragile commands using \protect.

#### When I display an entry's symbol using \glsentrysymbol it doesn't come out right

This should no longer be an issue with glossaries version 4.0. For earlier versions, you will have to switch off the sanitization for the symbol, using the package option sanitize={symbol=false}. You must then protect any fragile commands using \protect.

If you need to do the same for the description, you will need to use the package option sanitize={description=false,symbol=false}.

#### I've used the smallcaps/smaller option but the long form in the list of acronyms is always the long form of the last defined acronym

This has been fixed in version 1.15. Earlier versions can fix this by using the package option sanitize={description=false}.

#### \Gls doesn't work with the smaller option (everything is converted to uppercase)

Redefine \acronymfont to use \textsmaller instead of \smaller:

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

This has been fixed in version 1.19.

Note that if your acronym starts with a capital letter, \Gls will produce the same text as \gls.

#### \Gls doesn't work when \acronymfont uses a declaration

This is similar to the previous problem. Using a declaration instead of a text block command confuses \makefirstuc. So use a text block command instead. If there is no text block equivalent, you will have to define one. For example:

\newcommand{\textlarge}[1]{{\large #1}}
\renewcommand{\acronymfont}[1]{\textlarge{#1}}


#### The long form of acronyms won't break across a line

This can occur when you are using hyperref and latex (rather than pdflatex) which won't break a hyperlink across a line. Either use pdflatex or you can suppress the hyperlink on first use.

#### Acronyms are displayed as "acronymfont" followed by the label in certain situations (such as page headers)

This should no longer be an issue with glossaries version 4.0. For earlier versions, use the package option sanitize=none and protect fragile commands in acronym and glossary definitions.

### Unexpected Output in the Glossaries

#### One or more of my glossaries haven't appeared

Check the following:

1. You have used \makeglossaries in the preamble.

2. You have used either \printglossaries or \printglossary at the point in the document where you want the glossary to appear. Remember that if you have multiple glossaries and you use \printglossary, you must specify the glossary name in the optional argument for the additional glossaries (this includes the list of acronyms when you have used the acronym option). The name is not required for the main glossary.

3. Make sure you have used one or more of: \glslink, \glsadd, \glsaddall, \gls or \glspl (or the uppercase variants).

4. Remember that once you have saved your .tex file, you must follow the three step process:

1. latex filename

This creates the .glo file that contains the glossary information for makeindex to collate, but there is no glossary in the document yet. Any hyperlinks to glossary entries will be undefined because the glossary doesn't exist yet.

2. makeglossaries filename

Note there is no extension -- makeglossaries reads filename.aux to determine the relevant glossary information, but passes filename.glo to makeindex, which in turn creates filename.gls which contains the glossary.

3. latex filename

This reads filename.gls (created in the previous step). The document should now contain the glossary, and the hyperlinks to glossary entries should now be defined. If not, check the makeindex transcript file (filename.glg) for errors.

If you don't have Perl installed or are otherwise unable to run makeglossaries, you can run makeindex on each of your glossaries. For example, to create the main glossary (assuming your file is called myfile.tex):

makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo

If you have used the acronym package option, you will need to create the list of acronyms file as follows:
makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn

Repeat this procedure for each glossary that you have defined.

#### All my glossary entries have appeared in the same glossary instead of in separate glossaries

If you are using makeindex directly instead of via makeglossaries, you must remember to call makeindex separately for each glossary. For example, if you have both a main glossary and a list of acronyms you will need to do (assuming your file is called myfile.tex):

makeindex -s myfile.ist -t myfile.glg -o myfile.gls myfile.glo
makeindex -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn


If you have Perl installed, I would strongly recommend that you use makeglossaries instead, as then all you need do is:

makeglossaries myfile

which significantly reduces the chance of errors.

Also try checking the makeindex transcript files to see if there were any errors in the makeindex run.

#### Entries that appear in the first paragraph of a page have the wrong page number in the glossary

This has been fixed in version 1.07.

#### Why have numbers appeared after my glossary entries?

These are the page numbers on which that glossary entry has been used. You can suppress the number list using the package option nonumberlist.

#### Why have my glossary terms appeared in bold in the glossary?

The most likely reason is that you are using one of the list-type glossary styles which put the term in the optional argument of \item which sets its argument in bold. The tree-like glossary styles also make the term bold. You can override this by redefining \glsnamefont. For example:

\renewcommand{\glsnamefont}[1]{\mdseries #1}


#### I have used the smallcaps option, but the entry names appear in lowercase bold in the glossary

See the previous query for the reason why the entry is in bold. It is most likely in lowercase because you are using a set of fonts that don't support bold small caps, so the closest match has been used instead. Try using a different font encoding. For example:

\usepackage[T1]{fontenc}

Or change \glsnamefont to use a medium weight font instead of bold, as in the previous answer.

#### Why is there a larger vertical gap between some glossary entries?

The glossary is divided into 28 groups corresponding to the initial character: symbols, digits, a, ..., z. Each group is separated by \glsgroupskip which is set to \indexspace when using one of the list styles or is set to a blank row when using one of the tabular styles. This can be suppressed by using the package option nogroupskip or by redefining \glsgroupskip to do nothing:

\renewcommand{\glsgroupskip}{}

However note that \glsgroupskip is redefined each time the glossary style is changed, so make sure you either redefine it after you set the glossary style or define your own custom glossary style.

#### When I use the hyperlink to take me to an entry in the glossary, the relevant line is just above the top edge of the viewer.

As from glossaries v1.16, this shouldn't occur. For earlier versions use:

\newlength\mylen
\makeatletter
\renewcommand{\@glstarget}[2]{%
\settoheight{\mylen}{#2}\raisebox{\mylen}{\hypertarget{#1}{}}#2}
\makeatother

(\@glstarget is an internal command, so it should go between \makeatletter and \makeatother in the .tex file. If you put the above code into a style file, remember to remove the \makeatletter and \makeatother commands.)

Note that this fix is only required for the glossary styles that use lists.

#### I redefined one or more of the commands governing the glossary style, but it hasn't had an effect

Remember that these commands are overridden whenever \setglossarystyle is used (or \glossarystyle for versions prior to v4.0), so make sure the new definitions are placed after \setglossarystyle. In particular, remember that if you use the style key in the optional argument of \printglossary, it will override any previous definitions.

#### I've used the smallcaps option, but the acronyms are displayed in normal sized upper case letters.

The smallcaps package option uses textsc to typeset the acronyms. This command converts lower case letters to small capitals, while upper case letters remain their usual size. Therefore you need to specify the acronym in lower case letters.

#### I've redefined \acronymfont but the acronyms are still displayed in the surrounding font.

\acronymfont is only used by the package options that redefine \newacronym (e.g. description, smallcaps, footnote). Try using the smaller package option and redefine \acronymfont in the preamble.

#### Glossary terms at the start of a cell in tabularx don't align properly on the row

This has been fixed in version 2.03.

#### The glossary entry in the TOC is not aligned with the numbered chapter/section titles

By default, the glossary entry in the table of contents is aligned with the chapter/section numbers. As from version 1.1, you can use the package option numberline (in addition to the toc option) to align the title with the other TOC titles.

If you are using an older version, you can achieve the same effect by redefining \@gls@toc:

\renewcommand*{\@gls@toc}[2]{%

Note that this contains internal commands (commands that have an @ character in the name) so it either needs to go in a style file or it must be placed within \makeatletter and \makeatother in a .tex file.

Remember to use the toc package option and to re-run LaTeX.

## General Queries

### Defining Terms

#### Why must I protect fragile commands in the name key when the documentation says the name key is sanitized? (Pre version 4.0)

By default, the glossaries package sanitizes the values of the name, description and symbol keys, but not any of the other keys (except the sort key which is always sanitized regardless of the sanitize package option.) This means that you can use fragile commands in the name, description and symbol keys, but not the other keys. However, if you don't specify the text key, it will obtain its value from the name key (before it is sanitize), so if you have only specified the name key and not the text key, you must protect fragile commands using \protect.

#### Is it possible for an entry to have a name and an associated symbol?

Yes, just use the name for the term and the symbol key for the symbol. If you want the symbol to also appear in the text when you use commands such as \gls, then you can redefine \glsentryfmt or use \defglsentryfmt (those two commands are new to version 4.0).

#### My term has multiple plural forms, how can I deal with this?

Use the plural key for the plural term you are most likely to use, and use the user keys for the other plurals. For example:

\newglossaryentry{cow}{name=cow,
description={a fully grown female of any bovine animal (plural
cows, archaic plural kine)},
user1={kine}}

\let\glsaltpl\glsuseri

You can now use \glspl for the first plural and \glsaltpl for the second plural. There are six user keys, so this method can be used for other grammatical constructs as well. As from version 4.0, you can also define your own keys via \glsaddkey.

#### How do I cross-reference entries?

As from v1.17, you can use \glssee or use the see key when you define the entry. See the section Cross-Referencing Entries in the manual for further details.

### Glossary Formatting

#### How do I get rid of the full stop after the description in the glossary?

If you are using version 3.03 or above, use the package option nopostdot. Alternatively (version 1.03 or above) just redefine \glspostdescription to do nothing:

\renewcommand{\glspostdescription}{}


As from v1.17, if you want to remove it for a particular entry, use \nopostdesc in that entry's description.

#### Can I suppress the page lists in the glossary?

Yes. Use the nonumberlist package option or as an option in \printglossary.

As from v1.17, you can suppress the number list for a particular entry using the nonumberlist option when defining the entry.

#### How do I make my glossaries appear in numbered chapters/sections?

As from version 1.1, you can use the package option numberedsection. This option takes three possible values: false (unnumbered), nolabel (glossaries are numbered but not labelled) and autolabel (glossaries are numbered and automatically labelled). If numbersection=autolabel, the labels are taken from the glossary type, so the main (default) glossary is given the label main, the list of acronyms (when using the acronym option) is given the label acronym and additional glossaries are given the same label as used in the first argument to \newglossary. So you can refer to each glossary in the text using \ref. For example:

See chapter~\ref{main} for the main glossary and
chapter~\ref{acronym} for a list of acronyms.


For earlier versions, you can do something like:

\let\glossarysection=\chapter

or
\let\glossarysection=\section

to produce a numbered glossary.

Note that with the package option numbersection=nolabel, you will need to add your own label to the glossary preamble if you want to reference it. For example:

\renewcommand{\glossarypreamble}{\label{glossary}}
\printglossary

However take care if you have multiple glossaries. For example:
\renewcommand{\glossarypreamble}{\label{glossary}}
\printglossary
\renewcommand{\glossarypreamble}{\label{acronyms}}
\printglossary[type=acronym]


#### How do I have some of my glossaries in numbered sections and some in unnumbered sections?

As from version 1.14, you can use the key numberedsection in the optional argument to \printglossary. For example, to put the main glossary in an unnumbered section and the list of acronyms in a numbered section:

\printglossary[numberedsection=false]
\printglossary[type=acronym,numberedsection]


#### How do I make my glossaries appear in different sectional units?

Suppose you want the main glossary to appear in a chapter, but you want the list of acronyms to appear in a section, then use the package option section=chapter (which is actually the default if your document class defines chapters) and then change the document sectioning unit to section at the place where you want the change to occur. Version 1.1 introduced an easy interface to do this: \setglossarysection{<section name>}, where <section name> is the name of a sectional unit. For example:

\printglossary % print the main glossary
% change the glossary sectional unit to section
\setglossarysection{section}
\printglossary[type=acronym] % print the list of acronyms


For earlier versions, you need to redefine \@@glossarysec, but remember that this is an internal command so it needs to be placed inside \makeatletter and \makeatother. For example:

\printglossary % print the main glossary
\makeatletter
% change the glossary sectional unit to section
\renewcommand*{\@@glossarysec}{section}
\makeatother
\printglossary[type=acronym] % print the list of acronyms


#### How do I prevent my glossaries from starting a new section/chapter?

Redefine \glossarysection to ignore its arguments:

\renewcommand{\glossarysection}[2][]{}

(Remember to do this before using \printglossaries or \printglossary.)

#### Can I divide my glossary into groups?

As from v1.17, hierarchical glossaries are supported. See the section Sub-Entries in the manual for further details.

#### How do I define my own glossary style?

As from version 1.08, there is a section on this in the manual (called Defining your own glossary style).

#### Is it possible to prevent the glossaries package from loading longtable/supertabular?

As from v1.18, you can use the package options nolong or nosuper to prevent the glossaries package from automatically loading the glossary-long or glossary-super packages. Note, however, that if you use these options, you won't be able to use any of the glossary styles defined in those packages.

#### Is it possible to make the long/super styles use ragged right formatting?

As from v2.01, you can use the styles defined in glossary-longragged or glossary-superragged, but note that these packages have to be loaded explicitly after loading the glossaries package so you can use the style package option.

### Referencing Terms

#### How do I change the way the glossary term is formatted in the document (when using \gls etc)?

The font can be changed by redefining \glstextformat which takes one argument (the text to be displayed). For example, if you want all your glossary terms to appear in bold, you can do:

\renewcommand{\glstextformat}[1]{\textbf{#1}}


#### How do I change the way the text appears when I use commands like \gls?

As from version 4.0, commands like \gls and \glspl use \glsentryfmt to display the relevant information. Within the definition of this commands, you may use &92;glslabel to access the entry's label, \ifglsused to determine if the entry has been used, \glsifplural to determine if the plural form is required, \glscapscase to determine if a case change is required, \glsinsert to access the additional text provided by the final optional argument of commands like \gls, and \glscustomtext to access the text provided by \glsdisp. If you want different glossaries to have different formats, you can use \defglsentryfmt instead of redefining \glsentryfmt. See the section Changing the format of the link text in the user manual for further information.

##### Versions prior to v4.0
Commands like \gls and \glspl use \glsdisplayfirst and \glsdisplay to display the relevant information. The former command is used on first use and the latter command is used subsequently. Both commands take four arguments: the first is either the singular or plural form given by the text, plural, first or firstplural keys (used when the term was defined) depending on context. The second argument is the term's description (as supplied by the description key), the third argument is the symbol associated with the term (as supplied by the symbol key) and the fourth argument is the additional text supplied in the final optional argument to \gls or \glspl (or their uppercase variants). The default simply prints the first argument immediately followed by the fourth argument and ignores the remaining arguments.

For example, suppose you want a glossary of measurements and units, you can use the symbol key to store the unit:

\newglossaryentry{distance}{name=distance,
description={The length between two points},
symbol={km}}

and now suppose you want \gls{distance} to produce "distance (km)" on first use, then you can redefine \glsdisplayfirst as follows:
\renewcommand{\glsdisplayfirst}[4]{#1#4 (#3)}

Note that the additional text is placed after #1, so \gls{distance}['s] will produce "distance's (km)" rather than "distance (km)'s" which looks a bit odd (even though it may be in the context of "the distance (km) is measured between the two points" -- but in this instance it may be better not to use a contraction).

Caveat: care needs to be taken if you want to use the symbol within the text as the symbol key is sanitized by default. This means that any commands within the symbol will not be interpreted which can lead to strange results. If you do want to redefine \glsdisplay or \glsdisplayfirst so that the symbol is used, you need to use the package option sanitize={symbol=false} and protect fragile commands within the symbol key.

Remember that you need to use a glossary style that displays the symbol if you use the symbol key as many of the styles ignore it.

#### How do I change the way the text appears when I use commands like \gls for a given glossary?

As from version 4.0, you can use defglsentryfmt (see above) to change the way glossary entries appear when using commands like \gls or \glsdisp. See the section Changing the format of the link text in the user manual for further information.

##### Versions prior to v4.0

If you have multiple glossaries, changing \glsdisplayfirst and \glsdisplay (see above) will change the way all glossary entries appear when using commands like \gls. If you only want the change to affect entries for a given glossary, then you need to use \defglsdisplay and \defglsdisplayfirst instead of redefining \glsdisplay and \glsdisplayfirst.

Both \defglsdisplay and \defglsdisplayfirst take two arguments: the first is the glossary name and the second is how the term should be displayed when it is invoked using commands like \gls and \glspl. This is similar to the way \glsdisplayfirst was redefined in the previous section except that you must use ##1, ##2, ##3 and ##4 instead of #1, #2, #3 and #4.

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:

\defglsdisplayfirst{notation}{##1##4 (denoted ##3)}

Now suppose you have defined an entry as follows:
\newglossaryentry{set}{type=notation,
name=set,
description={A collection of objects},
symbol={$S$},
}

The first time you reference this entry using \gls it will be displayed as: "set (denoted S)" (similarly for \glspl and the other variants).

#### How do I define my own custom acronym style?

You can use the custom acronym format. For example, suppose you want the long form to appear in the margin on first use, you can do the following:

\DeclareRobustCommand{\MARGINPAR}[1]{\marginpar{#1}}

\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},% name is abbreviated form
description={\the\glslongtok},% description is long form
first={\the\glsshorttok\MARGINPAR{\the\glslongtok}},%
firstplural={\the\glsshorttok\noexpand\acrpluralsuffix\MARGINPAR{\the\glslongtok}},%
text={\the\glsshorttok},%
plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}

\SetCustomStyle % Switch to custom style

(Note that you need to use an up-to-date version of glossaries.)

#### How do I set the font for just the long form when using \newacronym?

You can use the custom acronym format, as described above. For example, suppose you want the long form to be emphasized using \emph, you can do the following:

\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},% name is abbreviated form
description={\the\glslongtok},% description is long form
first={\noexpand\emph{\the\glslongtok}\space(\the\glsshorttok)},%
firstplural={\noexpand\emph{\the\glslongtok\noexpand\acrpluralsuffix}\space(\the\glsshorttok)},%
text={\the\glsshorttok},%
plural={\the\glsshorttok\noexpand\acrpluralsuffix}%
}

\SetCustomStyle

This displays long (short). You can swap, add or remove \glslongtok and \glsshorttok, as required. Remember to use \SetCustomStyle to switch to this acronym style. (If you get an error saying that \CustomAcronymFields can't be redefined as it doesn't exist or an "Undefined control sequence" error for \SetCustomStyle, then you need to update your version of glossaries.)

Note, however, that this solution doesn't work for plurals that aren't formed by simply prefixing the singular term with \acrpluralsuffix. Here's an alternative solution that requires at least version 4.0:

\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},% name is abbreviated form
description={\the\glslongtok},% description is long form
}

\renewcommand*{\SetCustomDisplayStyle}[1]{%
\defglsentryfmt[#1]{%
\ifdefempty\glscustomtext
{%
\ifglsused{\glslabel}%
{% Subsequent use
\glsifplural
{% plural subsequent use
\glscapscase
{% no case change
\glsentryshortpl{\glslabel}\glsinsert
}%
{% first letter upper case
\Glsentryshortpl{\glslabel}\glsinsert
}%
{% all caps
\MakeTextUppercase{\glsentryshortpl{\glslabel}\glsinsert}%
}%
}%
{% singular subsequent use
\glscapscase
{% no case change
\glsentryshort{\glslabel}\glsinsert
}%
{% first letter upper case
\Glsentryshort{\glslabel}\glsinsert
}%
{% all caps
\MakeTextUppercase{\glsentryshort{\glslabel}\glsinsert}%
}%
}%
}%
{% First use
\glsifplural
{% plural first use
\glscapscase
{% no case change
\emph{\glsentrylongpl{\glslabel}\glsinsert}\space
(\glsentryshortpl{\glslabel})%
}%
{% first letter upper case
\emph{\Glsentrylongpl{\glslabel}\glsinsert}\space
(\glsentryshortpl{\glslabel})%
}%
{% All caps
\emph{\MakeTextUppercase{%
\glsentrylongpl{\glslabel}\glsinsert}\space
(\glsentryshortpl{\glslabel})}%
}%
}%
{% singular first use
\glscapscase
{% no case change
\emph{\glsentrylong{\glslabel}\glsinsert}\space
(\glsentryshort{\glslabel})%
}%
{% first letter upper case
\emph{\Glsentrylong{\glslabel}\glsinsert}\space
(\glsentryshort{\glslabel})%
}%
{% All caps
\emph{\MakeTextUppercase{%
\glsentrylong{\glslabel}\glsinsert}\space
(\glsentryshort{\glslabel})}%
}%
}%
}%
}%
{% custom text provided by \glsdisp
\ifglsused{\glslabel}%
{% subsequent use
\glscustomtext
}%
{% first use
\emph{\glscustomtext}%
}%
}%
}%
}

\SetCustomStyle


#### How do I make the acronym on first use display the short form followed by the long form in brackets?

1. If you are using the default definition of \newacronym, you can change the definition of \acrfullformat:
\renewcommand{\acrfullformat}[2]{#2\space(#1)}


2. If you are using the description, smaller or smallcaps options (but neither the dua or footnote options) you can do:
\defglsdisplayfirst[\acronymtype]{\firstacronymfont{#3}#4 (#1)}


3. Use the custom acronym format described in How do I define my own custom acronym style?

#### How do I make acronyms appear in a different font (but not the long form)?

If you are just using the default definition of \newacronym, then use the package option \smaller and redefine \acronymfont to use the required font.

If you are using any of the package options that redefine \newacronym (such as description), then just redefine \acronymfont to use the required font.

#### How do I make the short form of the acronyms appear in a different font for the first use?

As from version 1.14, follow the instructions for the previous query, but redefine \firstacronymfont instead of \acronymfont.

#### How do I suppress the hyperlink for the first use just for acronyms?

As from version 2.03, you can also use the package option hyperfirst=false to suppress the first use link for all terms (including acronyms). If you also have non-acronym glossaries where the term on first use is identical to that used subsequently (that is, where the first and text keys have identical values), you can use \glsunsetall for just those glossaries to counteract the effect of hyperfirst=false.

##### Pre version 2.03

Use the footnote package option and do:

\defglsdisplayfirst[\acronymtype]{#2#4 (\firstacronymfont{#1})}


Note that this won't work for acronyms that belong to a glossary not given by \acronymtype.

#### Is it possible to reset acronyms so that they can be fully expanded again?

Yes. To reset an acronym you can use \glsreset{<label>} or \glslocalreset{<label>} where <label> is the label identifying the acronym. (These commands also work with glossary entries in general, but you will only see a difference if you set different values for first and subsequent use.)

To reset all entries for a given glossary type use \glsresetall[<glossary list>] or \glslocalresetall[<glossary list>]. If the optional argument is omitted, all entries for all defined glossaries will be reset.

#### Is it possible to set an acronym so that it uses the short form on first use?

Yes, this is basically the reverse of the previous question. To unset an acronym you can use \glsunset{<label>} or \glslocalunset{<label>} where <label> is the label identifying the acronym. (These commands also work with glossary entries in general, but you will only see a difference if you set different values for first and subsequent use.)

To unset all entries for a given glossary type use \glsunsetall[<glossary list>] or \glslocalunsetall[<glossary list>]. If the optional argument is omitted, all entries for all defined glossaries will be unset.

### Upgrading from the Glossary Package

#### Why doesn't the new glossaries package create command names for the acronyms like the old glossary package?

There are a number of reasons:

1. The new way of accessing terms using commands like \gls is more compatible with standard LaTeX syntax.

2. Each term would require a command for the single as well as plural term, as well as commands to generate the upper case versions. For a large glossary that can amount to a lot of extra commands.

3. Provision would also be needed to allow for the optional arguments, which is awkward as commands such as \gls have 2 optional arguments, one before and one after the mandatory argument. Without the mandatory argument, you would need to use an empty optional first argument if you want to use the second argument, which is a nuisance.
4. You need to explicitly add a space after a command name that doesn't have a mandatory argument. (Don't rely on xspace, there are issues with that package that have led David Carlisle, the package author, to deprecate its use.)

If you really want to, as from v1.18, you can use \oldacronym` which emulates the old glossary package's syntax. See the section Upgrading From the glossaries Package in the glossaries documentation.

### Sorting and Collating Entries

#### How do I get TeXnicCenter to use makeglossaries.bat?

This is described in the introductory guide in the LaTeX Community's Know How section.

#### How do I get WinEdt to make the glossaries?

This is explained in a thread on comp.text.tex.

#### Do I have to use makeglossaries?

No, you can use makeindex or xindy directly, but you will need to remember to use it for each glossary that has been defined, and you will need to remember all the relevant switches. If you want to use xindy, you must remember to use the xindy option when loading the glossaries package. See Generating the associated glossary files for further details.

Alternatively, you can use the MakeGlossariesGUI Java application.

#### How do I change the way entries are sorted?

There are three package options that change the sort order: sort=standard (default alphabetical sort), sort=def (sort in order of definition) and sort=use (sort in order of use). As from version 4.0, you can also redefine glsprestandardsort to hook into the standard sort mechanism to modify its behaviour. See the section Sorting Options in the user manual for further details.

Alternatively, if you want to override the sort for an individual entry, then you can use the entry's sort key to sort it according to a different term. If it's for the entire alphabet, then you will need to use xindy (instead of makeindex) and use an appropriate xindy language module. I'm sorry, I can't give any assistance with writing or adapting xindy modules or styles. If you want help, try the xindy mailing list on the Xindy Web Site.

### Documentation

#### The manual is very long, is there an introductory guide?

There is now a separate beginners guide distributed with the glossaries package. There is also a section on glossaries in Using LaTeX to Write a PhD Thesis and an introductory guide in the LaTeX Community's Know How section.

#### What's happened to the Quick Guide for the Impatient section in the manual?

I've replaced it with a separate beginners guide.

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.