[Tex/LaTex] Show footnotes on odd pages only

conditionalsdouble-sidedfootnotespage-breaking

I'm writing my thesis using the scrbook-class. Is it possible to display footnotes only on the odd (right) pages?

This should mean that \footnote{something} should be collected on even pages and displayed on the next page (of course followed by the footnotes from this page).

I've seen this behavior in a few textbooks and thought it was quite nice, but don't know how to achieve this style.

P.S.: Of course one has to violate this approach when a chapter ends on an even page.

MWE (does not do what I want):

\documentclass{scrbook}
\usepackage{blindtext}

\begin{document}
\blindtext[2]\footnote{First footnote}
\blindtext[2]\footnote{Second footnote}
\blindtext[2]\footnote{Third footnote}
\end{document}

Output:
enter image description here

Should look like:
enter image description here

Best Answer

The following solution uses the \label-\ref system to record a footnote and retrieve it, possibly on the current page, or possibly \afterpage:

enter image description here

\documentclass{scrbook}% http://ctan.org/pkg/KOMA-script
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{afterpage,etoolbox,refcount}% http://ctan.org/pkg/{afterpage,etoolbox,refcount}
\patchcmd{\footnotemark}{\stepcounter}{\refstepcounter}{}{}% Update \footnotemark to allow \label-\ref
\let\oldfootnote\footnote% Store \footnote in \oldfootnote
\let\oldfootnotetext\footnotetext% Store \footnotetext in \oldfootnotetext
\newcounter{fntext}% Footnote text counter (for correct sequential retrieval of footnote text
\renewcommand{\footnotetext}{\stepcounter{fntext}\oldfootnotetext}
\renewcommand{\footnote}{\evenfootnote}
\newcommand{\evenfootnote}[1]{%
  \leavevmode\footnotemark\label{evenfn-\thefootnote}% Set footnote mark
  \ifodd\getpagerefnumber{evenfn-\thefootnote}\relax% Page is odd
    \def\whichpage{\afterpage}% Footnote text on next page
  \else
    \def\whichpage{\relax}% Footnote text on current page
  \fi%
  \whichpage{\footnotetext[\getrefnumber{evenfn-\thefntext}]{#1}}% Set footnote text
}

\begin{document}

\lipsum[1-2]\evenfootnote{First footnote}
\lipsum[1-2]\evenfootnote{Second footnote}
\lipsum[1-2]\evenfootnote{Third footnote}
\lipsum[1-2]\evenfootnote{Fourth footnote}
\lipsum*[1]\evenfootnote{Mystery footnote}
\lipsum[1-2]\evenfootnote{Fifth footnote}
\lipsum[1-2]\evenfootnote{Sixth footnote}

\end{document}

refcount provides expandable macros that extracts page references, used in testing whether the current page is odd or not.