2 \documentclass[twoside
]{report}
3 \usepackage[chatter
]{rotating
}
7 \newcommand\@@Display
[1]{%
9 \begin{minipage
}[b
]{.45\textwidth}%
11 }\raisebox{\depth}{\usebox{\@display
}}%
14 \newcommand\@@VDisplay
[1]{%
16 \begin{minipage
}[b
]{.45\textwidth}%
17 \BVerbatimInput[fontsize=
\small]{#1}%
21 \newcommand\SideBySide[2]{%
22 \bgroup\def\baselinestretch{1}%
25 \makebox[\textwidth][l
]{\@@Display
{#1}\hspace{1em
}%
30 \newcommand\BeginExample{%
34 \begin{VerbatimOut
}{\jobname.ex
}%
36 \newcommand{\EndExample}{\end{VerbatimOut
}}
38 \newenvironment{example
}
42 \begin{VerbatimOut
}{\jobname.ex
}%
45 \SideBySide {\input{\jobname.ex
}}%
48 %-------------------------------------------------------
49 \def\degrees{{\small$^
{\mathrm{o
}}$
}}
50 %-------------------------------------------------------
54 \title{Test of `rotating' package
}
55 \author{Sebastian Rahtz and Leonor Barroca
\thanks{Now maintained as part of the
\LaTeX\ graphics bundle.
}}
56 \date{November
19th
1994\thanks{Updated for graphics bundle
2016/
05/
22}}
59 `Rotating' provides a generalised rotation environment, where the text
60 will be rotated (anti-clockwise) by the number of degrees specified as
61 a parameter to the environment, but no special arrangement is made to
62 find space for the result.
72 A complete example of rotating text without leaving space
73 would the `Save the whale' text
74 written at
10 degree intervals round the compass. We use
75 `rlap' to ensure that all the texts are printed at the same point.
76 Just to show that
\TeX\ can handle PostScript muckings-about
80 \newsavebox{\wangtext}
82 \def\wheel#1{\savebox{\wangtext}{#1}%
83 \wangspace\wd\wangtext
84 \advance\wangspace by
1cm
%
86 \rule{0pt
}{\wangspace}%
87 \rule[-
\wangspace]{0pt
}{\wangspace}%
88 \wang=-
180\loop\ifnum\wang<
180
89 \rlap{\begin{rotate
}{\the\wang}%
90 \rule{1cm
}{0pt
}#1\end{rotate
}}%
91 \advance\wang by
10\repeat}}
92 \wheel{Save the whale
}
96 desires
\LaTeX\ to leave space for the rotated box, then `turn' is used:
98 Start here
\begin{turn
}{56}%
102 The environment `Sideways' is a special case, setting the rotation to $-
90$,
103 and leaving the correct space for the rotated box.
112 If you deal with whole paragraphs of text, you realize that
\TeX\
113 boxes are not as simple as they sometimes look: they have a height
114 {\em and
} a depth. So when you rotate, you rotate about the point on
115 the left-hand edge of the box that meets the baseline. The results can
116 be unexpected, as shown in the full set of paragraph rotations in
117 Figures
\ref{angles1
} and
\ref{angles2
}. If you really want to turn a
118 paragraph so that it appears to rotate about the
{\em real
} bottom of
120 you have to adjust the box in the normal
\LaTeX\ way:
123 \savebox{\foo}{\parbox{1in
}{Save
124 the whales Save the whale
128 \begin{turn
}{45}\usebox{\foo}\end{turn
}
132 \savebox{\foo}{\parbox[b
]{1in
}{Save
133 the whales Save the whale
137 \begin{turn
}{45}\usebox{\foo}\end{turn
}
142 \savebox{\foo}{\parbox{1in
}{Save
143 the whales Save the whale Save the whale Save the whale
}}%
144 \framebox{---
\begin{turn
}{#1}\framebox{\usebox{\foo}}\end{turn
}---
}}%
147 \begin{tabular
}{|c|c|c|
}
149 \testrot{0} &
\testrot{-
40}&
\testrot{-
80}\\
150 0\degrees & -
40\degrees & -
80\degrees \\
152 \testrot{-
120}&
\testrot{-
160}&
\testrot{-
200}\\
153 120\degrees & -
160\degrees & -
200\degrees \\
155 \testrot{-
240}&
\testrot{-
280}&
\testrot{-
320}\\
156 -
240\degrees & -
280\degrees & -
320\degrees \\
159 \caption{Rotation of paragraphs between
0 and -
320 degrees
\label{angles1
}}
163 \begin{tabular
}{|c|c|c|
}
165 \testrot{-
180} &
\testrot{40}&
\testrot{80}\\
166 -
180\degrees &
40\degrees &
80\degrees \\
168 \testrot{120}&
\testrot{160}&
\testrot{200}\\
169 120\degrees &
160\degrees &
200\degrees \\
171 \testrot{240}&
\testrot{280}&
\testrot{320}\\
172 240\degrees &
280\degrees &
320\degrees \\
175 \caption{Rotation of paragraphs between
0 and
320 degrees
\label{angles2
}}
179 We can set tabular material in this way; at the same time, we
180 demonstrate that the rotation can be nested:
184 \begin{tabular
}{|lr|
}
185 \em Word &
\begin{rotate
}{90}%
186 Occurrences
\end{rotate
}
198 \rule{0pt
}{1.5in
}\begin{tabular
}{rrr
}
199 \begin{rotate
}{45}Column
1\end{rotate
}&
200 \begin{rotate
}{45}Column
2\end{rotate
}&
201 \begin{rotate
}{45}Column
3\end{rotate
}\\
214 \begin{turn
}{45}Column
1\end{turn
}&
215 \begin{turn
}{45}Column
2\end{turn
}&
216 \begin{turn
}{45}Column
3\end{turn
}\\
228 \rule{0pt
}{1.5in
}\begin{tabular
}{rrr
}
229 \begin{rotate
}{45}Column
1\end{rotate
}
231 \begin{rotate
}{45}Column
2\end{rotate
}
233 \begin{rotate
}{45}Column
3\end{rotate
}
246 \begin{tabular
}{|l|c|c|c|c|c|p
{1in
}|
}
248 &&
\multicolumn{4}{c
}{NUMBER OF SITES
}\vline &ACCEPT or\\
249 \cline{3-
6} &STUDY AREA&&
\multicolumn{3}{c
}{%
250 IN BOUNDARY ZONE
}\vline&REJECT\\
251 \cline{4-
6}&&&&
\multicolumn{2}{c
}{EXPECTED
}
253 \cline{5-
6}&&TOT&OBS&FROM&TO&HYPOTH\\
255 &FULL SAMPLE&
41&
31&
10.3&
27.0&REJECT\\
256 &SAMPLE AREA
1&
23&
16&
4.3&
16.7&ACCEPT\\
257 &SAMPLE AREA
2&
18&
15&
2.8&
13.7&REJECT\\
258 &RUSHEN&
13&
9&
1.2&
10.4&ACCEPT\\
259 &ARBORY&
10&
7&
0.6&
8.8&ACCEPT\\
260 &MAROWN&
10&
8&
0.4&
8.6&ACCEPT\\
262 \begin{rotate
}{90}PRIMARY UNITS
%
263 \end{rotate
}\rule{0.5cm
}{0pt
}
264 &SANTON&
8&
7&
0.0&
7.3&ACCEPT\\
270 If you are interested in setting rotated material in tables or
271 figures, this presents no problem. Figure
\ref{fig1
} shows how
272 PostScript files which are being incorporated using can be
273 rotated at will, while Figure
\ref{fig2
} shows, in contrast, how
274 `includegraphics' itself handles rotation. It is also possible to rotate the
275 whole of the figure environment, including caption,
276 by using the `sidewaysfigure' ands `sidewaystable' environments
277 in place of `figure' and `table'.
279 Sideways figures and tables always take up the whole page. They can be
280 rotated so that the bottom ot the figures is on the left or the right;
281 the default is to always turn to the right. If the `twoside' option
282 has been given to the main
document class, this package then starts
283 rotating sideways figures according to the page number (this requires
284 two passes through
\LaTeX{} at least). If you want the `twoside'
285 option, but want the figures always in one direction, use the
286 `figuresright' or `riguresleft' options to `rotating'.
288 The code used to produce figures
289 \ref{rotfloat1
}--
\ref{rotfloat4
} is as follows:
292 \item[Figure
\ref{rotfloat1
}]
293 {\small\begin{verbatim
}
294 \begin{sidewaystable
}
296 \caption{This is a narrow table, which should be centred vertically
297 on the final page.
\label{rotfloat1
}}
298 \begin{tabular
}{|ll|
}
311 \item[Figure
\ref{rotfloat2
}]
312 {\scriptsize\begin{verbatim
}
313 \begin{sidewaystable
}
315 \begin{tabular
}{|llllllllp
{1in
}lp
{1in
}|
}
317 Context &Length &Breadth/ &Depth &Profile &Pottery &Flint &Animal &Stone &Other &C14 Dates \\
318 & &Diameter & & & & &
322 \multicolumn{10}{|l
}{\bf Grooved Ware
}&\\
323 784 &--- &
0.9m &
0.18m &Sloping U &P1 &$
\times$
46 & $
\times$
8 && $
\times$
2 bone&
2150$
\pm$
100 BC\\
324 785 &--- &
1.00m &
0.12 &Sloping U &P2--
4 &$
\times$
23 & $
\times$
21 & Hammerstone &---&---\\
325 962 &--- &
1.37m &
0.20m &Sloping U &P5--
6 &$
\times$
48 & $
\times$
57* & ---& ---&
1990 $
\pm$
80 BC (Layer
4)
1870 $
\pm$
90 BC (Layer
1)\\
326 983 &
0.83m &
0.73m &
0.25m &Stepped U &--- &$
\times$
18 & $
\times$
8 & ---& Fired clay&---\\
328 \multicolumn{10}{|l
}{\bf Beaker
}&\\
329 552 &--- &
0.68m &
0.12m &Saucer &P7--
14 &--- & --- & --- &--- &---\\
330 790 &--- &
0.60m &
0.25m &U &P15 &$
\times$
12 & --- & Quartzite-lump&--- &---\\
331 794 &
2.89m &
0.75m &
0.25m &Irreg. &P16 &$
\times$
3 & --- & --- &--- &---\\
335 \caption[Grooved Ware and Beaker Features, their Finds and
336 Radiocarbon Dates
]{Grooved Ware and Beaker Features, their
337 Finds and Radiocarbon Dates; For a breakdown of the Pottery
338 Assemblages see Tables I and III; for
339 the Flints see Tables II and IV; for the
340 Animal Bones see Table V.
}\label{rotfloat2
}
345 \item[Figure
\ref{rotfloat3
}]
346 {\small\begin{verbatim
}
349 \rotcaption{Minimum number of individuals; effect of rotating table
350 and caption separately
}\label{rotfloat3
}%
352 \begin{tabular
}[b
]{cccccccccp
{1cm
}}
354 Phase&Total&Cattle&Sheep&Pig&Red Deer&Horse&Dog&Goat&Other\\
356 &
1121&
54&
12&
32&
1&
1&
1&
1&
1 polecat\\
357 3&
8255&
58&
6&
35&
1&
1&
1&
1&
1 roe deer,
1 hare,
1 cat,
1 otter\\
358 4&
543&
45&
6&
45&
4&
1&
1&---&---\\
360 &
9919&
157&
24&
112&
6&
3&
3&
2&
5\\
368 \item[Figure
\ref{rotfloat4
}]
369 {\small\begin{verbatim
}
370 \begin{sidewaysfigure
}
372 \includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}
373 \caption{A pathetically squashed rotated pussycat
}\label{rotfloat4
}
382 \includegraphics[width=
1in
]{cat
}
388 \includegraphics[width=
1in
]{cat
}
393 ---
\includegraphics[width=
1in
]{cat
}---
395 \caption{A normal, and sideways, pictures within a figure
\label{fig1
}}
400 \includegraphics[width=
1in,
%
404 \caption{Figures rotated with `includegraphics'
\label{fig2
}}
406 \begin{sidewaystable
}
408 \caption{This is a narrow table, which should be centred vertically
409 on the final page.
\label{rotfloat1
}}
410 \begin{tabular
}{|ll|
}
423 \begin{sidewaystable
}
425 \begin{tabular
}{|llllllllp
{1in
}lp
{1in
}|
}
427 Context &Length &Breadth/ &Depth &Profile &Pottery &Flint &Animal &Stone &Other &C14 Dates \\
428 & &Diameter & & & & &
432 \multicolumn{10}{|l
}{\bf Grooved Ware
}&\\
433 784 &--- &
0.9m &
0.18m &Sloping U &P1 &$
\times$
46 & $
\times$
8 && $
\times$
2 bone&
2150$
\pm$
100 BC\\
434 785 &--- &
1.00m &
0.12 &Sloping U &P2--
4 &$
\times$
23 & $
\times$
21 & Hammerstone &---&---\\
435 962 &--- &
1.37m &
0.20m &Sloping U &P5--
6 &$
\times$
48 & $
\times$
57* & ---& ---&
1990 $
\pm$
80 BC (Layer
4)
1870 $
\pm$
90 BC (Layer
1)\\
436 983 &
0.83m &
0.73m &
0.25m &Stepped U &--- &$
\times$
18 & $
\times$
8 & ---& Fired clay&---\\
438 \multicolumn{10}{|l
}{\bf Beaker
}&\\
439 552 &--- &
0.68m &
0.12m &Saucer &P7--
14 &--- & --- & --- &--- &---\\
440 790 &--- &
0.60m &
0.25m &U &P15 &$
\times$
12 & --- & Quartzite-lump&--- &---\\
441 794 &
2.89m &
0.75m &
0.25m &Irreg. &P16 &$
\times$
3 & --- & --- &--- &---\\
445 \caption[Grooved Ware and Beaker Features, their Finds and
446 Radiocarbon Dates
]{Grooved Ware and Beaker Features, their
447 Finds and Radiocarbon Dates; For a breakdown of the Pottery
448 Assemblages see Tables I and III; for
449 the Flints see Tables II and IV; for the
450 Animal Bones see Table V.
}\label{rotfloat2
}
456 \rotcaption{Minimum number of individuals; effect of rotating table
457 and caption separately
}\label{rotfloat3
}%
459 \begin{tabular
}[t
]{cccccccccp
{1cm
}}
461 Phase&Total&Cattle&Sheep&Pig&Red Deer&Horse&Dog&Goat&Other\\
463 &
1121&
54&
12&
32&
1&
1&
1&
1&
1 polecat\\
464 3&
8255&
58&
6&
35&
1&
1&
1&
1&
1 roe deer,
1 hare,
1 cat,
1 otter\\
465 4&
543&
45&
6&
45&
4&
1&
1&---&---\\
467 &
9919&
157&
24&
112&
6&
3&
3&
2&
5\\
475 \begin{sidewaysfigure
}
476 \centerline{\includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}}
477 \caption{A pathetically squashed rotated pussycat (
1)
}
480 \begin{sidewaysfigure
}
481 \centerline{\includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}}
482 \caption{A pathetically squashed rotated pussycat (
2)
}
485 \begin{sidewaysfigure
}
486 \centerline{\includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}}
487 \caption{A pathetically squashed rotated pussycat (
3)
}
490 \begin{sidewaysfigure
}
491 \centerline{\includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}}
492 \caption{A pathetically squashed rotated pussycat (
4)
}
495 \begin{sidewaysfigure
}
496 \centerline{\includegraphics[width=
.8\textheight,height=
.4\textwidth]{cat
}}
497 \caption{A pathetically squashed rotated pussycat
}\label{rotfloat4
}