3

I am changing style for my chapter and in turn it is affecting the Table of Contents title.

This is my table of contents page:

enter image description here

and this is my chapter page:

enter image description here

This is the code snippet:

\documentclass[12pt,a4paper,final]{report}
\usepackage{fancyhdr}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{eso-pic}

\usepackage{titlesec}
\titleformat{\section}[block]
{\fontsize{16}{18}\bfseries}
{\thesection}
{1em}
{}
\titleformat{\subsection}[block]
{\fontsize{14}{15}\bfseries}
{\thesubsection}
{1em}
{}

\usepackage{blindtext}
\newcommand{\hsp}{\hspace{0pt}}
\titleformat{\chapter}[hang]
{\flushright\fontseries{b}\fontsize{80}{100}\selectfont}{\fontseries{b}\fontsize{72}{84}\selectfont\textcolor{black}\thechapter\hsp}{0pt}
{.\\ \Huge\bfseries}
[]
\titlespacing*{\chapter}{0pt}{540pt}{20pt}
  • 1
    Okay... so what do you want the format of the ToC chapter to look like then? – Werner Oct 25 '16 at 6:28
  • Same as the default .. – Arun Pottekat Oct 25 '16 at 6:53
  • Then move the titleformat and titlespacing commands to after the ToC... – Werner Oct 25 '16 at 6:55
2

\titleformat updates how the \chapter is set at the time you call it. So, if you want to delay the chapter formatting, just delay the call to \titleformat:

% ...
\usepackage{titlesec}
% ...

\chapter{A chapter}% Default formatting for \chapter

% ...

\titleformat{\chapter}% ...

\chapter{Another chapter}% New/updated formatting for \chapter

% ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.