I currently have the following ToC code:
\usepackage{tocloft}
\renewcommand{\cftchapfont}{\chaptername }
\newcommand{\likechapter}[1]{
\chapter*{#1}
\phantomsection
\addcontentsline{toc}{chapter}{ #1}
}
And section of the document are defined like this:
\likechapter{Introduction}
\chapter{Some chapter}
\section{Some section}
\section{Some subsection}
It produces the following ToC:
I don't need "chapter" text for Introduction. If I change \renewcommand{\cftchapfont}{\chaptername }
to \renewcommand{\cftchapfont}{}
, it removes "chapter" from all chapters. So, how can I remove only for some chapters (defined by \likechapter
)?
EDIT: minimal example:
\documentclass{report}
\usepackage[english]{babel}
\usepackage[a4paper]{geometry}
\usepackage{tocloft}
\renewcommand{\cftchapfont}{\chaptername }
\newcommand{\likechapter}[1]{
\chapter*{#1}
\phantomsection
\addcontentsline{toc}{chapter}{ #1}
}
\begin{document}
\tableofcontents
\newpage
\likechapter{Introduction}
\chapter{Some chapter}
\section{Some section}
\section{Some subsection}
\end{document}
tocloft
way of prefixing entries in the toc, I do think it has an interface to add those without messing with a font setting.