If you have to write up your model results, often you have to write down the model documentation. My colleague at work pointed me to a great package in LaTeX that can make your life easier with respect to the nomenclature used. It allows you to produce a glossary with all your variables, parameters and acronyms without much extra work. The package is called “nomencl” and here is an example of a pdf generated with LaTeX:
As you can see, I have acronyms, parameters and variables as well as the reference to where they are used for the first time (if you only use variables and parameters you can even refer to the equation they are used for the first time).
Using this package is quite easy:
Add:
1 2 |
\usepackage{nomencl} % If you want to use the references add options refpage, refeq \makenomenclature |
and
1 |
\printnomenclature |
to print the nomenclature.
Symbols can be added in the text like follows (after the equation they appear the first time):
\nomenclature{$vw$}{ Time cost multiple for walking time}
To generate the nomenclature you have to give a specific command. In Emacs you can add the following code to your .emacs-file
1 2 3 4 5 6 7 |
(eval-after-load "tex" '(add-to-list 'TeX-command-list '("Nomenclature" "makeindex %s.nlo -s nomencl.ist -o %s.nls" (lambda (name command file) (TeX-run-compile name command file) (TeX-process-set-variable file 'TeX-command-next TeX-command-default)) nil t :help "Create nomenclature file"))) |
When you now hit C-c C-c you can choose the option “Nomenclature” and the necessary files are generated.
If you want to have the distinction between several groups, you just add the following code in your preamble and change the second part according your preferences:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
\usepackage{xstring} \usepackage{xstring} \usepackage{xpatch} \patchcmd{\thenomenclature} {\leftmargin\labelwidth} {\leftmargin\labelwidth\itemindent 1em } {}{} \newcommand{\nomenclheader}[1]{% \item[\hspace*{-\itemindent}\normalfont\bfseries#1]} \renewcommand\nomgroup[1]{% \IfStrEqCase{#1}{% {V}{\nomenclheader{Variables}}% V - Variables {P}{\nomenclheader{Parameters}}% P - Parameters {A}{\nomenclheader{Acronyms}}% A - Acronyms }% } |
To produce an entry for paramters, you just add [P] in front of the normal entry
1 2 |
<p>\nomenclature[P]{$vw$}{ Time cost multiple for walking time} </p> |
One last remark: The entries might not be aligned properly. For this you can add in your preamble:
1 |
\nomlabelwidth=30mm |
and choose the width accordingly. The nomenclature entries have rather much vertical space between them. This can be changed by adding one of the following lines to your preamble:
1 2 3 4 5 |
;;No extra skip \setlength{\nomitemsep}{-\parsep} ;; Set to 1cm \setlength{\nomitemsep}{1cm} |