2 %% This is file `rotating.sty',
\r
3 %% generated with the docstrip utility.
\r
5 %% The original source files were:
\r
7 %% rotating.dtx (with options: `package')
\r
8 %% Copyright (C) 1994 Sebastian Rahtz and Leonor Barroca. All
\r
9 %% rights reserved. Permission is granted to to customize the
\r
10 %% declarations in this file to serve the needs of your installation.
\r
11 %% However, no permission is granted to distribute a modified version of
\r
12 %% this file under its original name.
\r
14 \def\RInfo{1997/09/26, v2.13}
\r
15 %% File: rotating.dtx Copyright (C) 1995 Sebastian Rahtz and Leonor Barroca
\r
16 \ProvidesPackage{rotating}[\RInfo\space Rotation package]
\r
17 \NeedsTeXFormat{LaTeX2e}
\r
18 \newif\if@rot@twoside
\r
19 \DeclareOption{clockwise}{% this is for compatibility
\r
20 \AtBeginDocument{\setkeys{Grot}{units=360}}%
\r
22 \DeclareOption{counterclockwise}{%
\r
23 \AtBeginDocument{\setkeys{Grot}{units=-360}}%
\r
25 \DeclareOption{figuresleft}{%
\r
29 \DeclareOption{figuresright}{%
\r
33 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}
\r
34 \ExecuteOptions{clockwise}
\r
42 \RequirePackage{graphicx}
\r
43 \RequirePackage{ifthen}
\r
44 \def\rotdriver#1{\makeatletter\input{#1.def}\makeatother}
\r
45 \newcounter{r@tfl@t}
\r
46 \setcounter{r@tfl@t}{0}
\r
49 \setbox\z@\hbox\bgroup\ignorespaces}
\r
58 \setbox\z@\hbox\bgroup\ignorespaces}
\r
67 \setbox\z@\hbox\bgroup\ignorespaces}
\r
72 \wd0\z@\dp0\z@\ht0\z@
\r
77 \setbox\z@\hbox{{#2}}%
\r
78 \Grot@x\z@\Grot@y\z@
\r
79 \wd0\z@\dp0\z@\ht0\z@
\r
82 \newsavebox\rot@float@box
\r
86 {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}%
\r
88 \def\@xrotfloat#1[#2]{%
\r
90 \begin{lrbox}\rot@float@box
\r
91 \begin{minipage}\textheight
\r
94 \end{minipage}\end{lrbox}%
\r
95 \global\addtocounter{r@tfl@t}{1}%
\r
96 \rot@label{RF\ther@tfl@t}%
\r
97 \message{Adding sideways figure on }%
\r
98 \def\R@@page{\pageref{RF\ther@tfl@t}}%
\r
99 \wd\rot@float@box\z@
\r
100 \ht\rot@float@box\z@
\r
101 \dp\rot@float@box\z@
\r
102 \vbox to \textheight{%
\r
103 \setkeys{Grot}{units=360}%
\r
105 \def\R@@page{\pageref{RF\ther@tfl@t}}%
\r
107 \let\R@@page\rot@LR
\r
109 \ifthenelse{\isodd{\R@@page}}{%
\r
110 \message{right hand page}%
\r
112 \centerline{\rotatebox{90}{\box\rot@float@box}}%
\r
114 \message{left hand page}%
\r
115 \vfill \centerline{\rotatebox{90}{\box\rot@float@box}}%
\r
120 \def\sidewaysfigure{\@rotfloat{figure}}
\r
121 \let\endsidewaysfigure\end@rotfloat
\r
122 \def\sidewaystable{\@rotfloat{table}}
\r
123 \let\endsidewaystable\end@rotfloat
\r
124 \def\@rotdblfloat{%
\r
125 \if@twocolumn\let\reserved@a\@rotdbflt\else\let\reserved@a\@rotfloat\fi
\r
127 \def\@rotdbflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}}
\r
128 \def\@rotxdblfloat#1[#2]{%
\r
129 \hsize\textwidth\linewidth\textwidth
\r
131 \begin{lrbox}\rot@float@box
\r
132 \begin{minipage}\textheight
\r
134 \def\end@rotdblfloat{%
\r
135 \end{minipage}\end{lrbox}%
\r
136 \global\addtocounter{r@tfl@t}{1}%
\r
137 \rot@label{RF\ther@tfl@t}%
\r
138 \message{Adding sideways figure on }%
\r
139 \def\R@@page{\pageref{RF\ther@tfl@t}}%
\r
140 \@tempdima\ht\rot@float@box
\r
141 \advance\@tempdima by \dp\rot@float@box
\r
142 \typeout{BOX wd: \the\wd\rot@float@box, ht: \the\ht\rot@float@box, dp:
\r
143 \the\dp\rot@float@box: so shift by .5 of \the\@tempdima}%
\r
144 \wd\rot@float@box\z@
\r
145 \ht\rot@float@box\z@
\r
146 \dp\rot@float@box\z@
\r
147 \vbox to \textheight{%
\r
148 \setkeys{Grot}{units=360}%
\r
150 \def\R@@page{\pageref{RF\ther@tfl@t}}%
\r
152 \let\R@@page\rot@LR
\r
154 \ifthenelse{\isodd{\R@@page}}{%
\r
155 \message{right hand page}%
\r
156 \hbox to \textwidth{\hfill\rotatebox{-90}{\box\rot@float@box}\hfill}%
\r
159 \message{left hand page}%
\r
161 \hbox to\textwidth{\hfill\rotatebox{90}{\box\rot@float@box}\hfill}%
\r
166 \newenvironment{sidewaystable*}
\r
167 {\@rotdblfloat{table}}
\r
169 \newenvironment{sidewaysfigure*}
\r
170 {\@rotdblfloat{figure}}
\r
173 \long\def \r@protected@write#1#2#3{%
\r
175 \let\therpage\relax
\r
177 \let\protect\@unexpandable@protect
\r
178 \edef\reserved@a{\write#1{#3}}%
\r
181 \if@nobreak\ifvmode\nobreak\fi\fi
\r
183 \def\therpage{\arabic{page}}
\r
184 \def\rot@label#1{\@bsphack
\r
185 \r@protected@write\@auxout{}%
\r
186 {\string\newlabel{#1}{{\@currentlabel}{\therpage}}}%
\r
188 \def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}}
\r
189 \long\def\@rotcaption#1[#2]#3{%
\r
190 \addcontentsline{\csname ext@#1\endcsname}{#1}{%
\r
191 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
\r
196 \@makerotcaption{\csname fnum@#1\endcsname}{#3}%
\r
198 \long\def\@makerotcaption#1#2{%
\r
199 \setbox\@tempboxa\hbox{#1: #2}%
\r
200 \ifdim \wd\@tempboxa > .8\vsize
\r
202 \begin{minipage}{.8\textheight}\end{minipage}%
\r
205 \rotatebox{90}{\box\@tempboxa}%
\r
211 %% End of file `rotating.sty'.
\r