MakeIndex, Nomenclature, Glossaries and AcronymsNomenclature on Texstudio on Mac OS-X

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
Pink
Posts: 2
Joined: Mon Jul 29, 2019 9:29 am

Nomenclature on Texstudio on Mac OS-X

Post by Pink »

Hi,

I've followed every thread I can find to implement nomenclature on my elsarticle Latex document using Texstudio, but nothing has worked for me so far. Here's what I have done so far:
% In preamble:
\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass[review]{elsarticle}
\usepackage[intoc]{nomencl}
\makenomenclature

% In the document:
\nomenclature{$a$}{The number of angels per unit area}
\printnomenclature
I have a Mac OSX system, so I don't have the option to 'Configure TexStudio' from the drop-down menu, so I typed this into the Terminal:
pdflatex "/Users/myname/OneDrive/elsarticle-template/v2 draft".tex

makeindex "/Users/myname/OneDrive/elsarticle-template/v2 draft".nlo -s nomencl.ist -o  "/Users/myname/OneDrive/elsarticle-template/v2 draft".nls -t %.nlg

pdflatex "/Users/myname/OneDrive/elsarticle-template/v2 draft".tex
In this, the full address of my file is : "/Users/myname/OneDrive/elsarticle-template/v2 draft"

I have also tried a few times with just the file name, and not the full address. However, absolutely nothing has worked!

I would really appreciate any input on what is wrong in my implementation.
Thanks a lot!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Nomenclature on Texstudio on Mac OS-X

Post by rais »

I would refrain from spaces in filenames.
Additionally, I'd check for the presence of a .nlo file first, before trying to invoke \write18 on it.
And then there's no output of \printnomenclature, as long as there's no text at all...

Code: Select all

\documentclass[review]{elsarticle}
\IfFileExists{\jobname.nlo}{%
  \immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}%
}{%
  \typeout{No `\jobname.nlo' file yet---skipping makeindex call.}%
}
\usepackage[intoc]{nomencl}
\makenomenclature

\begin{document}
% In the document:
x\nomenclature{$a$}{The number of angels per unit area}
\printnomenclature
\end{document}
works for me (just running pdfLaTeX on it), as long as there's no space in \jobname and (restricted) shell-escape is enabled (for me, shell-escape is enabled in restricted mode by default, you may need to add -shell-escape or -shell-restricted to your pdfLaTeX call)

[edit] running pdfLaTeX twice, at least, of course[/edit]
KR
Rainer
Pink
Posts: 2
Joined: Mon Jul 29, 2019 9:29 am

Nomenclature on Texstudio on Mac OS-X

Post by Pink »

Thanks so much, rais!! I started following your points starting from the simplest. It turns out that all I needed to do was remove the space in the file name. Then magically, a nomenclature appeared! I'm super happy this finally works, and it's been a good lesson that it's best to avoid spaces in names, even if everything seems to be ok for most things.

Thanks again!
Post Reply