%% rotpages.sty R1.0
%% Copyright 2002 Sergio Callegari
%%
%% This program may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX 
%% version 1999/12/01 or later.
%%
%% This program consists of the files:
%% rotpages.sty, rotpages-doc.tex, rotpages-doc.pdf, 
%% rotpages-example.tex, rotpages-example.pdf, README 
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{rotpages}[2002/01/25 R1.0 Boxed Rotated Pages (SC)]
\RequirePackage{graphics}
\newbox\SC@deferredpages
\newbox\SC@rotatedbox
\newlength\SC@rotd
\let\SC@makecol=\@makecol
%%\let\SC@makefcolumn=\@makefcolumn
\def\SC@processpage{%
 \setbox\SC@rotatedbox\hbox{\resizebox*{-\hsize}{-\vsize}{%
      \fbox{\copy\@outputbox}}}%
  \settodepth\SC@rotd{\copy\SC@rotatedbox}%
  \setbox\@outputbox\vbox{%
    \hbox{\raisebox{\SC@rotd}[\vsize][0pt]{\box\SC@rotatedbox}}}  
  \message{...deferring page...}
  \global\setbox\SC@deferredpages=\vbox{%
    \copy\@outputbox\break\unvbox\SC@deferredpages}%
  }
\def\rotboxpages{%
  \clearpage
  \begingroup
  \def\@opcol{\relax}%
  \def\@startcolumn{\relax}%
  \def\@makecol{\SC@makecol\SC@processpage}%
  \fboxsep=3ex%
  %%\def\@makefcolumn##1{\SC@makefcolumn{##1}\SC@processpage}
  }
\def\endrotboxpages{%
  \newpage
  \endgroup%
  \unvbox\SC@deferredpages 
  }
%%