Debian Codegraph @

texmf-dist/doc/latex/flowfram/samples/sample-news2.tex

raw
1 % This file is public domain.
2
3 \documentclass[12pt]{article}
4
5 \usepackage{graphicx}
6 \usepackage{color}
7 \usepackage{flowfram}
8 \usepackage[a4paper,margin=20mm]{geometry}
9
10 % define lengths to help compute positions
11 \newlength\leftX
12 \newlength\leftY
13 \newlength\leftH
14 \newlength\leftW
15
16 \newlength\rightX
17 \newlength\rightY
18 \newlength\rightH
19 \newlength\rightW
20
21 % Create a static frame to put title in
22 \setlength{\leftH}{3cm}
23 \setlength{\leftY}{\textheight}
24 \addtolength{\leftY}{-\leftH}
25
26 \newstaticframe[1]{\textwidth}{\leftH}{0pt}{\leftY}[title]
27
28 % Create left hand frame. This will have an L shape
29
30 \setlength{\leftH}{13cm}
31 \adjustheight{\leftH}
32 \addtolength{\leftY}{-\leftH}
33
34 \newstaticframe[1]{\textwidth}{\leftH}{0pt}{\leftY}[L]
35 \setstaticframe*{L}{shape={\parshape=24
36 0pt 0.5\linewidth
37 0pt 0.5\linewidth
38 0pt 0.5\linewidth
39 0pt 0.5\linewidth
40 0pt 0.5\linewidth
41 0pt 0.5\linewidth
42 0pt 0.5\linewidth
43 0pt 0.5\linewidth
44 0pt 0.5\linewidth
45 0pt 0.5\linewidth
46 0pt 0.5\linewidth
47 0pt 0.5\linewidth
48 0pt 0.5\linewidth
49 0pt 0.5\linewidth
50 0pt 0.5\linewidth
51 0pt 0.5\linewidth
52 0pt 0.5\linewidth
53 0pt \linewidth
54 0pt \linewidth
55 0pt \linewidth
56 0pt \linewidth
57 0pt \linewidth
58 0pt \linewidth
59 0pt \linewidth
60 }}
61
62 % egg picture
63
64 \addtolength{\rightY}{\leftY}
65 \addtolength{\rightY}{73mm}
66 \setlength{\rightW}{0.9in}
67 \setlength{\rightH}{1.5in}
68 \setlength{\rightX}{\textwidth}
69 \addtolength{\rightX}{-\rightW}
70 \newstaticframe[1]{\rightW}{\rightH}{\rightX}{\rightY}[egg]
71
72 % set contents
73 \setstaticcontents*{egg}{\includegraphics[scale=0.9]{egg}}
74
75 % Right hand static frame
76
77 \setlength{\rightX}{0.5\textwidth}
78 \addtolength{\rightX}{\columnsep}
79 \setlength{\rightW}{\textwidth}
80 \addtolength{\rightW}{-\rightX}
81 \setlength{\rightY}{\leftY}
82 \addtolength{\rightY}{2.8cm}
83 \setlength{\rightH}{\leftH}
84 \addtolength{\rightH}{-2.8cm}
85
86 \newstaticframe[1]{\rightW}{\rightH}{\rightX}{\rightY}[right]
87
88 \setstaticframe*{right}{shape={\parshape=16
89 0pt \linewidth
90 0pt \linewidth
91 0pt \linewidth
92 0pt \linewidth
93 0pt 0.75\linewidth
94 0pt 0.75\linewidth
95 0pt 0.65\linewidth
96 0pt 0.8\linewidth
97 0pt 0.8\linewidth
98 0pt \linewidth
99 0pt \linewidth
100 0pt \linewidth
101 0pt \linewidth
102 0pt \linewidth
103 0pt \linewidth
104 0pt \linewidth
105 }}
106
107 % insert vertical and horizontal rules, can't use
108 % \insertrule as left hand
109 % frame is actually the width of the typeblock
110 \addtolength{\rightX}{-0.5\columnsep}
111 \newstaticframe[1]{0pt}{\rightH}{\rightX}{\rightY}[Lrule]
112 \setstaticcontents*{Lrule}{\makebox[0pt][l]{%
113 \rule{\columnseprule}{\rightH}\rule{\rightW}{\columnseprule}}}
114
115 % middle heading
116
117 \setlength{\leftH}{2cm}
118 \addtolength{\leftY}{-\leftH}
119
120 \newstaticframe[1]{\textwidth}{\leftH}{0pt}{\leftY}[midhead]
121
122 % insert horizontal rule
123 \inserthrule*{static}{L}{static}{midhead}
124
125 % flow frames
126 \twocolumninarea{\textwidth}{\leftY}{0pt}{0pt}
127
128 % static frame for sheep picture
129
130 \newstaticframe[1]{1.6in}{1.6in}{0pt}{0pt}[sheep]
131
132 % set contents
133 \setstaticcontents*{sheep}{\includegraphics[scale=1.2]{sheep}}
134
135 \setcounter{secnumdepth}{0}
136 \setlength{\sdfparindent}{\parindent}
137
138 \begin{document}
139 \begin{staticcontents*}{title}
140 \begin{center}
141 \bfseries\Huge
142 Fairy Tale Times
143 \end{center}
144 \hfill Issue 2. 7 December 2005.
145 \end{staticcontents*}
146
147 \begin{staticcontents*}{L}
148 \section{Killer Wolf on the Loose}
149
150 The authorites are warning of a killer wolf on the
151 loose. He has so far devoured an old grandmother and
152 two pig brothers. He is described as being furry with
153 big eyes and big teeth.
154
155 On Monday this week he broke into a house, and devoured
156 an old lady. He then disguised himself as the old lady
157 in order to deceive her granddaughter. Luckily for the little
158 girl a woodsman arrived in time to rescue her. Parents are
159 being cautioned not to let their children wander about on
160 their own, and to remind them not to talk to strangers.
161
162 The next day the wolf struck again, this time targeting two
163 pig brothers who had most incautiously made their dwellings
164 on the cheap using inadequate materials. The wolf also made
165 an attempt on the third pig brother, but was unable to break
166 into his house.
167
168 Police are appealing to the public for witnesses and remind
169 people to keep their doors securely fastened at all times.
170 ``Always ask to see identification,'' said one police advisor,
171 ``and invest in improving the general security of your property.''
172 \end{staticcontents*}
173
174 \begin{staticcontents*}{right}
175 \section{Tragic Wall Accident}
176
177 An egg person tragically fell from a six foot wall yesterday
178 afternoon and was smash\-ed to pieces. The king's cavalry rushed
179 to the scene, but regretted that they were unable to help him.
180
181 Humpty Dumpty was believed to be sitting on the wall when he fell. Police have ruled out foul play, but
182 are advising people not to play on high walls, particularly
183 those vulnerable members of the population suffering from
184 eggshell syndrome.
185
186 \small\em
187 %Wall related incidents this year: page 3
188 %
189 Exclusive interview with one of the King's men on page 6
190 \end{staticcontents*}
191
192 \begin{staticcontents*}{midhead}
193 \section{Relief as Missing Sheep Finally Return Home}
194 \end{staticcontents*}
195
196 There was much celebration yesterday morning when Little Bo
197 Peep's sheep finally returned home. They had been missing
198 for more than a week.
199
200 ``I just didn't know where to find them,'' the shepherdess
201 stated, ``but I was told to leave them alone and they'd come
202 home.''
203
204 \parshape=8
205 0pt \linewidth
206 0pt \linewidth
207 0.3\linewidth 0.7\linewidth
208 0.3\linewidth 0.7\linewidth
209 0.25\linewidth 0.75\linewidth
210 0.25\linewidth 0.75\linewidth
211 0pt \linewidth
212 0pt \linewidth
213 Unusual advice perhaps, but it seems to have worked
214 as they did indeed come home. Eye witnesses reported that their
215 tails were wagging behind them.
216 ``I'm just so happy they've come home,'' Little Bo Peep said
217 in a press conference yesterday afternoon.
218 The sheep themselves made no comment, and police are%
219 \framebreak\parshape=0
220 still trying to determine what happened to them.
221 The big bad wolf is reportedly helping them with their inquiries.
222
223 \noindent\hrulefill
224
225 This is a sample document illustrating the
226 flowfram package. It uses \TeX's \verb|\parshape| command
227 to create irregularly shaped paragraphs. This can be a complicated
228 and somewhat tiresome task, and is generally not recommended.
229 Using the shapepar package provides you with more intricate
230 shapes, but as its documentation says, it is not intended
231 for use in large documents.
232
233 \hfill Nicola Talbot
234 \end{document}