[Tex/LaTex] tocloft: undefined error

table of contentstocloft

I'm getting an undefined error for \cftchapfont (and all other tocloft options). I haven't found this problem documented elsewhere, which leads me to suspect that I'm missing something simple.

\documentclass[12pt]{article}
\usepackage{tocloft}
\renewcommand{\cftchapfont}{\LARGE\scshape}
\begin{document}
\tableofcontents
\section{first chapter}
\section{second chapter}
\end{document}

Best Answer

Since the article class has no chapters, the solution is to (a) use a different document class, or (b) use \cftsecfont.

\documentclass[12pt]{article}
\usepackage{tocloft}
\renewcommand{\cftsecfont}{\LARGE\scshape}
\begin{document}
\tableofcontents
\section{first section}
\section{second section}
\end{document}