5

I am trying to make a list of variable definitions in the appendix and I tried making glossaries and using acronyms packages but I don't know what to do. I do not need to reference the symbols in the text, just make a list with a variable and its definition as so:

List of Variables:

m The mass of the object

λ The absolute value of the displacement

  • 1
    Welcome to TeX.SX! If you need it auto-sorted, have a look on nomencl. If not, just have a look on tabbing. If in appendix or elsewhere does not matter, just write \chapter{List of Variables}. If you want to get a solution, you have to give us a minimal working code and an explanation, what you have tried and where you are having problems. – LaRiFaRi Jul 22 '14 at 11:48
  • I have some macros that create such an appendix where the symbols are given in the same order as they appear in the tex, grouped first by chapter and then by section. It isn't short (~40-50 lines of code), but if this is the sort of thing you're after then I'd be happy to post it. – Andrew Jul 22 '14 at 13:32
4

Late, but still of use: A solution with glossaries package.

\documentclass{article}
\usepackage{bm}
\usepackage[toc,symbols]{glossaries}

\newglossaryentry{mass}{%
  name={\ensuremath{m}},
  description={The mass of the object},
  type=symbols
}

\newglossaryentry{disp}{%
  name={\ensuremath{\bm\lambda}},
  description={The absolute displacement},
  type=symbols
}


\makeglossaries


\begin{document}
\section{Normal section}
The \gls{mass} of the Sun can be determined by the centripetal force being given by the gravitional force and the orbiting period of the Earth. 

The \gls{disp} can not be used alone for determing the solar mass. 



\appendix
\printglossary[numberedsection,type=symbols,style=list,nogroupskip]

\end{document}

enter image description here

Update

\documentclass{article}
\usepackage{bm}
\usepackage[toc,symbols,nomain]{glossaries}

\newcommand{\listofsymbolsname}{List of Symbols}

\newglossaryentry{mass}{%
  name={\ensuremath{m}},
  description={The mass of the object},
  type=symbols
}

\newglossaryentry{disp}{%
  name={\ensuremath{\bm\lambda}},
  description={The absolute displacement},
  type=symbols
}


\makeglossaries


\begin{document}
\section{Normal section}
The \gls{mass} of the Sun can be determined by the centripetal force being given by the gravitional force and the orbiting period of the Earth. 

The \gls{disp} can not be used alone for determing the solar mass. 



\appendix
\printglossary[title=\listofsymbolsname,type=symbols,style=list,nogroupskip]

\end{document}

enter image description here

  • Hi, the section of the symbols is titled "A Symbols". How do you change it to something like "List of Symbols"? – Carlos - the Mongoose - Danger Jan 14 '17 at 19:25
  • @MachineLearningisnotGod: See the update at the end of my answer. It's pretty straightforward with title=... – user31729 Jan 14 '17 at 21:10
  • For some reason the second example above works well but the \printglossary[title=\listofsymbolsname,type=symbols,style=list,nogroupskip] won't print the Symbols glossary. Even though all references within the text show up correctly. – A. Vieira Aug 18 '17 at 15:25
  • Yup. It's not just me ShareLatex doesn't like it either. Copied and pasted the second example on there and only the first part showed up. – A. Vieira Aug 18 '17 at 15:31
  • @A.Vieira: Works for me out of the box using TL 2017 on Linux, even after 2 years this is still a solution ;-) – user31729 Aug 18 '17 at 15:35
1

As you already found out yourself, there are at least two packages, that could help you.

  • acronym and
  • glossaries.

I would add - nomencl

I haven't worked with package arconym, so I leave that aside. Christian Hupfer has said something about package glossaries. So I want to focus on package nomencl.

Behind the Scenes

A lot of packages, that deal with acronyms and glossaries are using makeindex and Co. to prepare and build the part, that contains the Glossary. This usually means,

  1. you have to add a package,
  2. define some formatting style,
  3. insert your acronyms and explain them
  4. run LaTeX,
  5. run a version of Makeindex or another and run LaTeX again.

Package nomencl

The package nomencl is a package, which utilizes good old makeindex to sort your acronyms in some way or another. It also defines its own Makeindex-style (nomencl.ist), which you have to use, when you are running Makeindex.

By loading the package, you will be able, to use the \nomenclature-command, to introduce an acronym and to give immediately its explanation. There is also an optional argument, which you can use for sorting reasons.

You also have to add the command makenomenclature, which will open an additional file, containing the contents of the \nomenclature-command. This file will be parsed by Makeindex later. If you don't use this command, there will be no file and therefore, Makeindex won't be able, to do anything.

Last but not least, you must issue the \printnomenclature-command in order to print out the sorted list of acronyms instead.

After having run LaTeX, you have to run Makeindex like this (supposed your LaTeX-file is main.tex:

makeindex main.nlo -s nomencl.ist -o main.nls

Of course, after that you have to complete the process by running LaTeX again.

The package will print every occurrence of the \nomenclature-command, unless you have specified the same acronym twice. It will make something like an description-environment, where the acronym is printed as the label and its explanation is printed next. It does not reference to the page, where the acronym was used.

(Therefore, I think, it is exactly the solution, you are looking fore.)

Here is the example and result, using the nomencl-package.

\documentclass{article}
\usepackage{bm}
\usepackage{nomencl}

%% Use the package nomencl
\makenomenclature


\begin{document}
\section{Normal section}
The $m$\nomenclature{$m$}{The mass of the object} of the Sun can
be determined by the centripetal force being given by the gravitional
force and the orbiting period of the Earth.

The $\bm{\lambda}$\nomenclature{$\bm{\lambda}$}{The absolute
  displacement} can not be used alone for determing the solar mass.

\appendix
%% This is the right place, to print the list of used acronyms.
\printnomenclature

\end{document}

Result with package <code>nomenclature</code>

Package glossaries

This package also uses Makeindex to edit and sort the list of acronyms and abbreviations. This time, you can freely choose between the good old makeindex itself or the newer xindy-processor. The later one is able to support 8-Bit input, that is any kind of Umlaut and otherwise accented characters as öäüeøå... This might come in handy, nowadays. This time, you have to add the command \makeglossaries in your preamble.

The major difference with this package is, that you define the acronyms to be used in the preamble of your document, as Christian has explained so well. You do this with the command \newglossarentry and a list of key=value pairs.

After having them defined, you may use them by different commands like \gls (lower case letters, singular form) or \Gls (singular form beginning with a captial letter) or \glspl (plural form in lower case) and \Glspl (for plural form with capital case letter) in your document. This time, the \[gG]ls*-commands save also the page number, for back referencing from the list of acronmys into the text.

Again, you have to run LaTeX, than (again assuming main.tex)

makeglossaries main

which in turn will run makeindex or xindy behind the scenes.

Afterwards, you have to run LaTeX again.

If you had called the package hyperref and afterwards glossaries, you will be able to click on the page numbers in the List of Acronyms; they will be linked to the usage in your text.

Resumee

From your question: package nomencl will be your solution, if there must not be pagenumbers in the list of acronyms. It might be easier to use, in the first run.

Otherwise, it will be a wise decision, to dig into the mighty options, package glossaries gives you. It might be somewhat more complicated, than nomencl, but in the long run it might be very much worth the effort.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.