[Tex/LaTex] No file %.nls while using nomencl

nomenclaturetexworks

I would like to use nomencl. I have the following code:

\usepackage{nomencl}
\makenomenclature
\nomenlature{test}{This is a test}
\printnomenclature
\makeindex My_file.nlo -s nomencl.ist -o My_file.nls"

I receive the following error:

No file My_file.nls.

All my files are in the same folder and I can see the nlo file.

I am using TeXworks (pdfLaTeX+MakeIndex+BibTeX) and Windows Vista.

Best Answer

The command \makeindex doesn't have any arguments. The arguments you are showing must be used for the compilation makeindex:

Suppose your file has the name demo than you have to call

pdfLaTeX demo.tex
makeindex demo.nlo -s nomencl.ist -o demo.nls
bibtex demo.aux
pdfLaTeX demo.tex
pdfLaTeX demo.tex

To test the compilation steps you can use the following MWE:

\documentclass{article}

\usepackage{nomencl}
\makenomenclature
\nomenclature{test}{This is a test}

\begin{document}
\section{foo}

\printnomenclature
\end{document}

enter image description here

You can simplify the compilation by using arara:

Add the lines to your header:

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

and compile the file with arara. The documentation describes the integration of arara inside TeXWorks.

Related Question