Debian Codegraph @

texmf-dist/source/latex/graphics/lscape.dtx

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