You can use \ULCornerWallPaper{1}{background.pdf}
in the document itself, not in the preamble:
Putting it on a specific page (e.g. after \newpage
or \end{titlepage}
or whatever) will make the background appear on all pages starting from that page.
(Similarly, putting \ClearWallPaper
on some page will remove the background from all pages starting with that one.)
As far as I can tell, you can't. adjustbox
, always worth a look, does not seem to offer the necessary option(s), either.
Luckily, we can hack it. Observe that
\includegraphics[width=\paperwidth,keepaspectratio,clip]{img}
works well for portrait images -- scaling them so the width fits and clip -- and the opposite
\includegraphics[height=\paperheight,keepaspectratio,clip]{img}%
works for landscape images. So we can choose the correct version according to image dimensions which version to use:
\settoheight\imageheight{\includegraphics{img}}%
\settowidth\imagewidth{\includegraphics{img}}%
\ifthenelse{\dimtest{\imageheight}{>=}{\imagewidth}}{%
\includegraphics[width=\paperwidth,keepaspectratio,clip]{img}%
}{%
\includegraphics[height=\paperheight,keepaspectratio,clip]{img}%
}%
Note that this requires package xifthen
. The example then ends up compiling to:
I have not figured out yet how to choose a well-defined part of the image, say the middle part, when clipping; it seems to work from the left resp. the bottom by default. Also, the clipped image seems to produce Overful \hbox
warnings.
Best Answer
You can use
ifoddpage
package:If you don't want to use any extra package simply do this:
and remove
\usepackage{ifoddpage}
.