%
% \iffalse
%
%% lscape.dtx Copyright (C) 1994 1999 David Carlisle
%%
%% This file is part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%<*dtx>
          \ProvidesFile{lscape.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
%<package>\ProvidesPackage{lscape}
%<driver> \ProvidesFile{lscape.drv}
% \fi
%         \ProvidesFile{lscape.dtx}
          [1999/02/16 v3.0a Landscape Pages (DPC)]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage{lscape}
\begin{document}
 \DocInput{lscape.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{lscape.dtx}
%
% \title{The \textsf{lscape} package\thanks{This file
%        has version number \fileversion, last
%        revised \filedate.}}
% \author{D. P. Carlisle}
% \date{\filedate}
%
% \CheckSum{59}
%
% \begin{landscape}
% \maketitle
%
% All text, within the \texttt{landscape} environment is rotated through
% 90 degrees. The environment may span several pages. It works well
% with, and was originally created for, use with \textsf{longtable} to
% produce long wide tables.
%
% All the work is done by the \textsf{graphics} package, the trick is to
% call it at the right place in the output routine to rotate the current
% page before the page head and foot are added.
%
%
% \StopEventually{\end{landscape}}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \changes{v1.00}{1992/04/28}{Initial release}
% \changes{v2.00}{1992/11/18}{Support for footnotes and floats.
%         Special thanks to Sarah J. McQuay for testing this release}
% \changes{v3.00}{1994/10/05}{Update using LaTeX2e graphics package}
%
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}
\ProcessOptions
\RequirePackage{graphics}
%    \end{macrocode}
%
%    \begin{macrocode}
\let\LS@makecol=\@makecol
\let\LS@makefcolumn=\@makefcolumn
\def\LS@rot{%
  \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
%    \end{macrocode}
%
% First set up the page size for landscape.
%    \begin{macrocode}
\def\landscape{%
  \clearpage
  \begingroup
  \vsize=\textwidth
  \hsize=\textheight
  \linewidth=\hsize
  \columnwidth=\hsize
  \@colroom=\vsize
  \textheight=\vsize
  \@colht=\vsize
%    \end{macrocode}
% Rotate the page body (text and float pages).
%    \begin{macrocode}
  \def\@makecol{\LS@makecol\LS@rot}%
  \def\@makefcolumn##1{\LS@makefcolumn{##1}\LS@rot}}
%    \end{macrocode}
%
% Restore everything.
%    \begin{macrocode}
\def\endlandscape{%
  \clearpage
  \endgroup
  \global\@colht=\textheight
  \global\vsize=\textheight
  \global\@colroom=\textheight}
%</package>
%    \end{macrocode}
%
%
% \Finale
%
