Page LayoutRemove Space for Chapter Prefix in ToC

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jbgrad
Posts: 5
Joined: Sat Nov 17, 2012 4:31 am

Remove Space for Chapter Prefix in ToC

Post by jbgrad »

The chapter lines of my ToC should only have the number, not the word "Chapter". I used \renewcommand{\chaptername}{} as follows in modifying my university's template (which is unfortunately wrong). However, while the word "Chapter" is gone, the space taken up by it is not, so an entry looks like:
1 [Space the length of "Chapter"] Name-of-chapter
instead of
1 Name-of-chapter

Code: Select all

\renewcommand{\tableofcontents}{%
    \renewcommand{\chaptername}{}
    \doublespace
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapteroneside*{%\contentsname
        \@mkboth{%
          \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
Any assistance in removing this unwanted horizontal space (the length of "Chapter") would be appreciated.
Last edited by localghost on Sat Nov 17, 2012 12:01 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Remove Space for Chapter Prefix in ToC

Post by Stefan Kottwitz »

That's not the behavior of standard classes, so obviously your university's template provided this addition which you would like to remove. Look for a macro called \l@chapter or post the template file here as attachment to a post.

Stefan
LaTeX.org admin
Post Reply