I am writing my thesis using a template provided by the university. It requires using the report class. To format the headings in the front matter, it uses the titlesec package and redefine the format (\titleformat, \titlespacing). However, this also changes the format of chapter headings in the main matter, which I don't like. I have tried using \newenvironment to define an environment preliminary to wrap the front matter and to only redefine the headings' format locally. However it did not work.

My questions are: is it possible to change the headings' format locally? if not, how to save the default format and restore it after the front matter?

I guess I can always redefine the format after the front matter, but I want to keep the default.

  • 1
    Please add a fully compilable minimal working example (MWE) that illustrates your problem. Possibly with a link to your universities template. Also sometimes definitions can be restricted by putting them inside of {} or \begingroup \endgroup, but I'm not sure if that can work for you. – bodo Aug 27 '12 at 16:00

You can use titlesec's commands anywhere and their effect will be limited to the group, or environment, containing them. The following document works with changing of sections and chapters. For illustration, I have only demonstrated sections; uncomment the lines in the body with \chapter commands to see these working too.


{\normalfont\huge\itshape}{\chaptertitlename\ \thechapter}{20pt}{\Huge}%


%\chapter{First chapter}
\section{A section}

%\chapter{Next chapter}
\section{Another section}


\section{A last section}


Sample output

When trying to implement this with your own styles, I suggest you first get the titlesec commands working globally in a spearate document to help debugging. After that you can build them in to an environment, if you so wish, or simply include them in the appropriate group, e.g.

\section{A small caps section}


| improve this answer | |

It is not possible to change them locally. However, you can revert to the "original" ones at any place in the document, and namely inside the command \mainmatter, as shown below. The correct way to define the original titles is described in titlesec manual. At this to your document preamble:

    {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
  \titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
  \titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  \titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  \titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1em}
  \titlespacing*{\subparagraph}{\parindent}{3.25ex plus 1ex minus .2ex}{1em}
| improve this answer | |

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.