[Tex/LaTex] Leading dots near chapters in table of content

table of contents

I have a question, how to make leading dots in a table of content near chapters? I searched then internet and found only solutions how to add leading dots to sections, but not for chapters. I have tried to use:

\usepackage{tocloft}
\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}

but its not working for me.

Thanks for the help in advance.

\documentclass{report}[12pt]
\usepackage{tocloft}
\renewcommand{\cftchapterdotsep}{\cftdotsep}
\begin{document}
\tableofcontents
\chapter{A chapter}
\end{document}

Best Answer

You MWE has only 3 letters too much: The command uses chap instead of chapter

\documentclass{report}[12pt]
\usepackage{tocloft}
\renewcommand\cftchapdotsep{\cftdotsep}%
\begin{document}
\tableofcontents
\chapter{A chapter}
\end{document}