I use classsicthesis style for my PhD. Since this style is somehow geared towards using the outside margin for additional notes and stuff, I thought I could also place the legends of my plots there. I use pgfplots to create them. I styled my plots so that the legend is placed outside the plot. The problem I don't know how to solve (and I really wonder if it can be done) is:
How can it be automatically determined if the plot is on the even or odd page so that the legend always appears on the outside margin?
At the moment I can only do this manually by placing the following two lines in the code of each plot:
legend style={at={(-0.1,1)}, anchor=north east}, %for even pages
%legend style={at={( 1.1,1)}, anchor=north west}, %for odd pages
and (un)commenting the appropriate line - which, of course, is not practical at all. An automated solution would be great - otherwise it's just not worth it for a lengthy document with lots of plots.
P.S.: I am using TexLive 2011 on Ubuntu 11.10
EDIT: I thought of the question as kind of a general problem, but I was probably wrong, so I created the following MWE to illustrate it a help with the alternative answers:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% legend style={at={(-0.1,1)}, anchor=north east}, %for even pages
legend style={at={( 1.1,1)}, anchor=north west}, %for odd pages
]
\addplot coordinates { (0,0) (1,1) };
\addlegendentry{Legend entry}
\end{axis}
\end{tikzpicture}
\end{document}
\documentclassand the appropriate packages so that those trying to help don't have to recreate it, and so they can easily test the solution as well. – Peter Grill Nov 05 '11 at 17:39