3

I have successfully managed to place a background image at the bottom of my page by using the wallpaper package and \LLCornerWallPaper. Depending on odd / even pages I want to set the left / right part of a panorama as background. This answer shows how to do something based on oddness / evenness for KOMA-Script.

Now my problem is that both images appear on both odd and even pages. Here is my (simplified) code:

\documentclass[twoside,titlepage=false]{scrartcl}
\usepackage{wallpaper}
\usepackage{scrextend}
\begin{document}
\ifthispageodd{\LLCornerWallPaper{1}{pano-left}}{}
Text odd.\newpage
\ifthispageodd{\LLCornerWallPaper{1}{pano-right}}{}
Text even.
\end{document}

2 Answers 2

3

Quick and dirty

\documentclass[twoside,titlepage=false]{scrartcl}
\usepackage{ifthen,mwe,wallpaper,everypage,lipsum}
\AddEverypageHook{\ClearWallPaper\ifthenelse{\isodd{\arabic{page}}}%
{\LRCornerWallPaper{0.1}{example-image-a.jpg}}%
{\LLCornerWallPaper{0.1}{example-image-b.jpg}}}
\begin{document}
\lipsum[1-25]
\end{document}

You can use \AddThispageHook if you want to things locally. The trick is to use \ClearWallPaper when needed.

enter image description here

3

You can load package scrlayer-scrpage which is part of the KOMA-Script bundle. Then you can add layers for even and odd pages to all page styles.

\documentclass[twoside,titlepage=false]{scrartcl}
\usepackage{scrlayer-scrpage}
\usepackage{graphicx}
\DeclareNewLayer[
  background,
  evenpage,
  mode=picture,
  contents={\putLL{\includegraphics[scale=.2]{example-image-a.jpg}}}
]{bg.even}
\DeclareNewLayer[
  background,
  oddpage,
  mode=picture,
  contents={\putLR{\makebox[0pt][r]{\includegraphics[scale=.2]{example-image-b.jpg}}}}
]{bg.odd}
\AddLayersToPageStyle{@everystyle@}{bg.odd,bg.even}
\usepackage{lipsum}
\begin{document}
\lipsum
\lipsum
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .