LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and AcronymsNomenclature on Texstudio on Mac OS-X Topic is solved

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

Nomenclature on Texstudio on Mac OS-X

Postby Pink » Mon Jul 29, 2019 9:49 am

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:
  1. % In preamble:
  2. \immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
  3. \documentclass[review]{elsarticle}
  4. \usepackage[intoc]{nomencl}
  5. \makenomenclature
  6.  
  7. % In the document:
  8. \nomenclature{$a$}{The number of angels per unit area}
  9. \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:

  1. pdflatex "/Users/myname/OneDrive/elsarticle-template/v2 draft".tex
  2.  
  3. makeindex "/Users/myname/OneDrive/elsarticle-template/v2 draft".nlo -s nomencl.ist -o "/Users/myname/OneDrive/elsarticle-template/v2 draft".nls -t %.nlg
  4.  
  5. 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!

rais
Posts: 250
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Mon Jul 29, 2019 10:29 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[review]{elsarticle}
  2. \IfFileExists{\jobname.nlo}{%
  3. \immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}%
  4. }{%
  5. \typeout{No `\jobname.nlo' file yet---skipping makeindex call.}%
  6. }
  7. \usepackage[intoc]{nomencl}
  8. \makenomenclature
  9.  
  10. \begin{document}
  11. % In the document:
  12. x\nomenclature{$a$}{The number of angels per unit area}
  13. \printnomenclature
  14. \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

Postby Pink » Tue Jul 30, 2019 9:01 pm

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!


Return to “MakeIndex, Nomenclature, Glossaries and Acronyms”

Who is online

Users browsing this forum: No registered users and 1 guest