.\" Copyright (c) 1986 The Regents of the University of California.
.\" Redistribution and use in source and binary forms are permitted
.\" provided that the above copyright notice and this paragraph are
.\" duplicated in all such forms and that any documentation,
.\" advertising materials, and other materials related to such
.\" distribution and use acknowledge that the software was developed
.\" by the University of California, Berkeley. The name of the
.\" University may not be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\" @(#)intro.me 6.4 (Berkeley) 7/17/89
.\" Modified for groff by jjc@jclark.com.
.he 'USING GROFF AND \-ME''%'
.\"eh 'USD:22-%''Writing Papers with NROFF using \-me'
.\"oh 'Writing Papers with NROFF using \-me''USD:22-%'
.b "Writing Papers with GROFF using \-me"
*Author's current address:
Berkeley, California 94704.
Electronics Research Laboratory
University of California, Berkeley
Berkeley, California 94720
.i "Modified for \*G by James Clark"
the text processing facilities
of AT&T Bell Laboratories
already is generally familiar
with the \*U operating system
This is intended to be a casual introduction,
as such not all material is covered.
many variations and additional features
of the \-me macro package
For a complete discussion of this
The \-me Reference Manual
The \*N/\*T Reference Manual.
that runs on the \*U operating system,
and outputs a formatted paper
suitable for publication or framing.
telling how to format the printed copy.
describes the basic requests.
The more complex requests
which are not discussed in section 2
are covered in section 5.
discusses things you will need
if you want to typeset documents.
you probably won't want to read beyond section 4
until you have tried some of the basic features out.
When you have your raw text ready,
call the \*G formatter by typing
as a request to the \*U shell:
output device you are using.
A complete description of options
to the \*G command can be found in
which appears on the same line
which modifies the meaning
which says to space four lines
Arguments are separated from the request
.sh 1 "Basics of Text Processing"
output lines with those words,
the right hand margin by inserting extra spaces
packed onto output lines,
Sometimes you may want to start a new output line
even though the line you are on
at the end of a paragraph.
starts a new output line.
cause a break automatically,
and input lines beginning with a space.
are text to be formatted.
Requests always have a period
also does more complex things,
such as automatically numbering pages,
skipping over page folds,
putting footnotes in the correct place,
I can offer you a few hints
keep the input lines short.
Short input lines are easier to edit,
and \*G will pack words onto longer lines
are to add or delete sentences
do not put spaces at the end of lines,
since this can sometimes confuse the \*N
do not hyphenate words at the end of lines
(except words that should have hyphens in them,
\*G is smart enough to hyphenate words
and join a word back together.
since then you will get a space
Now is the time for all good men
to come to the aid of their party.
Four score and seven years ago,...
followed by an indented first line.
Now is the time for all good men
to come to the aid of their party.
Four score and seven years ago,...
Notice that the sentences
and lines beginning with spaces
Now is the time for all good men
to come to the aid of their party.
Four score and seven years ago,...
Now is the time for all good men
to come to the aid of their party.
Four score and seven years ago,...
A new line begins after the word
because the second line began with a space character.
which will be described later.
.sh 2 "Headers and Footers"
Arbitrary headers and footers
define the titles to put at the head and the foot
there is a left-justified part,
and a right-justified part.
To separate these three parts
Any character may be used,
is replaced by the current page number
whenever found in the title.
\&.fo \(aaJane Jones\(aa\(aaMy Book\(aa
results in the page number
in the lower left corner,
in the lower right corner.
\*G will double space output text automatically if you
as is done in this section.
You can revert to single spaced mode
A number of requests allow
you to change the way the printed copy looks,
Most of these requests adjust the placing
should be replaced with values you wish to use;
represent characters which should actually be typed.
(meaning skip a single line)
My thoughts on the subject
leaves one and a half inches of space,
.q "My thoughts on the subject" ,
followed by a single blank line.
changes the amount of white space
spaces more than you are already leaving),
(meaning leave less than you do now),
indented exactly five spaces
should apply to one line only,
after which it should revert
Ware, James R. The Best of Confucius,
An excellent book containing translations of
most of Confucius\(aa most delightful sayings.
A definite must for anyone interested in the early foundations
Ware, James R. The Best of Confucius,
An excellent book containing translations of
most of Confucius' most delightful sayings.
A definite must for anyone interested in the early foundations
Text lines can be centered
To center more than one line,
is the number of lines to center),
If you want to center many lines
but don't want to count them,
request tells \*G to center zero more lines,
If you want to start a new line
without performing any other action,
Displays are sections of text
from the body of the paper.
are quotes which are several lines long,
and hence are set in from the rest
As Weizenbaum points out:
It is said that to explain is to explain away.
This maxim is nowhere so well fulfilled
as in the areas of computer programming,...
As Weizenbaum points out:
It is said that to explain is to explain away.
This maxim is nowhere so well fulfilled
as in the areas of computer programming,...
when the material to be printed
should not be filled and justified
such as columns of figures
or the examples used in this paper.
Alternatives to avoid deadlock are:
Lock in a specified order
Detect deadlock and back out one process
Lock all resources needed before proceeding
Alternatives to avoid deadlock are:
Lock in a specified order
Detect deadlock and back out one process
Lock all resources needed before proceeding
which are kept on a single page
An example of where you would use a keep
in that lists may be broken
Blocks are the basic kind of keep.
They begin with the request
If there is not room on the current page
for everything in the block,
This has the unpleasant effect
at the bottom of the page.
When this is not appropriate,
you can use the alternative,
move relative to the text.
which will be referred to
A floating keep will appear
at the bottom of the current page
it will appear at the top
Floating keeps begin with the line
For an example of a floating keep,
Text of keep to be floated.
Figure 1. Example of a Floating Keep.
Figure 1. Example of a Floating Keep.
to draw a horizontal line
stands out from the text.
Keeps and lists are normally collected in
so that they are good for tables and such.
(Throughout this section,
will be indented from both margins.
a newer, bigger, better toy than ever before!
Be the first on your block to have your own computer!
Yes kids, you too can have one of these modern
You too can produce beautifully formatted papers
without even batting an eye!
a newer, bigger, better toy than ever before!
Be the first on your block to have your own computer!
Yes kids, you too can have one of these modern
You too can produce beautifully formatted papers
without even batting an eye!
Lists and blocks are also normally indented
(floating keeps are normally left justified).
To get a left-justified list,
left justified list, enter:
first line of unfilled display
produces the indented text:
first line of unfilled display
request produces the left justified result:
first line of unfilled display
produces the line-at-a-time centered output:
first line of unfilled display
that you want to center several lines
rather than centering them
which are surrounded by the requests
All the lines are centered as a unit,
such that the longest line is centered
lined up around that line.
to center a group of lines
first line of unfilled display
first line of unfilled display
the result would have been the same,
that the lines of the centered block
would have all been on one page.
this causes the centered block
to center within the entire line
rather than within the line
There are a number of requests
are printed at the bottom of the current page.
is intended to be a variant form
when explicitly called for,
such as at the end of each chapter.
are a type of delayed text
(usually the page number)
until called for explicitly.
Footnotes begin with the request
The current footnote number is maintained
and can be used by typing \e**,
to produce a footnote number\**.
The number is automatically incremented
and at the same time is presumptuous;
one who is not diligent and at the same time is ignorant;
one who is untruthful and at the same time is incompetent;
such men I do not count among acquaintances.\e**
and at the same time is presumptuous;
one who is not diligent and at the same time is ignorant;
one who is untruthful and at the same time is incompetent;
such men I do not count among acquaintances.\**
is very similar to a footnote
except that it is printed
when called for explicitly.
at the end of each chapter,
as is the convention in some disciplines.
If you are using delayed text
as your standard reference mechanism,
you can still use footnotes,
except that you may want to reference them
(actually more like a table of contents,
since the entries are not sorted alphabetically)
in that it is saved until called for.
each entry has the page number
appended to the last line
Index entries begin with the request
request may have a argument,
which is the value to print
It defaults to the current page number.
If the page number given is an underscore
which specifies an explicitly null page number.
request prints the index.
Why the sea is boiling hot
This is a terribly long index entry, such as might be used
for a list of illustrations, tables, or figures; I expect it to
Why the sea is boiling hot
This is a terribly long index entry, such as might be used
for a list of illustrations, tables, or figures; I expect it to
request may have a single character
may be maintained simultaneously
(such as a list of tables, table of contents, etc.).
Notice that the index must be printed
rather than at the beginning
where it will probably appear
(as a table of contents);
the pages may have to be physically rearranged
A large number of fancier requests
notably requests to provide other sorts of paragraphs,
numbered sections of the form
(such as used in this document),
Paragraphs generally start with
left-justified block-style paragraphs
as demonstrated by the next paragraph.
Sometimes you want to use paragraphs
This can be done with the
A word specified on the same line as
is printed in the margin,
at a prespecified position
This is the first paragraph.
Notice how the first line
of the resulting paragraph lines up
with the other lines in the paragraph.
And here we are at the second paragraph already.
You may notice that the argument to \c
This is the first paragraph.
Notice how the first line of the resulting paragraph lines up
with the other lines in the paragraph.
And here we are at the second paragraph already.
You may notice that the argument to
We can continue text without starting a new indented
If you have spaces in the label of a
instead of a regular space.
This is typed as a backslash character
If a label of an indented paragraph
(that is, the argument to
is longer than the space allocated for the label,
will begin a new line after the label.
This paragraph had a long label.
The first character of text on the first line
will not line up with the text on second and subsequent lines,
although they will line up with each other.
This paragraph had a long label.
The first character of text on the first line
will not line up with the text on second and subsequent lines,
although they will line up with each other.
It is possible to change the size of the label
by using a second argument
which is the size of the label.
the above example could be done correctly
which will make the paragraph indent
10 spaces for this paragraph only.
If you have many paragraphs to indent
For example, to leave one inch of space
somewhere before the first call to
Refer to the reference manual
no hanging tag will be printed.
This is the first paragraph of the example.
We have seen this sort of example before.
This paragraph is lined up with the previous paragraph,
but it has no tag in the margin.
This is the first paragraph of the example.
We have seen this sort of example before.
This paragraph is lined up with the previous paragraph,
but it has no tag in the margin.
numbers paragraphs sequentially from 1.
The numbering is reset at the next
(to be described in the next section)
This is the second point.
Points are just regular paragraphs
which are given sequence numbers automatically
This paragraph will reset numbering by .np.
we have reverted to numbering from one now.
This is the second point.
Points are just regular paragraphs
which are given sequence numbers automatically
This paragraph will reset numbering by .np.
we have reverted to numbering from one now.
request gives lists of this sort that are identified with
bullets rather than numbers.
The paragraphs are also crunched together.
\&One tablespoon cream or top milk
\&Salt, cayenne, and lemon juice to taste
\&A generous two tablespoonfuls of butter
if you put the first three ingredients in a a heavy, deep pan
and whisk the ingredients madly over a medium flame
(never taking your hand off the handle of the pot)
until the mixture reaches the consistency of custard
then mix in the butter off-heat,
you will have a wonderful Hollandaise sauce.
One tablespoon cream or top milk
Salt, cayenne, and lemon juice to taste
A generous two tablespoonfuls of butter
(such as the ones used in this document)
can be automatically generated
specifies how many numbers
(separated by decimal points)
in a fairly intuitive fashion.
the new number starts out
If you subtract section numbers
(or keep the same number)
the final number is incremented.
\&.sh 1 "The Preprocessor"
\&.sh 1 "Code Generation"
produces as output the result:
You can specify the section number to begin
by placing the section number after the section title,
using spaces instead of dots.
\&.sh 3 "Another section" 7 3 4
will begin the section numbered
requests will number relative to this number.
There are more complex features
which will cause each section to be indented
proportionally to the depth of the section.
For example, if you enter:
each section will be indented by an amount
must have a scaling factor attached,
that is, it must be of the form
is a character telling what units
(the width of a single character).
sections will be indented by
per level of depth in the section number.
this document was produced
at the beginning of the input file,
giving three spaces of indent
Section headers without automatically generated numbers
which will do a section heading,
but will put no number on the section.
.sh 2 "Parts of the Basic Paper"
which assist in setting up
initializes for a title page.
There are no headers or footers
a typical title page might appear as:
Each chapter is automatically numbered
and a heading is printed at the top of each chapter
to begin a chapter called
with appropriate spacing for a thesis.
Also, the header is moved to the foot of the page
on the first page of a chapter.
request was not designed to work only with the
it is tuned for the format acceptable
the result is a chapter with no heading.
This can also be used at the beginning
was used to generate page one
papers traditionally have the abstract,
and so forth at the front of the paper,
it is more convenient to format
This is so that index entries
can be collected and then printed
for the table of contents
which begins the preliminary part
After issuing this request,
request will begin a preliminary section
this prints the page number
in lower case Roman numbers.
to begin different parts of the
to begin the bibliographic section
comments begin with the sequence
\&.th \e" set for thesis mode
\&.fo \(aa\(aaDRAFT\(aa\(aa \e" define footer for each page
\&.tp \e" begin title page
\&.(l C \e" center a large block
\&.)l \e" end centered part
\&.+c INTRODUCTION \e" begin chapter named "INTRODUCTION"
\&.(x t \e" make an entry into index `t'
\&.)x \e" end of index entry
\&.+c "NEXT CHAPTER" \e" begin another chapter
\&.(x t \e" enter into index `t' again
\&.++ B \e" begin bibliographic information
\&.+c BIBLIOGRAPHY \e" begin another `chapter'
\&.++ P \e" begin preliminary material
\&.+c "TABLE OF CONTENTS"
\&.xp t \e" print index `t' collected above
\&.+c PREFACE \e" begin another preliminary section
Figure 2. Outline of a Sample Paper
.sh 2 "Equations and Tables"
Two special \*U programs exist
to format special types of material.
This document will only describe
to the standard features;
consult the reference manuals
for a description of their use.
program is described fully
Typesetting Mathematics \- User's Guide
and are kept on one page.
They are introduced by the
request and terminated by the
which is printed vertically centered
If the equation becomes too long
continuation of equation 34
specifies that the equation
(including numerous examples)
Tbl \- A Program to Format Tables
Tables are normally kept on a single page.
If you have a table which is too big
so that you know it will extend
begin the table with the request
after the part of the table
duplicated at the top of every page
that the table is printed on.
For example, a table definition
for a long table might look like:
.ds TA \|\h'.4n'\v'-.2n'\s-4\zT\s0\v'.2n'\h'-.4n'\(ci\|
.if n .ds TA \ \o'-T'\ \"
.sh 2 "Two Column Output"
You can get two column output
This causes everything after it
to be output in two-column form.
may leave a totally blank column
when it starts a new page.
To revert to single column output,
is a collection of requests and text
by stating a simple request.
Macros begin with the line
is the name of the macro to be defined)
and end with the line consisting of two dots.
After defining the macro,
is the same as stating all the other lines.
and then centers the next input line,
Macro names may be one or two characters.
In order to avoid conflicts
always use upper case letters as names.
The only names to avoid are
.sh 2 "Annotations Inside Keeps"
Sometimes you may want to put
or index entry inside a keep.
if you want to maintain a
you will want to do something like:
and an entry in the index
(presumably a list of figures index).
so the page number in the index is likely to be wrong.
The solution is to use the magic string
at the beginning of all the lines dealing with the index.
which will defer the processing of the index
until the figure is output.
that the page number in the index
.sh 1 "\*T and the Photosetter"
on either a regular terminal
using the \*T formatting program.
that are available simultaneously,
plus the special math font.
The normal font is Roman.
There are ways of switching between fonts.
and bold-italic fonts respectively.
You can set a single word
but does not affect the surrounding text.
Notice that if you are setting more than one word
you must surround that word with double quote marks
so that it will appear to the \*G processor as a single word.
The quote marks will not appear in the formatted text.
If you do want a quote mark to appear,
you should quote the entire string
quote marks where you want one to appear.
if you want to produce the text:
.i """Master Control\|"""
in italics, you must type:
\&.i """Master Control\e|"""
produces a very narrow space
does not overlap the quote sign in \*G,
Notice that pseudo font requests
set only the single parameter in the pseudo font;
ordinary font requests will begin setting all text
if you do not provide a parameter.
with these three font requests
of the way \*G justifies text.
if you were to issue the requests:
which I think you will agree does not look good.
is set in the original font.
in the font of the surrounding text,
You can mix fonts in a word by using the
.q "continue text processing" ;
without a space between them.
the result would have been
supports different sizes of type,
is the size wanted in points.
(distance between the bottom of most letters
is set to be proportional
These pointsize changes are
to reset the pointsize of basic text to twelve point, use:
to reset the default pointsize of
If you only want to set the names of sections in a larger pointsize,
alone \*- this sets section titles
in a larger font than the default.
A single word or phrase can be set in a smaller pointsize
than the surrounding text
This is especially convenient for words that are all capitals,
due to the optical illusion that makes them look even larger
is a slow mechanical operation.
On laser printers it may require loading new fonts.
should be considered carefully.
It is conventional when using
use pairs of grave and acute accents
to generate double quotes,
This is because it looks better
to use grave and acute accents;
You may use the sequences
to stand for the left and right quote
\e*(lqSome things aren\(aat true
even if they did happen.\e*(rq
.q "Some things aren't true even if they did happen."
the special font request:
Notice that you must surround
the material to be quoted
if it is more than one word.
to produce non-trivial papers
during the development stages;
for their help with the documentation phase;
for numerous complaints years after I was
most accompanied by fixes
(hence forcing me to fix several small bugs);
and the plethora of people who have contributed ideas
and have given support for the project.
and applies to the version of the \-me macros
included with \*G version \*(MO.