The glossaries-extra
package internally loads glossaries
so you don't need to load both. The "noidx" method is quick for order of use/definition but slow and inefficient for alphabetic sorting, so glossaries-extra
provides a hybrid method where you can use makeindex
/xindy
for the glossaries that need alphabetical ordering and \printnoidxglossary
for order of use/definition. With glossaries-extra
, there's an optional argument to \makeglossaries
that's a comma-separated list of glossary labels indicating which glossaries need processing by makeindex
/xindy
. These ones are displayed with \printglossary
and the others are displayed with \printnoidxglossary
. (Note that there's no \makenoidxglossary
.)
\documentclass[a4paper,twoside]{book}
\usepackage[abbreviations,symbols,nogroupskip,nonumberlist]{glossaries-extra}
\makeglossaries[abbreviations]
\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}}
\glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}}
\glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}}
\glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}}
\glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}
\newabbreviation{ny1}{NY}{New York}
\newabbreviation{la1}{LA}{Los Angeles}
\newabbreviation{un1}{UN}{United Nations}
\begin{document}
\printnoidxglossary[type=symbols,sort=use,style=long,title={List of Symbols}]
\printglossary[type=abbreviations]
Reference symbols: $\gls{F}$, $\gls{t}$, $\gls{x}$, $\gls{v}$, $\gls{a}$.
\gls{ny1} \gls{la1} and \gls{un1} are abbreviations that should
appear alphabetically in the list of abbreviations.
\end{document}
The build process still uses the makeglossaries
script, which picks up from the .aux
file which glossaries need processing, so in this case it will skip the list of symbols.
The list of symbols is in the order of use:

The list of abbreviations is in alphabetical order:

If you prefer to use \newacronym
instead of \newabbreviation
you need to replace the abbreviations
package option with acronyms
(or acronym
) and set the abbreviation style:
\documentclass[a4paper,twoside]{book}
\usepackage[acronym,symbols,nogroupskip,nonumberlist]{glossaries-extra}
\makeglossaries[\acronymtype]
\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}}
\glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}}
\glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}}
\glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}}
\glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}
\setabbreviationstyle[acronym]{long-short}
\newacronym{ny1}{NY}{New York}
\newacronym{la1}{LA}{Los Angeles}
\newacronym{un1}{UN}{United Nations}
\begin{document}
\printnoidxglossary[type=symbols,sort=use,style=long,title={List of Symbols}]
\printglossary[type=\acronymtype]
Reference symbols: $\gls{F}$, $\gls{t}$, $\gls{x}$, $\gls{v}$, $\gls{a}$.
\gls{ny1} \gls{la1} and \gls{un1} are abbreviations that should
appear alphabetically in the list of abbreviations.
\end{document}
Here's a completely different approach where the terms are defined in .bib
files.
abbreviations.bib
:
% Encoding: UTF-8
@abbreviation{ny1,
short = {NY},
long = {New York}
}
@abbreviation{la1,
short = {LA},
long = {Los Angeles}
}
@abbreviation{un1,
short = {UN},
long = {United Nations}
}
If you already have an existing file containing \newabbreviation
(or \newacronym
) you can convert it to a .bib
with convertgls2bib
, which is supplied with bib2gls
.
symbols.bib
:
% Encoding: UTF-8
@symbol{x,
name = {\ensuremath{x}},
description = {position}
}
@symbol{v,
name = {\ensuremath{v}},
description = {velocity}
}
@symbol{a,
name = {\ensuremath{a}},
description = {acceleration}
}
@symbol{t,
name = {\ensuremath{t}},
description = {time}
}
@symbol{F,
name = {\ensuremath{F}},
description = {force}
}
Again, if you already have an existing file containing \glsxtrnewsymbol
you can convert it to a .bib
file with convertgls2bib
.
Document (test.tex
):
\documentclass[a4paper,twoside]{book}
\usepackage[record,% using bib2gls
abbreviations,symbols]{glossaries-extra}
\GlsXtrLoadResources[
src={abbreviations},% data in abbreviations.bib
sort={en}, % sort by this language tag (en = English)
type=abbreviations, % put the entries in this glossary
save-locations=false % no number list required
]
\GlsXtrLoadResources[
src={symbols}, % data in symbols.bib
sort={use}, % sort by order of use
type=symbols, % put the entries in this glossary
save-locations=false % no number list required
]
\begin{document}
\printunsrtglossary[type=symbols,style=long,title={List of Symbols}]
\printunsrtglossary[type=abbreviations]
Reference symbols: $\gls{F}$, $\gls{t}$, $\gls{x}$, $\gls{v}$, $\gls{a}$.
\gls{ny1} \gls{la1} and \gls{un1} are abbreviations that should
appear alphabetically in the list of abbreviations.
\end{document}
The document build is:
pdflatex test
bib2gls test
pdflatex test
By default bib2gls
doesn't form letter groups, so there's no need for the nogroupskip
option now. If you decide that you do actually want letter groups you need to add the --group
or -g
switch:
bib2gls -g test
The list of symbols is as before:

and the list of abbreviations is again in alphabetical order:

This provides a more flexible way of applying different ordering to different glossaries.
If your TeX distribution is too old to support either the hybrid method or the bib2gls
method, you can use the \makenoidxglossaries
method with just the base glossaries
package as in the other answer, but with glossaries-extra
you can still use \glsxtrnewsymbol
if you have the symbols
package option as that command has been available since the first release of glossaries-extra
:
\documentclass[a4paper,twoside]{book}
\usepackage[abbreviations,symbols,nogroupskip,nonumberlist]{glossaries-extra}
\makenoidxglossaries
\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}}
\glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}}
\glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}}
\glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}}
\glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}
\newabbreviation{ny1}{NY}{New York}
\newabbreviation{la1}{LA}{Los Angeles}
\newabbreviation{un1}{UN}{United Nations}
\begin{document}
\printnoidxglossary[type=symbols,sort=use,style=long,title={List of Symbols}]
\printnoidxglossary[type=abbreviations]
Reference symbols: $\gls{F}$, $\gls{t}$, $\gls{x}$, $\gls{v}$, $\gls{a}$.
\gls{ny1} \gls{la1} and \gls{un1} are abbreviations that should
appear alphabetically in the list of abbreviations.
\end{document}
The advantage is that the code is a bit more compact.
glossaries-extra
(which loadsglossaries
with appropriate options) followed by trying to loadglossaries
with a different option list. You will always get an error if you try to load the same package twice with different options. (\usepackage[bar]{foo}
\usepackage[baz]{foo}
)