[Tex/LaTex] Remove all page numbers from the table of content

lyxpage-numberingtable of contents

I want to send the table of content of a document containing only section and subsection titles. Sections of the document are empty, therefore, page numbers do not make sense at this stage. I get a big column of useless page numbers on the right.

Title ............. 3
Title ............. 3
Title ............. 3

I do not want to remove a few page numbers from the TOC numbering as asked here, here or here. But I want to remove all page numbers from the TOC. The table of content would look like this

Title ............. 
Title ............. 
Title ............. 

Or better, without the dots:

Title 
Title  
Title  

Best Answer

Use tocloft. From its manual:

enter image description here enter image description here

A sample:

\documentclass{article}
\usepackage{tocloft}
\usepackage{blindtext}
 \cftpagenumbersoff{section}
 \cftpagenumbersoff{subsection}
 \cftpagenumbersoff{subsubsection}
\begin{document}
  \tableofcontents
  \Blinddocument
\end{document}

enter image description here


Now wondering how to publish the TOC only, but that's probably for another question.

Let us say the name of your .tex file is myfile.tex with the following content:

\documentclass{article}
\usepackage{blindtext}   % for demo only
\begin{document}
  \tableofcontents
  \Blinddocument
\end{document}

Compile this 2-3 times. This will generate an auxiliary file named myfile.toc.

Now prepare anothe .tex file name mytoc.toc, say, with the following contents:

\documentclass{article}
\begin{document}
  \input{myfile.toc} 
\end{document} 

Compile this to get only the toc of myfile.tex.

Related Question