[Tex/LaTex] After adding blank page, two sided option has confused

double-sidedmargins

I am using the two sided option in latex. I need to start my section in the right side of my thesis so because of that sometimes I added a blank page without a page number. After adding blank page, two-sided option confused and mixed the sequence.

How can I handle this problem ?

EDIT:

To add a blank page I use this package and settings.

\usepackage{afterpage}

\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}

I added \afterpage{blankpage} command where I want to add a blank page. After the blankpage the sections start and sections should be start at the right side. But they start from the left side. \cleardoublepage creates a new blank page with the page number so that is not intended.

Best Answer

Your command does not add a blank page, it simply moves to a new page. Therefore if your section ends at page 3, \blankpage will move to the new page, which is 4.

You should use \cleardoublepage. It is right that this generates a page with header and footer, for that we can use the emptypage package.

You can also redefine the \section in your document, so that you won't have to retype \cleardoublepage after each section with the \let \def commands.

here is a MWE of what I suggest:

\documentclass[twoside]{article}

\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{emptypage}

\let\oldsection\section
\def\section{\cleardoublepage\oldsection}

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}

\begin{document}
    \section{Section1}
    \lipsum[1-13]
    \section{Section2}
    \lipsum[14-25]
\end{document}

Right and left definitions are quite tricky as they depend on the binding (or lack of which). I added fancyhdr so that it would be clear which page is odd and which is even. I assumed you wanted your sections on the odd pages. If you want them on the even take a look at this Answer

Related Question