1

I have this code, but the nomenclature is not printed, why? Im working on Mac with TeXStudio. Thank you in advance.

 % arara: nomencl
 % arara: pdflatex
 \documentclass[12pt,a4paper]{report}
 \usepackage[prefix]{nomencl}
 \newcommand{\nomunit}[1]{\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
 \makenomenclature

 \begin{document}
 This is a minimal working example.

 \printnomenclature

 And this is the equation that changed the world's history:
 \begin{equation} \label{relat}
    E=mc^2
 \end{equation}

 \nomenclature{$E$}{Energy\nomunit{J}}
 \nomenclature{$m$}{Mass\nomunit{kg}}
 \nomenclature{$c$}{Speed of light\nomunit{m/s}}
 \end{document}
  • 1
    Have you run makeindex -- or does arara provide a rule for nomencl at all? If I run it by hand I've got a nomenclature –  Dec 21 '15 at 18:04
  • @ChristianHupfer arara does have a nomencl rule but it needs another % arara: pdflatex (before the nomencl rule). – Nicola Talbot Dec 21 '15 at 18:48
  • @NicolaTalbot: Right, I just checked it -- Thanks for this information. I've never used arara before (don't tell Paulo ;-)) –  Dec 21 '15 at 18:53
  • @ChristianHupfer lol, I'll keep it a secret ;-) It looks as though the nomencl rule doesn't set -s by default, so it would need to be % arara: nomencl: {style: 'nomencl.ist'} (I think that could do with fixing in the rule.) – Nicola Talbot Dec 21 '15 at 19:00
  • @NicolaTalbot: You should answer -- you found the error –  Dec 21 '15 at 19:00
  • 1
    @ChristianHupfer okay, done :-) – Nicola Talbot Dec 21 '15 at 19:10

1 Answers1

1

The arara directives at the start of the document need modifying slightly. First, you need pdflatex before nomencl (in addition to the one afterwards). Second, the nomencl rule doesn't seem to set the makeindex style file (through the -s switch). This ought to be fixed (paging Paulo, Marco, Brent, and, erm cough, me), but you can set it explicitly like this:

% arara: pdflatex
% arara: nomencl: {style: 'nomencl.ist'}
% arara: pdflatex
\documentclass[12pt,a4paper]{report}
\usepackage[prefix]{nomencl}
\newcommand{\nomunit}[1]{\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
\makenomenclature

\begin{document}
This is a minimal working example.

\printnomenclature

And this is the equation that changed the world's history:
\begin{equation} \label{relat}
   E=mc^2
\end{equation}

\nomenclature{$E$}{Energy\nomunit{J}}
\nomenclature{$m$}{Mass\nomunit{kg}}
\nomenclature{$c$}{Speed of light\nomunit{m/s}}
\end{document}

You may actually need another pdflatex to get the cross-references up-to-date:

% arara: pdflatex
% arara: nomencl: {style: 'nomencl.ist'}
% arara: pdflatex
% arara: pdflatex
Nicola Talbot
  • 41,153
  • Sorry, but is not working. I have no idea waht the Arara is – Nicolás Sacco Dec 21 '15 at 19:48
  • @NicolásSacco I assumed that you had the lines % arara: in your document because you were using arara. (Why did you include them?) If you're just building your document by clicking on a "pdflatex" button or menu it (sorry I don't use TeXstudio so I don't know the interface), then you additionally need to run makeindex and then pdflatex again. – Nicola Talbot Dec 21 '15 at 23:40
  • @NicolásSacco Perhaps this answer can help. – Nicola Talbot Dec 21 '15 at 23:41