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 use the report class. I have a total of 8 chapters, however I only want 6 chapters to have a number. So I want to start the numbering at the third chapter, and the first 2 chapters should only show the title in the table of contents. so basically i have the chapters: abbreviations preface theoretical background etc.

and i want the abbreviations and preface to show up in the TOC as only the title and start the numbering at theoretical background. Any suggestions on how to do this?

share|improve this question

2 Answers 2

You can always use the starred version of sectioning command (\chapter*) here to prevent the numbering as well as the TOC entry.

However, in your case, you want to have the TOC listing, so must add it manually using \addcontentsline (see the short code)

Please note, that starred chapters do not use a \cleardoublepage, so they start at the next page.

\documentclass{report}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\chapter*{First}
\addcontentsline{toc}{chapter}{First}

\blindtext


\chapter*{Second}
\addcontentsline{toc}{chapter}{Second}

\blindtext


\chapter{First numbered one}
\blindtext
\end{document}

enter image description here

Edit -- a more sophisticated version, adding an optional argument to \chapter* that goes to the TOC!

\documentclass{report}

\usepackage{blindtext}
\usepackage{etoolbox}
\begin{document}


%%% Redefine the chapter commands such that \chapter*[short_title]{Long title} is possible 
\let\LaTeXStandardChapter\chapter
\makeatletter

\newcommand{\unstarredchapter@opt}[2][]{%  
\LaTeXStandardChapter[#1]{#2}%
}

\newcommand{\unstarredchapter@noopt}[1]{%
\unstarredchapter@opt[#1]{#1}%
}%

\newcommand{\starredchapter@opt}[2][]{%
\LaTeXStandardChapter*{#2}
\ifblank{#1}{}{%
\addcontentsline{toc}{chapter}{#1}}
}%

\newcommand{\starredchapter@noopt}[1]{%
\starredchapter@opt[]{#1}%
}%

\newcommand{\starredchapter}{%
\@ifnextchar[{\starredchapter@opt}{\starredchapter@noopt}
}%


\newcommand{\unstarredchapter}{%
\@ifnextchar[{\unstarredchapter@opt}{\unstarredchapter@noopt}
}%

\renewcommand{\chapter}{%
\@ifstar{\starredchapter}{\unstarredchapter}
}%
\makeatother



\tableofcontents



\chapter*[Abbreviations]{Abbreviations}

\blindtext


\chapter*[Preface]{Preface}

\blindtext


\chapter{Theoretical background}
\blindtext

\chapter*{A starred chapter with no toc entry}

\end{document}

enter image description here

share|improve this answer
    
Perfect! Exactly what I meant, thank you! –  user53965 Jul 3 at 9:01
    
@user53965: I provided an improved version, such that \addcontentsline is not necessary at all (it is done automatically inside then) –  Christian Hupfer Jul 3 at 9:11

Use

\setcounter{chapter}{2}

to have chapters numbers starting from 3.

To add your missing chapters to the table of contents you can use:

\setcounter{page}{4}
\addcontentsline{toc}{chapter}{1. Hello}

\setcounter{page}{14}
\addcontentsline{toc}{chapter}{2. world}
\setcounter{chapter}{5}

As far as I can see you need to generate at least one page for each chapter in order to get the page numbering correct in te table of contents.

share|improve this answer
    
Your solution shifts the chapter number and adds non existing chapters to the toc, unfortunately. –  Christian Hupfer Jul 3 at 9:15
    
@ChristianHupfer Hmm, sorry I misread the question as I thought that's what the OP asked for... –  Andrew Jul 3 at 9:55

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.