7

Hello I am trying to further modify my TOC. I got an answer here as to how I could remove the \section numbers on the left side of the TOC and now I would like to expand that. I would like to remove the left-hand numbering for \subsection and \subsubsection as well but I do not know how. (I also want to keep these numbers out of the document and I am using \def\sectionformat{} to do that)

Also, my TOC is slightly over one page and so I would like to adjust the spacing from 2 to 1.5, is there any way to do this?

section numbers remeoved

\documentclass[12pt, a4paper, twoside]{article}
    \usepackage{baskervald}
    \usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
    \usepackage[T1]{fontenc}
    \usepackage[notes]{biblatex-chicago}
    \usepackage{filecontents}
    \usepackage{microtype}
    \usepackage{url}
    \usepackage{makeidx}
    \usepackage{indentfirst}
    \usepackage{setspace}
    \usepackage{chngcntr}\counterwithin*{footnote}{section}
    \newcommand*{\textsubscript}[1]{$#1{}$}
    \DefineBibliographyStrings{english}{references = {Works Cited}}
    \DeclareBibliographyCategory{primary}
    \makeindex
    \addbibresource{bibliography.bib}
    \makeatletter
    \let\latexl@section\l@section
    \def\l@section#1#2{\begingroup\let\numberline\@gobble\latexl@section{#1}{#2}\endgroup}
    \def\@seccntformat#1{\ifcsname #1format\endcsname\else\csname the#1\endcsname\quad\fi}
    \def\sectionformat{}
    \def\subsectionformat{}
    \def\subsubsectionformat{}
    \makeatother
    \author{}
    \title{\vspace*{36 pt}\textbf{\emph{\Huge{Big Important Title}}}\vfill}
    \date{}
    \begin{document}
    \tableofcontents
    \section{Part I}
    Hello World
    \end{document}
10

If you want no number starting from subsections downwards either in the document and in the TOC, the simplest way is to say

\setcounter{secnumdepth}{1} % only chapter and sections will be numbered
\setcounter{tocdepth}{3}    % entries down to \subsubsections in the TOC
  • Thank you, it worked great! Do you know how to adjust the line spacing in the TOC as well? – Mike Stumpf Jul 15 '12 at 20:23
  • 1
    @Wrigley242 Just say \begingroup\onehalfspacing\tableofcontents\par\endgroup or, better, don't use increased spacing at all (if you can). – egreg Jul 15 '12 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.