3 .\" Copyright (C) Caldera International Inc. 2001-2002.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code and documentation must retain the above
10 .\" copyright notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed or owned by Caldera
17 .\" International, Inc.
18 .\" 4. Neither the name of Caldera International, Inc. nor the names of other
19 .\" contributors may be used to endorse or promote products derived from
20 .\" this software without specific prior written permission.
22 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
23 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
24 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 .\" IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
27 .\" INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 .\" POSSIBILITY OF SUCH DAMAGE.
35 .\" @(#)u3 8.1 (Berkeley) 6/8/93
39 III. DOCUMENT PREPARATION
42 systems are used extensively for document preparation.
47 programs that produce a text with
48 justified right margins, automatic page numbering and titling,
49 automatic hyphenation,
52 is designed to produce output on terminals and
55 (pronounced ``tee-roff'')
56 instead drives a phototypesetter,
57 which produces very high quality output
58 on photographic paper.
59 This paper was formatted with
68 is that the text to be formatted contains within it
69 ``formatting commands'' that indicate in detail
70 how the formatted text is to look.
71 For example, there might be commands that specify how long
72 lines are, whether to use single or double spacing,
73 and what running titles to use on each page.
79 are relatively hard to learn to use effectively,
81 ``packages'' of canned formatting requests are available
83 paragraphs, running titles, footnotes, multi-column output,
84 and so on, with little effort
85 and without having to learn
89 These packages take a modest effort to learn,
90 but the rewards for using them are so great
91 that it is time well spent.
94 we will provide a hasty look at the ``manuscript''
97 Formatting requests typically consist of a period and two upper-case letters,
100 which is used to introduce a title,
103 to begin a new paragraph.
105 A document is typed so it looks something like this:
116 another paragraph ...
118 another section heading
122 The lines that begin with a period are the formatting requests.
125 calls for starting a new paragraph.
126 The precise meaning of
128 depends on what output device is being used
129 (typesetter or terminal, for instance),
130 and on what publication the document will appear in.
133 normally assumes that a paragraph is preceded by a space
138 and the first word is indented.
139 These rules can be changed if you like,
140 but they are changed by changing the interpretation
143 not by re-typing the document.
145 To actually produce a document in standard format
152 for the typesetter, and
163 to use the manuscript package of formatting requests.
165 There are several similar packages;
166 check with a local expert to determine which ones
167 are in common use on your machine.
171 In addition to the basic formatters,
173 a host of supporting programs
174 that help with document preparation.
175 The list in the next few paragraphs
176 is far from complete,
177 so browse through the manual
178 and check with people around you for other possibilities.
183 let you integrate mathematics
184 into the text of a document,
185 in an easy-to-learn language that closely resembles the way
186 you would speak it aloud.
191 sum from i=0 to n x sub i ~=~ pi over 2
195 sum from i=0 to n x sub i ~=~ pi over 2
200 provides an analogous service for preparing tabular material;
201 it does all the computations necessary to align complicated columns
202 with elements of varying widths.
205 prepares bibliographic citations from a data base,
206 in whatever style is defined by the formatting package.
207 It looks after all the details of numbering references in sequence,
208 filling in page and volume numbers,
209 getting the author's initials and the journal name right,
215 detect possible spelling mistakes in a document.\(dg
217 \(dg "typo" is not provided with Berkeley Unix.
220 works by comparing the words in your document
222 printing those that are not in the dictionary.
223 It knows enough about English spelling to detect plurals and the like,
224 so it does a very good job.
226 looks for words which are ``unusual'',
228 Spelling mistakes tend to be more unusual,
229 and thus show up early when the most unusual words
233 looks through a set of files for lines
234 that contain a particular text pattern
235 (rather like the editor's context search does,
236 but on a bunch of files).
239 grep \(fming$\(fm chap*
241 will find all lines that end with
246 (It is almost always a good practice to put single quotes around
247 the pattern you're searching for,
248 in case it contains characters like
252 that have a special meaning to the shell.)
254 is often useful for finding out in which of a set of files
255 the misspelled words detected by
257 are actually located.
260 prints a list of the differences between
263 two versions of something automatically
264 (which certainly beats proofreading by hand).
267 counts the words, lines and characters in a set of files.
269 translates characters into other characters;
270 for example it will convert upper to lower case and vice versa.
271 This translates upper into lower:
273 tr A-Z a-z <input >output
277 sorts files in a variety of ways;
279 provides many of the editing facilities
282 but can apply them to arbitrarily long inputs.
284 provides the ability to do both pattern matching and numeric computations,
285 and to conveniently process fields within lines.
286 These programs are for more advanced users,
287 and they are not limited to document preparation.
288 Put them on your list of things to learn about.
290 Most of these programs are either independently documented
295 or are sufficiently simple that the description in
300 is adequate explanation.
302 Hints for Preparing Documents
304 Most documents go through several versions (always more than you expected) before they
305 are finally finished.
306 Accordingly, you should do whatever possible to make
307 the job of changing them easy.
309 First, when you do the purely mechanical operations of typing,
310 type so that subsequent editing will be easy.
311 Start each sentence on a new line.
313 and break lines at natural places,
314 such as after commas and semicolons,
315 rather than randomly.
316 Since most people change documents by rewriting phrases
317 and adding, deleting and rearranging sentences,
318 these precautions simplify any editing
319 you have to do later.
321 Keep the individual files of a document down
323 perhaps ten to fifteen thousand characters.
324 Larger files edit more slowly,
325 and of course if you make a dumb mistake
326 it's better to have clobbered a small file than a big one.
327 Split into files at natural boundaries in the document,
328 for the same reasons that you start each sentence
331 The second aspect of making change easy
332 is to not commit yourself to formatting details too early.
333 One of the advantages of formatting packages like
335 is that they permit you to delay decisions
336 to the last possible moment.
338 until a document is printed,
339 it is not even decided whether it will be typeset
340 or put on a line printer.
342 As a rule of thumb, for all but the most trivial jobs,
343 you should type a document in terms of a set of requests
346 and then define them appropriately,
347 either by using one of the canned packages
349 or by defining your own
354 As long as you have entered the text in some systematic way,
355 it can always be cleaned up and re-formatted
356 by a judicious combination of
357 editing commands and request definitions.