2

The following code gives me a "Preface" and a "Prologue", but with, at the top of their respective pageS, the word CONTENTS (see screen capture bellow, for the Preface page). It's as if the "Preface" and the "Prologue" were still part of the document's contents section.

I can't figure out how to not have that word up there. Thanks.

\documentclass[11pt,oneside,letterpaper]{book}

\usepackage{graphicx}
\graphicspath{ {TSTPT_Images/} }
%\usepackage[a4paper]{geometry}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks=false, pdfborder={0 0 0}]{hyperref}
\usepackage{cleveref}

\begin{document}
\frontmatter

\title{\Huge THIS IS MY TITLE}
\author{Name of author here}
\date{\today}
\maketitle

\begin{center}
\chapter*{\parbox{\linewidth}{\centering Book One:\\Title of Book One}}
%\fbox{\includegraphics[width=0.6\textwidth]{image}}
\end{center}
\clearpage

\tableofcontents
\cleardoublepage

\phantomsection
\addcontentsline{toc}{section}{Preface}
\section*{Preface}

Text here.

\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Prologue}
\section*{Prologue}

Text here.

\cleardoublepage
\mainmatter
\phantomsection
\addcontentsline{toc}{section}{Chapter The First}
\chapter*{Chapter The First}
\section{Title Uno}

Text here.

\cleardoublepage
\section{Title Dos}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Chapter The Second}
\chapter*{Chapter The Second}
\section{Title Tres}
Text for test.\\

\end{document}

enter image description here

  • The intended structure of the document is not properly reflected by the sectioning commands. \tableofcontents is on the level of a chapter, whereas preface and prolog are \sections, hence they appear as sub-units of the table of contents. Use \part commands for dividing the document into sub-books. Moreover, your table of contents will be for the whole document, not only for the first book. There are packages for having several table of documents. – gernot Sep 17 '16 at 14:27
  • Is it intended to have several of these "books" in one document, each with a table of contents, or is the chapter*{... Book One...} intended as a subtitle-page? – gernot Sep 17 '16 at 14:42
  • I'd suggest being consistent with the book sectional units. Use \chapter* for your Preface and reformat the way the chapters look in the ToC (using something like tocloft) rather than setting a chapter as a section. – Werner Sep 17 '16 at 16:59
  • Related/duplicate: Headers of \chapter* take the headers of their previous \chapter – Werner Sep 17 '16 at 17:00
  • @gernot It is intended to have several books within one document, each with a TOC (so, an overall TOC at the beginning and then individual TOC per book). I find it convoluted too, but it's my friend's design so I'll stick to it for now. And thank you all for your replies. – CyanideBaby Sep 18 '16 at 9:40
2

\markright{} after \tableofcontents and \cleardoublepage helps to remove the chapter title from the header. The page number stays in the header.

An alternative is \thispagestyle{plain} for the start pages of the sections in the front matter.

Also:

  • \usepackage[hidelinks]{hyperref} for unmarked links

  • Section numbers like 0.1, 0.2 are a bit strange, maybe this is the intension: Unnumbered chapters with independently numbered sections:

    \usepackage{remreset}
    \makeatletter
    \@removefromreset{section}{chapter}
    \makeatother
    \renewcommand*{\thesection}{\arabic{section}}
    
  • The duplicate page anchor problem can be solved by:

    \begingroup
      \hypersetup{pageanchor=false}
      \maketitle
    \endgroup
    
  • The box problem of the "book title page" can be fixed by:

    \vspace*{50pt}
    \begingroup
      \centering
      \Huge\bfseries
      Book One:\\Title of Book One
      \par
      \thispagestyle{plain}
    \endgroup
    \clearpage
    
  • Maybe some empty page(s) needs to be inserted in the beginning part to fix the page numbers. Odd numbered pages are right pages, even numbered pages are left pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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