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.
\documentclass[12pt,a4paper,openright]{mwrep}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm,twoside]{geometry}
\usepackage[section]{minted}
\usepackage{lipsum}

\begin{document}
\tableofcontents
\listoffigures
\listoflistings

\chapter{c1}
\lipsum
\begin{figure}
.
\label{f1}
\caption{figure}
\end{figure}
\lipsum
\begin{listing}
.
\label{l1}
\caption{listing}
\end{listing}

\chapter{c2}
\lipsum
\end{document}

In this MWE I want to start each chapter at even page. I want to make an exception for \listoffigures and \listoflistings. How can I do that?

share|improve this question
    
Please see my updated improved answer. –  Gonzalo Medina Jun 21 '12 at 0:12
add comment

2 Answers

up vote 8 down vote accepted

You need the twoside and openright class options. You can then locally \let \cleardoublepage to be \clearpage for the lists (so they can start on any page) and then redefine \cleardoublepage to make sure every subsequent chapter will begin in an even numbered page:

\documentclass[12pt,a4paper,twoside,openright]{mwrep}
\usepackage{minted}
\usepackage{lipsum}

\begin{document}

\begingroup
\let\cleardoublepage\clearpage
\tableofcontents
\listoffigures
\listoflistings
\endgroup
\makeatletter

\renewcommand*\cleardoublepage{\clearpage\if@twoside
  \ifodd\c@page \hbox{}\newpage\if@twocolumn\hbox{}%
  \newpage\fi\fi\fi}
\makeatother

\chapter{Test Chapter One}
\lipsum[2]

\chapter{Test Chapter Two}
\lipsum

\chapter{Test Chapter Three}
\lipsum

\end{document}

And the resulting ToC:

enter image description here

share|improve this answer
add comment

Thanks Gonzalo! To avoid the redefinition of \cleardoublepage you can use brackets to change the definition just temporary:

{\let\cleardoublepage\clearpage\listoffigures}
{\let\cleardoublepage\clearpage\chapter{MyChapter}}
share|improve this answer
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.