Move a tag
[latex2e.git] / latex2e-20170415 / required / graphics / lscape.dtx
blob733e183ee6c6ba1417a69091b37c63fc9a0f6b40
2 % \iffalse
4 %% lscape.dtx Copyright (C) 1994 1999-2000 David Carlisle
5 %%            Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project
6 %%
7 %% This file is part of the Standard LaTeX `Graphics Bundle'.
8 %% It may be distributed under the terms of the LaTeX Project Public
9 %% License, as described in lppl.txt in the base LaTeX distribution.
10 %% Either version 1.3c or, at your option, any later version.
12 %<*dtx>
13           \ProvidesFile{lscape.dtx}
14 %</dtx>
15 %<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
16 %<package>\ProvidesPackage{lscape}
17 %<driver> \ProvidesFile{lscape.drv}
18 % \fi
19 %         \ProvidesFile{lscape.dtx}
20           [2000/10/22 v3.01 Landscape Pages (DPC)]
22 % \iffalse
23 %<*driver>
24 \documentclass{ltxdoc}
25 \usepackage{lscape}
26 \begin{document}
27  \DocInput{lscape.dtx}
28 \end{document}
29 %</driver>
30 % \fi
32 % \GetFileInfo{lscape.dtx}
34 % \title{The \textsf{lscape} package\thanks{This file
35 %        has version number \fileversion, last
36 %        revised \filedate.}}
37 % \author{D. P. Carlisle}
38 % \date{\filedate}
41 % \begin{landscape}
42 % \MaintainedByLaTeXTeam{graphics}
43 % \maketitle
45 % All text, within the \texttt{landscape} environment is rotated through
46 % 90 degrees. The environment may span several pages. It works well
47 % with, and was originally created for, use with \textsf{longtable} to
48 % produce long wide tables.
50 % All the work is done by the \textsf{graphics} package, the trick is to
51 % call it at the right place in the output routine to rotate the current
52 % page before the page head and foot are added.
55 % \StopEventually{\end{landscape}}
56 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 % \changes{v1.00}{1992/04/28}{Initial release}
59 % \changes{v2.00}{1992/11/18}{Support for footnotes and floats.
60 %         Special thanks to Sarah J. McQuay for testing this release}
61 % \changes{v3.00}{1994/10/05}{Update using LaTeX2e graphics package}
62 % \changes{v3.01}{1999/06/22}{Added better pdfTeX support
63 %    by Scott Pakin, from graphics/3063}
66 %    \begin{macrocode}
67 %<*package>
68 %    \end{macrocode}
69 %  Here is what Scott Pakin wrote about the pdftex option:
70 % \begin{quote}
71 %    I've made a minor improvement to lscape.dtx that I'd like to share
72 % with the world.  My addition makes lscape rotate the PDF "paper" --
73 % not just the text on the page -- when given the "pdftex" option.
74 % (Naturally, this works only with pdfLaTeX.)  The result is that the
75 % text is viewable online without the reader having to rotate his/her
76 % head 90 degrees.  The document still prints normally.
77 % \end{quote}
80 %    \begin{macrocode}
81 \newif\ifGin@pdftex
82 \Gin@pdftexfalse
83 \DeclareOption{pdftex}{%
84   \PassOptionsToPackage\CurrentOption{graphics}
85   \Gin@pdftextrue
87 \DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}
88 \ProcessOptions
89 \RequirePackage{graphics}
90 %    \end{macrocode}
92 %    \begin{macrocode}
93 \let\LS@makecol=\@makecol
94 \let\LS@makefcolumn=\@makefcolumn
95 \def\LS@rot{%
96   \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
97 %    \end{macrocode}
99 % First set up the page size for landscape.
100 %    \begin{macrocode}
101 \def\landscape{%
102   \clearpage
103   \begingroup
104   \vsize=\textwidth
105   \hsize=\textheight
106   \linewidth=\hsize
107   \columnwidth=\hsize
108   \@colroom=\vsize
109   \textheight=\vsize
110   \@colht=\vsize
111 %    \end{macrocode}
112 %    Rotate the page body (text and float pages).
113 %    \begin{macrocode}
114   \def\@makecol{\LS@makecol\LS@rot}%
115   \def\@makefcolumn##1{\LS@makefcolumn{##1}\LS@rot}}
116 %    \end{macrocode}
118 %    Restore everything.  This is where the pdftex option makes a
119 %    difference.
120 %    \begin{macrocode}
121 \def\endlandscape{%
122   \ifGin@pdftex
123     \pdfpageattr{/Rotate 90}
124   \fi
125   \clearpage
126   \endgroup
127   \global\@colht=\textheight
128   \global\vsize=\textheight
129   \global\@colroom=\textheight}
130 %</package>
131 %    \end{macrocode}
134 % \Finale