TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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. – canaaerus Aug 27 '12 at 16:00
up vote 5 down vote accepted

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}


share|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}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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