Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing a book and use nomencl to print a list of symbols at the end. How do I cleveref to this list? In the introduction of the book, I would like to write something like "All the notation we use can be found in \cref{...}", where LaTeX should replace \cref{...} by the name of the nomenclature list, i.e. by \nomrefname.

Using the intoc option or the \addcontentsline command, I managed to get an entry for the list of symbols in the table of contents, but when I put something like \label{SectionNomenclature} before or after my \printnomenclature and try \cref{SectionNomenclature} I am referenced to the last chapter before the list of symbols. :(

MWE:

\documentclass[a4paper,oneside]{book}

\usepackage[refpage,intoc]{nomencl}     %nomenclature
\usepackage[pdftex]{hyperref}       %hyperlink references
\usepackage[capitalize]{cleveref}   %automatic clever references


\makenomenclature

\nomenclature[N]{$\mathbb{N}$}{the natural numbers $\N=\{0,1,2, \ldots \}$}

\begin{document}


\tableofcontents

\part{Introduction}

\chapter{Overview}

\section{Blabla}

All the symbols used can be found in \cref{SectNomenclature}.

\printnomenclature

\label{SectNomenclature}


\end{document}
share|improve this question
1  
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jubobs Feb 6 at 12:22

2 Answers 2

up vote 4 down vote accepted

Since you are already loading hyperref, you can patch \thenomenclature to use \phantomsection (to generate an anchor) and to add the \label; since you are interested in getting the title of the sectional unit, use \nameref:

\documentclass[a4paper,oneside]{book}
\usepackage[refpage,intoc]{nomencl}
\usepackage{etoolbox}
\usepackage{hyperref}
\usepackage[capitalize]{cleveref}

\patchcmd{\thenomenclature}
  {\chapter*{\nomname}}
  {\phantomsection\chapter*{\nomname}\label{SectNomenclature}}
  {}
  {}

\makenomenclature

\nomenclature[N]{$\mathbb{N}$}{the natural numbers $\N=\{0,1,2, \ldots \}$}

\begin{document}

\tableofcontents

\part{Introduction}
\chapter{Overview}
\section{Test section}

All the symbols used can be found in~\nameref{SectNomenclature}.

\printnomenclature

\end{document}

enter image description here

There's no need to pass the pdftex option to hyperref; the right driver will be automatically detected.

share|improve this answer
    
Thanks, this works fine. :) –  Meneldur Feb 6 at 15:28

Building on Gonzalo Medina's answer, you make the \cref command work by introducing a new counter and refstepping it at the start of the Nomenclature section.

\documentclass[a4paper,oneside]{book}
\usepackage[refpage,intoc]{nomencl}
\usepackage{amssymb}
\usepackage{etoolbox}
\usepackage{hyperref}
\usepackage[capitalize]{cleveref}

\newcounter{nomencl}
\crefformat{nomencl}{#2Nomenclature#3}

\patchcmd{\thenomenclature}
  {\chapter*{\nomname}}
  {\clearpage\refstepcounter{nomencl}\chapter*{\nomname}\label{SectNomenclature}}
  {}
  {}

\makenomenclature

\newcommand{\N}{\mathbb N}

\nomenclature[N]{$\mathbb{N}$}{the natural numbers $\N=\{0,1,2, \ldots \}$}

\begin{document}

\tableofcontents

\part{Introduction}
\chapter{Overview}
\section{Test section}

All the symbols used can be found in~\cref{SectNomenclature}.

\printnomenclature

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.