Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to add one cartoon in the right margin of odd pages in one book. More precisely, ...

  • ... the page #1 must contain the picture #1,
  • ... the page #3 must contain the picture #2,
  • ... the page #5 must contain the picture #3,
  • ... and so on.

How can I achieve this ?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

You can include the pictures using \includegraphics.

In order to ensure to get one cartoon per page, I would call it from the header rendering, using \srcpage2 for example.

Here is an example:

\documentclass[paper=a4]{scrbook}

\usepackage{scrpage2}
\usepackage{graphicx}
\newcommand{\cartoon}[1]{%
\begin{picture}(0,0)
        \put(#1,-200){\includegraphics[width=35mm]{xkcd/\thepage.jpg}}
\end{picture}
}
\cehead[\cartoon{-320}]{}
\cohead[\cartoon{220}]{}
\pagestyle{scrplain}
\usepackage{blindtext}

\begin{document}
\Blinddocument   
\end{document}

And the result, alternating margins:

Page 1

Page 2

Page 3

Edit: Upon re-reading your question, I just saw you only wanted odd margins. Just remove the \cehead and you'll only have odd margins.

share|improve this answer
    
Hello. Can you be a little more precise ? –  projetmbc Aug 30 '11 at 14:13
    
I'm preparing an example :-) –  ℝaphink Aug 30 '11 at 14:14
    
Thanks, I'll look at it later. –  projetmbc Aug 30 '11 at 14:30
    
Oh, just saw odd margins... –  ℝaphink Aug 30 '11 at 14:41
2  
You may have to use \the\numexpr\thepage/2\relax as the figure number, depending on the precise specification. –  Bruno Le Floch Aug 30 '11 at 15:13
show 7 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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