Debian Codegraph @

texmf-dist/doc/latex/rotpages/Examples/rotpages-fancy-ex.tex

raw
1 \documentclass[12pt,twoside]{article}
2 \usepackage[a4paper,headheight=4ex]{geometry}
3 \usepackage{times}
4 \usepackage{rotpages}
5 \usepackage{fancyhdr}
6
7 \title{\texttt{rotpages.sty} --- Multiple page rotation in \LaTeX\\
8 Example file}
9 \author{Sergio Callegari}
10 \date{January 1st, 2003}
11
12 \fancyhead[LE]{\emph{rotpages.sty}}
13 \fancyhead[RO]{Multiple page rotation in \LaTeX}
14 \fancyfoot{}
15 \fancyfoot[L]{{\footnotesize Example file for a fancy document.}}
16 \fancyfoot[R]{\thepage}
17
18
19 \begin{document}
20 \sloppy
21 \pagestyle{fancy}
22 \maketitle
23 \thispagestyle{fancy}
24
25 \newcounter{rotpg}
26 \setlength{\rotboxheight}{\vsize-9ex-1pt}
27 \setlength{\rotboxwidth}{\hsize-4ex-1pt}
28
29 \renewcommand{\rotboxAtRotationHook}[1]{%
30 \addtocounter{rotpg}{1}%
31 {\fboxsep 2ex%
32 \fbox{\parbox{\linewidth}{%
33 \scalebox{-1}{\footnotesize\textsc{Rotated page \therotpg}}\\
34 #1}}}}
35 \renewcommand{\rotboxAtShippingHook}[1]{%
36 \parbox{\linewidth}{%
37 \rule{\linewidth}{0.5pt}\\[-1ex]
38 \hspace*{0pt}\hfill CAPOVOLGERE IL TESTO PER LEGGERE CORRETTAMENTE QUESTA
39 PAGINA\hfill\hspace*{0pt}\\
40 #1\\
41 \hspace*{0pt}\hfill CAPOVOLGERE IL TESTO PER LEGGERE CORRETTAMENTE QUESTA
42 PAGINA\hfill\hspace*{0pt}\\[-2ex]%
43 \rule{\linewidth}{0.5pt}
44 }}
45
46 This is the first page of the document. In this document we take
47 advantage only of the more complex features of the \texttt{rotpages.sty}
48 package, i.e.\@ we only use the \emph{hook} commands to do some fancy
49 framing of the pages.
50
51
52 The first pages are typeset normally. To fill them a little, we include
53 the first part of \emph{Pinocchio} by Carlo Collodi.
54
55 \bigskip
56 {\slshape%
57 \textbf{CHAPTER 1}
58
59 \emph{How it happened that Mastro Cherry, carpenter,
60 found a piece of wood that wept and laughed like a child}
61 \medskip
62
63 Centuries ago there lived ---
64
65 "A king!" my little readers will say immediately.
66
67 No, children, you are mistaken. Once upon a time
68 there was a piece of wood. It was not an expensive piece
69 of wood. Far from it. Just a common block of firewood,
70 one of those thick, solid logs that are put on the fire in
71 winter to make cold rooms cozy and warm.
72
73 I do not know how this really happened, yet the fact
74 remains that one fine day this piece of wood found itself
75 in the shop of an old carpenter. His real name was
76 Mastro Antonio, but everyone called him Mastro Cherry,
77 for the tip of his nose was so round and red and shiny
78 that it looked like a ripe cherry.
79
80 As soon as he saw that piece of wood, Mastro Cherry
81 was filled with joy. Rubbing his hands together happily,
82 he mumbled half to himself:
83
84 "This has come in the nick of time. I shall use it to
85 make the leg of a table."
86
87 He grasped the hatchet quickly to peel off the bark and
88 shape the wood. But as he was about to give it the first
89 blow, he stood still with arm uplifted, for he had heard a
90 wee, little voice say in a beseeching tone: "Please be careful!
91 Do not hit me so hard!"
92
93 What a look of surprise shone on Mastro Cherry's
94 face! His funny face became still funnier.
95
96 He turned frightened eyes about the room to find out
97 where that wee, little voice had come from and he saw
98 no one! He looked under the bench--no one! He peeped
99 inside the closet--no one! He searched among the shavings--
100 no one! He opened the door to look up and down
101 the street--and still no one!
102
103 "Oh, I see!" he then said, laughing and scratching his Wig.
104 "It can easily be seen that I only thought I heard the tiny
105 voice say the words! Well, well--to work once more."
106
107 He struck a most solemn blow upon the piece of wood.
108
109 "Oh, oh! You hurt!" cried the same far-away little voice.
110
111 Mastro Cherry grew dumb, his eyes popped out of his
112 head, his mouth opened wide, and his tongue hung down
113 on his chin.
114
115 As soon as he regained the use of his senses, he said,
116 trembling and stuttering from fright:
117
118 "Where did that voice come from, when there is no
119 one around? Might it be that this piece of wood has
120 learned to weep and cry like a child? I can hardly
121 believe it. Here it is--a piece of common firewood, good
122 only to burn in the stove, the same as any other. Yet--
123 might someone be hidden in it? If so, the worse for him.
124 I'll fix him!"
125
126 With these words, he grabbed the log with both hands
127 and started to knock it about unmercifully. He threw it
128 to the floor, against the walls of the room, and even up
129 to the ceiling.
130
131 He listened for the tiny voice to moan and cry.
132 He waited two minutes--nothing; five minutes--nothing;
133 ten minutes--nothing.
134
135 "Oh, I see," he said, trying bravely to laugh and
136 ruffling up his wig with his hand. "It can easily be seen
137 I only imagined I heard the tiny voice! Well, well--to
138 work once more!"
139
140 The poor fellow was scared half to death, so he tried
141 to sing a gay song in order to gain courage.
142
143 He set aside the hatchet and picked up the plane to
144 make the wood smooth and even, but as he drew it to
145 and fro, he heard the same tiny voice. This time it giggled
146 as it spoke:
147
148 "Stop it! Oh, stop it! Ha, ha, ha! You tickle my stomach."
149
150 This time poor Mastro Cherry fell as if shot. When
151 he opened his eyes, he found himself sitting on the floor.
152
153 His face had changed; fright had turned even the tip of
154 his nose from red to deepest purple.
155
156 }
157 \bigskip
158 Note that the next pages are upside down.
159
160 \rotboxpages%
161 Here come the rotated pages. Note that while formatting the
162 document, this page is \emph{deferred}, until all the block of rotated
163 pages is processed. In this way, this page is printed as the last one
164 of the block. However, if the printed work is read upside down, this
165 page correctly appears as the first of the block.
166
167 Obviously, also this page contains the continuation of the novel:
168
169 \bigskip
170 {\slshape%
171
172 \textbf{CHAPTER 2}
173
174 \emph{Mastro Cherry gives the piece of wood to his friend Geppetto,
175 who takes it to make himself a Marionette that will dance,
176 fence, and turn somersaults}
177 \medskip
178
179 In that very instant, a loud knock sounded on the door.
180 "Come in," said the carpenter, not having an atom of
181 strength left with which to stand up.
182
183 At the words, the door opened and a dapper little old man came in.
184 His name was Geppetto, but to the boys of the neighborhood he was
185 Polendina\footnote{Corneal mush}, on account of the wig he always
186 wore which was just the color of yellow corn.
187
188 }
189
190 \bigbreak
191
192 Here we make a small break in the story. Please, take a second to
193 observe how the page content is rotated, while the page headers and
194 footers, comprising the page number, are printed with the standard
195 orientation. Take also a quick look at the footnote and observe that
196 it is in the right place.
197
198 Note also that in order to introduce a frame, the rotated pages are
199 slightly smaller (i.e.\@ they contain a little less text than the
200 normal ones.)
201
202 After this informative bit, it is time for some more Pinocchio:
203
204 \bigskip
205 {\slshape%
206 Geppetto had a very bad temper. Woe to the one who
207 called him Polendina! He became as wild as a beast and
208 no one could soothe him.
209
210 "Good day, Mastro Antonio," said Geppetto. "What
211 are you doing on the floor?"
212
213 "I am teaching the ants their A B C's."
214
215 "Good luck to you!"
216
217 "What brought you here, friend Geppetto?"
218
219 "My legs. And it may flatter you to know, Mastro
220 Antonio, that I have come to you to beg for a favor."
221
222 "Here I am, at your service," answered the carpenter,
223 raising himself on to his knees.
224
225 "This morning a fine idea came to me."
226
227 "Let's hear it."
228
229 "I thought of making myself a beautiful wooden
230 Marionette. It must be wonderful, one that will be able to
231 dance, fence, and turn somersaults. With it I intend to go
232 around the world, to earn my crust of bread and cup of
233 wine. What do you think of it?"
234
235 "Bravo, Polendina!" cried the same tiny voice which
236 came from no one knew where.
237
238 On hearing himself called Polendina, Mastro Geppetto
239 turned the color of a red pepper and, facing the carpenter,
240 said to him angrily:
241
242 "Why do you insult me?"
243
244 "Who is insulting you?"
245
246 "You called me Polendina."
247
248 "I did not."
249
250 "I suppose you think \_I\_ did! Yet I KNOW it was you."
251
252 "No!"
253
254 "Yes!"
255
256 "No!"
257
258 "Yes!"
259
260 And growing angrier each moment, they went from
261 words to blows, and finally began to scratch and bite and
262 slap each other.
263
264 When the fight was over, Mastro Antonio had Geppetto's
265 yellow wig in his hands and Geppetto found the carpenter's
266 curly wig in his mouth.
267
268 "Give me back my wig!" shouted Mastro Antonio in a surly voice.
269
270 "You return mine and we'll be friends."
271
272 The two little old men, each with his own wig back on
273 his own head, shook hands and swore to be good friends
274 for the rest of their lives.
275
276 "Well then, Mastro Geppetto," said the carpenter, to
277 show he bore him no ill will, "what is it you want?"
278
279 "I want a piece of wood to make a Marionette. Will you give it to
280 me?"
281
282 Mastro Antonio, very glad indeed, went immediately
283 to his bench to get the piece of wood which had frightened
284 him so much. But as he was about to give it to his friend,
285 with a violent jerk it slipped out of his hands and hit
286 against poor Geppetto's thin legs.
287
288 "Ah! Is this the gentle way, Mastro Antonio, in which
289 you make your gifts? You have made me almost lame!"
290
291 "I swear to you I did not do it!"
292
293 "It was \_I\_, of course!"
294
295 "It's the fault of this piece of wood."
296
297 "You're right; but remember you were the one to throw it at my legs."
298
299 "I did not throw it!"
300
301 "Liar!"
302
303 "Geppetto, do not insult me or I shall call you Polendina."
304
305 "Idiot."
306
307 "Polendina!"
308
309 "Donkey!"
310
311 "Polendina!"
312
313 "Ugly monkey!"
314
315 "Polendina!"
316
317 On hearing himself called Polendina for the third time,
318 Geppetto lost his head with rage and threw himself upon
319 the carpenter. Then and there they gave each other a
320 sound thrashing.
321
322 After this fight, Mastro Antonio had two more scratches
323 on his nose, and Geppetto had two buttons missing from
324 his coat. Thus having settled their accounts, they shook
325 hands and swore to be good friends for the rest of their lives.
326
327 Then Geppetto took the fine piece of wood,
328 thanked Mastro Antonio, and limped away toward home.
329 }
330 \endrotboxpages
331
332 And the normal behaviur of \LaTeX is back!
333 Exiting isn't it? So don't forget to tell your friends about this new
334 package!
335 \end{document}
336
337 %%% Local Variables:
338 %%% mode: latex
339 %%% TeX-master: t
340 %%% End: