TeX - LaTeX Asked by scientist man on June 29, 2021
My question:
How to make it so section
and part
page numbers stay on the table of contents, whereas subsections, etc. have no page numbering?
Assuming you're employing a document class that is compatible with the tocloft
package, the following solution may be of interest to you. (Just copy the lines from usepackage[titles]{tocloft}
to renewcommandcftdot{}
to the preamble of your LaTeX document.
documentclass{article}
setcounter{secnumdepth}{5}
setcounter{tocdepth}{5}
usepackage[titles]{tocloft}
makeatletter
renewcommandcftsubsecpagefont{@gobble}
renewcommandcftsubsubsecpagefont{@gobble}
renewcommandcftparapagefont{@gobble}
renewcommandcftsubparapagefont{@gobble}
makeatother
renewcommandcftdot{} % no dot leaders either
begin{document}
tableofcontents
part{AA}
section{BB}
subsection{CC}
subsubsection{DD}
paragraph{EE}
subparagraph{FF}
end{document}
Correct answer by Mico on June 29, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP