3

I'm using marginpar to put margin figures in a document - there are $n$ pages and $n$ figures so I'd like to have one on each page, anchored to the first line of text on each page - at the moment I put them in in roughly the right place with

\marginpar{
\begin{figure}
\includegraphics[angle=270,width=\marginparwidth]{images/diagram.pdf}
\caption{mycaption}
\label{mylabel}
\end{figure}
}

but when I add or remove text they get moved around unpleasantly - is there a way I can enforce with say \marginpar[page=1]?

Torbjørn T.
  • 206,688
Joe
  • 479

1 Answers1

3

You can not put a figure in a marginpar; your posted code would produce the error

! LaTeX Error: Not in outer par mode.

To include an image at the same point in each page you could use something like

\makeatletter
\def\@ooddhead{\hfill
\begin{picture}(0,0)
\put(0,-50){\includgraphics{file\thepage}}
\end{picture}
\makeatother

This will include the file file1.pdf on the first page, the file file2.pdf on second, etc.

malin
  • 3,727
  • 4
  • 23
  • 35
David Carlisle
  • 757,742
  • 1
    Um - code putting figure in marginpar does does work - I should point out I'm using the style file {chi-ext} for extended abstracts... (and the figure in the marginpar is included in the sample file...) the files are at http://chi2012.acm.org/chi2012extendedformatLaTeX.zip – Joe Dec 22 '12 at 21:46
  • 3
    Standard latex figure environment will not work there, if you are using non standard definitions without telling anyone it is hard to help. It always helps to post complete small documents in your question showing all packages used. – David Carlisle Dec 22 '12 at 22:25