I previously used nomencl without issues, but I recently got this problem I cannot solve.

Below you can find a MWE. I use TeXworks. The first line comes from here. Even after multiple runs of the "pdfLaTeX" command, no nomenclature is printed.
This is most baffling to me, because the same document had previously a nomenclature created in this way.
I cannot identify where it stopped showing, and the MWE that does not produce it, also does not contain any of the latest included packages of the original document, so I would exclude any possible conflict between packages.


\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
% Packages
\title{ \LARGE \bf title\\}
% Start Document
\nomenclature{foo}{a function}
\nomenclature{bar}{an argument}
\nomenclature[a]{fubar}{an undesired result}
% End Document


enter image description here

What am I doing wrong? Otherwise, what should I do to fix this issue?

  • I get the nomenclature correctly. You are probably not enabling shell escape. Compile with pdflatex -shell-escape <file>.tex. See this. – Phelype Oleinik Apr 24 '18 at 13:00
  • @PhelypeOleinik please turn that into an answer, so that I can accept it! Also, any idea why I was able to obtain a nomenclature without shell escape earlier? – Federico Apr 24 '18 at 13:04
  • I wrote an answer. As for the reason you had the nomenclature before, it's hard to say. You probably had a non-empty .nls file that was being read by your .tex file. You probably were testing the makeindex command line and generated the .nls file, then subsequent runs of pdflatex read that into the nomenclature section. – Phelype Oleinik Apr 24 '18 at 13:21

The nomencl package uses makeindex to sort the entries alphabetically. To make the nomenclature work correctly you must run:

pdflatex - To write the \nomenclature commands into the .nlo file
makeindex - To read the .nlo file, sort it, and write the to the .nls file
pdflatex - To read back the .nls file and write the nomenclature to the .pdf

The command line to run makeindex is:

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

where file is the name of your main .tex file.

It's quite a mouthful to write every time, that why you have that first line to your .tex file:

\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}

which will run makeindex automatically every time.

You are not getting the nomenclature because makeindex was never called, so the .nls file is empty. You have to enable shell escaping to make any \write18 work correctly.

You can run pdflatex -shell-escape <file>.tex by hand or, as you use TeXWorks, you can enable -shell-escape automatically.


-shell-escape can be dangerous, if you copy code from the internet, you allow the code to do anything in your computer, so be careful. In general, this kind of thing doesn't happen, but better safe than sorry.

As an alternative you can use arara to automate this kind of thing. arara has a rule dedicated to the nomencl package. You can simply add this to the header of your document:

% arara: pdflatex
% arara: nomencl
% arara: pdflatex

and compile with arara <file>.tex.

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.