0

I wanted to add a separate line saying "CHAPTER" in toc, but I don't want it to have a page number and to link anywhere. My current code is:

\documentclass[12pt]{report}

\usepackage[titles]{tocloft}
\usepackage{hyperref}

\begin{document}

\tableofcontents

\cftaddtitleline{toc}{chapter}{CHAPTERS}{}

\chapter{Some chapter}
\section{Some section 1}

\chapter{Some chapter 2}
\section{Some section 2}

\end{document}

In this way, there is no page number, but "CHAPTERS" is still clickable. How could I remove the hyperlink?

1

Use \addtocontents instead of \cftaddtitleline.

% titlelineprob.tex  SE 564030
\documentclass[12pt]{report}

\usepackage[titles]{tocloft}
\usepackage{hyperref}

\begin{document}

\tableofcontents

%\cftaddtitleline{toc}{chapter}{CHAPTERS}{}
\addtocontents{toc}{\textbf{CHAPTERS}\par}

\chapter{Some chapter}
\section{Some section 1}

\chapter{Some chapter 2}
\section{Some section 2}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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