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 am trying to create a customized table of contents with the following form. I have been looking at a number of sources but still having a hard time getting it to work adequately. Right before the abstract there is a title page that should not be considered in the table of contents. There is an appendix at the end, that should not have a page number.

The table of contents should look like this:

                                   Table of Contents

            Abstract............................................ ii
            Acknowledgement. ................................... iii
            Table of Contents................................... iv
            Tables.............................................. v
            Figures............................................. vi
            1.0 Introduction ................................... 1
                    1.1 Background.............................. 2
                    1.1 Objectives.............................. 3
            2.0 Review.......................................... 4
                    2.1 xxxxxxxxxx.............................. 5
                    2.2 yyyyyyyyyy.............................. 6
            3.0 Conclusion...................................... 7
            4.0 References...................................... 8
            CODE................................................ 9
            APPENDIX
share|improve this question
    
Which document class are you using? –  Gonzalo Medina Dec 11 '11 at 18:40
    
Should the chapter numbering 1.0, 2.0, 3.0,... also be maintained in the document or is it just for the ToC? –  Gonzalo Medina Dec 11 '11 at 18:47
2  
What is the "title that should not be considered"? Sounds like a phrase from Harry Potter: "He who must not be named". :) –  Werner Dec 11 '11 at 19:08
add comment

2 Answers

up vote 7 down vote accepted

Here's a possible solution using the tocloft package and the book document class:

\documentclass{book}
\usepackage{tocbibind}
\usepackage{tocloft}
\usepackage{lipsum}

\AtBeginDocument{%
  \renewcommand\listtablename{Tables}
  \renewcommand\listfigurename{Figures}
  \renewcommand\contentsname{Table of Contents}
}

% Centered title for ToC, LoF, LoT
\renewcommand{\cfttoctitlefont}{\hfill\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftloftitlefont}{\hfill\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hfill}
\renewcommand{\cftlottitlefont}{\hfill\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hfill}

% Leaders for chapter entries
\renewcommand\cftchapdotsep{\cftdotsep}

% Add space to account for new chapter numbering schema
\renewcommand\cftchapnumwidth{3em}
\renewcommand\cftsecindent{3em}

% Redefine representation for chapter (and section) counters
\renewcommand\thechapter{\arabic{chapter}.0}
\renewcommand\thesection{\arabic{chapter}.\arabic{section}}

\begin{document}

\frontmatter
\chapter{Abstract}
\lipsum[1]
\chapter{Acknowledgements}
\lipsum[1]
\clearpage
\tableofcontents
\clearpage
\listoftables
\clearpage
\listoffigures
\clearpage
\mainmatter
\chapter{Introduction}
\section{Background}
\section{Objectives}
\chapter{Review}
\section{Test Section}
\section{AnotherTest Section}

\backmatter
\chapter{CODE}

\chapter*{APPENDIX}
\addtocontents{toc}{\protect\addvspace{10pt}}
\addtocontents{toc}{\textbf{APPENDIX}}

\end{document}

enter image description here

share|improve this answer
1  
+1 for including the ToC in the ToC, as specified by the OP. :-) –  lockstep Dec 11 '11 at 19:12
    
@lockstep: it's such a senseless (and ugly) practice, but some institutions require it as part of their format for theses. –  Gonzalo Medina Dec 11 '11 at 19:15
add comment

Here' s an example using the book class. \frontmatter causes Roman, \mainmatter arabic page numbering. For the appendix, I switch off page numbering manually with \pagenumbering{gobble} and add an unnmumbered \part.

EDIT: Added changed numbering scheme (plus correction of ToC indents).

\documentclass{book}

\renewcommand{\thechapter}{\arabic{chapter}.0}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@chapter}{1.5em}{2.3em}{}{}
\patchcmd{\l@section}{{1.5em}{2.3em}}{{2.3em}{2.3em}}{}{}
\makeatother

\begin{document}

\frontmatter

\tableofcontents

\chapter{Acknowledgement}

\mainmatter

\chapter{bla}

\section{blubb}

\chapter{foo}

\cleardoublepage
\appendix
\pagenumbering{gobble}

\part*{Appendix}
\addcontentsline{toc}{part}{Appendix}

\chapter{bar}

\end{document}

enter image description here

share|improve this answer
    
What's the difference between \pagenumbering{empty} and \pagenumbering{gobble}? Just curious. –  Mico Dec 11 '11 at 19:13
    
Well, \pagenumbering{empty} results in an error. You were thinking of \pagestyle{empty}, weren't you? ;-) –  lockstep Dec 11 '11 at 19:15
    
Yes, I was. :-) –  Mico Dec 11 '11 at 19: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.