text:
# glossary.sty v 2.4: LaTeX2e Package to Assist Generating Glossaries

Nicola L.C. Talbot

20th July 2006

# Introduction

The glossary package is provided to assist generating a glossary. It has a certain amount of flexibility, allowing the user to customize the format of the glossary, and define new glossary-style objects.

# Installation

You need to make sure you have downloaded the following three files:

glossary.ins
glossary.dtx

To extract the code from the glossary.dtx file, you will need to run the installation file through LaTeX:
latex glossary.ins

This will create the following files:
glossary.sty
glossary.perl
makeglos.pl
makeglos.bat

along with several sample files. The file glossary.sty should be placed somewhere in the LaTeX path, e.g. texmf/tex/latex/glossary/ or localtexmf/tex/latex/glossary/. Remember to update the TEX database if you are installing this package for the first time. The file glossary.perl is a LaTeX2HTML style file, and should be placed in the LaTeX2HTML style file directory (usually latex2html/styles/). The file makeglos.pl is a Perl script which calls makeindex. If you are using UNIX or Linux, you will need to set the permissions so that you can execute the file:
chmod a+x makeglos.pl

You should then place this file somewhere on your path. (You may also need to edit the first line of this file, if perl is located in a directory other than /usr/bin/1.)

If you are not using UNIX or Linux etc, you may have to explicitly load the file into Perl, so you would need to do perl makeglos.pl instead of just makeglos.pl. If you are using Windows, a batch file, makeglos.bat is provided which will run Perl on makeglos.pl. Both makeglos.pl and makeglos.bat should be placed somewhere specified by the PATH environment variable. (For example, put them both in the same directory as makeindex, which will probably be in \texmf\miktex\bin\).

If you don't have Perl installed on your system, you can just use makeindex, only you will have to remember all the command line switches, and you won't be able to merge entries that have the same name, but different descriptions.

Note that if you are updating the glossary package, it is a good idea to update makeglos.pl as it may also have been modified.

# Generating Glossary Information

The standard LaTeX command \makeglossary (analogous to \makeindex) should be placed in the document preamble. If this command is omitted, glossary information will be ignored. Glossary entries are generated using the command \glossary{key-val list}. This command is a slightly modified version of the standard \glossary command, in order to separate out the information into entry-name and entry-description. The argument to \glossary must be a comma-separated list of key=value pairs. The following keys are available:

Key Value
name The entry name
description A description about the entry
sort How to sort the entry. (Entry name used if sort omitted)
format How to format the page number
number Override the page number with a different counter. The value should be the name of a counter (e.g. number=section).
For example:
\glossary{name={singular matrix},
description={A matrix with zero determinant}}

The following example sorts on the text U instead of $\mathcal{U}$:
\glossary{name={$\mathcal{U}$},
description={The universal set},
sort=U}

Note that you should always use the sort key if the name key contains commands, this is particularly important if you are using hyperlinks, as the target is constructed from the name key if the sort key is omitted.

In the glossary, each entry is followed by a list of page numbers that correspond to the pages where the relevant \glossary command is placed. By default the numbers are formatted in the current font, but the page number format for individual entries can be changed using the format key. This should be the name of a LaTeX formatting command without the preceding \ (as with the | operator in \index.) For example:

\glossary{name={$\mathbb{R}$},
description={The set of real numbers},
sort=R,
format=textbf}

In addition, the following formats are also available:
 hyperrm The number is a hyper link in roman hypersf The number is a hyper link in sans-serif hypertt The number is a hyper link in typewriter font hyperbf The number is a hyper link in bold hypermd The number is a hyper link in medium weight hyperit The number is a hyper link in italic hypersl The number is a hyper link in slanted font hyperup The number is a hyper link in upright font hypersc The number is a hyper link in small caps hyperem The number is a hyper link using \emph
If the hyper option has not been set, hyperem is equivalent to emph, and the remaining hyperrm etc are equivalent to textrm etc. Note that it is important the you use hyperrm instead of hyperpage, as the \hyperpage command won't work on a list or range of numbers in the glossary2. If you want to define your own command that uses hyper links, it must be defined in an analogous manner to \hyperrm. For example, if you want to display a page number in a bold italic format, that contains a hyperlink to the appropriate page, you would need to define it as follows:
\newcommand{\hyperbfit}[2][\gls@number]{%
\textbf{\itshape\glshyper{#1}{#2}}}

As can be seen from the definition, all the \hyperxx commands have an optional argument. This argument is the name of the counter being used. You do not need to worry about this argument if you only use these commands within the \glossary command. So the previous example can simply be rewritten as:
\glossary{name={$\mathbb{R}$},
description={The set of real numbers},
sort=R,
format=hyperbf}

Note: although the numbers in the glossary are referred to as page'' numbers in this manual, they may in fact refer to some other counter, such as the section counter, depending on whether the number key has been used.

As with the \index command, care must be taken if you want to use the special characters: @ | " and !. These characters should be preceded by the double quote character. For example:

\glossary{name={$"|\mathcal{S}"|$,
description=The cardinality of the set \mathcal{S}}}

There is no provision for sub-entries, as these are generally only applicable in an index, and not in a glossary.

As from version 2.14, there is an additional command available:

\xglossary{gls-entry}{text}

This is equivalent to text\glossary{gls-entry}, where text will be made a hyper link to the relevant entry in the glossary, if hyper links are supported.

## Storing Glossary Information

It is very cumbersome having to use the \glossary command throughout your document, every time you use a term that you want in your glossary. This is particularly true for terms with a long description. The glossary package provides a means of storing the glossary information at the beginning of the document, and then using it whenever required. It is strongly recommended that you use this approach, rather than explicity using the \glossary command.

The following command:

\storeglosentry[ gls-type]{ label}{ gls-entry}

can be used to store glossary information, where label is a unique label assigned to this entry. The information can then be used later with any of the following commands:

\useglosentry[ opt]{ label}
\useGlosentry[
opt]{ label}{ text}
\gls[
opt]{ label}

\useglosentry adds the glossary entry whose label is given by label to the appropriate glossary, \useGlosentry adds the glossary entry, and makes text a hyperlink to that entry (if hyperlinks are supported). The third command, \gls, is like \useGlosentry, but forms text from the name given in the glossary entry.

Returning to an earlier example, instead of typing:

\glossary{name={$\mathcal{U}$},
description={The universal set},
sort=U}

every time you want to add this entry to the glossary, you can instead store the information:
\storeglosentry{glos:U}{name={$\mathcal{U}$},
description={The universal set},
sort=U}

Now, instead of continually copying and pasting the glossary command for this entry (which can have quite a large description field), you can use either:
\useglosentry{glos:U}

which is equivalent to:
\glossary{name={$\mathcal{U}$},
description={The universal set},
sort=U}

or you can use:
\useGlosentry{glos:U}{text}

which is equivalent to:
\xglossary{name={$\mathcal{U}$},
description={The universal set},
sort=U}{text}

or you can use:
\gls{glos:U}

which is equivalent to:
\xglossary{name={$\mathcal{U}$},
description={The universal set},
sort=U}{$\mathcal{U}$}

If you want to use glossary entries in an equation, it is better to use \ensuremath instead of $...$. For example:
\storeglosentry{Gamma}{name=\ensuremath{\Gamma(z)},
description=Gamma function,
sort=Gamma}

You can then use this entry in either text or math mode:
The \useGlosentry{Gamma}{Gamma function} is defined as
$$\gls{Gamma} = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt$$

If you are using hyper links, and you want to use \useGlosentry within math mode, you must use \ensuremath:
$$\useGlosentry{Gamma}{\ensuremath{\Gamma(x+1)}} = x\Gamma(x)$$

The optional argument to \storeglosentry (gls-type) indicates the glossary type (see later to find out how to define new glossary types). If omitted, the standard glossary is used.

The optional argument to \useglosentry, \useGlosentry and \gls (opt) allows you to add additional information to the glossary entry, for example:

\useglosentry[format=textbf]{glos:U}

is equivalent to:
\glossary{name={$\mathcal{U}$},
description={The universal set},
sort=U,
format=textbf}

Since version 2.4, \storeglosentry is robust, and \protect should no longer be needed, however the identifying label, label, should not contain any special characters.

As from version 2.36, if you want to use all glossary entries which have been defined using \storeglosentry, do: \useglosentry{*}. (Note that this option is not available for \useGlosentry and \gls.)

# makeglos.pl

Whenever a glossary entry is used, either explicity using \glossary or \xglossary or implicitly using \useglosentry, \useGlosentry and \gls, the information is saved in a file with the extension glo (unless the \makeglossary command is omitted, in which case the glossary information is simply ignored.) A makeindex style file (ist) is also created, which is customized for the document, and can be passed to makeindex.

For example, suppose your document is called mydoc.tex, the glossary will be saved in the file mydoc.glo, and the makeindex style file mydoc.ist will be created. These files can then be passed to makeindex as follows:

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

which generates the output file mydoc.gls, with transcript written to mydoc.glg.

The Perl script makeglos.pl provided with this package allows you to use makeindex without having to remember all the command line options. The command

makeglos.pl mydoc

will perform the command:
makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo

In addition, makeglos.pl also takes the option -m which can be used to collate entries where the same name has multiple descriptions.

makeglos.pl has the following syntax:

makeglos.pl [-ilqrgm] [-s sty] [-o gls] [-t log] [-p num] <filename>

where all switches, apart from -m are the same as those for makeindex. If there are multiple glossary types (see later) and the file extension is omitted, makeglos.pl will iterate through each glossary type (it will pick up the relevant information from the auxiliary file).

The name of the ist file can be changed by redefining the command \istfilename before \makeglossary. For example:

\renewcommand{\istfilename}{foo.ist}
\makeglossary

Only one ist file will be created per document, even if you have multiple glossaries with different styles. The only circumstance where you will need multiple ist files for a single document is when you have multiple glossaries that use different counters with different compositors, but this is rarely likely to occur.

Creation of the ist file can be suppressed by issuing the command \noist before \makeglossary. It will also be suppressed when the command \nofiles is used, or if the command \makeglossary is omitted.

It should be noted that there are a few packages that can cause problems with the creation of the ist file, for example ngerman. If you encounter problems when LaTeX is processing the \makeglossary command, or if you get errors from makeindex complaining about the style file, this is the most probable cause. See later for information on how to fix this.

# Displaying the Glossary

Once the gls file has been created by makeindex (as described in the previous section) the glossary can then be included in the document with the command \printglossary. If chapters are defined, the glossary will start with

\chapter*{\glossaryname}

\section*{\glossaryname}

The format of the main body of the glossary depends on the options passed to the package.

# Package Options

The package options must be specified as a comma-separated list of key=value pairs. Available options are:

style
The glossary style. Values:
list
use description environment in the glossary
altlist
modified version of style=list. The description starts on the line following the name of the term being defined.
super
use supertabular environment in the glossary
long
use longtable environment in the glossary (Default)

none
The glossary doesn't have a heading (Default)
plain

border
Glossary border. Values:
none
The glossary doesn't have a border (Default)
plain
Border around the main body of the glossary

cols
Number of columns. Values:
2
The entry name and description are in two separate columns with the associated page numbers in the same column as the description. (Default)
3
The entry name, description and associated page numbers are in three separate columns.

number
Associated number corresponding to each entry. This may either be the keyword none indicating that the corresponding numbers should be suppressed, or it can be the name of a LaTeX counter. The default is number=page.

toc
Boolean variable:
true
false
Note that if you specify this option, you will need to run LaTeX twice after generating the glossary.

hypertoc
Boolean variable. This is similar to the package option toc, but if you are using the hyperref package, hypertoc will generate a link to the point immediately before the glossary title, whereas toc will have a hyperlink to just after the glossary title. Note that you can not use both toc=true and hypertoc=true. Default value: hypertoc=false.

hyper
Boolean variable:
true
Make associated numbers in the glossary a hypertext link, and also make acronyms, and the text given by \xglossary have a hyperlink to their corresponding entries in the glossary.
false
Don't make associated numbers a hypertext link
If the hyperref or html package has been loaded prior to loading glossary.sty, hyper=true is set, otherwise the default is hyper=false. Note that this package option now encompasses the old hyperacronym option.

section
Boolean variable:
true
Make the glossary an unnumbered section, even if chapters are defined
false
Only make glossary an unnumbered section if chapters are not defined (default).

acronym
Boolean variable:
true
Make the list of acronyms separate from the main glossary.

false
The acronyms will all be placed in the main glossary. (Default)

global
Boolean variable:
false
Acronym commands only have a local effect. (Default)
true
Acronym commands have a global effect.
The border, header and cols options should not be used in conjunction with style=list or style=altlist, as they only make sense with one of the tabular-style options. The value for the boolean variables can be omitted if they are to be set. For example toc is equivalent to toc=true. Note that the altlist style is better suited to glossaries with long entry names.

You can set up your own preferred defaults in a configuration file. The file must be called glossary.cfg and should be placed somewhere on the TEX path. In this file you can use the command \glossarypackageoptions{option-list} where option-list is a comma-separated list of key=value pairs, as passed to the glossary package. Note that this command may only be used in the configuration file.

# Defining New Glossary Types

A new type of glossary can be defined using the command:

\newglossarytype[log-ext]{name}{out-ext}{in-ext}[style list]

For example, suppose you want your document to have a separate index of terms and index of notation, you could use \makeglossary, \glossary, \xglossary and \printglossary for the first glossary, and define a new type of glossary called say, notation, using

\newglossarytype[nlg]{notation}{not}{ntn}

which will create the analogous commands: \makenotation, \notation, \xnotation and \printnotation which can be used for the second glossary.

As from version 2.3, \newglossarytype now has an additional optional argument style list. This should be a comma separated list of key=value pairs that can be used to specify the style of the new glossary. If omitted, the new glossary will have the same format as the main glossary. The following options are available: number, style, header, border and cols. These can take the same values as those given in the package options (described in section 6).

The command \newglossarytype should only occur in the preamble. The new commands \makename, \name, \xname and \printname all have the same format as their glossary'' counter-parts.

The glossary information will be saved to a file with the extension given by out-ext (analogous to glo), which can then be passed to makeindex either directly or via makeglos.pl, and the file to be read in (i.e. the file created by makeindex) will have the extension in-ext (analogous to gls).

The optional argument log-ext indicates the extension for the makeindex log file, if omitted the extension glg is used. This is not used by LaTeX, however makeglos.pl reads in this information from the LaTeX auxiliary file and passes it to makeindex.

For the above notation example, if your document is called, say, mydoc.tex, you will need to do the following:

latex mydoc
makeglos.pl mydoc
latex mydoc

(You may need to do an extra latex mydoc to get cross-references up-to-date.) Note that if you don't specify the file extension when using makeglos.pl, it will check the transcript file from the LaTeX run to determine all the glossary types, so, for this example,
makeglos.pl mydoc

is equivalent to:
makeglos.pl mydoc.glo
makeglos.pl mydoc.not

since makeglos.pl has read in the information for the notation glossary type from the file mydoc.log.

If you don't have Perl installed on your system, or for any other reason are unable to use makeglos.pl, you can call makeindex explicitly:

latex mydoc
makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
makeindex -s mydoc.ist -t mydoc.nlg -o mydoc.ntn mydoc.not
latex mydoc

Note that you can use the command \printglossary[name] instead of \printname. These two commands have the same effect when using LaTeX, however, they have a slightly different effect when using LaTeX2HTML (see later).

If the command \glossary-typename is defined, (e.g. \notationname in the above example) this will be used as the title for the specified glossary. If this command is not defined, \glossaryname will be used instead. If the command \shortglossary-typename is defined, (e.g. \shortnotationname in the above example) this will be used for the table of contents entry, otherwise \glossary-typename will be used instead. For example:

\newglossarytype[nlg]{notation}{not}{ntn}
\newcommand{\notationname}{Index of Notation}
\newcommand{\shortnotationname}{Notation}

# Acronyms

The glossary package provides the command:

\newacronym[ cmd-name]{ acronym}{ long}{ glossary entry}

which can be used to define acronyms. The argument long is the full name, the argument acronym is the acronym for long and glossary entry is the glossary information in the form used by the \glossary command. If the optional argument cmd-name is missing, \newacronym will create a command called \acronym, otherwise it will create a command called \cmd-name (henceforth denoted \acr-name). This command can then be used throughout the text. The first instance of this command is equivalent to:

long (\xacronym{name=long (acronym),glossary entry}{acronym})

subsequent instances will be equivalent to:

\xacronym{name=long (acronym),glossary entry}{acronym}

The command \acr-name also has a starred version, which will make the first letter of long uppercase (for use at the start of a sentence).

Note that if you want to change the format of the acronym, for example, if you want the acronym to appear in small caps, you will need to not only use the optional argument, but you will also need to use the sort key, otherwise you will get an error. For example:

\newacronym[SVM]{\textsc{svm}}{Support Vector Machine}%
{description=Statistical pattern recognition
technique,sort=svm}

If the package option acronym is not set (default) \xacronym, is a synonym for \xglossary, and the acronyms will appear in the main glossary (remember to specify \makeglossary and \printglossary). If the package option acronym=true is specified, a new glossary type called acronym will be defined as:

\newglossarytype[alg]{acronym}{acr}{acn}
\providecommand{\acronymname}{List of Acronyms}

You will then need to use the commands \makeacronym and \printacronym to make the list of acronyms appear. You will also need to run the acr file through makeindex (or makeglos.pl). For example:
makeindex -s mydoc.ist -t mydoc.alg -o mydoc.acn mydoc.acr

alternatively:
makeglos.pl mydoc

Note that the package option acronym=true is only appropriate if you want both a glossary and a separate list of acronyms. If you do not write in English, you can set up your own language definition for \acronymname in the configuration file glossarycfg. For example:
\newcommand{\acronymname}{Akronyme}

(If glossary.cfg does not exist, create a new file, add the appropriate definition of \acronymname, and save it to the same directory as glossary.sty.)

The name key does not need to appear in glossary entry, as it is constructed from long and acronym. By default this will be in the form: long (acronym), however the format can be overridden using the command:

\setacronymnamefmt{format}

Within format the following commands may be used to represent long and acronym: \glolong and \gloshort. For example, suppose you just want the acronym to appear in the glossary entry, and not its full length name, then you would need to do:

\setacronymnamefmt{\gloshort}

As from version 2.32, you can also modify the way the description key is formatted for acronyms using:

\setacronymdescfmt{format}

Within format you may use the commands \glolong and \gloshort (as above), and you can also use the command \glodesc which is the description as specified by the description key in \newacronym. This means that if you are using a tabular style glossary, you can have the abbreviated form in one column and the long form in the second column with the description. For example, the following:

\setacronymnamefmt{\gloshort}
\setacronymdescfmt{\glolong: \glodesc}
\newacronym{svm}{support vector machine}{description=Statistical
pattern recognition technique}

will generate a glossary entry of the form:
\glossary{name=svm,description=support vector machine: Statistical
pattern recognition technique}

Note that if you omit \glodesc from \setacronymdescfmt the description specified in \newacronym will be ignored. So
\setacronymnamefmt{\gloshort}
\setacronymdescfmt{\glolong}
\newacronym{svm}{support vector machine}{description=Statistical
pattern recognition technique}

will generate a glossary entry of the form:
\glossary{name=svm,description=support vector machine}

You will need to specify the name key explicitly if the name contains a makeindex special character. For example:

\newacronym{RNA}{Ribonukleins\"aure}{name={Ribonukleins\""aure (RNA)}}

Note that this will override any formatting specified by \setacronymnamefmt.

Given an acronym named acr-name (the command name associated with the acronym as defined in \newacronym without the preceding backslash), the following commands are also available:

\useacronym[insert]{acr-name}

This command can be used instead of \acr-name. \useacronym also has a starred version equivalent to \acr-name*. The optional argument insert allows you to insert text after long, if this is the first occurrence of the acronym, or after the acronym on subsequent occurrences.

\resetacronym{acr-name}

This command will cause the next use of \acr-name to produce the long version. To reset all acronyms do \resetallacronyms.

\unsetacronym{acr-name}

This command will cause all subsequent uses of \acr-name to produce the short version. To unset all acronyms do \unsetallacronyms.

\ifacronymfirstuse{acr-name}{true text}{false text}

This will test if the acronym has been used yet. If it has been used, true text will be implemented, otherwise false text will be implemented.

The long and short forms of an acronym can be produced explicitly without a corresponding glossary entry, using the commands:

\acrln{acr-name}
\acrsh{acr-name}

Or, alternatively:

\acr-namelong
\acr-nameshort

The first two commands (\acrln and \acrsh) have a starred form that makes the first letter uppercase. The other two commands, simply contain long and acronym.

Note that since these four commands do not generate glossary entries they will therefore not contain any hyperlinks, even if you have specified the hyper package option. They are provided for use in situations where the associated glossary command may cause problems (e.g. in a sectioning command.)

Note that, as with all LaTeX commands, spaces following command names are ignored so if, for example, you defined a new acronym called, say, SVM, then the command \SVM will ignore any spaces following it. To force a space, you can either place an empty set of braces after the command name (e.g. \SVM{}) or use \_ i.e. a backslash followed by a space (e.g. \SVM\ ). Alternatively, as from version 2.22, if you load the xspace package before loading the glossary package, spaces will be put in automatically using \xspace.

If you want the acronym to appear in a particular font, for example, small caps, you can redefine the command \acronymfont. For example:

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

The default definition of \acronymfont is:
\newcommand{\acronymfont}[1]{#1}

## Examples

\newacronym{SVM}{Support Vector Machine}{description=Statistical
pattern recognition technique}

This will define the command \SVM. The first time this command is used will display the text: Support Vector Machine (SVM). Subsequent use will simply display: SVM. The next example uses the optional argument cmd-name since the acronym contains a non-alphabetical character:
\newacronym[KSVM]{K-SVM}{Kernel Support Vector
Machine}{description=Statistical pattern recognition
technique using the kernel trick''}

This will define the command \KSVM. The first time this command is used will display the text: Kernel Support Vector Machine (K-SVM). Subsequent use will simply display: K-SVM.

To test whether or not an acronym has been used:

\ifacronymfirstuse{SVM}{a}{an} \SVM\ is \ldots

If the acronym has not been used, the following text will be produced:

a Support Vector Machine is ...

otherwise it will produce:

an SVM is ...

To expand the acronym a second time:
\chapter{An overview of the \protect\SVM}
\resetacronym{SVM}
The \SVM\ \ldots

Note the use of \protect (see note 15.) In fact, in this situation it would be better to do:
\chapter[An overview of the \SVMlong]{An overview of the \protect\SVM}
\resetacronym{SVM}
The \SVM\ \ldots

Now suppose you want the text: support vector machine, instead of Support Vector Machine (i.e. you don't like the uppercase letters). You can define the acronym as follows:

\newacronym{SVM}{support vector machine}{description=Statistical
pattern recognition technique}

however, if the command \SVM occurs at the start of the sentence, you would clearly want the first letter as an uppercase letter. This can be done using \SVM* instead of \SVM. For example:
\SVM*\ techniques are widely used \ldots

This will then come out as: Support vector machine (SVM) techniques are widely used ...(Assuming this is the first use of either \SVM or \SVM*.)

Alternatively, \useacronym{SVM} can be used instead of \SVM. For example:

\useacronym*[s]{SVM} are widely used in the area of pattern
recognition.

If this is the first use of the acronym SVM, it will produce the following text:

Support vector machines (SVM) are widely used in the area of pattern recognition.

If this is not the first use of this acronym, it will produce the following text:

SVMs are widely used in the area of pattern recognition.

# Customizing the Glossary

The glossary package provides commands which can be redefined to customize the glossary. The following name commands are defined by this package:
Command Default Value
\glossaryname Glossary
\shortglossaryname \glossaryname
\entryname Notation
\descriptionname Description
The commands \entryname and \descriptionname are put in the first two columns of the header row if you are using one of the tabular glossary styles together with a header row (as specified by the header=true package option). If you are using cols=3, the command \glspageheader will be put in the third column of the header row. By default, this command does nothing.

The command \shortglossaryname is used for the page headers and table of contents entry. Any text required before or after the glossary can be added by redefining the commands \glossarypreamble and \glossarypostamble. For example.

\renewcommand{\glossarypreamble}{Page numbers in
italic indicate the main definition\par}

By default, \glossarypreamble and \glossarypostamble do nothing.

Any text required before or after the list of page numbers are specified by the commands \glsbeforenum and \glsafternum. By default, these commands do nothing, any redefinition of these commands should come somewhere before the relevant \printglossary command. For example:

\printglossary
\renewcommand{\glsbeforenum}{(}
\renewcommand{\glsafternum}{)}
\printnotation

This will put the page number list in brackets for the second glossary, but not the first.

Individual glossaries can have their styles changed either by setting the style in the final optional argument to \newglossarystyle (see earlier) or using the command:

\setglossarystyle[type]{style list}

For example:

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

If type is omitted, the change is applied to the main glossary.

The command \setglossary{key-val list} can be used to modify some of the glossary settings. The argument key-val list is a comma-separated list of key=value pairs. Available keys are:

type
This is the glossary type. If it is omitted, the standard glossary is assumed.

glsnumformat
This is the name of the command, without the preceding backslash3, to format the entry numbers. For example, to make all the entry numbers italic, do:
\setglossary{glsnumformat=textit}

To suppress numbering altogether, you can do:
\setglossary{glsnumformat=ignore}

glodelim
This specifies what to do after the entry description and before the page numbers. The default value is a comma, unless the cols=3 option is specified, in which case it has the value &, or if style=altlist, in which case it is simply a space4. If the package option number=none is specified, glodelim will have an empty value (unless cols=3 is specified, where, again, it will have the value &.) This setting corresponds to the delim_0 key in the makeindex style file.

Note that if you want a new line between the description and the list of page numbers you will need to use \noexpand. For example:

\setglossary{glodelim={\noexpand\newline}}

delimN
The delimiter to be inserted between two page numbers for the same entry. (This corresponds to the delim_n key in the makeindex style file.) By default, this has the value ,_ (comma followed by a space). If the package option number=none is chosen, the value is set to empty.

delimR
The delimiter to be inserted between the starting and ending page number range for the same entry. (This corresponds to the delim_r key in the makeindex style file.) By default, this has the value --. If the package option number=none is chosen, the value is set to empty.

gloskip
This specifies what to do between groups. If style=list or style=altlist this has the value \indexspace, otherwise it creates a blank row in the longtable or supertabular environment. This command corresponds to the group_skip key in the makeindex style file. Note that as from version 2.3, you should no longer redefine the command \gloskip.

delimT
The text to be inserted after the list of page numbers for an entry. (This corresponds to the delim_t key in the makeindex style file.) The default value depends on the glossary style. It does nothing for the list-type styles, and has the value \\ for the tabular-type styles. Note that delimT is separate from \glsafternum.

For example, if you are using a 2 column tabular style, and you want a blank line after every entry (not just after every group) you can do the following:

\setglossary{delimT={\cr & \cr},gloskip={}}

Note the use of \cr instead of \\ and gloskip is set to nothing otherwise there would be a double space between groups.
Note that:
\setglossary{glsnumformat=ignore}

is equivalent to
\setglossary{glsnumformat=ignore,delimN={},delimR={}}

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}

The start and end of the main body of the glossary is given by the commands: \beforeglossary and \afterglossary. If the style=list or style=altlist package options are chosen these commands simply begin and end the description environment, otherwise these commands begin and end the longtable or supertabular environment with argument specified by \glossaryalignment5.

The glossary package no longer conflicts with the array package. Changes can now be made to \glossaryalignment regardless of whether or not the array package has been used.

The command \gloitem indicates what to do at the start of each glossary entry. This command takes one argument, which will be the text specified by the name key in the \glossary command. In the case of the style=list option, \gloitem{text} will do

\item[text]

or if style=altlist:

\item[text]\mbox{}\par

otherwise it will do

text &

This command corresponds to the item_0 key in the makeindex style file.

If the glossary has a tabular style with a header row (header=true and either style=long or style=super), then the header row for cols=2 will be given by:

\bfseries\entryname & \bfseries \descriptionname\\

and the header row for cols=3 will be given by:
\bfseries\entryname & \bfseries\descriptionname &

(It may also contain \hline\hline if the border key is set.)

If you want to override this, you need to define the command \glossaryheader6.

For example, if you are using a tabular style with cols=2, and you want the \descriptionname to be centred, you could do:

\newcommand{\glossaryheader}{\bfseries\entryname &
\hfil\bfseries\descriptionname\\}

If you want an extra row below the header row, you can define the command\glossarysubheader For example, if you are using cols=3, and you want an extra row after the header row, you can do:

\newcommand{\glossarysubheader}{ & & \\}

The command \glosstail indicates what to do at the end of the longtable or supertabular environment.

The width of the second column for the tabular-type styles is given by the length \descriptionwidth. This value can be changed using the \setlength command (the default value is 0.6\linewidth).

# Sample Documents

This package comes with the following sample documents:
• sampleSec.tex -- This document uses the options: style=altlist, toc and number=section. It also loads the hyperref package before loading the glossary package, so the glossary has hyperlinks to the section numbers. Experimenting with different package options, will illustrate the different glossary styles. You will need to do:
pdflatex sampleSec
makeglos.pl sampleSec
pdflatex sampleSec
pdflatex sampleSec

If you don't want to use makeglos.pl, you will need to do
makeindex -s sampleSec.ist -t sampleSec.glg -o sampleSec.gls sampleSec.glo

• sampleNtn.tex -- This has a glossary and defines a new glossary type called notation. The glossary has associated page numbers, but the new glossary type doesn't. The two glossaries have different styles. You will need to do:
latex sampleNtn
makeglos.pl sampleNtn
latex sampleNtn
latex sampleNtn

If you don't want to use makeglos.pl, you will need to do
makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.ntn sampleNtn.not

• sampleNtn2.tex --This is similar to sampleNtn.tex, but uses \storeglosentry.

• sampleEq.tex -- This has a glossary where the numbers in the glossary refer to the equation number rather than the page number (achieved with the package option number=equation). The \entryname, \descriptionname, \glossaryname and \glspageheader are all redefined to customize the glossary. You will need to do:
latex sampleEq
makeglos.pl sampleEq
latex sampleEq

If you don't want to use makeglos.pl, you will need to do
makeindex -s sampleEq.ist -t sampleEq.glg -o sampleEq.gls sampleEq.glo

• sampleEqPg.tex -- This is a modified version of sampleEq.tex. This example has one glossary, where some of the entry numbers refer to the corresponding page number, and some of the entry numbers refer to the corresponding equation number. You will need to do:
latex sampleEqPg
makeglos.pl sampleEqPg
latex sampleEqPg

If you don't want to use makeglos.pl, you will need to do
makeindex -s sampleEqPg.ist -t sampleEqPg.glg -o sampleEqPg.gls sampleEqPg.glo

• sampleAcr.tex -- This has a glossary containing acronyms. It uses the style altlist as this is better suited to glossaries with long names. It also uses the hyperref package, so the page numbers in the glossary will automatically be hyperlinks, and the acronyms within the text will have hyperlinks to their corresponding entry in the glossary. You will need to do:
pdflatex sampleAcr
makeglos.pl sampleAcr
pdflatex sampleAcr
pdflatex sampleAcr

If you don't want to use makeglos.pl, you will need to do
makeindex -s sampleAcr.ist -t sampleAcr.glg -o sampleAcr.gls sampleAcr.glo

• sample.tex -- This has a glossary entry with two different definitions of the same name. If you just use makeindex, the two entries will be treated separately, however, if you want them concatenated, you can use makeglos.pl with the -m switch. You will need to do:
pdflatex sample
makeglos.pl -m sample
pdflatex sample
pdflatex sample

(Depending on the configuration of your system, you may have to do perl makeglos.pl instead of just makeglos.pl)

If you don't want to use makeglos.pl, you will need to do

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

however, the entries with the same name but multiple descriptions will not be merged. You will also have to given them different sort keys otherwise you will get duplicate hyper targets.

• sample4col.tex--This illustrates how to modify the glossary style so that it has 4 columns. You will need to do:
latex sample4col
makeglos.pl sample4col
latex sample4col

# LaTeX2HTML Style File

A LaTeX2HTML Perl script, glossary.perl, is provided with this package for those wishing to use the glossary package with the LaTeX2HTML translator. The file glossary.perl should be extracted along with glossary.sty when you run the installation script (glossary.ins) through LaTeX.

## Limitations

• The only package options supported are: style=altlist, hyper=true, toc=true, acronym=true and acronym=false.

• If you have more than one glossary type, the secondary glossaries will occur in the same segment as the primary glossary if you use the command \printname instead of \printglossary[name], where name is the name of the glossary type.

• The command \setglossary must be placed in the preamble to have an effect.

• The \storeglosentry commands must be in the document environment to have an effect. (They don't seem to work in the preamble, I don't know why.)

• If you place a \glossary command inside an environment not translated by LaTeX2HTML (for example, inside a mathematics environment), it will not be entered into the glossary.

• The combinations "", "|, "! and "@ will be correctly translated, unless they occur within a maths environment. This is because the maths environment is translated before being passed to \glossary. You can overcome this by doing, e.g.:
\begin{latexonly}
\glossary{name=$"|\mathcal{S}"|$,description=cardinality of set
$\mathcal{S}$,sort=cardinality}
\end{latexonly}
\begin{htmlonly}
\glossary{name=$|\mathcal{S}|$,description=cardinality of set
$\mathcal{S}$,sort=cardinality}
\end{htmlonly}

Alternative, you can use \mid instead:

\glossary{name=$\mid\mathcal{S}\mid$,description=cardinality of
set $\mathcal{S}$,sort=cardinality}

• Glossary items with the same names but different definitions will not be merged.

• The configuration file glossary.cfg is ignored.

# Troubleshooting

This is a list of common problems, for a more up-to-date FAQ, see http://theoval.cmp.uea.ac.uk/~nlct/packages/faq/.

1. My glossary hasn't appeared.

Check the following:

• Have you included the command \makeglossary in the preamble?

• Have you put the command \printglossary where you want the glossary to appear?

• Have you used makeglos.pl or makeindex, and if you did, did it successfully create the gls file? (Check the transcript glg file.)

• If you used makeindex directly, did you specify the ist file created by \makeglossary, and did you remember to specify the output file with the extension gls?

• When makeindex scans the ist file, it should generate the message:
9 attributes redefined, 0 ignored

If you have a number other than 0 ignored, then there is something wrong with the ist file. Some packages can cause problems with the creation of this file, see item 16 below.

• Have you remembered to LaTeX your document again after using makeglos.pl or makeindex?

• Have you used \glossary or \xglossary?

• If you have used \storeglosentry, have you also used \useglosentry, \useGlosentry or \gls?

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

2. 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-nameshort and \acr-namelong don't generate entries in the list of acronyms, where \acr-name is the name of an acronym command.

3. 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, or use the global package option.

4. I get an error when using the command \saveglosentry.

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

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

Check the following

• If you defined the entry using \storeglosentry have you used either \useglosentry, \useGlosentry or \gls?

• Have you remembered to \protect commands such as \mathcal within \storeglosentry?

• Have you used the characters @ ! | "? If so, have you preceded them with a double quote character?

Check the makeindex log file to see if there are any error messages.

6. 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.

7. 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.

8. 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.

9. 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).

10. 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 information7.

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

Check the following:

1. Have you remembered to use PDFLaTeX instead of LaTeX, or used a driver that understands hyperlinks?
2. Have you remembered to use the hyperref or html 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.

12. The glossary package conflicts with the datetime package.

This has been fixed in version 2.01.

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

This has been fixed in version 2.1.

14. I get the following error:
! Package array Error: Illegal pream-token (\glossaryalignment): c' used.

The glossary package used to conflict with the array package. This was fixed in version 2.1. As from version 2.3, it doesn't matter whether you load the glossary package before or after the array package.

15. I get the following error:
Use of \@chapter doesn't match its definition

or
! Argument of \@sect has an extra }

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}}

16. 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.

17. makeglos.pl gives the following error message:
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 makeglos.pl.

Let me know if you encounter any other problems or if you have any comments regarding this package.

# Obsolete Commands

The commands described in this section are now obsolete, but are currently still provided for backwards compatibility. Their use is deprecated.

\saveglosentry{ name}{description}
This command has now been replaced by \storeglosentry.

The command \glsprimaryfmt has now been removed.

The package option hyperacronym is now superseded by the package option hyper. This option was implemented prior to the introduction of the command \xglossary. Since the acronyms now use \xglossary, there is no difference between the hyperacronym and hyper options. This option has a boolean value:

true
Make acronyms link to their corresponding entry in the glossary
false
If the hyperref package has been loaded prior to loading glossary.sty or if hyper=true is set, hyperacronym=true otherwise hyperacronym=false.

# Contact Details

Dr Nicola Talbot
School of Computing Sciences
University of East Anglia
Norwich. Norfolk
NR4 7TJ. United Kingdom.
http://theoval.cmp.uea.ac.uk/~nlct/

# Acknowledgements

I would like to thank all the many people who have made suggestions and pointed out bugs.

## Index

Troubleshooting
array
Customizing the Glossary | Customizing the Glossary | Troubleshooting | Troubleshooting
datetime
Troubleshooting
\descriptionname
Customizing the Glossary | Sample Documents
\entryname
Sample Documents
file types
acr
Acronyms
cfg
Package Options | Acronyms
glg
makeglos.pl | Defining New Glossary Types | Troubleshooting
glo
makeglos.pl | makeglos.pl | Defining New Glossary Types | Troubleshooting
gls
makeglos.pl | Displaying the Glossary | Defining New Glossary Types | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
ist
makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
perl
LaTeX2HTML Style File | LaTeX2HTML Style File
\glodesc
Acronyms | Acronyms
\glolong
Acronyms | Acronyms
\gloshort
Acronyms | Acronyms
glossary
Introduction | Generating Glossary Information | Generating Glossary Information | Storing Glossary Information | Storing Glossary Information | Storing Glossary Information | Package Options | Examples | Defining New Glossary Types | Acronyms | Acronyms | Acronyms | Customizing the Glossary | Customizing the Glossary | Sample Documents | Limitations | Limitations | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
glossary border
see package options, border
glossary columns
see package options, cols
\glossary keys
description
Generating Glossary Information | Storing Glossary Information | Acronyms
format
Generating Glossary Information | Generating Glossary Information | Troubleshooting
hyperbf
Generating Glossary Information | Troubleshooting
hyperem
Generating Glossary Information | Generating Glossary Information
hyperit
Generating Glossary Information
hypermd
Generating Glossary Information
hyperrm
Generating Glossary Information | Generating Glossary Information
hypersc
Generating Glossary Information
hypersf
Generating Glossary Information
hypersl
Generating Glossary Information
hypertt
Generating Glossary Information
hyperup
Generating Glossary Information
name
Generating Glossary Information | Generating Glossary Information | Generating Glossary Information | Acronyms | Acronyms | Acronyms | Acronyms | Customizing the Glossary
number
Generating Glossary Information | Generating Glossary Information
sort
Generating Glossary Information | Generating Glossary Information | Generating Glossary Information | Acronyms
glossary style
see package options, style
glossary.cfg
see file type, cfg
\glossaryalignment
Troubleshooting
\glossaryname
Displaying the Glossary | Defining New Glossary Types | Sample Documents
\gls
Storing Glossary Information | Troubleshooting | Troubleshooting | Troubleshooting
Sample Documents
html
Package Options | Troubleshooting
hyperref
Package Options | Package Options | Sample Documents | Sample Documents | Troubleshooting | Obsolete Commands
\hyperrm
Generating Glossary Information
keyval
Troubleshooting | Troubleshooting | Troubleshooting
\makeacronym
Acronyms | Troubleshooting
makeglos.pl
makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Acronyms | Sample Documents | Sample Documents | Sample Documents | Sample Documents | Sample Documents | Sample Documents | Sample Documents | Sample Documents | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
\makeglossary
makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | Defining New Glossary Types | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
makeindex
Installation | Installation | Installation | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | makeglos.pl | Displaying the Glossary | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Defining New Glossary Types | Acronyms | Acronyms | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Sample Documents | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
makeindex key
delim_0
Customizing the Glossary
delim_n
Customizing the Glossary
delim_r
Customizing the Glossary
delim_t
Customizing the Glossary
group_skip
Customizing the Glossary
item_0
Customizing the Glossary
makeindex style file (.ist)
see file types, ist
\newacronym
Acronyms | Troubleshooting
\newglossarystyle
Customizing the Glossary
ngerman
makeglos.pl | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
\nofiles
makeglos.pl
\noist
Troubleshooting | Troubleshooting
package options
,
none
Package Options
acronym
Package Options | Package Options | Acronyms | Acronyms | Acronyms | Acronyms | Limitations | Limitations | Troubleshooting
false
Package Options | Limitations
true
Package Options | Acronyms | Acronyms | Limitations | Troubleshooting
border
Package Options | Package Options | Package Options | Package Options | Examples | Examples | Examples | Examples | Customizing the Glossary | Customizing the Glossary
none
Package Options | Examples | Examples
plain
Package Options | Examples | Examples
cols
Package Options | Package Options | Package Options | Package Options | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary
2
Package Options | Customizing the Glossary | Customizing the Glossary
3
Package Options | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary
global
Package Options | Package Options | Troubleshooting | Troubleshooting
false
Package Options
true
Package Options
Package Options | Package Options | Package Options | Package Options | Examples | Examples | Examples | Examples | Customizing the Glossary | Customizing the Glossary
none
Package Options | Examples | Examples
plain
Package Options | Examples | Examples
true
Customizing the Glossary | Customizing the Glossary
hyper
Generating Glossary Information | Generating Glossary Information | Package Options | Package Options | Package Options | Package Options | Acronyms | Acronyms | Limitations | Troubleshooting | Troubleshooting | Obsolete Commands | Obsolete Commands | Obsolete Commands | Obsolete Commands | Obsolete Commands
false
Package Options | Package Options
true
Package Options | Package Options | Limitations | Obsolete Commands
hyperacronym
Package Options | Package Options | Obsolete Commands | Obsolete Commands | Obsolete Commands | Obsolete Commands | Obsolete Commands | Obsolete Commands
false
Obsolete Commands | Obsolete Commands
true
Obsolete Commands | Obsolete Commands
hypertoc
Package Options | Package Options | Package Options | Package Options | Package Options | Package Options
false
Package Options
true
Package Options
number
Package Options | Package Options | Package Options | Examples | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Sample Documents | Sample Documents
equation
Sample Documents
none
Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary
page
Package Options | Examples
section
Sample Documents
section
Package Options | Package Options
false
Package Options
true
Package Options
style
Package Options | Package Options | Package Options | Package Options | Package Options | Examples | Examples | Examples | Examples | Examples | Examples | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Sample Documents | Limitations | Troubleshooting | Troubleshooting
altlist
Package Options | Package Options | Package Options | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary | Sample Documents | Sample Documents | Limitations
list
Package Options | Package Options | Package Options | Examples | Examples | Customizing the Glossary | Customizing the Glossary | Customizing the Glossary
long
Package Options | Examples | Examples | Examples | Examples | Customizing the Glossary | Troubleshooting
super
Package Options | Customizing the Glossary | Troubleshooting
toc
Package Options | Package Options | Package Options | Package Options | Package Options | Package Options | Package Options | Package Options | Package Options | Package Options | Sample Documents | Sample Documents | Limitations
false
Package Options
true
Package Options | Package Options | Package Options | Limitations
page number formats
hyperbf
Generating Glossary Information | Troubleshooting
hyperem
Generating Glossary Information | Generating Glossary Information
hyperit
Generating Glossary Information
hypermd
Generating Glossary Information
hyperrm
Generating Glossary Information | Generating Glossary Information
hypersc
Generating Glossary Information
hypersf
Generating Glossary Information
hypersl
Generating Glossary Information
hypertt
Generating Glossary Information
hyperup
Generating Glossary Information
perl
Installation
\printacronym
Acronyms | Troubleshooting
\printglossary
Defining New Glossary Types | Defining New Glossary Types | Troubleshooting
\protect
Troubleshooting
\saveglosentry
Troubleshooting | Obsolete Commands
\setacronymnamefmt
Acronyms
\setglossary
Limitations | Troubleshooting
\setglossary keys
delimN
Customizing the Glossary
delimR
Customizing the Glossary
delimT
Customizing the Glossary | Customizing the Glossary
glodelim
Customizing the Glossary | Customizing the Glossary
gloskip
Customizing the Glossary | Customizing the Glossary
glsnumformat
Customizing the Glossary | Troubleshooting
type
Customizing the Glossary
\storeglosentry
Storing Glossary Information | Storing Glossary Information | Sample Documents | Limitations | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
see package options, toc
\useacronym
Examples
\useGlosentry
Storing Glossary Information | Storing Glossary Information | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting | Troubleshooting
\xacronym
Acronyms | Acronyms | Acronyms
\xglossary
Package Options | Defining New Glossary Types | Acronyms | Troubleshooting | Obsolete Commands | Obsolete Commands
xpdf
Troubleshooting
\xspace
Acronyms | Acronyms

#### Footnotes

... /usr/bin/`1
and you can also remove the .pl extension which isn't to everyone's liking.
... glossary2
This is because the list and number ranges are delimited using \delimR and \delimN instead of explicitly using a comma or en-dash.
... backslash3
Note, you should no longer try redefining the command \glsnumformat, as this now takes an optional argument, allowing for different glossary types
... space4
This is because the altlist style is intended for use with long descriptions that will look better ending with a full stop which the user can add if desired.
...\glossaryalignment5
This isn't quite true anymore, see the documented code for clarification


text:
# Hyperfine mixing in $b o c$ semileptonic decay of doubly heavy baryons - High Energy Physics - Phenomenology

Hyperfine mixing in $b o c$ semileptonic decay of doubly heavy baryons - High Energy Physics - Phenomenology - Descarga este documento en PDF. Documentación en PDF para descargar gratis. Disponible también para leer online.

Abstract: We qualitatively corroborate the results of W. Roberts and M. Pervin in Int.J. Mod. Phys. A 24, 2401 2009 according to which hyperfine mixing greatlyaffects the decay widths of $b\to c$ semileptonic decays involving doubly heavy$bc$ baryons. However, our predictions for the decay widths of the unmixedstates differ from those reported in the work of Roberts and Pervin by a factorof 2, and this discrepancy translates to the mixed case. We further show thatthe predictions of heavy quark spin symmetry, might be used in the future toexperimentally extract information on the admixtures in the actual physical$bc$ baryons, in a model independent manner.

Autor: C. Albertus, E. Hernández, J.Nieves

Fuente: https://arxiv.org/

format: plain


text:
During my internship at IBM Research this summer, my office mate Renbo and I discussed the following extremely important research problem.

There are twelve men on an island. Eleven weigh exactly the same amount, but one of them is slightly lighter or heavier. You must figure out which. The island has no scales, but there is a see-saw. The exciting catch: you can only use it three times.

To clarify: the riddle is asking us to find the odd-weight islander, but we do not need to determine whether the odd-weight islander is lighter or heavier.

Instead of solving this riddle, we’re going to take the riddle-writer’s perspective: what is the maximum number of islanders such that the riddle is solvable? Along the way, we’ll uncover some hints about how to approach the original riddle.

The Problem

Suppose we have $$n$$ islanders and are allowed $$w$$ weighings on the see-saw. We ask: under what conditions on $$n$$ and $$w$$ is the riddle solvable? (In the original riddle, $$n = 12$$ and $$w = 3$$.) There are two sorts of conditions we might look for.

• A sufficient condition on $$n$$ and $$w$$ is one such that if the condition holds, the riddle is solvable.
• A necessary condition on $$n$$ and $$w$$ is one such that if the condition fails, the riddle is unsolvable.

The way to prove that a condition is sufficient is pretty intuitive: given the condition, find a solution! For example, solving the original riddle shows that $$n = 12, w = 3$$ is a sufficient condition. Of course, as those who paused the Brooklyn 99 episode to try out the riddle quickly found out, finding the solution can still be tricky. But the overall approach to proving a sufficient condition is clear.

Necessary conditions are more difficult. To prove that a condition is necessary, we have to show that if the condition fails, then there does not exist any islander-weighing strategy that solves the riddle. For example, suppose we want to prove that the puzzle is impossible for $$n = 13$$ islanders in $$w = 3$$ weighings. It’s not enough to take a solution that finds the odd-weight islander for $$n = 12, w = 3$$ and demonstrate that it fails for $$n = 13, w = 3$$. Instead, we need to somehow consider every islander-weighing strategy.

In this post, we will find a necessary condition on $$n$$ and $$w$$ for the puzzle to be solvable. Specifically, we’ll prove that the puzzle is solvable only if

$2n - 1 < 3^w.$

To do so, we’ll use information theory, a branch of mathematics that helps us prove necessary conditions like this without explicitly considering every possible islander-weighing strategy.

The Short Version

We’re going to start by proving a slightly weaker necessary condition: the puzzle is solvable only if $$2n - 1 \leq 3^w$$ (note the non-strict inequality). Proving this weaker condition introduces all the key ideas without using any information theory.

We begin by observing that if the riddle is solvable, then it is solvable with a deterministic strategy (see Appendix, Lemma 1), so we can restrict our attention to deterministic strategies.

Suppose the riddle asked us to both find the odd-weight islander and determine whether they are lighter or heavier. To solve this modified riddle, we need to distinguish between the $$2n$$ possible scenarios: there are $$n$$ possibilities for the odd-weight islander, and they are either lighter or heavier. Each see-saw weighing has three possible outcomes: the left side is heavier, the right side is heavier, or the sides are balanced. So there are $$3^w$$ possible outcomes of a sequence of $$w$$ weighings. After observing one of these $$3^w$$ outcomes, we should be able to unambiguously determine which of the $$2n$$ scenarios we are in. We can’t do this if there are fewer outcomes than scenarios. This means $$2n \leq 3^w$$ is a necessary condition to solve the modified riddle.

The original riddle asks us just to find the odd-weight islander, so it seems like we only have to distinguish between $$n$$ possible scenarios. But it turns out that, even if we’re not trying to, we almost always end up figuring out whether the odd-weight islander is lighter or heavier. To see why, suppose we figure out that Charles is the odd-weight islander. If we ever put Charles on the see-saw in the process, then we see whether Charles was on the lighter or heavier side of the see-saw. This means the only way we can find the odd-weight islander without finding out whether they are lighter or heavier is if we never weigh the odd-weight islander.

Given an islander-weighing strategy, we say an islander is “lonely” if whenever they are the odd-weight islander, our strategy never weighs them. It turns out that any successful strategy can have at most one lonely islander (see Appendix, Lemma 2). This means that to solve the riddle, we must distinguish between at least $$2n - 1$$ possible scenarios:

• a single scenario in which the odd-weight islander is the lonely islander, and
• $$2n - 2$$ scenarios in which the odd-weight islander is one of the $$n - 1$$ non-lonely islanders.

There are still $$3^w$$ possible outcomes of $$w$$ weighings, so $$2n - 1 \leq 3^w$$ is a necessary condition to solve the riddle.

A Stricter Condition

Let’s think about what the $$2n - 1 \leq 3^w$$ condition says about the original $$n = 12, w = 3$$ riddle. Could we solve it with fewer weighings? How about more islanders?

• Given $$n = 12$$, we must have $$23 \leq 3^w$$, which means we need $$w \geq 3$$, so the riddle cannot be solved in fewer weighings.
• Given $$w = 3$$, we must have $$2n - 1 \leq 27$$, which means $$n \leq 14$$. So the riddle might be solvable with more islanders.

It turns out that the riddle is solvable for $$n = 13$$ but not $$n = 14$$. But we could rule out $$n = 14$$ using the necessary condition $$2n - 1 < 3^w$$ (note the strict inequality) that we promised in the introduction. Proving this stricter condition is where the information theory comes in.

How Much Information is in Each Weighing?

One of the key insights of information theory is to draw a connection between information and randomness. Information theory views anything we don’t know as a random variable. The entropy of a random variable tells us, roughly speaking, how much information we expect to gain by learning the outcome of that random variable. For brevity, I’m not going to explain in detail how to define entropy, instead explaining just the bits we need for this post. (If you’re curious, sources like Wikipedia have pretty good explanations.)

In our context, the main random variable we want to know is which of the $$2n - 1$$ scenarios we are in. Let’s give it a name:

$S = \text{the scenario we're in''.}$

If each of the scenarios is equally likely, then $$S$$ has entropy $$H(S) = \log_2(2n - 1)$$.

Solving the riddle entails learning the outcome of $$S$$, but we never observe $$S$$ directly. Instead, we observe the results of each weighing. These weighing outcomes are also random variables, so let’s write

$T_i = \text{the outcome of the ith weighing''.}$

Let’s call the possible outcomes of a weighing $$\ell$$, $$r$$, and $$b$$ for tipping left, tipping right, and staying balanced, respectively. Writing $$p_i$$ for the probability mass function of $$T_i$$ (meaning, for example, that $$p_3(l)$$ is the probability that the see-saw tips left on the third weighing), we can write the entropy of $$T_i$$ as

$H(T_i) = p_i(\ell) \log_2\biggl(\frac{1}{p_i(\ell)}\biggr) + p_i(r) \log_2\biggl(\frac{1}{p_i(r)}\biggr) + p_i(b) \log_2\biggl(\frac{1}{p_i(b)}\biggr).$

To solve the riddle, it must be that the amount of information we get from the weighings is at least the amount of information we would get by directly learning which scenario we are in. That is, a necessary condition for the riddle to be solvable is

$H(S) \leq \sum_{i = 0}^w H(T_i). \qquad (*)$

(To be precise, the amount of information we learn from the $$i$$th weighing is never more than $$H(T_i)$$, but might be less if later weighings tell us information we already learned from earlier weighings. Look up conditional entropy for details.)

Our question thus becomes: how do we maximize $$H(T_i)$$, the entropy of the $$i$$th weighing? It turns out that the entropy of a random variable is maximized when all of its outcomes are equally likely. In the case of $$T_i$$, this happens when each outcome has probability $$1/3$$, so $$H(T_i) \leq \log_2 3$$. Plugging this bound into $$(*)$$, we get necessary condition

$\log_2(2n - 1) \leq w\log_2(3)$

… which is equivalent to the weaker necessary condition $$2n - 1 \leq 3^w$$ we already derived. What’s missing?

To get the stricter condition, we need one last observation: we can’t actually make the three outcomes of each weighing equally likely! Suppose that in the first weighing we put $$k$$ islanders on each side of the see-saw. The probability of each outcome is

$p_1(\ell) = \frac{2k}{2n - 1} \quad p_1(r) = \frac{2k}{2n - 1} \quad p_1(b) = \frac{2n - 1 - 4k}{2n - 1}.$

That is, of the $$2n - 1$$ scenarios, there are $$2k$$ that would make the see-saw tip left: $$k$$ where someone on the left is heavier and $$k$$ where someone on the right is lighter. (Remember that, by definition, the lonely islander is not on the see-saw.) But we cannot possibly have $$2k = 2n - 1 - 4k$$, because $$2k$$ is even and $$2n - 1 - 4k$$ is odd. So we can’t make the three outcomes equally likely, which means $$H(T_i) < \log_2(3)$$. Plugging this bound into $$(*)$$, we get necessary condition

$\log_2(2n - 1) < w\log_2(3),$

which is equivalent to $$2n - 1 < 3^w$$, as desired.

Appendix

Here are a few of the details we skipped above. The proofs don’t use any fancy techniques, so they make good exercises if you can resist peeking.

Lemma 1.

If the riddle is solvable, then it is solvable with a deterministic islander-weighing strategy.

Proof.

Suppose we have a nondeterministic islander-weighing strategy solves the riddle. That means when we get to a nondeterministic step, we choose between one of several options for to proceed. But our strategy always works, which means it should work no matter which option we pick. In particular, it still works if we always arbitrarily pick the first option, which makes our strategy deterministic. $$\square$$

Lemma 2.

Any deterministic islander-weighing strategy that solves the riddle has at most one lonely islander.

Proof.

Recall that an islander is “lonely” for a given strategy if whenever they are the odd-weight islander, they are not placed on the see-saw. We’re going to show that if a strategy has a lonely islander, then none of the other islanders are lonely. Say that Jake is the lonely islander and consider Charles, another islander. We need to show that if Charles is the odd-weight islander, then we have put Charles on the see-saw at least once.

The key is this: because Jake is lonely, we can’t put Jake on the see-saw until we get at least one unbalanced weighing. This is because until we see an unbalanced weighing, Jake could still be the odd-weight islander.

Suppose now that Charles is the odd-weight islander. If we never put Charles on the see-saw, then all the weighings are balanced. But because all the weighings are balanced, we must never have put Jake on the see-saw. Because neither Jake nor Charles have been weighed, we cannot possibly tell the difference between them. Therefore, to solve the riddle, if Charles is the odd-weight islander, our strategy must at some point put Charles on the see-saw. $$\square$$


text:
# Definition:Linear Representation

## Definition

### Groups

Let $\left({\mathbb k, +, \circ}\right)$ be a field.

Let $V$ be a vector space over $\mathbb k$ of finite dimension.

Let $\operatorname {GL} \left({V}\right)$ be the general linear group of $V$.

Let $\left({G, \cdot}\right)$ be a finite group.

A linear representation of $G$ on $V$ is a group homomorphism $\rho: G \to \operatorname {GL} \left({V}\right)$.

### Algebras

Let $K$ be a field.

Let $A$ be an associative unitary algebra over $K$.

Then a (linear) representation of $A$ is a vector space $V$ over $K$ equipped with a homomorphism of algebras:

$\rho: A \to \operatorname{End} \left({V}\right)$

where $\operatorname{End}\left({V}\right)$ is the endomorphism ring of $V$.


text: 機率研討會 主講者: Prof. Krishina B. Athreya (Iowa State University) 講題: 1. Coalescence in critical and subcritical Galton Watson processes 2. Staistical estimation of integrals w.r.t. infinite measures 時間: 2014-06-09 (Mon.)  14:10 - 16:30 地點: 數學所 617 研討室 (台大院區) Abstract: 1.If a Galton Watson process is not extinct by the nth generation and has at least two individuals, pick two individuals at random by SRSWOR. Trace their lines of descent back in time till they meet. Call that generation Xn a pairwise coalescence time. Let Yn denote the coalescence time for the whole population of the nth generation conditined on non extinction. In this talk we present results on the limit behaviors of Xn and Yn for both critical and subcritical cases. 2. Let f be an integrable function on an infinite measure space, the usual MCMC or iid Monte Carlo will not work here. We show that if a regenerative sequence with the given measure as its canonical measure could be generated then a consistent estimation is possible. Under some appropriate conditions a confidence interval also can be constructed. This is all illustrated with estimating countable sums and integrals w.r.t. Lebesgue measure on Rd using SSRW. || Close window ||


text:
# Time-dependent Schrodinger equation for many particles

1. Jul 9, 2012

### AxiomOfChoice

If you've got, say, three particles, then the time-dependent Schrodinger equation (in units where $\hbar = 1$) for the system reads

$$i \frac{\partial \psi}{\partial t} = -\sum_{i=1}^3 \frac{1}{2m_i} \Delta_i \psi + \sum_{i<j} V(r_i - r_j)\psi,$$

right? And of course $\psi = \psi(r_1,r_2,r_3;t)$. But there isn't just ONE solution to this equation, right? There are MANY. And don't they correspond to, say, all particles being independent for large times, or one particle bound to another and the remaining one free, etc.? And I'm guessing this is at the heart of scattering theory - kind of examining the variety of long-time behaviors that can be exhibited in this case. Do I have this right?

Last edited: Jul 9, 2012
2. Jul 9, 2012

### jfy4

Yes that's right. The wave function as $t\rightarrow \pm \infty$ and it's corresponding probabilities are what we can measure. Not only $t$, but also as $r\rightarrow \infty$ which in a collider experiment is on the order of meters.


text:
# Math Help - Tangent line derivatives

1. ## Tangent line derivatives

Hi,

I know this question is easy but I havent done this topic in awhile and I forget how to do it.

$f(x)=-0.1x^3 -0.26x^2 + 0.861x + 1.539$
I need to sketch the tangent lines to y=f(x) at x=-3 and x=2?
How do I work out the tangent line?

2. To find the tangent you need to take the derivative of f(x)

3. And when you found f'(x), you just replace x be the values given to you.

4. Hi, thats what I done, I got -0.279

So on my graph when x=-3, the corresponding y value is -0.279 ?

it looks like the tangent will cut through the curve?

5. No, the gradient at the x coordinate x = -3 is -0.279.

To find the y value, you need to replace in f(x).

But since you replaced in f'(x), you get the value of the gradient.

6. ok so when i plug in f(-0.279) I get a value of 1.28 for y.

so I connect from y=1.28 on the graph to where x=-3 line drops vertically onto the curve?

7. I'm getting f(-3) = -0.684. Check your calculations again.

You might want to find the equation of the gradient, by using:

$\dfrac{y - y_1}{x - x_1} = m$

You will get the y intercept of the tangent then.

Then, you connect the y intercept with the point to where the line x = -3 drops vertically on the curve.

8. You got f(-3) or f'(-3) = -0.684?

9. I didn't put any apostrophe in my answer, meaning I got f(-3) = -0.684. f'(-3) = -0.279.

You need to find the point on the curve first. You were given x = -3. The y coordinate is given by f(-3).

Now, since you are looking for a tangent at that point, you also need to find f'(3).

Once you get those, you have your coordinates.

f(-3) = -0.684
f'(-3) = -0.279
x = -3

Or, (-3, -0.684) with gradient m = -0.279

Thus, you get the equation of the tangent as being:

$\dfrac{y - (-0.684)}{x - (-3)} = -0.279$

This becomes:

$y = -0.279x - 1.521$

Now that you have the equation of the tangent, you can join the points: (-3, -0.684) and (0, -1.521) to get the tangent.


text:
I am trying to add a header/footer to each page of my markdown document, and I know that this has previously been addressed here, but I am having issues when converting it to a pdf in pandoc.

---
title:
- \usepackage{graphicx}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
\fancyfoot[LE,RO]{footer}

---

And then have a markdown document such as below:

The unanimous Declaration of the thirteen united States of America,When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.--That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, --That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.--Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.

He has refused his Assent to Laws, the most wholesome and necessary for the public good.

He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them.

He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, a right inestimable to them and formidable to tyrants only.

He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their public Records, for the sole purpose of fatiguing them into compliance with his measures.

He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.

He has refused for a long time, after such dissolutions, to cause others to be elected; whereby the Legislative powers, incapable of Annihilation, have returned to the People at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.

He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage their migrations hither, and raising the conditions of new Appropriations of Lands.

He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.

He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.

He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.

He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.

He has affected to render the Military independent of and superior to the Civil power.

He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; giving his Assent to their Acts of pretended Legislation:

For Quartering large bodies of armed troops among us:

For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:

For cutting off our Trade with all parts of the world:

For imposing Taxes on us without our Consent:

For depriving us in many cases, of the benefits of Trial by Jury:

For transporting us beyond Seas to be tried for pretended offences

For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at once an example and fit instrument for introducing the same absolute rule into these Colonies:

For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:

For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.

He has abdicated Government here, by declaring us out of his Protection and waging War against us.

He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.

He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation and tyranny, already begun with circumstances of Cruelty & perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.

He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.

He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.

In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. A Prince whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.

Nor have We been wanting in attentions to our Brittish brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, and we have conjured them by the ties of our common kindred to disavow these usurpations, which, would inevitably interrupt our connections and correspondence. They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.

We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these United Colonies are, and of Right ought to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.

Do I need to include any Latex in the markdown section of the document in order to render the pdf correctly? The pandoc command I use is:

pandoc markdowntest.md -o out.pdf

When I run this, the header overlaps with the markdown output, and then footer only appears on the first page.

Is there something that I am missing?

I don't do pandoc, but you should debug it in LaTeX first.

You need to increase \headheight and decrease \textheight to match.

\documentclass[twoside]{article}

\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[LE,RO]{footer}

\begin{document}
\noindent\rule{\textwidth}{\textheight}\newpage
\noindent\rule{\textwidth}{\textheight}\newpage
\end{document}

Thanks @John Kormylo, I ended up going with.

---