5

The following code produces ! Undefined control sequence.

\documentclass{article}
\begin{document}
\tableofcontents
\cftaddtitleline{toc}{section}{Topic 1}{}
\end{document}

What am I doing wrong? I need \cftaddtitleline to add text in TOC for pages which are written in Word.

1 Answer 1

7

You need to load the tocloft package providing the \cftaddtitleline command:

\documentclass{article}
\usepackage{tocloft}
\begin{document}
\tableofcontents
\cftaddtitleline{toc}{section}{Topic 1}{}
\end{document}

or switch to the memoir document class which also provides the command:

\documentclass[article]{memoir}
\begin{document}
\tableofcontents*
\cftaddtitleline{toc}{section}{Topic 1}{}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .