Debian Codegraph @

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

raw
1 % This file is public domain.
2
3 % arara: pdflatex
4 % arara: pdflatex
5 \documentclass[a4paper]{report}
6
7 \usepackage[landscape,margin=1in]{geometry}
8 \usepackage{color}
9 \usepackage{flowfram}
10 \usepackage[colorlinks]{hyperref}
11
12 % Use sans-serif font as default font
13 \renewcommand{\familydefault}{cmss}
14
15 % adjust \textheight so that it is an integer multiple of
16 % \baselineskip
17 \adjustheight{\textheight}
18
19 % set up pagelayout. One column for title page
20 % two columns for the rest.
21 \onecolumninarea[1,2]{0.6\textwidth}{\textheight}{0.4\textwidth}{0pt}
22 \twocolumninarea[>2]{0.6\textwidth}{\textheight}{0.4\textwidth}{0pt}
23
24 % Set up dynamic frame on the left. This is where
25 % the headings will go.
26
27 \newdynamicframe{0.4\textwidth}{\textheight}{0pt}{0pt}[left]
28
29 % put the chapter headings in this frame
30 \dfchaphead*{left}
31 % Modify the default style
32 \renewcommand{\DFchapterstyle}[1]{%
33 \raggedright\Huge\slshape\MakeUppercase{#1}\par}
34
35 % Make static frames for background (only for page 1)
36 \vtwotone[1]{0.6\paperwidth}{[cmyk]{0.65,0.13,0,0}}{backleft}%
37 {0.4\paperwidth}{[cmyk]{0.94,0.54,0,0}}{backright}
38
39 % Make a border along the top of each page
40 \vtwotonetop{1cm}{0.6\paperwidth}{[cmyk]{0.65,0.13,0,0}}{topleft}%
41 {0.4\paperwidth}{[cmyk]{0.94,0.54,0,0}}{topright}
42
43 % make a static frame for the logo
44 \newstaticframe{0.2\textwidth}{0.25\textheight}{0pt}{0pt}[logo]
45
46 % empty page style, because I am going to make my own
47 \pagestyle{empty}
48
49 % Each new chapter sets \thispagestyle{\chapterfirstpagestyle}, change this empty as well
50 \renewcommand{\chapterfirstpagestyle}{empty}
51
52 % Now make a frame in which to put my own customized footer
53 \newdynamicframe[>1]{\textwidth}{\headheight}{0pt}{-\footskip}[footer]
54
55 % set the contents of the frame:
56 \setdynamiccontents*{footer}{%
57 School of Computing Sciences, University of East Anglia\hfill
58 http://www.cmp.uea.ac.uk/\hfill
59 page \thepage\ of \pageref*{lastpage}}
60
61
62 \providecommand{\env}[1]{\texttt{#1}}
63 \providecommand{\cmdname}[1]{\texttt{\symbol{92}#1}}
64 \providecommand{\meta}[1]{\textnormal{\textless\textit{#1}\textgreater}}
65
66 \begin{document}
67
68 % not a very interesting logo
69 \setstaticcontents*{logo}{\sffamily{\Huge\slshape FLF} Flowfram}
70
71 {\noindent
72 \slshape\Huge\MakeUppercase{A Sample Brochure}\par
73 \vskip0.5in
74 \noindent\large\MakeUppercase{Nicola Talbot}\\
75 }
76
77
78 \chapter{Introduction}
79
80 The \textsl{flowfram} package is designed to enable you to create
81 frames in a document such that the
82 contents of the \env{document} environment flow from one
83 frame to the next in the order that they were defined.
84 This is useful for creating posters
85 or magazines or any other form of document that does not
86 conform to the standard one or two column layout.
87
88 This is a modified version of the manual for the \textsl{flowfram} package.
89 It is intended to illustrated what can be done. See the full
90 manual (flowfram-manual.pdf) for
91 a comprehensive description, as some parts of this document
92 may now be out of date.
93 If the columns are very narrow, it may be better to
94 use \cmdname{raggedright}, otherwise \TeX\ may have a
95 problem working out the line breaks.
96
97 This is column~\thedisplayedframe.
98
99 The main type of frame is the flow frame. This is described on
100 column~\ref{flow:flowframe} on page~\pageref{flow:flowframe}.
101 The order used to draw the contents of each frame on the page
102 is described in column~\ref{flow:stacking} on
103 page~\pageref{flow:stacking}. Floats are describe in
104 column~\ref{flow:floats} on page~\pageref{flow:floats}.
105
106 \chapter{Setting up Frames}
107
108 This is column~\thedisplayedframe.
109
110 The \textsl{flowfram} package provides three types of frame:
111 {flow frames}, {static
112 frames} and {dynamic frames}.
113
114 \section*{Flow Frames}
115
116 \labelflow{flow:flowframe}
117 The flow frame is the principle type of frame.
118 The text of the \env{document} environment will flow from
119 one frame to the next in order of definition. Each
120 flow frame has an associated width, height,
121 position on the page, and optionally a border.
122
123 It is recommended that all the flow frames in a document
124 have the same width, otherwise problems may occur
125 when a paragraph spans to flow frames of unequal
126 widths. This is because \TeX's output routine does not
127 register the change in \cmdname{hsize} until it reaches
128 a paragraph break. If it is absolutely necessary for
129 flow frames to have unequal widths, judicious use of
130 \cmdname{framebreak} is required.
131
132 \section*{Static Frames}
133
134 A static frame is a rectangular area in which text neither
135 flows into, nor flows out of. The contents must be set
136 explicitly, and once set, the contents of the static frame will
137 remain the same on each page until it is explicitly
138 changed. Thus, a static frame can be used, for example, to make
139 a company logo appear in the same place on every page.
140
141 \section*{Dynamic Frames}
142
143 A dynamic frame is similar to a static frame, but its contents
144 are re-typeset on each page. (A static frame stores its
145 contents in a savebox, whereas a dynamic frame stores its
146 contents in a macro).
147
148 This is column~\thedisplayedframe.
149
150 \chapter{Frame Attributes}
151 \label{sec:modattr}
152
153 Once you have defined the {flow frames}, {static frames} and
154 {dynamic frames}, their attributes can be changed.
155 The three types of frame mostly have the
156 same set of attributes, but some are specific to a certain type.
157 The available attributes are as follows
158 (\textsuperscript{\textbf{F}} indicates the key is
159 only available for {flow frames},
160 \textsuperscript{\textbf{S}} indicates the key is only available
161 for {static frames}
162 and \textsuperscript{\textbf{D}} indicates the key
163 is only available for {dynamic frames}):
164
165 \begin{description}
166 \item[width=\meta{length}]\mbox{}\par The width of the frame.
167
168 \item[height=\meta{length}]\mbox{}\par The height of the frame.
169
170 \item[x=\meta{length}]\mbox{}\par The x-coordinate of the frame.
171
172 \item[y=\meta{length}]\mbox{}\par The y-coordinate of the frame.
173
174 \item[border=\meta{style}]\mbox{}\par The style of the border around the
175 frame, this can take the values: \texttt{none} (no border),
176 \texttt{plain} (plain border) or the name of a \LaTeX\
177 frame making command without the preceding backslash.
178 The value \texttt{fbox} is equivalent to \texttt{plain}.
179
180 \item[offset=\meta{offset}]\mbox{}\par The border offset, if it is a
181 user-defined border. This is the distance from the outer
182 edge of the left hand border to the left edge of the
183 bounding box of the text inside the border. The \textsl{flowfram}
184 package is able to compute the border for
185 known frame making commands.
186 If you define your own frame making command, you may need to
187 specify the offset explicitly, or the frames
188 may end up shifted to the right or left.
189
190 \item[bordercolor=\meta{colour}]\mbox{}\par The colour of the border
191 if you are using a standard frame making command.
192 The colour can either be specified as, e.g.\ \texttt{green},
193 or including the colour model, for example
194 \verb/[rgb]{0,1,0}/.
195
196 \item[textcolor=\meta{colour}]\mbox{}\par The text colour for that
197 frame. Again, the colour can either be specified as,
198 e.g.\ \texttt{green}, or including the colour model,
199 for example \verb/[rgb]{0,1,0}/.
200
201 \item[pages=\meta{page list}]\mbox{}\par The {list of
202 pages} for which the frame
203 should appear. This can either have the values: \texttt{all},
204 \texttt{even}, \texttt{odd} or \texttt{none} (the latter
205 removes the frame from that point on---useful if you
206 have multiple pages with the same number), or it can be a
207 comma-separated list of single pages, or
208 {page ranges}.
209
210 \item[margin=\meta{side}\textsuperscript{F}]\mbox{}\par The side of
211 the flow frame that its corresponding margin should go on. This
212 can take the values \texttt{left} or \texttt{right}.
213
214 \item[clear=\meta{boolean}\textsuperscript{S}] If this value
215 is set, the static frame will be cleared at the start of the
216 next page.
217
218 \item[style=\meta{cmd}\textsuperscript{D}]\mbox{}\par This should be
219 the name of a command \emph{without} the preceding backslash,
220 to be applied to the contents of the specified dynamic frame.
221 The command may either be a declaration, for example \verb/style=large/
222 which will set the contents of all the dynamic frames in a
223 large font, or it can be a command that takes a single argument,
224 for example \verb/style=textbf/
225 which will make the text for all the dynamic frames come out in
226 bold. To unset a style, do \verb/style=none/.
227
228 \end{description}
229
230 \chapter{Miscellaneous}
231
232 \section*{Page Layout}
233
234 The \textsl{flowfram} package has the package option \texttt{draft}
235 which will draw the {bounding boxes} for
236 each frame defined. At the bottom right of each
237 bounding box (except for the bounding box denoting the
238 typeblock), a marker will be shown to indictate the type
239 of frame, its IDN and its IDL.
240
241 You can see the layout for the current page (irrespective of
242 whether or not the \texttt{draft} option has been set) using
243 the command:\newline
244 \cmdname{flowframeshowlayout}
245
246 The headers and footers will appear as usual (but will not
247 be shown in draft mode), according to the format given by
248 \cmdname{pagestyle}.
249
250 \section*{Frame Stacking Order}
251
252 \labelflow{flow:stacking}
253 The material on each page is placed in the following order:
254 \begin{enumerate}
255 \item Each static frame defined for that page in ascending
256 order of IDN.
257
258 \item Each flow frame defined for that page in ascending
259 order of IDN.
260
261 \item Each dynamic frame defined for that page in ascending
262 order of IDN.
263
264 \item {Bounding boxes} if the \texttt{draft}
265 package option has been used.
266 \end{enumerate}
267
268 This ordering can be used to determine if you want something
269 to overlay or underlay everything else on the page.
270
271 \section*{Prematurely Ending a Flow Frame}
272
273 You can force text to move immediately to the next defined
274 flow frame using one of the standard \LaTeX\ page breaking commands
275 which work in an analogous way to the way they
276 work in standard two column mode.
277
278 The command \cmdname{framebreak} is provided for situations
279 where a paragraph spans two flow frames
280 of different widths, as \TeX's output routine does not
281 adjust to the new value of \cmdname{hsize} until the last
282 paragraph of the previous frame has ended. As a
283 result, the end of the paragraph at the beginning of the new
284 flow frame retains the width of the previous flow frame.
285
286 If you want to start a new page, rather than simply move to the
287 next frame, use the command\newline
288 \cmdname{finishthispage}.
289
290 \section*{Floats}
291
292 \labelflow{flow:floats}
293 Since floats (such as figures and tables) can only go in
294 {flow frames}, this package provides
295 the additional environments:
296 \env{staticfigure} and
297 \env{statictable} which can be used in static frames
298 and dynamic frames. Unlike their \env{figure} and
299 \env{table} counterparts, they are fixed in place, and
300 so do not take an optional placement specifier. The
301 \cmdname{caption} and \cmdname{label} commands can
302 be used within \env{staticfigure} and \env{statictable} as
303 usual.
304
305 The standard \env{figure} and \env{table} commands will
306 behave as usual in the flow frames, but their starred versions,
307 \env{figure*} and \env{table*} behave no differently
308 from \env{figure} and \env{table}.
309
310 \section*{Global Values}
311
312 The following macros can be changed using\linebreak \cmdname{renewcommand}:
313
314 \begin{itemize}
315 \item \cmdname{setffdraftcolor}
316
317 This sets the colour of the bounding box
318 when it is displayed in draft mode.
319
320 \item
321 \cmdname{setffdrafttypeblockcolor}
322
323 This sets the colour of
324 the bounding box of the typeblock when it is displayed
325 in draft mode.
326
327 \item \cmdname{fflabelfont}
328
329 This sets the font size for the bounding box markers in
330 draft mode.
331
332 \end{itemize}
333
334 The following are lengths, which can be changed using
335 \cmdname{setlength}:
336
337 \begin{itemize}
338 \item \cmdname{fflabelsep}
339
340 This is the distance from the right hand side of the
341 bounding box at which to place the bounding box marker.
342
343 \item \cmdname{flowframesep}
344
345 This is the gap between the text of the frame and
346 its border, for the standard border types.
347
348 \item \cmdname{flowframerule}
349
350 This is the width of the frame's border, if using
351 a border given by a frame making command that uses \cmdname{fboxsep}
352 to set its border width.
353
354 \item \cmdname{columnsep}
355
356 This is the horizontal distance between flow frames when using one of the
357 \cmdname{Ncolumn} type of commands
358
359 \item \cmdname{vcolumnsep}
360
361 This is the vertical distance between the flow frames and the static or
362 dynamic frame when using one of the \cmdname{Ncolumntop} type of commands.
363 \end{itemize}
364
365 \label{lastpage}
366 \end{document}