[Tex/LaTex] Cross-referencing label and table of contents

cross-referencingtable of contents

I am using a label for referencing. I just added my table of contents and saw the label is used as chaptertitle. How could I fix this?

My MWE:

\documentclass[a4paper,dutch]{report}

\let\orichaptermark\chaptermark
\renewcommand\chaptermark[1]{\label{chap:#1}\orichaptermark{#1}}

\begin{document}

\tableofcontents

\chapter[label]{Chapter name}

\end{document} 

Best Answer

While it's possible to make label names with chapter names it's better to refrain from this procedure.

The optional argument of \chapter is reserved (in standard LaTeX document classes) for the short entry to the table of content (and page headers), especially useful for long chapter names.

The \cref command inserts the correct reference name (chapter), if the cleveref package is loaded. (Load it as last one, even after hyperref)

\documentclass[a4paper,dutch]{report}

\usepackage{blindtext}

\usepackage{cleveref}
%\let\orichaptermark\chaptermark
%\renewcommand\chaptermark[1]{\label{chap:#1}\orichaptermark{#1}}

\begin{document}

\tableofcontents

\chapter{Chapter name}\label{first:chapter}
\blindtext

 \chapter[Second chapter]{A very long second chapter title}\label{second:chapter}
\blindtext

In \cref{first:chapter} we saw that ... 


\end{document} 

enter image description here enter image description here