Text FormattingChange the chapter title fontsize but not in the ToC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

Change the chapter title fontsize but not in the ToC

Post by sdelandtsheer »

Hi,

I need to change the fontsize of some chapter titles (not all of them). When I do this the change is also seen in the ToC, and this is ugly.

Here is the MWE:

Code: Select all

\documentclass[A4paper, oneside]{book}
\begin{document}

\tableofcontents

\chapter{My first chapter}
\section{A section}
Some text here
\section{Another section}
More text

\chapter{\Large A chapter title with another fontsize and \emph{some italics}}
\section{Yet another section}
Another piece of text
\section{The last section}
Some concluding remarks

\end{document}
Can somebody help me?

Thanks a lot!
Attachments
Look how ugly this is...
Look how ugly this is...
MWE.jpg (28.65 KiB) Viewed 6872 times

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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Change the chapter title fontsize but not in the ToC

Post by kaiserkarl13 »

Use the optional argument to \chapter, like so:

Code: Select all

\documentclass{report}
\begin{document}
\tableofcontents

\chapter{My First Chapter}
\section{A section}
Some text here
\section{Another section}
More text

\chapter[A chapter title with another fontsize and some italics]%
        {\Large A chapter title with another fontsize and \emph{some italics}}
\section{Yet another section}
Another piece of text
\section{The last section}
Some concluding remarks
\end{document}
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

Change the chapter title fontsize but not in the ToC

Post by sdelandtsheer »

Thanks, sometimes things are so simple...

In the meantime, I had made another (more complicated) solution with the titlesec package, and the "thesis" class:

Code: Select all

\documentclass[A4paper, oneside]{thesis}

\usepackage{titlesec}

\begin{document}

\tableofcontents

\chapter{My first chapter}
\section{A section}
Some text here
\section{Another section}
More text

\titleformat{\chapter}[display]{\huge\bfseries\color{black}}{\chaptertitlename\ \thechapter}{11pt}{\huge}
\chapter{A chapter title with another fontsize and \emph{some italics}}
\section{Yet another section}
Another piece of text
\section{The last section}
Some concluding remarks

\end{document}
Thanks a lot. This forum is awesome and saved me a huge amount of time already. You guys rock!
Post Reply