[Tex/LaTex] Per-chapter blank page disappears after Chapter 2

blank-pagechapterspage-breaking

I use LaTeX with the document class book. I´d like a blank page between chapters but it works only after Chapter 1. I've tried to force a blank page with \newpage, \clearpage and \cleardoublepage and nothing happens.

How can I add a blank page? Why are they not included automatically after chapters?

Here is my document.tex:

\documentclass[a4paper,11pt]{book}

\usepackage{./estilos/estiloBase} 
\usepackage{./estilos/colores}  
\usepackage{./estilos/comandos}

\graphicspath{{./imagenes/}}

\begin{document}

\pagestyle{empty}
\input{portada.tex}
\cleardoublepage

\input{primerahoja.tex}
\cleardoublepage
\pagestyle{plain}

\frontmatter 

\input{previo.tex}
\cleardoublepage

\tableofcontents
\listoffigures
\listoftables

\mainmatter 

\chapter{Introducción}
\label{cap:introduccion}
\input{cap1.tex}

\chapter{Descripción general del proyecto}
\label{cap:descripcion}
\input{cap2.tex}

\chapter{Contexto}
\label{cap:contexto}
\input{cap3.tex}
...

\appendix
\cleardoublepage
\addappheadtotoc
\appendixpage
\chapter{Manual de usuario}
\label{cap:manusuario}

\backmatter

\chapter*{Software utilizado}
\addcontentsline{toc}{chapter}{Software utilizado}
\input{programas.tex}

\cleardoublepage

\addcontentsline{toc}{chapter}{Bibliografía y referencias}
\bibliographystyle{unsrt}
\bibliography{bibliografia}

\input{fdl-1.3.tex}
\end{document}

Best Answer

The book document class issues openright by default, which means that \chapter pages will start on a recto (right) page (typically an odd numbered page):

enter image description here

Therefore, it may be that some chapters end without a blank page while others end with one, depending on whether the subsequent page is recto or verso. If you wish to always have a blank page before a chapter, then you should pass the openany option to the document class and add the following to your preamble:

\let\oldchapter\chapter % Make a copy of \chapter
\renewcommand{\chapter}{%
  \clearpage% Clear the page and flush any pending floats
  \mbox{}% Put something on the new page
  \clearpage% Issue another \clearpage (perhaps not necessary, as \oldchapter may issue it)
  \oldchapter}% Regular chapter

The comments above describes the update to \chapter.

Most books are set with openright with the chapters starting on recto in the twoside document option. Otherwise, if you're not printing your document in twoside mode, then openany would be a good option.