Debian Codegraph @

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

raw
1 % This file is public domain.
2
3 \documentclass[a4paper]{article}
4
5 \usepackage[margin=1in,top=1in,bottom=1in]{geometry}
6 \usepackage{url}
7 \usepackage{graphicx}
8 \usepackage%[draft]
9 {flowfram}%[=v1.18]
10
11 \newcommand{\sty}[1]{\textsf{#1}}
12 \newcommand{\env}[1]{\textsf{#1}}
13 \newcommand{\cmdname}[1]{\texttt{\symbol{92}#1}}
14 \newcommand{\meta}[1]{\textnormal{\textless\textit{#1}\textgreater}}
15
16 % set up the document frames
17
18 % frames for page 1
19 \twocolumnStop[1]{2in}
20 \setstaticframe{1}{label=title}
21
22 % frames for subsequent pages
23 \twocolumn[>1]
24
25 \begin{document}
26 \begin{staticcontents*}{title}
27 \title{Creating Flow Frames for Posters or Magazines}
28 \author{Nicola L. C. Talbot\\[1cm]\url{http://www.dickimaw-books.com/}}
29 \date{}
30 \maketitle
31 \end{staticcontents*}
32
33 This document is a sample document, see \linebreak
34 \texttt{flowfram-manual.pdf} for
35 an up-to-date guide on how to use the \sty{flowfram} package.
36
37 \section{Introduction}
38
39 The \sty{flowfram} package is designed to enable you to create
40 frames in a document such that the
41 contents of the \env{document} environment flow from one
42 frame to the next in the order that they were defined.
43 This is useful for creating posters\marginpar{A marginal note}
44 or magazines or any other form of document that does not
45 conform to the standard one or two column layout.
46
47 \subsection{Setting up Frames}
48
49 The \sty{flowfram} package provides three types of frame:
50 {flow frames}, {static
51 frames} and {dynamic frames}.
52
53 \subsubsection{Flow Frames}
54
55 The flow frame is the principle type of frame.
56 The text of the \env{document} environment will flow from
57 one frame to the next in order of definition. Each
58 flow frame has an associated width, height,
59 position on the page, and optionally a border\footnote{A
60 footnote!}.
61
62 \subsubsection{Static Frames}
63
64 A static frame is a rectangular area in which text neither
65 flows into, nor flows out of. The contents must be set
66 explicitly, and once set, the contents of the static frame will
67 remain the same on each page until it is explicitly
68 changed. Thus, a static frame can be used, for example, to make
69 a company logo appear in the same place on every page.
70
71 \subsubsection{Dynamic Frames}
72
73 A dynamic frame is similar to a static frame, but its contents
74 are re-typeset on each page. (A static frame stores its
75 contents in a savebox, whereas a dynamic frame stores its
76 contents in a macro).
77
78 \section{Frame Attributes}
79 \label{sec:modattr}
80
81 Once you have defined the {flow frames}, {static frames} and
82 {dynamic frames}, their attributes can be changed.
83 The three types of frame mostly have the
84 same set of attributes, but some are specific to a certain type.
85 The available attributes are as follows
86 (\textsuperscript{\textbf{F}} indicates the key is
87 only available for {flow frames},
88 \textsuperscript{\textbf{S}} indicates the key is only available
89 for {static frames}
90 and \textsuperscript{\textbf{D}} indicates the key
91 is only available for {dynamic frames}):
92
93 \begin{description}
94 \item[width=\meta{length}] The width of the frame.
95
96 \item[height=\meta{length}] The height of the frame.
97
98 \item[x=\meta{length}] The x-coordinate of the frame.
99
100 \item[y=\meta{length}] The y-coordinate of the frame.
101
102 \item[border=\meta{style}] The style of the border around the
103 frame, this can take the values: \texttt{none} (no border),
104 \texttt{plain} (plain border) or the name of a \LaTeX\
105 frame making command without the preceding backslash.
106 The value \texttt{fbox} is equivalent to \texttt{plain}.
107
108 \item[offset=\meta{offset}] The border offset, if it is a
109 user-defined border. This is the distance from the outer
110 edge of the left hand border to the left edge of the
111 bounding box of the text inside the border. The \sty{flowfram}
112 package is able to compute the border for
113 known frame making commands.
114 If you define your own frame making command, you may need to
115 specify the offset explicitly, or the frames
116 may end up shifted to the right or left.
117
118 \item[bordercolor=\meta{colour}] The colour of the border
119 if you are using a standard frame making command.
120 The colour can either be specified as, e.g.\ \texttt{green},
121 or including the colour model, e.g. \verb/[rgb]{0,1,0}/.
122
123 \item[textcolor=\meta{colour}] The text colour for that
124 frame. Again, the colour can either be specified as,
125 e.g.\ \texttt{green}, or including the colour model,
126 e.g. \verb/[rgb]{0,1,0}/.
127
128 \item[pages=\meta{page list}] The {list of
129 pages} for which the frame
130 should appear. This can either have the values: \texttt{all},
131 \texttt{even}, \texttt{odd} or \texttt{none} (the latter
132 removes the frame from that point on---useful if you
133 have multiple pages with the same number), or it can be a
134 comma-separated list of single pages, or
135 {page ranges}.
136
137 \item[margin=\meta{side}\textsuperscript{F}] The side of
138 the flow frame that its corresponding margin should go on. This
139 can take the values \texttt{left} or \texttt{right}.
140
141 \item[clear=\meta{boolean}\textsuperscript{S}] If this value
142 is set, the static frame will be cleared at the start of the
143 next page.
144
145 \item[style=\meta{cmd}\textsuperscript{D}] This should be
146 the name of a command \emph{without} the preceding backslash,
147 to be applied to the contents of the specified dynamic frame.
148 The command may either be a declaration, for example \verb/style=large/
149 which will set the contents of all the dynamic frames in a
150 large font, or it can be a command that takes a single argument,
151 for example \verb/style=textbf/
152 which will make the text for all the dynamic frames come out in
153 bold. To unset a style, do \verb/style=none/.
154
155 \end{description}
156
157 \section{Miscellaneous}
158
159 \subsection{Page Layout}
160
161 The \sty{flowfram} package has the package option \texttt{draft}
162 which will draw the {bounding boxes} for
163 each frame defined. At the bottom right of each
164 bounding box (except for the bounding box denoting the
165 typeblock), a marker will be shown to indictate the type
166 of frame, its IDN and its IDL.
167
168 You can see the layout for the current page (irrespective of
169 whether or not the \texttt{draft} option has been set) using
170 the command:\newline
171 \cmdname{flowframeshowlayout}
172
173 The headers and footers will appear as usual (but will not
174 be shown in draft mode), according to the format given by
175 \cmdname{pagestyle}.
176
177 \subsection{Frame Stacking Order}
178
179 The material on each page is placed in the following order:
180 \begin{enumerate}
181 \item Each static frame defined for that page in ascending
182 order of IDN.
183
184 \item Each flow frame defined for that page in ascending
185 order of IDN.
186
187 \item Each dynamic frame defined for that page in ascending
188 order of IDN.
189
190 \item {Bounding boxes} if the \texttt{draft}
191 package option has been used.
192 \end{enumerate}
193
194 This ordering can be used to determine if you want something
195 to overlay or underlay everything else on the page.
196
197 \subsection{Prematurely Ending a Flow Frame}
198
199 You can force text to move immediately to the next defined
200 flow frame using one of the standard \LaTeX\ page breaking commands
201 which work in an analogous way to the way they
202 work in standard two column mode.
203
204 The command \cmdname{framebreak} is provided for situations
205 where a paragraph spans two flow frames
206 of different widths, as \TeX's output routine does not
207 adjust to the new value of \cmdname{hsize} until the last
208 paragraph of the previous frame has ended. As a
209 result, the end of the paragraph at the beginning of the new
210 flow frame retains the width of the previous flow frame.
211
212 If you want to start a new page, rather than simply move to the
213 next frame, use the command\newline
214 \cmdname{finishthispage}.
215
216 \subsection{Floats}
217
218 Since floats (such as figures and tables) can only go in
219 {flow frames}, this package provides
220 the additional environments:
221 \env{staticfigure} and
222 \env{statictable} which can be used in static frames
223 and dynamic frames. Unlike their \env{figure} and
224 \env{table} counterparts, they are fixed in place, and
225 so do not take an optional placement specifier. The
226 \cmdname{caption} and \cmdname{label} commands can
227 be used within \env{staticfigure} and \env{statictable} as
228 usual.
229
230 The standard \env{figure} and \env{table} commands will
231 behave as usual in the flow frames, but their starred versions,
232 \env{figure*} and \env{table*} behave no differently
233 from \env{figure} and \env{table}.
234
235 \begin{figure}
236 \centering
237 \includegraphics[width=\linewidth]{example-image}
238 \caption{An Unstarred Figure}
239 \end{figure}
240
241 \begin{figure*}
242 \centering
243 \includegraphics[width=\linewidth]{example-image}
244 \caption{A Starred Figure}
245 \end{figure*}
246
247 \subsection{Global Values}
248
249 The following macros can be changed using \cmdname{renewcommand}:
250
251 \begin{itemize}
252 \item \cmdname{setffdraftcolor}
253
254 This sets the colour of the bounding box
255 when it is displayed in draft mode.
256
257 \item
258 \cmdname{setffdrafttypeblockcolor}
259
260 This sets the colour of
261 the bounding box of the typeblock when it is displayed
262 in draft mode.
263
264 \item \cmdname{fflabelfont}
265
266 This sets the font size for the bounding box markers in
267 draft mode.
268
269 \end{itemize}
270
271 The following are lengths, which can be changed using
272 \cmdname{setlength}:
273 \marginpar{Another marginal note}
274
275 \begin{itemize}
276 \item \cmdname{fflabelsep}
277
278 This is the distance from the right hand side of the
279 bounding box at which to place the bounding box marker.
280
281 \item \cmdname{flowframesep}
282
283 This is the gap between the text of the frame and
284 its border, for the standard border types.
285
286 \item \cmdname{flowframerule}
287
288 This is the width of the frame's border, if using
289 a border given by a frame making command that uses \cmdname{fboxsep}
290 to set its border width.
291 \end{itemize}
292
293
294 \section*{Contact Details}
295
296 Dr Nicola Talbot\\
297 Dickimaw Books\\
298 \url{http://www.dickimaw-books.com/}
299
300 \end{document}