Generalcontents and chapter headings at the center

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
karisalk
Posts: 12
Joined: Wed Jul 21, 2010 12:59 pm

contents and chapter headings at the center

Post by karisalk »

Hi out there. How do you achieve putting the chapter heading and table of contents heading the center with different font size.
Thanks.

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

contents and chapter headings at the center

Post by Stefan Kottwitz »

Hi,

this could be done using the titlesec package, for instance

Code: Select all

\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\centering\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\begin{document}
\tableofcontents
\chapter{Test}
\end{document}
Stefan
LaTeX.org admin
karisalk
Posts: 12
Joined: Wed Jul 21, 2010 12:59 pm

Re: contents and chapter headings at the center

Post by karisalk »

Thank you very much! It worked very well and I am learning more by extending it to other contexts.
Cheers.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: contents and chapter headings at the center

Post by Stefan Kottwitz »

I'm glad to read that it helped.
Just a remark, don't forget to mark the topic as "solved" if the question has been solved to improve the readability of the board. It can be done by editing the first post of the topic and choosing the checkmark.

Stefan
LaTeX.org admin
Post Reply