6

I've been trying to use the nomencl package to start a table of notation. I'm using the example code included in the documentation:

\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\section*{Main equations}
\begin{equation}
a=\frac{N}{A}
\end{equation}%
\nomenclature{$a$}{The number of angels per unit area}%
\nomenclature{$N$}{The number of angels per needle point}%
\nomenclature{$A$}{The area of the needle point}%
The equation $\sigma = m a$%
\nomenclature{$\sigma$}{The total mass of angels per unit area}%
\nomenclature{$m$}{The mass of one angel}
follows easily.
\printnomenclature
\end{document}

I see this produces the .nlo file as it should, but I can't run it. I gather according to the manual I'm supposed to run a command, but how do I go about doing this - I'm running Windows 7 with TeX Live 2011.

6

The nomencl documentation states that you have to run

makeindex <filename>.nlo -s nomencl.ist -o <filename>.nls

(from the command line, or as part of your editor workflow) which produces a .nls file, which is used by \printnomenclature. In fact, nomencl defines

\def\@outputfileextension{.nlo}%
\def\@inputfileextension{.nls}%

to be the respective output and input file extensions. The former is created via \makenomenclature, while the latter is used by \printnomenclature.

  • How would I go about adding that to the editor workflow? (i'm using TeXworks) This is the first thing i've had to execute outside of TeX, so I'm not really sure of the procedure. – Andy Feb 29 '12 at 23:39
  • @Andy: I have not worked with TeXworks (I've used TeXnicCenter for this), but will try to look into this tonight. – Werner Feb 29 '12 at 23:42
  • @Andy, If you do not mind using some other editor for this purpose, Try a shareware winedt from winedt.com. It has this facility (TeX->Make Nomencl). Winedt is a shareware, but you can use it. – user11232 Mar 1 '12 at 0:03
  • @Werner I'd go with latexmk. Example .latexmkrc given in this other answer. – Mike Renfro Mar 1 '12 at 3:42
2

Adding some more details on Werner's answer, I would like to mention that one has to run this command from the folder where the yourfile.nlo is situated. Otherwise it is better to give the full path of yourfile.nlo (just in case your folder is not in system path).

makeindex E:\path..\yourfile.nlo -s nomencl.ist -o E:\path..\yourfile.nls

Then run pdflatex again (preferably 2 times).

2

Credit for this answer goes to Joseph Wright.

You can force the makeindex from the .text file (tested it in WinEdt 8 and Tex) by adding \write18 as a first line.

\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\section*{Main equations}
\begin{equation}
a=\frac{N}{A}
\end{equation}%
\nomenclature{$a$}{The number of angels per unit area}%
\nomenclature{$N$}{The number of angels per needle point}%
\nomenclature{$A$}{The area of the needle point}%
The equation $\sigma = m a$%
\nomenclature{$\sigma$}{The total mass of angels per unit area}%
\nomenclature{$m$}{The mass of one angel}
follows easily.
\printnomenclature
\end{document}

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.