5

I want to place a full-page image after one of the closest page breaks, but I want to control, whether to place this image on ad odd or on an even page.

The closest question I found is this: Dynamically insert full-page image at nearest page break.

Probably I should use something like this:

    \newcommand{\placeonodd}[1]{%
        \ifeven\c@page{
            \afterpage{
            \thispagestyle{empty}\noindent\includegraphics[height=\textheight]{#1}%
            }}
        \else{---somehow delay \includegraphics until next pagebreak---}
    }
pantlmn
  • 1,366
  • 8
  • 17
  • So far I was convinced that for this is enough to use option p: \begin{figure}[p] ... \end{figure} and it will be placed on the first page after. Or I do missing something in your question? – Zarko Jul 13 '15 at 06:07
  • @Zarko: Suppose I want all my pictures only on odd pages — what is the right solution for this? – pantlmn Jul 13 '15 at 06:26
  • I see, I miss the point of question. How to do this automatically, I don't know. Manually just put float in text somewhere on even page before. Of course, this require more compilations. – Zarko Jul 13 '15 at 06:36
  • Maybe you'll be interested to read this post: http://tex.stackexchange.com/questions/233113/putting-titles-in-color-boxes/233122#233122 – nadous Jul 13 '15 at 06:37
  • Probably this answer might help, but I do not know how to edit it for my case. – pantlmn Jul 13 '15 at 06:59
  • So the odd-page float must take up the complete page? – 1010011010 Jul 13 '15 at 07:37
  • @1010011010: Yes, a complete page. – pantlmn Jul 13 '15 at 11:10

1 Answers1

3

Were you getting \ifeven from some package?

\documentclass{article}
\usepackage{afterpage}
\usepackage{mwe}

\newcommand{\placeonodd}[1]{%
  \ifodd\value{page}\afterpage{\placeonodd{#1}}%
  \else\afterpage{\thispagestyle{empty}\noindent%
    \includegraphics[height=\textheight,width=\textwidth]{#1}}%
  \fi
}
\begin{document}
\placeonodd{example-image}
\lipsum[1-16]
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120