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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
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: 10360
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