0

How can I modify the font of the chapter* command. I essentially want to keep it the same except to make the font a little smaller. How could I do this using titlesec. Also how can I redefine the chapter* command so that I can add these sections to the table of contents.

4
  • 3
    You know you can use titlesec, so please show what you've tried thus-far
    – Joseph Wright
    Commented May 30 at 6:30
  • Well I don't know how to do it for the chapter* case since I don't know which command to use. I have only seen it be done for numbered cases.
    – xyz04
    Commented May 30 at 6:36
  • Do you mean you want different formatting for \chapter and \chapter*?
    – Joseph Wright
    Commented May 30 at 7:19
  • No I just want it for chapter* specifically
    – xyz04
    Commented May 30 at 7:25

1 Answer 1

2

You can use the numberless feature of titlesec, but you must also define a format for the numbered chapters.

\documentclass{book}
\usepackage{titlesec}

% the following emulates the standard
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}
  {\chaptertitlename\ \thechapter}
  {20pt}
  {\Huge}
% format for numberless chapters
\titleformat{name=\chapter,numberless}[display]
 {\large\sffamily}
 {}% this argument isn't used
 {0pt}% unused
 {\managechapter}

\makeatletter
\newcommand{\managechapter}[1]{%
  #1% print the title
  \if@mainmatter
    \addcontentsline{toc}{chapter}{#1}% send to the toc
    \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% like book does usually
  \fi
}
\makeatother

\begin{document}

\frontmatter

\tableofcontents

\listoffigures

\mainmatter

\chapter*{Introduction}

\chapter{Normal chapter}

\end{document}

In the numberless format I used a very distinctive font choice, just to show the result. Notice that this also changes the format for the table of contents and the other lists.

The \if@mainmatter condition is necessary, as you don't want that the table of contents ends up listed in itself.

enter image description here

If you want the list of figures and similar chapters to go in the toc, add

\usepackage[nottoc]{tocbibind}

enter image description here

3
  • Really appreciate this. From what I understand the manage chapter is adding the chapter to the toc, is there any way to turn this into a optional thing where I can pass an argument in to make it appear in the TOC or not?
    – xyz04
    Commented Jun 6 at 5:31
  • @xyz04 Can you be more specific about how you would decide when an unnumbered chapter should go in the tocor not?
    – egreg
    Commented Jun 6 at 7:41
  • I mean my idea was that it would be nice to have some control over if I want an unnumbered chapter to be included in the toc when working in the main matter. I don't know if realistically this is possible but it would be nice to have this functionality.
    – xyz04
    Commented Jun 6 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .