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---}
    }
  • 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 6:07
  • @Zarko: Suppose I want all my pictures only on odd pages — what is the right solution for this? – pantlmn Jul 13 '15 at 6: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 6:36
  • Maybe you'll be interested to read this post: tex.stackexchange.com/questions/233113/… – nadous Jul 13 '15 at 6:37
  • Probably this answer might help, but I do not know how to edit it for my case. – pantlmn Jul 13 '15 at 6:59
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}
  • \ifeven I just imagined in my head, sorry ;-) – pantlmn Jul 14 '15 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.