Page LayoutTOC on right hand side of double sided

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
twsouthwick
Posts: 4
Joined: Sun Jun 20, 2010 12:12 am

TOC on right hand side of double sided

Post by twsouthwick »

I am having issues renewing the TOC command so that it will be on the right hand side of a book. Here's the code I'm using:

Code: Select all

\documentclass[12pt,letterpaper,twoside,openright]{book}

\usepackage{testtoc}

\begin{document}

\title{Test Title}
\author{Nobody}
\maketitle

\tableofcontents

\section{test1}

\section{test2}

\end{document}
This requires a package testtoc.sty:

Code: Select all

\usepackage{hyperref}
\usepackage[dotinlabels]{titletoc}

\renewcommand{\tableofcontents}{
	\newpage
	\phantomsection
	\pdfbookmark[0]{Table of Contents}{tableofcontents}
	\begin{center}
		TABLE OF CONTENTS
	\end{center}
	\par
	\@starttoc{toc}
	\newpage
}	
I try putting in a \newpage but it does not do anything. Thanks for any help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

TOC on right hand side of double sided

Post by Stefan Kottwitz »

Hi,

you could use \cleardoublepage. This command starts a new page on a right hand side. If necessary, an empty page would be inserted.

Stefan
LaTeX.org admin
twsouthwick
Posts: 4
Joined: Sun Jun 20, 2010 12:12 am

Re: TOC on right hand side of double sided

Post by twsouthwick »

Awesome! Thanks. That does it - kind of weird that it wouldn't insert a new page with the \newpage command ... anyone know why?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

TOC on right hand side of double sided

Post by localghost »

twsouthwick wrote:Awesome! […] That does it […]
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).
twsouthwick wrote:[…] kind of weird that it wouldn't insert a new page with the \newpage command ... anyone know why?
The \newpage command just ends the current page, not more.


Thorsten
Post Reply