[Tex/LaTex] Makeindex no .nls file

indexing

Here is the sample code from test.tex: http://texblog.org/2012/05/14/list-of-symbols-or-abbreviations-nomenclature/

\documentclass{article} 
\usepackage{nomencl}
\makenomenclature
\renewcommand{\nomname}{Time Zones}
\begin{document}
UTC\nomenclature{UTC}{Coordinated Universal Time} is 3 hours behind ADT\nomenclature{ADT}{Atlantic Daylight Time} and 10 hours ahead of EST\nomenclature{EST}{Eastern Standard Time}.
\printnomenclature
\small\hfill Created by http://texblog.org
\end{document}

I ran this on TexStudio.
pdfLatex –> MakeIndex –> pdfLatex

Errors when I ran MakeIndex:

Process started: makeindex.exe "test".idx

Input index file test.idx not found. Usage: makeindex.exe [-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 …]

Process exited with error(s)

Errors when I ran pdfLatex

No file test.nls.

Thank you for your help!

Best Answer

If every one reads manuals, then we will have very less questions here and less reputation too ;)

To make nomenclature you have to pdflatex the .tex file and then run this command:

makeindex -s nomencl.ist -t "<file name>.nlg" -o "<file name>.nls" "<file name>.nlo"

where <file name> is the name without .tex extension (myfile if I have myfile.tex).

Then again pdflatex myfile.tex.

Now the question is how to run makeindex with all those arguments in texstudio.

You can create a user command for this. Go to OptionsConfigure TeXstudio. In the window that appears, choose Build tab on the left side. Search for User Commands. (You may have to click Add button with a green +). Type

Make Nomenclature

just after user0: (0,or 1 0r 2, depending on how many use commands you already have) in the first box. In the second box type:

makeindex -s nomencl.ist -t %.nlg -o %.nls %.nlo

Now OK it. Illustration below.

enter image description here

Now you have a menu under ToolsUser with a short key also.

enter image description here

Now run pdflatexMake Nomeclaturepdflatex. Hope things are now clear.

As another option, you can install the cool automation tool arara and create a User Command for arara (as mentioned above) and make all three compilation clicks in one go. You have to add these lines:

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

just before your \documentclass command (or anywhere in the document), and compile using

arara myfile

using your User Command.

Related Question