[Tex/LaTex] Rotated text in side margin

fancyhdrrotating

I've typeset a very wide table using longtable and rotating all the cells. As a consequence, if I want to place a "right" header, it ought to be in the bottom of the right margin, with the text rotated. I've been looking at some combination of fancyhdr and rotating, but can't get it to work. Rotating the text isn't the problem, but how does one place text at the bottom of a side margin?

Right now I have

\pagestyle{fancy} 
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{\begin{turn}{-90}\parbox{2in}{test \\ line two}\end{turn}}

which, of course, doesn't actually end up in the side margin.

Best Answer

It sounds like what you want to do is produce a single page in landscape. I was hoping that the geometry package's \newgeometry could do this, but it cannot.

I'd guess that the best bet would be to simply make another single page pdf that is in landscape for your table and then use \includepdf from pdfpages.

I guess that one alternative would be to use \newgeometry in concert with a single rotation of a minipage which contained all of the headers for that page (which you may have to just fill out yourself). Then you rotate the whole minipage and stuff it in the appropriate location. It'd take some fiddling around with though. It's also less attractive if the fancyhdr stuff doesn't work and the headers have to be written by hand.