2

I want a specific chapter heading as in the picture below (Chapter heading at the right-hand side, but section heading at the left-hand side) Can you help me?

enter image description here

5
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. May 18, 2013 at 10:35
  • 1
    The solution of egreg is good for the standard class but we don't know your documentclass. May 18, 2013 at 10:58
  • Egregs solution works well. If you want to change the format after table of contents etc. you can call the new definitions after \mainmatter. May 18, 2013 at 12:01
  • Dear Marco Daniel, I want References heading to be at the left-hand side too. But it is after \mainmatter and my definitions. Can you help me?
    – Just life
    May 18, 2013 at 12:47
  • Please see the edit in the answer. May 18, 2013 at 13:59

1 Answer 1

4

You can use the titlesec package and its \titleformat and \titlespacing commands.

\documentclass{book}
\usepackage[pass,showframe]{geometry}
\usepackage{titlesec}

\titleformat{\chapter}[display]
  {\filleft\Large}
  {\chaptername\ \thechapter}
  {5ex}
  {\bfseries\MakeUppercase}
\titlespacing*{\chapter}
  {0pt}
  {-15pt}
  {60pt}

\begin{document}
\mainmatter
\chapter{Introduction}
\section{Motivation}
Bla
\end{document}

The line \usepackage[pass,showframe]{geometry} has been added just for showing the result.

enter image description here


Here an approach to use the modification only for the mainmatter part.

\documentclass{book}
\usepackage[pass,showframe]{geometry}
\usepackage{titlesec}
\makeatletter
\let\ttl@save@mkchapOrig\@makechapterhead
\let\ttl@save@mkschapOrig\@makeschapterhead

\titleformat{\chapter}[display]
  {\filleft\Large}
  {\chaptername\ \thechapter}
  {5ex}
  {\bfseries\MakeUppercase}
\titlespacing*{\chapter}
  {0pt}
  {-15pt}
  {60pt}

\let\ttl@save@mkchapFormat\@makechapterhead
\let\ttl@save@mkschapFormat\@makeschapterhead

\g@addto@macro\frontmatter{%
   \let\@makechapterhead\ttl@save@mkchapOrig%
   \let\@makeschapterhead\ttl@save@mkschapOrig}

\g@addto@macro\mainmatter{%
   \let\@makechapterhead\ttl@save@mkchapFormat%
   \let\@makeschapterhead\ttl@save@mkschapFormat}

\g@addto@macro\backmatter{%
   \let\@makechapterhead\ttl@save@mkchapOrig%
   \let\@makeschapterhead\ttl@save@mkschapOrig}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\listoffigures
\mainmatter
\chapter{Introduction}
\section{Motivation}
Bla
\backmatter
\appendix
\chapter{appendix}
\end{document}
4
  • Thank you so much, egreg. But when I tried it, table of contents, list of figures were also at the right-hand side rather than the left-hand side as I expected. Can you help me?
    – Just life
    May 18, 2013 at 10:54
  • @Justlife I believe that the format of the chapter headings should be the same across the document. Why should they be different?
    – egreg
    May 18, 2013 at 14:06
  • Thank you so much. It's a standard form in my school that I have to follow.
    – Just life
    May 18, 2013 at 14:40
  • @Justlife I wrote to Marco that I see no reason whatsoever for changing style; but I didn't consider schools' standards that, as usual, know nothing about typography. :(
    – egreg
    May 18, 2013 at 14:44

You must log in to answer this question.

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