GeneralAdding nomenclature to the TOC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
meladey
Posts: 2
Joined: Sat Jan 03, 2015 1:02 am

Adding nomenclature to the TOC

Post by meladey »

Hi,
I am creating a list of abbreviation using nomencl package. Everything went fine except when I add the nomenclature to the table of contents where it assign the page number of the last page in the section instead of the first page. Here is my commands:

Code: Select all

\usepackage{nomencl}
\makenomenclature
\renewcommand{\nomname}{\large\textbf{LIST OF ABBREVIATIONS}} 
.
.
.
.
\printnomenclature[5em]
\addcontentsline{toc}{part}{LIST OF ABBREVIATIONS}
\addtocontents{toc}{\protect\vspace{-0.8em}}
So, instead of assigning "xv" which is the first page in my list of abbreviation, it assigns "xvi" which is the last page. Any help please!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Adding nomenclature to the TOC

Post by Johannes_B »

You have to print the list after writing the name to the toc file (i.e. it gets the page number where the list starts). If the list is printed first, the page number for the toc will be the page number on which the list was finished.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Adding nomenclature to the TOC

Post by Stefan Kottwitz »

Hi Meladey,

welcome to the forum!

Generally, I would do as Johannes suggested, just with a \clearpage or \cleardoublepage (two-sided) before. So it would become

Code: Select all

\cleardoublepage
\addcontentsline{toc}{part}{LIST OF ABBREVIATIONS}
\addtocontents{toc}{\protect\vspace{-0.8em}}
\printnomenclature[5em]
By the way, the nomencl package provides an option for that purpose, which you could use instead:

\usepackage[intoc]{nomencl}

Adding that \vspace would still be possible by redefining \nompreamble, such as

\renewcommand{\nompreamble}{\addtocontents{toc}{\protect\vspace{-0.8em}}}

You could also write that \addcontentsline into that nomenclature preamble.

Stefan
LaTeX.org admin
meladey
Posts: 2
Joined: Sat Jan 03, 2015 1:02 am

Re: Adding nomenclature to the TOC

Post by meladey »

Thank you Johannes and Stefan for your help. It works now.
Post Reply