1

I am using a template provided by the school to write my thesis. On the main.tex I am using \documentclass[11pt]{thesis}. Now I am trying to add a list of symbols page, I am using this code

\documentclass{article} 
\usepackage{nomencl}
\makenomenclature

\begin{document} Here is an example: \nomenclature{(c)}{Speed of light in a vacuum} \nomenclature{(h)}{Planck constant}

\printnomenclature \end{document}

Doing this does not display other pages. Removing the \documentclass{article} throws an error Can only be used in preamble.

How can I display the symbol page?

moewe
  • 175,683

1 Answers1

2

The MWE that you show is correct. Have you run makeindex? When you compile your file with a nomenclature, let's say named whatever.tex, let's say with pdflatex, a new file whatever.nlo is created in your working directory.

Then, you should invoke makeindex:

makeindex whatever.nlo -s nomencl.ist -o whatever.nls

And then, you should compile again, so that pdflatex can load whatever.nls to include the nomenclature list. In summary:

pdflatex whatever.tex
makeindex whatever.nlo -s nomencl.ist -o whatever.nls
pdflatex whatever.tex

The output of your code correctly processed:


mwe


Most probably you can include the code for the nomemclature directly in main.tex instead than using separate document, but taka into account that here you could need one or more additional compilations with pdflatex, as well as run before another programs, as biber or bibtex, to resolve cross-references, make the references, etc.

Fran
  • 80,769
  • Not the issue here though. The issue is buried in the question text (custom thesis class), not the MWE. – user202729 Jul 07 '22 at 02:16
  • It is not clear if he wanted to do the nomenclature in main.tex or in a separate document, but anyway, as he cannot compile the MWE code, inside a thesis class the issue most probably is the same, although of course, with these clues and an unknown custom class is impossible to be sure. – Fran Jul 07 '22 at 02:42
  • @Fran the symbols page is in separate file which i would include in the main.tex – Starrrrck Jul 07 '22 at 19:38
  • 2
    @Starrrrck Then is simply that, and include the PDF as image or using pdfpages. But this could have disadvantages compared with just load nomencl in the preamble of the main file and the rest in the body of the same file, or in a child file as mylist.tex and include it using \input{mylist}`. – Fran Jul 07 '22 at 21:47