Debian Codegraph @

texmf-dist/tex/latex-dev/graphics/rotating.sty

raw
1 %%
2 %% This is file `rotating.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% rotating.dtx (with options: `package')
8 %%
9 %% The source is maintained by the LaTeX Project team and bug
10 %% reports for it can be opened at https://latex-project.org/bugs/
11 %% (but please observe conditions on bug reports sent to that address!)
12 %%
13 %%
14 %% Copyright (C) 1995-1999 Sebastian Rahtz and Leonor Barroca
15 %% Copyright (C) 2001-2003,2007-2009 Robin Fairbairns
16 %% Copyright (C) 2016-2026 LaTeX Project
17 %% The LaTeX Project and any individual authors listed elsewhere
18 %% in this file.
19 \NeedsTeXFormat{LaTeX2e}
20 \ProvidesPackage{rotating}%
21 [2025/01/14 v2.16e
22 rotated objects in LaTeX%
23 ]
24 \DeclareOption{clockwise}{%
25 \AtBeginDocument{\setkeys{Grot}{units=360}}%
26 }
27 \DeclareOption{counterclockwise}{%
28 \AtBeginDocument{\setkeys{Grot}{units=-360}}%
29 }
30 \DeclareOption{anticlockwise}{\ds@counterclockwise}
31 \DeclareOption{figuresleft}{%
32 \@rot@twosidefalse
33 \def\rot@LR{0}%
34 }
35 \DeclareOption{figuresright}{%
36 \@rot@twosidefalse
37 \def\rot@LR{-1}%
38 }
39 \newif\ifrot@messages
40 \DeclareOption{quiet}{%
41 \rot@messagesfalse
42 \let\rot@message\@gobble % pro tem -- should suppress altogether
43 }
44 \DeclareOption{log}{%
45 \rot@messagestrue
46 \def\rot@message{\PackageInfo{rotating}}%
47 }
48 \DeclareOption{chatter}{%
49 \rot@messagestrue
50 \def\rot@message{\PackageWarning{rotating}}%
51 }
52 \newif\if@rot@twoside
53 \if@twoside
54 \@rot@twosidetrue
55 \else
56 \@rot@twosidefalse
57 \fi
58 \def\rot@LR{-1}
59 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
60 \ExecuteOptions{clockwise,quiet}
61 \ProcessOptions
62 \RequirePackage{graphicx}
63 \RequirePackage{ifthen}
64 \def\rotdriver#1{\makeatletter\input{#1.def}\makeatother}
65 \newcounter{r@tfl@t}
66 \setcounter{r@tfl@t}{0}
67 \newskip\rotFPtop \rotFPtop=\@fptop
68 \newskip\rotFPbot \rotFPbot=\@fpbot
69 \def\sideways{%
70 \leavevmode
71 \Grot@setangle{90}%
72 \setbox\z@\color@hbox\ignorespaces}
73 \def\endsideways{%
74 \unskip\color@endbox
75 \Grot@x\z@
76 \Grot@y\z@
77 \Grot@box
78 }
79 \def\turn#1{%
80 \leavevmode
81 \Grot@setangle{#1}%
82 \setbox\z@\color@hbox\ignorespaces}
83 \def\endturn{%
84 \unskip\color@endbox
85 \Grot@x\z@
86 \Grot@y\z@
87 \Grot@box
88 }
89 \def\rotate#1{%
90 \leavevmode
91 \Grot@setangle{#1}%
92 \setbox\z@\color@hbox\ignorespaces}
93 \def\endrotate{%
94 \unskip\color@endbox
95 \Grot@x\z@
96 \Grot@y\z@
97 \wd0\z@\dp0\z@\ht0\z@
98 \Grot@box
99 }
100 \def\turnbox#1#2{%
101 \leavevmode
102 \Grot@setangle{#1}%
103 \setbox\z@\hbox{{#2}}%
104 \Grot@x\z@\Grot@y\z@
105 \wd0\z@\dp0\z@\ht0\z@
106 \Grot@box
107 }
108 \newsavebox\rot@float@box
109 \def\@rotfloat#1{%
110 \@ifnextchar[%
111 {\@xrotfloat{#1}}%
112 {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}%
113 }
114 \def\@xrotfloat#1[#2]{%
115 \@float{#1}[#2]%
116 \begin{lrbox}\rot@float@box
117 \SuspendTagging{\minipage}%
118 \begin{minipage}\textheight
119 \ResumeTagging{\minipage}%
120 \UseTaggingSocket{para/restore}%
121 }
122 \def\end@rotfloat{%
123 \par\SuspendTagging{\minipage}%
124 \end{minipage}%
125 \ResumeTagging{\minipage}%
126 \end{lrbox}%
127 \stepcounter{r@tfl@t}%
128 \rot@label{RF\ther@tfl@t}%
129 \rot@pageref{RF\ther@tfl@t}{\R@@page}%
130 \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space}
131 \rot@mess@toks\expandafter{\@tempa}
132 \wd\rot@float@box\z@
133 \ht\rot@float@box\z@
134 \dp\rot@float@box\z@
135 \vbox to \textheight{%
136 \setkeys{Grot}{units=360}%
137 \if@rot@twoside
138 \else
139 \let\R@@page\rot@LR
140 \fi
141 \ifthenelse{\isodd{\R@@page}}{%
142 \if@rot@twoside
143 \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}%
144 \fi
145 \vfill
146 \@@line{%
147 \hskip\rotFPtop
148 \rotatebox{90}{\box\rot@float@box}%
149 \hskip\rotFPbot
150 }%
151 }{%
152 \if@rot@twoside
153 \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}%
154 \fi
155 \@@line{%
156 \hskip\rotFPbot
157 \rotatebox{-90}{\box\rot@float@box}%
158 \hskip\rotFPtop
159 }%
160 \vfill
161 }%
162 \rot@message{\the\rot@mess@toks}
163 }%
164 \end@float
165 }
166 \def\sidewaysfigure{\@rotfloat{figure}}
167 \let\endsidewaysfigure\end@rotfloat
168 \def\sidewaystable{\@rotfloat{table}}
169 \let\endsidewaystable\end@rotfloat
170 \def\@rotdblfloat{%
171 \if@twocolumn\expandafter\@rotdbflt\else\expandafter\@rotfloat\fi
172 }
173 \def\@rotdbflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}}
174 \def\@rotxdblfloat#1[#2]{%
175 \@float{#1}[#2]%
176 \hsize\textwidth\linewidth\textwidth
177 \begin{lrbox}\rot@float@box
178 \begin{minipage}\textheight
179 }
180 \def\end@rotdblfloat{%
181 \end{minipage}\end{lrbox}%
182 \stepcounter{r@tfl@t}%
183 \rot@label{RF\ther@tfl@t}%
184 \rot@pageref{RF\ther@tfl@t}{\R@@page}%
185 \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space}
186 \rot@mess@toks\expandafter{\@tempa}
187 \@tempdima\ht\rot@float@box
188 \advance\@tempdima by \dp\rot@float@box
189 \wd\rot@float@box\z@
190 \ht\rot@float@box\z@
191 \dp\rot@float@box\z@
192 \vbox to \textheight{%
193 \setkeys{Grot}{units=360}%
194 \if@rot@twoside
195 \else
196 \let\R@@page\rot@LR
197 \fi
198 \ifthenelse{\isodd{\R@@page}}{%
199 \ifrot@messages
200 \if@rot@twoside
201 \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}%
202 \fi
203 \fi
204 \vfill
205 \@@line{%
206 \hskip\rotFPtop
207 \rotatebox{90}{\box\rot@float@box}%
208 \hskip\rotFPbot
209 }%
210 }{%
211 \ifrot@messages
212 \if@rot@twoside
213 \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}%
214 \fi
215 \fi%
216 \@@line{%
217 \hskip\rotFPbot
218 \rotatebox{-90}{\box\rot@float@box}%
219 \hskip\rotFPtop
220 }%
221 \vfill
222 }%
223 \rot@message{\the\rot@mess@toks}%
224 }%
225 \end@dblfloat
226 }
227 \newenvironment{sidewaystable*}
228 {\@rotdblfloat{table}}
229 {\end@rotdblfloat}
230 \newenvironment{sidewaysfigure*}
231 {\@rotdblfloat{figure}}
232 {\end@rotdblfloat}
233
234 \def\rot@thepage{\@arabic\c@page}
235 \def\rot@label#1{\@bsphack
236 \rot@protected@write{\@auxout}{}%
237 {\string\newlabel{#1}{\rot@thepage}}%
238 \@esphack}
239 \def\rot@pageref#1#2{%
240 \expandafter\ifx\csname r@#1\endcsname\relax
241 \global\@rot@refundefinedtrue
242 \def#2{0}%
243 \else
244 \edef#2{\csname r@#1\endcsname}%
245 \fi
246 }
247 \long\def\rot@protected@write#1#2#3{%
248 \begingroup
249 \let\rot@thepage\relax
250 #2%
251 \let\protect\@unexpandable@protect
252 \edef\reserved@a{\write#1{#3}}%
253 \reserved@a
254 \endgroup
255 \if@nobreak\ifvmode\nobreak\fi\fi
256 }
257 \newif\if@rot@refundefined
258 \global\@rot@refundefinedfalse
259 \newtoks\rot@mess@toks
260 \def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}}
261 \long\def\@rotcaption#1[#2]#3{%
262 \addcontentsline{\csname ext@#1\endcsname}{#1}{%
263 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
264 \par
265 \begingroup
266 \@parboxrestore
267 \normalsize
268 \@makerotcaption{\csname fnum@#1\endcsname}{#3}%
269 \endgroup}
270 \long\def\@makerotcaption#1#2{%
271 \setbox\@tempboxa\color@hbox#1: #2\color@endbox
272 \ifdim \wd\@tempboxa > .8\vsize
273 \rotatebox{90}{%
274 \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
275 }%
276 \else%
277 \rotatebox{90}{\box\@tempboxa}%
278 \fi
279 \nobreak
280 \hspace{12pt}%
281 }
282 \AtBeginDocument{%
283 \providecommand\color@hbox{\hbox\bgroup}%
284 \providecommand\color@vbox{\vbox\bgroup}%
285 \providecommand\color@endbox{\egroup}%
286 }
287 \endinput
288 %%
289 %% End of file `rotating.sty'.