Hi,
Is there a way to change/customize "Table of Contents" name for table of contents using titletoc and titlesec package?
I need to set up some space before and after "Table of Contents" and to make it uppercase. Any idea?
Document Classes ⇒ "Table of Contents" and titletoc
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
"Table of Contents" and titletoc
Hi meho_r,
yes, there is. You could use \titleformat and \titlespacing for \section, the toc name is set this way. Just a quick example that you can test:
For details have a look at the titlesec documentation.
Stefan
yes, there is. You could use \titleformat and \titlespacing for \section, the toc name is set this way. Just a quick example that you can test:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{titlesec,titletoc}
\titleformat{\section}{\large\bfseries\MakeUppercase}{\thesection}{1em}{}
\begin{document}
\tableofcontents
\bigskip
\section{Test}
Text
\end{document}
Stefan
LaTeX.org admin
Re: "Table of Contents" and titletoc
Thanks. But I had some difficulties with MakeUppercase. If I use it for sections, all sections that have \\ or \\* in its name report errors. So I've done it this way:
1. For sections I used \uppercase instead of \MakeUppercase (but this doesn't work for the name of table of contents)
2. I put separate \titleformat... command with \MakeUppercase (the one you suggested) just before \tableofcontents command and it works nice.
1. For sections I used \uppercase instead of \MakeUppercase (but this doesn't work for the name of table of contents)
2. I put separate \titleformat... command with \MakeUppercase (the one you suggested) just before \tableofcontents command and it works nice.