Test of Rotating' Package: Sebastian Rahtz and Leonor Barroca November 19th 1994

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Test of rotating package

Sebastian Rahtz and Leonor Barroca November 19th 1994

Rotating provides a generalised rotation environment, where the text will be rotated (anti-clockwise) by the number of degrees specied as a parameter to the environment, but no special arrangement is made to nd space for the result.
Start here \begin{rotate}{-56} Save whales \end{rotate} End here

Start here End here


w ve Sa ha

A complete example of rotating text without leaving space would the Save the whale text written at 10 degree intervals round the compass. We use rlap to ensure that all the texts are printed at the same point. Just to show that TEX can handle PostScript muckings-about properly. . .
ale wh ale e th wh e the whale av SSavee the le Sav e the wha Sav the whale Save Sav Sav e the wha le SSavee the av t e he whale th wh e w al ha e le

les

ale \newcount\wang wh ale \newsavebox{\wangtext} he wh t e e ve e th e whal \newdimen\wangspace a SSav e th \def\wheel#1{\savebox{\wangtext}{#1}% le Sav e the wha \wangspace\wd\wangtext Sav the whale Save Sav Sav e the wha \advance\wangspace by 1cm% le \centerline{% SSavee the av t e he whale\rule{0pt}{\wangspace}% th wh e w al \rule[-\wangspace]{0pt}{\wangspace}% ha e \wang=-180\loop\ifnum\wang<180 le
\rlap{\begin{rotate}{\the\wang}% \rule{1cm}{0pt}#1\end{rotate}}% \advance\wang by 10\repeat}} \wheel{Save the whale}

he w

ha

le

Sa ve t

Save the whale

le ha e e w al th wh e he whale av t SSavee the le Sav e the wha Sav Save Sav the whale Sav e the wha le SSavee the av e the whale th wh e wh ale ale

A If the user desires L TEX to leave space for the rotated box, then turn is used:

Start here

The environment Sideways is a special case, setting the rotation to 90, and leaving the correct space for the rotated box.
Start here \begin{sideways}% Save the whale \end{sideways} End here

Start here

le ha e e w al th wh e he whale av t SSavee the le Sav e the wha Sav Save Sav the whale Sav e the wha le SSavee the av e the whale th wh e wh ale ale

end here

Start here \begin{turn}{56}% Save the whale \end{turn} end here

End here

If you deal with whole paragraphs of text, you realize that TEX boxes are not as simple as they sometimes look: they have a height and a depth. So when you rotate, you rotate about the point on the left-hand edge of the box that meets the baseline. The results can be unexpected, as shown in the full set of paragraph rotations in Figures 1 and 2. If you really want to turn a paragraph so that it appears to rotate about the real bottom of the TEX box, you have to A adjust the box in the normal L TEX way:
\newsavebox{\foo} \savebox{\foo}{\parbox{1in}{Save the whales Save the whale Save the whale Save the whale}}% Start \begin{turn}{45}\usebox{\foo}\end{turn} End

S Sa ave S ve th Sa ave th e ve t e wh th he w ale h s e w wh ale ha al le e S Sa ave S ve th Sa ave th e ve t e wh th he w ale h s e w wh ale ha al le e

Start

End

Start

End

\savebox{\foo}{\parbox[b]{1in}{Save the whales Save the whale Save the whale Save the whale}}% Start \begin{turn}{45}\usebox{\foo}\end{turn} End

We can set tabular material in this way; at the same time, we demonstrate that the rotation can be nested:

33 34

Word hello goodbye

Occurrences

\begin{sideways} \rule{1in}{0pt} \begin{tabular}{|lr|} \em Word & \begin{rotate}{90}% Occurrences\end{rotate} \\ \hline hello & 33\\ goodbye & 34\\ \hline \end{tabular} \end{sideways}

Save Save Save Save

the whales the whale the whale the whale

Sa Sa ve Sa ve the Sa ve the wh ve th a th e wh les e w wh ale ha ale le

s e whale Save th ale he wh Save t ale he wh Save t whale e Save th

0o

-40o

-80o
Sav e Sav the w e t hal Sa ve he wh es ale Sav the e the whale wha le

120o
s ale wh hale the w ale ave the wh le S e e a v Sa e th e wh v th Sa e v Sa

Save th e Save t whales he wh ale Save t he wh ale Save th e whale

-240o

Figure 1: Rotation of paragraphs between 0 and -320 degrees

s hale e w hale e th Sav the w hale e w Sav he ale e t Sav the wh e Sav

Sa v Sa e th v Sa e th e wh v a e S e ave the wh les the w ale wh hale ale

-160o

-200o
les ha ale w e wh le th e wha e ve th al Sa ve the wh Sa ve the Sa ve Sa

-280o

-320o

les ha ale w e wh le th e wha e ve th al Sa ve the wh Sa ve the Sa ve Sa

Save th e Save t whales he wh ale Save t he wh ale Save th e whale

-180o
s ale wh hale the w le ve the wha a S e e ale v Sa e th e wh v Sa e th v Sa

120o
Sa v Sa e th v Sa e th e wh v Sa e th e w ales ve ha th e e w wha le ha le le

160o

Sa Sa ve Sa ve the ve th w Sa ha ve th e th e wh les e w wh ale ha ale le

240o

280o

Figure 2: Rotation of paragraphs between 0 and 320 degrees

s hale e w hale e th w Sav le he e t e wha Sav h ale e t Sav the wh e Sav

Sav e th Sa e ve wh Sav the w ales e h al Sav th e th e wha e l ew hale e

Save Save Save Save

the whales the whale the whale the whale

40o

80o

200o

s e whale Save th ale he wh Save t ale he wh Save t whale e Save th

320o

1 4 7

2 5 8

3 6 9

\begin{quote} \rule{0pt}{1.5in}\begin{tabular}{rrr} \begin{rotate}{45}Column 1\end{rotate}& \begin{rotate}{45}Column 2\end{rotate}& \begin{rotate}{45}Column 3\end{rotate}\\ \hline 1& 2& 3\\ 4& 5& 6\\ 7& 8& 9\\ \hline \end{tabular} \end{quote}

C ol u C mn ol u 1 C mn ol um 2 n 3

1 4 7

2 5 8

\begin{quote} \begin{tabular}{rrr} \begin{turn}{45}Column 1\end{turn}& \begin{turn}{45}Column 2\end{turn}& \begin{turn}{45}Column 3\end{turn}\\ \hline 1& 2& 3\\ 4& 5& 6\\ 7& 8& 9\\ 3 \hline 6 \end{tabular} 9 \end{quote}

um n

um

1 4 7

2 5 8

n 2 ol um n 3

um

ol

ol

um

3 6 9

C ol u

ol

C ol

\begin{quote} \rule{0pt}{1.5in}\begin{tabular}{rrr} \begin{rotate}{45}Column 1\end{rotate} \rule{.5cm}{0pt}& \begin{rotate}{45}Column 2\end{rotate} \rule{.5cm}{0pt}& \begin{rotate}{45}Column 3\end{rotate} \rule{.5cm}{0pt}\\ \hline 1& 2& 3\\ 4& 5& 6\\ 7& 8& 9\\ \hline \end{tabular} \end{quote}

NUMBER OF SITES IN BOUNDARY ZONE EXPECTED TOT OBS FROM TO 41 31 10.3 27.0 23 16 4.3 16.7 18 15 2.8 13.7 13 9 1.2 10.4 10 7 0.6 8.8 10 8 0.4 8.6 8 7 0.0 7.3

ACCEPT or REJECT NULL HYPOTH REJECT ACCEPT REJECT ACCEPT ACCEPT ACCEPT ACCEPT

\begin{sideways} \begin{tabular}{|l|c|c|c|c|c|p{1in}|} \hline &&\multicolumn{4}{c}{NUMBER OF SITES}\vline &ACCEPT or\\ \cline{3-6} &STUDY AREA&&\multicolumn{3}{c}{% IN BOUNDARY ZONE}\vline&REJECT\\ \cline{4-6}&&&&\multicolumn{2}{c}{EXPECTED} \vline&NULL\\ \cline{5-6}&&TOT&OBS&FROM&TO&HYPOTH\\ \cline{2-7} &FULL SAMPLE&41&31&10.3&27.0&REJECT\\ &SAMPLE AREA 1&23&16&4.3&16.7&ACCEPT\\ &SAMPLE AREA 2&18&15&2.8&13.7&REJECT\\ &RUSHEN&13&9&1.2&10.4&ACCEPT\\ &ARBORY&10&7&0.6&8.8&ACCEPT\\ &MAROWN&10&8&0.4&8.6&ACCEPT\\ \rule{0.5cm}{0pt} \begin{rotate}{90}PRIMARY UNITS% \end{rotate}\rule{0.5cm}{0pt} &SANTON&8&7&0.0&7.3&ACCEPT\\ \hline \end{tabular} \end{sideways}

If you are interested in setting rotated material in tables or gures, this presents no problem. Figure 3 shows how PostScript les which are being incorporated using epsg can be rotated at will, while Figure 4 shows, in contrast, how epsg itself handles rotation. It is also possible to rotate the whole of the gure environment, including caption, by using the sidewaysgure ands sidewaystable environments in place of gure and table. Sideways gures and tables always take up the whole page. They can be rotated so that the bottom ot the gures is on the left or the right; the default is to always turn to the right. If the twoside option has been given to the main document class, this package then starts rotating sideways gures according A to the page number (this requires two passes through L TEX at least). If you want the twoside option, but want the gures always in one direction, use the guresright or riguresleft options to rotating. The code used to produce gures 19 is as follows: 7

FULL SAMPLE SAMPLE AREA 1 SAMPLE AREA 2 RUSHEN ARBORY MAROWN SANTON PRIMARY UNITS

STUDY AREA

Figure 1 \begin{sidewaystable}
\centering \caption{This is a narrow table, which should be centred vertically on the final page.\label{rotfloat1}} \begin{tabular}{|ll|} \hline a & b \\ c & d \\ e & f \\ g & h \\ i & j \\ \hline \end{tabular} \end{sidewaystable}

Figure 2

\begin{sidewaystable} \centering \begin{tabular}{|llllllllp{1in}lp{1in}|} \hline Context &Length &Breadth/ &Depth &Profile & &Diameter & & & Bones&&&\\ \hline &&&&&&&&&&\\ \multicolumn{10}{|l}{\bf Grooved Ware}&\\ 784 &--&0.9m &0.18m &Sloping 785 &--&1.00m &0.12 &Sloping 962 &--&1.37m &0.20m &Sloping 983 &0.83m &0.73m &0.25m &Stepped &&&&&&&&&&\\ \multicolumn{10}{|l}{\bf Beaker}&\\ 552 &--&0.68m &0.12m &Saucer 790 &--&0.60m &0.25m &U 794 &2.89m &0.75m &0.25m &Irreg. \hline \end{tabular}

&Pottery &

&Flint &

&Animal

&Stone

&Other

&C14 Dates \\

U U U U

&P1 &P2--4 &P5--6 &---

&$\times$46 &$\times$23 &$\times$48 &$\times$18

& & & &

$\times$8 $\times$21 $\times$57* $\times$8

&& $\times$2 bo & Hammerstone &---&-& ---& ---&1990 $ & ---& Fired clay&---

&P7--14 &P15 &P16

&--&$\times$12 &$\times$3

& --& --& ---

& --&--& Quartzite-lump&--& --&---

& & &

\caption[Grooved Ware and Beaker Features, their Finds and Radiocarbon Dates]{Grooved Ware and Beaker Features, their Finds and Radiocarbon Dates; For a breakdown of the Pottery Assemblages see Tables I and III; for the Flints see Tables II and IV; for the Animal Bones see Table V.}\label{rotfloat2} \end{sidewaystable}

Figure 3 \begin{table}
\centering \rotcaption{Minimum number of individuals; effect of rotating table and caption separately}\label{rotfloat3}% \begin{sideways} \begin{tabular}[b]{cccccccccp{1cm}} \hline Phase&Total&Cattle&Sheep&Pig&Red Deer&Horse&Dog&Goat&Other\\ \hline &1121&54&12&32&1&1&1&1&1 polecat\\ 3&8255&58&6&35&1&1&1&1&1 roe deer, 1 hare, 1 cat, 1 otter\\ 4&543&45&6&45&4&1&1&---&---\\ \hline

---\begin{turn}{156} \epsfig{figure=cat.eps,width=1in} \end{turn}-----\begin{sideways} \epsfig{figure=cat.eps,width=1in} \end{sideways}---

---\epsfig{figure=cat.eps,width=1in}---

Figure 3: A normal, and sideways, pictures within a gure


\epsfig{figure=cat.eps,width=1in,% angle=-56}

Figure 4: Figures rotated with epsg


&9919&157&24&112&6&3&3&2&5\\ \hline \end{tabular} \end{sideways} \end{table}

Figure 9 \begin{sidewaysfigure}
\centerline{\epsfig{figure=cat.eps,width=.8\textheight,height=.4\textwidth}} \caption{A pathetically squashed rotated pussycat}\label{rotfloat4} \end{sidewaysfigure}

Table 1: This is a narrow table, which should be centred vertically on the nal page. a b c d e f g h i j

10

Context

Length

Breadth/ Diameter

Depth

Prole

Pottery

Flint

Animal Bones

Stone

Other

C14 Dates

Grooved 784 785 962 0.9m 1.00m 1.37m Hammerstone 0.18m 0.12 0.20m Sloping U Sloping U Sloping U P1 P24 P56 46 23 48 8 21 57*

Ware

2 bone

11 0.73m 0.25m Stepped U 18 8 Fired clay 0.68m 0.60m 0.75m 0.12m 0.25m 0.25m Saucer U Irreg. P714 P15 P16 12 3 Quartzite-lump

983

0.83m

2150 100 BC 1990 80 BC (Layer 4) 1870 90 BC (Layer 1)

Beaker 552 790 794

2.89m

Table 2: Grooved Ware and Beaker Features, their Finds and Radiocarbon Dates; For a breakdown of the Pottery Assemblages see Tables I and III; for the Flints see Tables II and IV; for the Animal Bones see Table V.

Table 3: Minimum number of individuals; eect of rotating table and caption separately Phase Total 1121 Cattle 54 Sheep 12 Pig 32 Red Deer 1 Horse 1 Dog 1 Goat 1

8255

58

35

12

543 9919

45 157

6 24

45 112

4 6

1 3

1 3

Other 1 polecat 1 roe deer, 1 hare, 1 cat, 1 otter 5

Figure 5: A pathetically squashed rotated pussycat (1)

13

14

Figure 6: A pathetically squashed rotated pussycat (2)

Figure 7: A pathetically squashed rotated pussycat (3)

15

16

Figure 8: A pathetically squashed rotated pussycat (4)

Figure 9: A pathetically squashed rotated pussycat

17

You might also like