]> AND Private Git Repository - LiCO.git/blob - PeCO-EO/rotating.sty
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Merge branch 'master' of ssh://bilbo.iut-bm.univ-fcomte.fr/LiCO
[LiCO.git] / PeCO-EO / rotating.sty
1 %%\r
2 %% This is file `rotating.sty',\r
3 %% generated with the docstrip utility.\r
4 %%\r
5 %% The original source files were:\r
6 %%\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
13 %% \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
21 }\r
22 \DeclareOption{counterclockwise}{%\r
23  \AtBeginDocument{\setkeys{Grot}{units=-360}}%\r
24 }\r
25 \DeclareOption{figuresleft}{%\r
26   \@rot@twosidefalse\r
27   \def\rot@LR{0}%\r
28 }\r
29 \DeclareOption{figuresright}{%\r
30  \@rot@twosidefalse\r
31  \def\rot@LR{-1}%\r
32 }\r
33 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}\r
34 \ExecuteOptions{clockwise}\r
35 \if@twoside\r
36   \@rot@twosidetrue\r
37 \else\r
38   \@rot@twosidefalse\r
39 \fi\r
40 \def\rot@LR{-1}\r
41 \ProcessOptions\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
47 \def\sideways{%\r
48   \Grot@setangle{90}%\r
49   \setbox\z@\hbox\bgroup\ignorespaces}\r
50 \def\endsideways{%\r
51   \unskip\egroup\r
52   \Grot@x\z@\r
53   \Grot@y\z@\r
54   \Grot@box\r
55 }\r
56 \def\turn#1{%\r
57   \Grot@setangle{#1}%\r
58   \setbox\z@\hbox\bgroup\ignorespaces}\r
59 \def\endturn{%\r
60   \unskip\egroup\r
61   \Grot@x\z@\r
62   \Grot@y\z@\r
63   \Grot@box\r
64 }\r
65 \def\rotate#1{%\r
66   \Grot@setangle{#1}%\r
67   \setbox\z@\hbox\bgroup\ignorespaces}\r
68 \def\endrotate{%\r
69   \unskip\egroup\r
70   \Grot@x\z@\r
71   \Grot@y\z@\r
72   \wd0\z@\dp0\z@\ht0\z@\r
73   \Grot@box\r
74 }\r
75 \def\turnbox#1#2{%\r
76   \Grot@setangle{#1}%\r
77   \setbox\z@\hbox{{#2}}%\r
78   \Grot@x\z@\Grot@y\z@\r
79   \wd0\z@\dp0\z@\ht0\z@\r
80   \Grot@box\r
81 }\r
82 \newsavebox\rot@float@box\r
83 \def\@rotfloat#1{%\r
84   \@ifnextchar[%\r
85     {\@xrotfloat{#1}}%\r
86     {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}%\r
87 }\r
88 \def\@xrotfloat#1[#2]{%\r
89   \@float{#1}[#2]%\r
90   \begin{lrbox}\rot@float@box\r
91   \begin{minipage}\textheight\r
92  }\r
93 \def\end@rotfloat{%\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
104     \if@rot@twoside\r
105       \def\R@@page{\pageref{RF\ther@tfl@t}}%\r
106     \else\r
107       \let\R@@page\rot@LR\r
108     \fi\r
109     \ifthenelse{\isodd{\R@@page}}{%\r
110     \message{right hand page}%\r
111     \vfill\r
112     \centerline{\rotatebox{90}{\box\rot@float@box}}%\r
113          }{%\r
114     \message{left hand page}%\r
115     \vfill    \centerline{\rotatebox{90}{\box\rot@float@box}}%\r
116          }%\r
117  }%\r
118    \end@float\r
119 }\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
126   \reserved@a}\r
127 \def\@rotdbflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}}\r
128 \def\@rotxdblfloat#1[#2]{%\r
129   \hsize\textwidth\linewidth\textwidth\r
130   \@float{#1}[#2]%\r
131   \begin{lrbox}\rot@float@box\r
132   \begin{minipage}\textheight\r
133 }\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
149     \if@rot@twoside\r
150       \def\R@@page{\pageref{RF\ther@tfl@t}}%\r
151     \else\r
152       \let\R@@page\rot@LR\r
153     \fi\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
157      \vfill\r
158          }{%\r
159     \message{left hand page}%\r
160     \vfill\r
161     \hbox to\textwidth{\hfill\rotatebox{90}{\box\rot@float@box}\hfill}%\r
162          }%\r
163  }%\r
164    \end@dblfloat\r
165 }\r
166 \newenvironment{sidewaystable*}\r
167                {\@rotdblfloat{table}}\r
168                {\end@rotdblfloat}\r
169 \newenvironment{sidewaysfigure*}\r
170                {\@rotdblfloat{figure}}\r
171                {\end@rotdblfloat}\r
172 \r
173 \long\def \r@protected@write#1#2#3{%\r
174       \begingroup\r
175        \let\therpage\relax\r
176        #2%\r
177        \let\protect\@unexpandable@protect\r
178        \edef\reserved@a{\write#1{#3}}%\r
179        \reserved@a\r
180       \endgroup\r
181       \if@nobreak\ifvmode\nobreak\fi\fi\r
182 }\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
187   \@esphack}\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
192   \par\r
193   \begingroup\r
194     \@parboxrestore\r
195     \normalsize\r
196     \@makerotcaption{\csname fnum@#1\endcsname}{#3}%\r
197   \endgroup}\r
198 \long\def\@makerotcaption#1#2{%\r
199  \setbox\@tempboxa\hbox{#1: #2}%\r
200  \ifdim \wd\@tempboxa > .8\vsize\r
201     \rotatebox{90}{%\r
202     \begin{minipage}{.8\textheight}\end{minipage}%\r
203     }\par\r
204  \else%\r
205     \rotatebox{90}{\box\@tempboxa}%\r
206  \fi\r
207  \hspace{12pt}%\r
208 }\r
209 \endinput\r
210 %%\r
211 %% End of file `rotating.sty'.\r