Commit Diff


commit - 6cc703dc9a8154efe7d8fc0445656c8f44486f07
commit + dfc67f9b6dbbf741f3ee7a87082398347fa9410a
blob - /dev/null
blob + 7c917cdbe3bd1a1ac5e4fa4b2a45ccc20c5c6ebc (mode 644)
--- /dev/null
+++ man/man1/eqn.1
@@ -0,0 +1,339 @@
+.TH EQN 1
+.EQ
+delim $$
+.EN
+.SH NAME
+eqn  \- typeset mathematics
+.SH SYNOPSIS
+.B eqn
+[
+.I option ...
+]
+[
+.I file ...
+]
+.SH DESCRIPTION
+.I Eqn
+is a
+.IR troff (1)
+preprocessor
+for typesetting mathematics
+on a typesetter.
+Usage is almost always
+.IP
+.L
+eqn file ... | troff
+.PP
+If no files are specified, 
+.I eqn
+reads from the standard input.
+.I Eqn
+prepares output for the typesetter 
+named in the
+.BI -T dest
+option (default
+.BR -Tutf ;
+see
+.IR troff (1)).
+When run with other preprocessor filters,
+.I eqn
+usually comes last.
+.PP
+A line beginning with
+.B .EQ
+marks the start of an equation;
+the end of an equation
+is marked by a line beginning with
+.BR .EN .
+Neither of these lines is altered,
+so they may be defined in macro packages
+to get
+centering, numbering, etc.
+It is also possible to set two characters
+as `delimiters';
+text between delimiters is also
+.I eqn
+input.
+Delimiters may be set to characters
+.I x
+and
+.I y
+with the option
+.BI -d xy
+or (more commonly) with
+.B delim
+.I xy
+between
+.B .EQ
+and
+.BR .EN .
+Left and right delimiters may be identical.
+(They are customarily taken to be
+$font L "$$" )$.
+Delimiters are turned off by
+.LR "delim off" .
+All text that is neither between delimiters nor between
+.B .EQ
+and
+.B .EN
+is passed through untouched.
+.PP
+Tokens within
+.I eqn
+are separated by
+spaces, tabs, newlines, braces, double quotes,
+tildes or circumflexes.
+Braces {} are used for grouping;
+generally speaking,
+anywhere a single character like
+.L x
+could appear, a complicated construction
+enclosed in braces may be used instead.
+Tilde
+.L ~
+represents a full space in the output,
+circumflex
+.L ^
+half as much.
+.PP
+.vs 13p
+Subscripts and superscripts are produced with the keywords
+.B sub
+and
+.BR sup .
+Thus
+.L "x sub i" 
+makes
+$x sub i$, 
+.L "a sub i sup 2"
+produces
+$a sub i sup 2$,
+and
+.L "e sup {x sup 2 + y sup 2}"
+gives
+$e sup {x sup 2 + y sup 2}$.
+.PP
+.B Over
+makes fractions:
+.L "a over b"
+yields $a over b$.
+.PP
+.B Sqrt
+produces square roots:
+.L "1 over sqrt {ax sup 2 +bx+c}"
+results in
+$1 over sqrt {ax sup 2 +bx+c}$ .
+.PP
+The keywords
+.B from
+and
+.B to
+introduce lower and upper
+limits on arbitrary things:
+$lim from {n -> inf} sum from 0 to n x sub i$
+is made with
+.LR "lim from {n -> inf} sum from 0 to n x sub i" .
+.PP
+Left and right brackets, braces, etc., of the right height are made with
+.B left
+and
+.BR right :
+.L "left [ x sup 2 + y sup 2 over alpha right ] ~=~1"
+produces
+$left [ x sup 2 + y sup 2 over alpha right ] ~=~1$.
+The
+.B right
+clause is optional.
+Legal characters after 
+.B left
+and
+.B right
+are braces, brackets, bars,
+.B c
+and
+.B f
+for ceiling and floor,
+and
+.B
+""
+for nothing at all (useful for a right-side-only bracket).
+.PP
+Vertical piles of things are made with 
+.BR pile ,
+.BR lpile ,
+.BR cpile ,
+and
+.BR rpile :
+.L "pile {a above b above c}"
+produces
+$pile {a above b above c}$.
+There can be an arbitrary number of elements in a pile.
+.B lpile
+left-justifies,
+.B pile
+and
+.B cpile
+center, with different vertical spacing,
+and 
+.B rpile
+right justifies.
+.PP
+Matrices are made with
+.BR matrix :
+.L "matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }"
+produces
+$matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }$.
+In addition, there is
+.B rcol
+for a right-justified column.
+.PP
+.vs 12p
+Diacritical marks are made with
+.BR prime ,
+.BR dot ,
+.BR dotdot ,
+.BR hat ,
+.BR tilde ,
+.BR bar ,
+.BR under ,
+.BR vec ,
+.BR dyad ,
+and
+.BR under :
+.L "x sub 0 sup prime = f(t) bar + g(t) under"
+is
+$x sub 0 sup prime = f(t) bar + g(t) under$,
+and
+.L "x vec = y dyad"
+is
+$x vec = y dyad$.
+.PP
+Sizes and fonts can be changed with prefix operators
+.B size 
+.IR n ,
+.B size
+.BI ± n \f1,
+.BR fat ,
+.BR roman ,
+.BR italic ,
+.BR bold ,
+or
+.BR font
+.IR n .
+Size and fonts can be changed globally in a document by
+.B gsize
+.I n
+and
+.B gfont
+.IR n ,
+or by the command-line arguments
+.BI -s n
+and
+.BI -f n\f1.
+.PP
+Normally subscripts and superscripts are reduced by
+3 point sizes from the previous size;
+this may be changed by the command-line argument
+.BI -p n\f1.
+.PP
+Successive display arguments can be lined up.
+Place
+.B mark
+before the desired lineup point in the first equation;
+place
+.B lineup
+at the place that is to line up vertically in subsequent equations.
+.PP
+Shorthands may be defined
+or existing keywords redefined with
+.BR define :
+.L define
+.I thing
+.L %
+.I replacement
+.L %
+defines a new token called
+.I thing
+which will be replaced by
+.I replacement
+whenever it appears thereafter.
+The 
+.L %
+may be any character that does not occur in
+.LR replacement .
+.PP
+Keywords like 
+.L sum
+.EQ
+( sum ),
+.EN
+.L int
+.EQ
+( int ),
+.EN
+.L inf
+.EQ
+( inf ),
+.EN
+and shorthands like
+.L >=
+.EQ
+(>=),
+.EN
+.L ->
+.EQ
+(->),
+.EN
+and
+.L !=
+.EQ
+( != )
+.EN
+are recognized.
+Greek letters are spelled out in the desired case, as in
+.L alpha
+or
+.LR GAMMA .
+Mathematical words like
+.LR sin ,
+.LR cos ,
+.L log
+are made Roman automatically.
+.IR Troff (1)
+four-character escapes like
+.L \e(lh
+(\(lh) can be used anywhere.
+Strings enclosed in double quotes " "
+are passed through untouched;
+this permits keywords to be entered as text,
+and can be used to communicate
+with 
+.I troff
+when all else fails.
+.SH FILES
+.TF /sys/lib/troff/font/devutf
+.TP
+.B /sys/lib/troff/font/devutf
+font descriptions for PostScript
+.SH SOURCE
+.B /sys/src/cmd/eqn
+.SH "SEE ALSO"
+.IR troff (1), 
+.IR tbl (1)
+.br
+J. F. Ossanna and B. W. Kernighan,
+``Troff User's Manual''.
+.br
+B. W. Kernighan and L. L. Cherry,
+``Typesetting Mathematics\(emUser's Guide'', 
+.I
+Unix Research System Programmer's Manual,
+Tenth Edition, Volume 2.
+.SH BUGS
+To embolden digits, parens, etc.,
+it is necessary to quote them,
+as in 
+.LR bold\ "12.3" .
+.EQ
+delim off
+.EN
blob - /dev/null
blob + b098f82205dba9c8aa19f40fe9a33e1df65cdecd (mode 644)
--- /dev/null
+++ man/man1/grap.1
@@ -0,0 +1,416 @@
+.TH GRAP 1
+.SH NAME
+grap \- pic preprocessor for drawing graphs
+.SH SYNOPSIS
+.B grap
+[
+.I file ...
+]
+.SH DESCRIPTION
+.I Grap
+is a
+.IR pic (1)
+preprocessor for drawing graphs on a typesetter.
+Graphs are surrounded by the
+.I troff
+`commands'
+.B \&.G1
+and
+.BR  \&.G2 .
+Data are scaled and plotted,
+with tick marks supplied automatically.
+Commands exist to modify the frame,
+add labels, override the default ticks,
+change the plotting style,
+define coordinate ranges and transformations,
+and include data from files.
+In addition,
+.I grap
+provides the same loops, conditionals, and macro processing that
+.I pic
+does.
+.PP
+.BI frame
+.B ht
+.I e
+.B wid
+.I e
+.B top
+.B dotted
+.IR ... :
+Set the frame around the graph to specified
+.B ht
+and
+.BR wid ;
+default is 2 by 3 (inches).
+The line
+.I styles
+.RB ( dotted ,
+.BR dashed ,
+.BR invis ,
+.BR solid
+(default))
+of the 
+.I sides
+.RB ( top ,
+.BR bot ,
+.BR left ,
+.BR right )
+of the frame can be set
+independently.
+.PP
+.B label
+.I side
+.B \&"a label"
+.B \&"as a set of strings"
+.IR adjust :
+Place label on specified side; default side is bottom.
+.I adjust
+is
+.B up
+(or
+.B down
+.B left
+.BR right )
+.I expr
+to shift default position;
+.B width
+.I expr
+sets the width explicitly.
+.PP
+.BI ticks
+.I side
+.B in
+.B at
+.IR "optname expr, expr, ..." :
+Put ticks on
+.I side
+at
+.I "expr, ...,
+and label with
+.I \&"expr"\f1.
+If any
+.I expr
+is followed by "...", label tick with "...",
+and turn off all automatic labels.
+If "..." contains
+.BR %f 's,
+they will be interpreted as
+.B printf
+formatting instructions for the tick value.
+Ticks point
+.B in
+or
+.B out
+(default out).
+Tick iterator: instead of
+.B at
+.IR \&... ,
+use
+.BI from
+.I expr
+.B to
+.I expr
+.B by
+.I "op expr
+where
+.I op
+is optionally
+.B +-*/
+for additive or multiplicative steps.
+.B by
+can be omitted, to give steps of size 1.
+If no ticks are requested, they are supplied automatically;
+suppress this with
+.B ticks
+.BR off .
+Automatic ticks normally
+leave a margin of 7% on each side; set this to anything by
+.B margin
+.B =
+.IR expr .
+.PP
+.B grid
+.I "side linedesc"
+.B at
+.IR "optname expr, expr, ..." :
+Draw grids perpendicular to
+.I side
+in style
+.I linedesc
+at
+.I "expr, ....\&
+Iterators and labels work as with ticks.
+.PP
+.B coord
+.I optname
+.B x
+.I "min, max"
+.B y
+.I "min, max"
+.B "log x
+.BR " log y" :
+Set range of coords and optional log scaling on either or both.
+This overrides computation of data range.
+Default value of
+.I optname
+is current coordinate system
+(each
+.B coord
+defines a new coordinate system).
+.PP
+.B plot
+.I \&"str"
+.B at
+.IR point ;
+.B
+.I \&"str"
+.B at
+.IR point :
+Put
+.I str
+at
+.IR point .
+Text position can be qualified with
+.BR rjust ,
+.BR ljust ,
+.BR above ,
+.BR below
+after "...".
+.PP
+.B line
+.B from
+.I point
+.B to
+.IR "point linedesc" :
+Draw line from here to there.
+.B arrow
+works in place of
+.BR line .
+.PP
+.B next
+.I optname
+.B at
+.IR "point linedesc" :
+Continue plot of data in
+.I optname to
+.IR point ;
+default is current.
+.PP
+.BI draw
+.IR "optname linedesc ..." :
+Set mode for
+.BR next :
+use this style from now on,
+and plot "..." at each point (if given).
+.PP
+.BI new
+.IR "optname linedesc ..." :
+Set mode for
+.BR next ,
+but disconnect from previous.
+.PP
+A list of numbers
+.I "x y1 y2 y3 ...
+is treated as 
+.B plot
+.B bullet
+.B at
+.IR x,y1 ;
+.B plot
+.B bullet
+.B at
+.IR x,y2 ;
+etc., or as
+.B next
+.B at
+.I x,y1
+etc., if
+.B draw
+is specified.
+Abscissae of 1,2,3,... are provided if there is only one input number per line.
+.PP
+A
+point
+.I "optname expr, expr
+maps the point to the named coordinate system.
+A
+.I linedesc
+is one of
+.B dot
+.B dash
+.B invis
+.B solid
+optionally followed by an expression.
+.PP
+.BI define
+.I name
+.BI { whatever } \f1:
+Define a macro.
+There are macros already defined for standard plotting
+symbols like
+.BR bullet ,
+.BR circle ,
+.BR star ,
+.BR plus ,
+etc., in
+.BR /sys/lib/grap.defines ,
+which is included if it exists.
+.PP
+.I var
+.B =
+.IR expr :
+Evaluate an expression.
+Operators are
+.B=
+.B +
+.B -
+.B *
+and
+.BR / .
+Functions are
+.B log
+and
+.B exp
+(both base 10),
+.BR sin ,
+.BR cos ,
+.BR sqrt ;
+.B rand
+returns random number on [0,1);
+.BI max( e , e )\f1,
+.BI min( e , e )\f1,
+.BI int( e )\f1.
+.PP
+.B print
+.IR expr ;
+.B print
+\fL"\f2...\fL"\f1:
+As a debugging aid, print
+.I expr
+or
+.I string
+on the standard error.
+.PP
+.B copy
+\fL"\fIfile name\fL"\fR:
+Include this file right here.
+.PP
+.B copy
+.B thru
+.IR macro :
+Pass rest of input (until
+.BR \&.G2 )
+through
+.IR macro ,
+treating each field (non-blank, or "...") as an argument.
+.I macro
+can be the name of a macro previously defined,
+or the body of one in place, like
+.BR "/plot $1 at $2,$3/" .
+.PP
+.B copy
+.B thru
+.I macro
+.B until
+\fL"\fIstring\fL"\fR:
+Stop copy when input is
+.I string
+(left-justified).
+.PP
+.BI pic
+.IR "remainder of line" :
+Copy to output with leading blanks removed.
+.PP
+.BI graph
+.IR "Name pic-position" :
+Start a new frame, place it at specified position,
+e.g.,
+.B graph
+.B Thing2
+.BR "with .sw at Thing1.se + (0.1,0)" .
+.I Name
+must be capitalized to keep
+.I pic
+happy.
+.PP
+.BI \&. "anything at beginning of
+.IR line :
+Copied verbatim.
+.PP
+.B sh
+.BI % anything
+.BR % :
+Pass everything between the
+.BR % 's
+to the shell;
+as with macros,
+.B %
+may be any character and
+.I anything
+may include newlines.
+.PP
+.B #
+.IR anything :
+A comment, which is discarded.
+.PP
+Order is mostly irrelevant; no category is mandatory.
+Any arguments on the
+.B \&.G1
+line are placed on the generated
+.B \&.PS
+line for
+.IR pic .
+.SH EXAMPLES
+.EX
+.ps -1
+.vs -1
+\&.G1
+frame ht 1 top invis right invis
+coord x 0, 10 y 1, 3 log y
+ticks left in at 1 "bottommost tick", 2,3 "top tick"
+ticks bot in from 0 to 10 by 2
+label bot "silly graph"
+label left "left side label" "here"
+grid left dashed at 2.5
+copy thru / circle at $1,$2 /
+1 1
+2 1.5
+3 2
+4 1.5
+10 3
+\&.G2
+.G1
+frame ht 1 top invis right invis
+coord x 0, 10 y 1, 3 log y
+ticks left in at 1 "bottommost tick", 2,3 "top tick"
+ticks bot in from 0 to 10 by 2
+label bot "silly graph"
+label left "left side label" "here"
+grid left dashed at 2.5
+copy thru / circle at $1,$2 /
+1 1
+2 1.5
+3 2
+4 1.5
+10 3
+.G2
+.ps
+.vs
+.EE
+.SH FILES
+.TF /sys/lib/grap.defines
+.TP
+.B /sys/lib/grap.defines
+definitions of standard plotting characters, e.g., bullet
+.SH SOURCE
+.B /sys/src/cmd/grap
+.SH "SEE ALSO"
+.IR pic (1), 
+.IR troff (1)
+.br
+J. L. Bentley and B. W. Kernighan,
+``GRAP\(emA Language for Typesetting Graphs'',
+.I
+Unix Research System Programmer's Manual,
+Tenth Edition, Volume 2.
blob - /dev/null
blob + 685de68fca396de6e1def74ac45c995e2567a4f2 (mode 644)
--- /dev/null
+++ man/man1/pic.1
@@ -0,0 +1,344 @@
+.TH PIC 1
+.de PS	\" start picture
+.	\" $1 is height, $2 is width, both in inches
+.if \\$1>0 .sp .35
+.ie \\$1>0 .nr $1 \\$1
+.el .nr $1 0
+.in (\\n(.lu-\\$2)/2u
+.ne \\$1
+..
+.de PE	\" end of picture
+.in
+.if \\n($1>0 .sp .65
+..
+.SH NAME
+pic, tpic \- troff and tex preprocessors for drawing pictures
+.SH SYNOPSIS
+.B pic
+[
+.I files
+]
+.PP
+.B tpic
+[
+.I files
+]
+.SH DESCRIPTION
+.I Pic
+is a
+.IR troff (1)
+preprocessor for drawing figures on a typesetter.
+.I Pic
+code is contained between
+.B .PS
+and
+.B .PE
+lines:
+.IP
+.EX
+\&.PS \f2optional-width\fP \f2optional-height\fP
+\f2element-list\fP
+\&.PE
+.EE
+.LP
+or in a file mentioned in a
+.B .PS
+line:
+.IP
+.BI .PS " " < file
+.LP
+If
+.IR optional-width
+is present, the picture is made that many inches wide,
+regardless of any dimensions used internally.
+The height is scaled in the same proportion unless
+.IR optional-height
+is present.
+If
+.B .PF
+is used instead of
+.BR .PE ,
+the typesetting position after printing is restored to what it was
+upon entry.
+.PP
+An
+.IR element-list
+is a list of elements:
+.EX
+	\f2primitive  attribute-list\fP
+	\f2placename\fP : \f2element\fP
+	\f2placename\fP : \f2position\fP
+	\f2var\fP = \f2expr\fP
+	\f2direction\fP
+	{ \f2element-list\fP }
+	[ \f2element-list\fP ]
+	for \f2var\fP = \f2expr\fP to \f2expr\fP by \f2expr\fP do { \f2anything\fP }
+	if \f2expr\fP then { \f2anything\fP } else { \f2anything\fP }
+	copy \f2file,\fP  copy thru \f2macro,\fP  copy \f2file\fP thru \fPmacro\fP
+	sh { \f2commandline\fP }
+	print \f2expr\fP
+	reset \f2optional var-list\fP
+	\f2troff-command\fP
+.EE
+.PP
+Elements are separated by newlines or semicolons;
+a long element may be continued by ending the line with a backslash.
+Comments are introduced by a
+.BI #
+and terminated by a newline.
+Variable names begin with a lower case letter;
+place names begin with upper case.
+Place and variable names retain their values
+from one picture to the next.
+.PP
+After each primitive
+the current position moves in the current direction
+.RB ( up , down ,
+.BR left , right
+(default)) by the size of the primitive.
+The current position and direction are saved upon entry
+to a
+.BR { ... }
+block and restored upon exit.
+Elements within a block enclosed in
+.BR [ ... ]
+are treated as a unit;
+the dimensions are determined by the extreme points
+of the contained objects.
+Names, variables, and direction of motion within a block are local to that block.
+.PP
+.IR Troff-command
+is any line that begins with a period.
+Such a line is assumed to make sense in the context where it appears;
+generally, this means only size and font changes.
+.PP
+The
+.I primitive
+objects are:
+.br
+.EX
+	box  circle  ellipse  arc  line  arrow  spline  move  \f2text-list\fP
+.EE
+.L arrow
+is a synonym for
+.LR "line ->" .
+.PP
+An
+.IR attribute-list
+is a sequence of zero or more attributes;
+each attribute consists of a keyword, perhaps followed by a value.
+.EX
+.ta .5i 2.5i
+	h(eigh)t \f2expr\fP	wid(th) \f2expr\fP
+	rad(ius) \f2expr\fP	diam(eter) \f2expr\fP
+	up \f2opt-expr\fP	down \f2opt-expr\fP
+	right \f2opt-expr\fP	left \f2opt-expr\fP
+	from \f2position\fP	to \f2position\fP
+	at \f2position\fP	with \f2corner\fP
+	by \f2expr, expr\fP	then
+	dotted \f2opt-expr\fP	dashed \f2opt-expr\fP
+	chop \f2opt-expr\fP	->  <-  <->
+	invis	same
+	fill \f2opt-expr\fP
+	\f2text-list\fP	\f2expr\fP
+.EE
+Missing attributes and values are filled in from defaults.
+Not all attributes make sense for all primitives;
+irrelevant ones are silently ignored.
+The attribute
+.L at
+causes the geometrical center to be put at the specified place;
+.L with
+causes the position on the object to be put at the specified place.
+For lines, splines and arcs,
+.L height
+and
+.L width
+refer to arrowhead size.
+A bare
+.I expr
+implies motion in the current direction.
+.PP
+Text is normally an attribute of some primitive;
+by default it is placed at the geometrical center of the object.
+Stand-alone text is also permitted.
+A text list
+is a list of text items:
+.EX
+\f2  text-item\fP:
+	"..." \f2positioning ...\fP
+	sprintf("\f2format\fP", \f2expr\fP, \f2...\fP) \f2positioning ...\fP
+\f2  positioning\fP:
+	center  ljust  rjust  above  below
+.EE
+If there are multiple text items for some primitive,
+they are arranged vertically and centered except as qualified.
+Positioning requests apply to each item independently.
+Text items may contain
+.I troff
+commands for size and font changes, local motions, etc.,
+but make sure that these are balanced
+so that the entering state is restored before exiting.
+.PP
+A position is ultimately an
+.I x,y
+coordinate pair, but it may be specified in other ways.
+.EX
+\f2  position\fP:
+	\f2expr, expr\fP
+	\f2place\fP ± \f2expr, expr\fP
+	\f2place\fP ± ( \f2expr, expr\fP )
+	( \f2position\fP,\f2 position\fP )	\f2x\fP\fR from one, \f2y\fP\fR the other\fP
+	\f2expr\fP [\fLof the way\fP] between \f2position\fP and \f2position\fP
+	\f2expr\fP < \f2position\fP , \f2position\fP >
+	( \f2position\fP )
+.EE
+.PP
+.EX
+\f2  place\fP:
+	\f2placename\fP \f2optional-corner\fP
+	\f2corner\fP of \f2placename\fP
+	\f2nth\fP \f2primitive\fP \f2optional-corner\fP
+	\f2corner\fP of \f2nth\fP \f2primitive\fP
+	Here
+.EE
+An
+.IR optional-corner
+is one of the eight compass points
+or the center or the start or end of a primitive.
+.EX
+\f2  optional-corner\fP:
+	.n  .e  .w  .s  .ne  .se  .nw  .sw  .c  .start  .end
+\f2  corner\fP:
+	top  bot  left  right  start  end
+.EE
+Each object in a picture has an ordinal number;
+.IR nth
+refers to this.
+.EX
+\f2  nth\fP:
+	\f2n\fPth\f2,     n\fPth last
+.EE
+.PP
+The built-in variables and their default values are:
+.EX
+.ta .5i 2.5i
+	boxwid 0.75	boxht 0.5
+	circlerad 0.25	arcrad 0.25
+	ellipsewid 0.75	ellipseht 0.5
+	linewid 0.5	lineht 0.5
+	movewid 0.5	moveht 0.5
+	textwid 0	textht 0
+	arrowwid 0.05	arrowht 0.1
+	dashwid 0.1	arrowhead 2
+	scale 1
+.EE
+These may be changed at any time,
+and the new values remain in force from picture to picture until changed again
+or reset by a
+.L reset
+statement.
+Variables changed within
+.B [
+and
+.B ]
+revert to their previous value upon exit from the block.
+Dimensions are divided by
+.B scale
+during output.
+.PP
+Expressions in
+.I pic
+are evaluated in floating point.
+All numbers representing dimensions are taken to be in inches.
+.EX
+\f2  expr\fP:
+	\f2expr\fP \f2op\fP \f2expr\fP
+	- \f2expr\fP
+	! \f2expr\fP
+	( \f2expr\fP )
+	variable
+	number
+	\f2place\fP .x  \f2place\fP .y  \f2place\fP .ht  \f2place\fP .wid  \f2place\fP .rad
+	sin(\f2expr\fP)  cos(\f2expr\fP)  atan2(\f2expr,expr\fP)  log(\f2expr\fP)  exp(\f2expr\fP)
+	sqrt(\f2expr\fP)  max(\f2expr,expr\fP)  min(\f2expr,expr\fP)  int(\f2expr\fP)  rand()
+\f2  op\fP:
+	+  -  *  /  %  <  <=  >  >=  ==  !=  &&  ||
+.EE
+.PP
+The
+.B define
+and
+.B undef
+statements are not part of the grammar.
+.EX
+	define \f2name\fP { \f2replacement text\fP }
+	undef \f2name\fP
+.EE
+Occurrences of
+.BR $1 ,
+.BR $2 ,
+etc.,
+in the replacement text
+will be replaced by the corresponding arguments if
+.I name
+is invoked as
+.EX
+	\f2name\fP(\f2arg1\fP, \f2arg2\fP, ...)
+.EE
+Non-existent arguments are replaced by null strings.
+Replacement text
+may contain newlines.
+The
+.B undef
+statement removes the definition of a macro.
+.PP
+.I Tpic
+is a
+.IR tex (1)
+preprocessor that accepts
+.IR pic
+language.
+It produces Tex commands that define a box called
+.BR \egraph ,
+which contains the picture.
+The box may be output this way:
+.IP
+.L
+\ecenterline{\ebox\egraph}
+.SH EXAMPLES
+.EX
+arrow "input" above; box "process"; arrow "output" above
+move
+A: ellipse 
+   circle rad .1 with .w at A.e
+   circle rad .05 at 0.5 <A.c, A.ne>
+   circle rad .065 at 0.5 <A.c, A.ne>
+   spline from last circle.nw left .25 then left .05 down .05
+   arc from A.c to A.se rad 0.5
+   for i = 1 to 10 do { line from A.s+.025*i,.01*i down i/50 } 
+.EE
+.PP
+.PS
+arrow "input" above; box "process"; arrow "output" above
+move
+A: ellipse 
+   circle rad .1 with .w at A.e
+   circle rad .05 at 0.5 <A.c, A.ne>
+   circle rad .065 at 0.5 <A.c, A.ne>
+   spline from last circle.nw left .25 then left .05 down .05
+   arc from A.c to A.se rad 0.5
+   for i = 1 to 10 do { line from A.s+.025*i,.01*i down i/50 } 
+.PE
+.SH SOURCE
+.B /sys/src/cmd/pic
+.SH "SEE ALSO"
+.IR grap (1), 
+.IR doctype (1),
+.IR troff (1)
+.br
+B. W. Kernighan,
+``PIC\(ema Graphics Language for Typesetting'',
+.I
+Unix Research System Programmer's Manual,
+Tenth Edition, Volume 2
blob - /dev/null
blob + 921e9e85e4df6277146cc01cb00992c05bd3765a (mode 644)
--- /dev/null
+++ man/man1/tbl.1
@@ -0,0 +1,285 @@
+.TH TBL 1
+.SH NAME
+tbl \- format tables for nroff or troff
+.SH SYNOPSIS
+.B tbl
+[
+.I file ...
+]
+.SH DESCRIPTION
+.I Tbl
+is a preprocessor for formatting tables for
+.I nroff
+or
+.IR troff (1).
+The input
+.I files
+are copied to the standard output,
+except for segments of the form
+.IP
+.nf
+.B .TS
+.IB options " ;
+.IB format " .
+.I data
+.B .T&
+.IB format " .
+.I data
+\&. . .
+.B .TE
+.fi
+.LP
+which describe tables
+and are replaced by
+.I troff 
+requests to lay out the tables.
+If no arguments are given,
+.I tbl
+reads the standard input.
+.PP
+The (optional)
+.I options
+line is terminated by a semicolon and contains one or more
+of
+.RS
+.TF linesize(n)
+.TP
+.B center
+center the table; default is left-adjust
+.TP
+.B expand
+make table as wide as current line length
+.TP
+.B box
+.TP
+.B doublebox
+enclose the table in a box or double box
+.TP
+.B allbox
+enclose every item in a box
+.TP
+.BI tab( x )
+use 
+.I x
+to separate input items; default is tab
+.TP
+.BI linesize( n )
+set rules in
+.IR n -point
+type
+.TP
+.BI delim( xy )
+recognize
+.I x
+and
+.I y
+as
+.IR eqn (1)
+delimiters
+.PD
+.RE
+.PP
+Each line, except the last, of the obligatory
+.I format
+describes one row of the table.
+The last line describes all rows until the next
+.BR .T& ,
+where the format changes,
+or the end of the table at
+.BR .TE .
+A format is specified by key letters, one per column, either upper or lower case:
+.RS
+.TP 0
+.B L
+Left justify: the default for
+columns without format keys.
+.PD0
+.TP
+.B R
+Right justify.
+.TP
+.B C
+Center.
+.TP
+.B N
+Numeric: align at decimal point (inferred for integers) or at
+.LR \e& .
+.TP
+.B S
+Span: extend previous column across this one.
+.TP
+.B A
+Alphabetic: left-aligned within column, widest item centered, indented relative to 
+.B L
+rows.
+.TP
+.B ^
+Vertical span: continue item from previous row into this row.
+.TP
+.B -
+Draw a horizontal rule in this column.
+.TP
+.B =
+Draw a double horizontal rule in this column.
+.PD
+.RE
+.PP
+Key letters may be followed by modifiers, also either case:
+.RS
+.TP \w'\fLF\fIfont\fLXX'u
+.B |
+Draw vertical rule between columns.
+.PD0
+.TP
+.B ||
+Draw a double vertical rule between columns.
+.TP
+.I n
+Gap between column is
+.I n
+ens wide.
+Default is 3.
+.TP
+.BI F font
+Use specified
+.IR font .
+.B B
+and
+.B I
+mean
+.B FB
+and
+.BR FI .
+.TP
+.B T
+Begin vertically-spanned item at top row of range; default is 
+vertical centering (with
+.LR ^ ).
+.TP
+.BI P n
+Use point size
+.IR n .
+.TP
+.BI V n
+Use
+.IR n -point
+vertical spacing in text block; signed
+.I n
+means relative change.
+.TP
+.BI W( n )
+Column width as a
+.I troff
+width specification.
+Parens are optional if
+.I n
+is a simple integer.
+.TP
+.B E
+Equalize the widths of all columns marked
+.BR E .
+.PD
+.RE
+.PP
+Each line of
+.I data
+becomes one row of the table; tabs separate items.
+Lines beginning with
+.L .
+are 
+.I troff 
+requests.
+Certain special data items are recognized:
+.RS
+.TP 0
+.B _
+Draw a horizontal rule in this column.
+.PD0
+.TP
+.B =
+Draw a double horizontal rule in this column.
+A data line consisting of a single
+.L _
+or
+.L =
+draws the rule across the whole table.
+.TP
+.B \e_
+Draw a rule only as wide as the contents of the column.
+.TP
+.BI \eR x
+Repeat character
+.I x
+across the column.
+.TP
+.B \e^
+Span the previous item in this column down into this row.
+.TP
+.B T{
+The item is a text block to be separately formatted
+by
+.I troff 
+and placed in the table.
+The block continues to the next line beginning with
+.BR T} .
+The remainder of the data line follows at that point.
+.PD
+.RE
+.PP
+When it is used in a pipeline with
+.IR eqn ,
+the
+.I tbl
+command should be first, to minimize the volume
+of data passed through
+pipes.
+.SH EXAMPLES
+.ds tb \fR<tab>\fP
+Let \*(tb
+represent a tab (which should
+be typed as a genuine tab).
+.if t .2C
+.EX
+\&.TS
+c s s
+c c s
+c c c
+l n n.
+Household Population
+Town\*(tbHouseholds
+\*(tbNumber\*(tbSize
+Bedminster\*(tb789\*(tb3.26
+Bernards Twp.\*(tb3087\*(tb3.74
+Bernardsville\*(tb2018\*(tb3.30
+\&.TE
+.if t \{\0 
+\0 
+\0\}
+.if n .PP
+.TS
+c s s
+c c s
+c c c
+l n n.
+Household Population
+Town	Households
+	Number	Size
+Bedminster	789	3.26
+Bernards Twp.	3087	3.74
+Bernardsville	2018	3.30
+.TE
+.EE
+.if t \{.sp3
+.1C\}
+.SH SOURCE
+.B /sys/src/cmd/tbl
+.SH SEE ALSO
+.IR troff (1), 
+.IR eqn (1),
+.IR doctype (1)
+.br
+M. E. Lesk and L. L. Cherry,
+``TBL\(ema Program to Format Tables'',
+.I
+Unix Research System Programmer's Manual,
+Tenth Edition, Volume 2.
blob - /dev/null
blob + db5b9e6fc04e50473ddfbdef746e80c8df939bc8 (mode 644)
--- /dev/null
+++ man/man1/troff.1
@@ -0,0 +1,198 @@
+.TH TROFF 1
+.SH NAME
+troff, nroff \- text formatting and typesetting
+.SH SYNOPSIS
+.B troff
+[
+.I option ...
+]
+[
+.I file ...
+]
+.PP
+.B nroff
+[
+.I option ...
+]
+[
+.I file ...
+]
+.SH DESCRIPTION
+.I Troff
+formats text in the named
+.I files
+for
+printing on a typesetter.
+.I Nroff
+does the same, but produces output suitable
+for typewriter-like devices.
+.PP
+If no
+.I file
+argument is present, the standard input is read.
+An argument consisting of a single minus
+.RB ( - )
+is taken to be
+a file name corresponding to the standard input.
+The options are:
+.nr xx \w'\fL-m\f2name\ \ '
+.TP \n(xxu
+.BI -o list
+Print pages in the comma-separated
+.I list
+of numbers and ranges.
+A range
+.IB N - M
+means 
+.I N
+through
+.IR M ;
+initial
+.BI - M
+means up to
+.IR M ;
+final
+.IB N -
+means from
+.I N
+to the end.
+.TP
+.BI -n N
+Number first generated page
+.IR N .
+.TP
+.BI -m name
+Process the macro file
+.BI /sys/lib/tmac/tmac. name
+before the input
+.IR files .
+.TP
+.BI -r aN
+Set register
+.I a
+(one character name) to
+.IR N .
+.TP
+.B -i
+Read standard input after the input files are exhausted.
+.TP
+.B -q
+Invoke the simultaneous input-output mode of the
+.B rd
+request.
+.TP
+.B -N
+Produce output suitable for typewriter-like devices.
+.SS Typesetter devices (not \fL-N\fP) only
+.TP \n(xxu
+.B -a
+Send a printable
+textual
+approximation
+of the results to the standard output.
+.TP
+.BI -T dest
+Prepare output for typesetter
+.IR dest :
+.br
+.ns
+.RS
+.TP \w'\fL-TLatin1\ 'u
+.B -Tutf
+(The default.) PostScript printers with
+preprocessing to handle Unicode
+characters encoded in
+.SM UTF
+.PD0
+.TP
+.B -Tpost
+Regular PostScript printers
+.PD0
+.TP
+.B -T202
+Mergenthaler Linotron 202 
+.RE
+.PD
+.TP "\w'\fL-m\f2name 'u"
+.BI -F dir
+Take font information from directory
+.IR dir .
+.SS Typewriter (\fL-N\fP) output only
+.TP \n(xxu
+.BI -s N
+Halt prior to every
+.I N
+pages (default
+.IR N =1)
+to allow paper loading or changing.
+.TP
+.BI -T name
+Prepare output for specified terminal.
+Known
+.I names
+include
+.B utf
+for the normal Plan 9
+.SM UTF
+encoding of the Unicode Standard character set (default),
+.B 37
+for the
+Teletype model 37,
+.B lp
+(`line-printer')
+for any terminal without half-line capability,
+.B 450
+for the \s-1DASI\s+1-450
+(Diablo Hyterm),
+and
+.B think
+(HP ThinkJet).
+.TP
+.B -e
+Produce equally-spaced words in adjusted
+lines, using full terminal resolution.
+.TP
+.B -h
+Use output tabs during horizontal spacing
+to speed output and reduce output character count.
+Tab settings are assumed to be every
+8 nominal character widths.
+.SH FILES
+.TF /sys/lib/troff/term/*
+.TP
+.B /tmp/trtmp*
+temporary file
+.TP
+.B /sys/lib/tmac/tmac.*
+standard macro files
+.TP
+.B /sys/lib/troff/term/*
+terminal driving tables for
+.I nroff
+.TP
+.B /sys/lib/troff/font/*
+font width tables for
+.I troff
+.SH SOURCE
+.B /sys/src/cmd/troff
+.SH "SEE ALSO"
+.IR lp (1),
+.IR proof (1),
+.IR eqn (1), 
+.IR tbl (1), 
+.IR pic (1), 
+.IR grap (1),
+.IR doctype (1), 
+.IR ms (6),
+.IR image (6),
+.IR tex (1),
+.IR deroff (1)
+.br
+J. F. Ossanna and B. W. Kernighan,
+``Troff User's Manual''
+.br
+B. W. Kernighan,
+``A TROFF Tutorial'',
+.I
+Unix Research System Programmer's Manual,
+Tenth Edition, Volume 2.