Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a preface for my document and instead of calling it Chapter 1, or using \chapter* to not include it in the table of contents, I would like it so it instead of a 1 I have a P. Then normal counting resumes - a bit like appendices.

so my table of contents looks like:

P Preface
   P.1 Stuff
   P.2 More Stuff

I    All about stuff

1 Stuff in itself
   1.1 Does stuff exist
   1.2 Does stuff matter
      1.2.1 The ethical implications of the non-existence of stuff


etc.

EDIT: Extra problem: I also want to not have it say:

Chapter P
 Preface

but just

 Preface

at the start of the preface - perhaps add to the table of contents manually - but my naive attempt didn't work so well.

share|improve this question
4  
I just see that you have asked several questions and have received good answers to some of them, but you haven't accepted any. Please consider marking one of the answers as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most (and it assigns reputation points to the author of the answer and to you!). –  Gonzalo Medina Apr 6 '12 at 2:03
add comment

2 Answers 2

up vote 13 down vote accepted

You should manually switch the chapter counter representation before the out-of-the-ordinary chapters. Here's the basic idea (remember, the chapter counter is incremented at the start of \chapter):

\setcounter{chapter}{15}% Equivalent to "letter O"
\renewcommand{\thechapter}{\Alph{chapter}}%
\chapter{Preface}
%...
\setcounter{chapter}{8}% Equivalent to "letter H"
\chapter{All about stuff}
%...
\setcounter{chapter}{0}%
\renewcommand{\thechapter}{\arabic{chapter}}%
\chapter{Stuff in itself}
%...

Here's a more complete example, using \chapter* for the Preface, and \part for "All about stuff":

enter image description here

\documentclass{book}
\begin{document}
\tableofcontents

\setcounter{chapter}{16}% Equivalent to "letter P"
\renewcommand{\thechapter}{\Alph{chapter}}%
% Alternatively, replace the above two commands with
%   \renewcommand{\thechapter}{P}
% as in Gonzalo's answer - it's just simpler.
%\chapter{Preface}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{\numberline{P}Preface}
%...
\part{All about stuff}
%...
%\setcounter{chapter}{0}%
%\renewcommand{\thechapter}{\arabic{chapter}}%
\chapter{Stuff in itself}
%...
\end{document}
share|improve this answer
    
Sweet, worked like a charm! If I could give bonus points for giving me the right number for P I would :) –  Lucas Apr 6 '12 at 0:08
    
Any ideas about my edit? –  Lucas Apr 6 '12 at 0:17
    
@Lucas: Do you want to have remove the P from the ToC as well? –  Werner Apr 6 '12 at 1:21
    
Nope. It was just that Chapter P looks rather silly. Gonzalo's solution seems to have sorted things. –  Lucas Apr 6 '12 at 1:23
    
@Lucas: I've updated my answer to accommodate your latest request. Using \chapter* and then adding the necessary details in the ToC via \addcontentsline. The fake \numberline{P} preserves your required "Chapter P" in the ToC. –  Werner Apr 6 '12 at 1:29
show 1 more comment

You can simply locally redefine the representation for the chapter counter and then set the counter to the proper value for the regular chapters. The titlesec package can be used to locally redefine the chapter title format:

\documentclass{book}
\usepackage{titlesec}
\begin{document}

\tableofcontents
\begingroup
\renewcommand\thechapter{P}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{20pt}{\Huge}
\chapter{Preface}
\section{Preface Section One}
\section{Preface Section Two}
\endgroup

\part{First Part}
\addtocounter{chapter}{-1}
\chapter{First Regular Chapter}
\section{Regular Section One One}
\section{Regular Section One Two}

\end{document}

enter image description here

share|improve this answer
    
Nice! Thank you! –  Lucas Apr 6 '12 at 1:18
add comment

Your Answer

 
discard

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.