3

I have a new problem with the nomenclature. My preamble in the main file has the following lines:

\documentclass[ngerman,draft,table*]{sdqthesis}
\usepackage{nomencl}
\makenomenclature
\immediate\write18{%
  makeindex -s nomencl.ist -o \jobname.nls -t \jobname.nlg \jobname.nlo%
} 
.
.
.

And in the same main file I use the command:

\printnomenclature

Then in another file, which is inculded in the main file, I define after an equation:

\nomenclature{$P^{NOpt}$}{Elektrische Leistung der nicht optimierbaren Geräte}

After compiling no error message is show but the nomenclature cannot be found anywhere. Does anyone have a clue what I have to do.

Problems with Makeindex

I was adviced to post a new question with a link to the other question.

Noob
  • 79
  • 1
    Please transfer the real question to this place -- the link to a non-answer which is likely to be deleted isn't really useful –  Sep 27 '15 at 16:36
  • 1
    Have you checked that makeindex had created file *.nls and do the files *.nlo and *.nlgexist? – Mensch Sep 27 '15 at 17:03
  • my arguments for the latex compiler are: -max-print-line=120 -interaction=nonstopmode -shell-escape "%wm" and to make index: makeindex %.nlo -s nomencl.ist -o %.nls -t %.nlg But the nomenclature is still not displayed – Noob Sep 27 '15 at 17:14

1 Answers1

3

There seems to be some asynchronous IO between the closing of the .nlo file (which contains the nomenclature entries) and the call to the shell-escape.

I've defined a command \writenomcl{\jobname} and hooked it into \AtEndDocument, so after two runs of pdflatex etc. the entries should be there.

The key point is to postpone the writing, i.e. \write18 and \closeout without \immediate.

\documentclass{article} % Don't have this sdqthesis.cls
\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature

\makeatletter
\newcommand{\closenomencl}{%
  \closeout\@nomenclaturefile%
}
\makeatother


\newcommand{\writenomencl}[1]{%
  \closenomencl%
  \IfFileExists{#1.nlo}{%
    \write18{%
      makeindex -s nomencl.ist -o #1.nls -t #1.nlg #1.nlo%
    }% 
  }{\typeout{Nothing there}}%
}


\AtEndDocument{\writenomencl{\jobname}}

\begin{document}

\nomenclature{$P^{NOpt}$}{Elektrische Leistung der nicht optimierbaren Geräte}
\nomenclature{$\lambda$}{Wellenlänge}

Hello World


\printnomenclature

\end{document}

enter image description here

  • I eliminated the command: "\immediate" from the main file. Now I have the following command in the mail file: "\write18{% makeindex -s nomencl.ist -o \jobname.nls -t \jobname.nlg \jobname.nlo% }" But still no nomenclature in the document – Noob Sep 27 '15 at 17:37
  • I think you have to close the .nlo file (like I've done in my code) –  Sep 27 '15 at 17:51
  • Okay, now it works. Is there a way how I can change the heading from Nomenclature into the german word Nomenklatur? – Noob Sep 27 '15 at 19:39