|
|
1.1 root 1: .TH prtx 5G "WH" MARX
2: .SH NAME
3: prtx \- format of prtx commands
4: .SH DESCRIPTION
5: .P
6: Commands are in ascii characters and
7: are terminated by either a ";" or a newline character.
8: Besides commands there are "prefixes" that modify the
9: following a command.
10: .P
11: Most commands and prefixes take arguments.
12: These are often numbers or
13: point positions.
14: The latter being a pair of numbers.
15: Numbers can be arbitrary
16: arithmetic expressions involving "+", "-", "*" or "/", numeric
17: constants, and parenthesis.
18: A numeric constant is a decimal number (optionally
19: including a decimal point and fraction) followed by a scale.
20: A scale is "i", for inches,
21: "c" for characters, or "d" for dots. (A dot is the smallest resolution
22: on the printer.) If the scale is omitted "c" is assumed. Constants
23: used in multiplication or division should omit the scale.
24: .PP
25: Point positions are specified by a row position and a column position,
26: separated by white space (blanks or tabs).
27: The upper left hand corner of the
28: page is 0 0. Positions increase to the right and downward.
29: If a page contains 60 characters vertically and 80 horizontally.
30: the last horizontal dot is at 80c-1d and the last
31: vertical dot is at 60c-1d.
32: .PP
33: The commands are:
34: .TP 10
35: # comment
36: This command has no effect. Note that it is terminated by a ";"
37: just like any other command.
38: .TP 10
39: line point1 point2 ...
40: Line Command:
41: Straight lines are drawn starting at
42: .I point1
43: going to
44: .I point2
45: and then to further points.
46: At least two points must be given but there is no maximum.
47: Points may be separated by a "," for readability.
48: .TP 10
49: interp point1 point2 ...
50: Interpolate command:
51: A curved line is drawn determined by the points.
52: A point may be surrounded by curly braces ( '{' and '}' )
53: in which case it is a "guide" point.
54: The curve is a second degree spline that
55: satisfies the following constraints:
56: .RS 10
57: .IP
58: It passes through all normal points.
59: .IP
60: If two guide points are adjacent in the list it passes through
61: the point midway between them and is tangent to the line connecting
62: them.
63: .IP
64: If a normal point is adjacent in the list to a guide point the
65: curve as it passes through the normal point is tangent to
66: the line connecting it to the guide.
67: .IP
68: If a normal point is not adjacent on the list to a guide point
69: the curve, as it passes through the normal point, has the same tangent
70: as the circle that goes through that point and two neighboring points
71: on the list. This will be the preceding and the following
72: points for a point in the middle of the list.
73: .P
74: Unfortunately these rules can result in cusps. They seem to
75: work best in the cases where there are three normal points
76: (an approximation to a circular segment) or in
77: the case where guide points are used to connect two normal
78: points.
79: .RE
80: .TP 10
81: ellipse center radius
82: Ellipse Command: An ellipse is drawn centered at
83: .I center,
84: with its shape determined by
85: .I radius.
86: The ellipse's axes are parallel to the picture's.
87: .I radius
88: is two expressions. The first determines the "vertical radius"
89: (i.e. half the length of the ellipse's vertical axis) and the
90: second determines the "horizontal radius". If they are equal
91: (as distances, not as number of dots or characters) the ellipse
92: is a circle.
93:
94:
95: .TP 10
96: text point text
97: Text Command:
98: Characters specified by
99: .I text
100: are placed on the output starting at
101: .I point.
102: (The position is the upper left hand corner of the first character.)
103: .I text
104: begins at the first non blank character following the point
105: and continues to the end of the line. Embedded ";" are allowed,
106: and "C" type escapes are processed.
107: An escaped newline (i.e. one immediately preceded by a backslash)
108: is treated as text and does not end the command.
109: A leading ":" is stripped off.
110: This is necessary if the first character desired is a space or
111: arithmetic operator.
112: .TP 10
113: stext point point text
114: Slanted text command:
115: Text is placed in the output as with the simple text command except
116: the base line (the line running across the top of the characters)
117: is the line through the two points.
118: The text starts at the first point and may proceed any
119: distance towards or beyond the second point.
120: The second point provides a direction only, the characters are
121: not stretched or compressed.
122: .TP 10
123: mtext point terminator
124: Multi line text command:
125: Lines following the one containing the command upto (but not including)
126: the first line that begins with the terminator character (default '.')
127: are put in the output, with the first line positioned at \fIpoint\fR
128: and the following lines positioned vertically below the first.
129: .TP 10
130: smtext point [point] [ terminator ] [text ]
131: General form of the text command:
132: The modifiers "s", "m", and "N" may be combined.
133: If both "s" and "m" are present "s" must come first.
134: The second point is required present if "s" is present and "terminator"
135: is required if "m" is present. Otherwise they must be omitted.
136: If "m" is omitted then text must be present.
137: .TP 10
138: $X [ point ]
139: Macro Command: Invoke macro
140: .I X.
141: The the body of macro
142: .I X
143: is executed with an offset of
144: .I point.
145: That is, positions in the body of the macro are taken as relative
146: to
147: .I point.
148: If
149: .I point
150: is omitted it is take to be the origin.
151: The color and solidity in effect at the point invocation are
152: used in drawing unless they are explicitly overridden by a prefix
153: within the macro body.
154: An invoke command is legal within a macro body but care should be
155: taken to avoid a macro invoking itself.
156: .PP
157: Prefixes modify the following command, which is separated
158: from the prefix by white space only.
159: However, commands can be grouped with braces
160: (i.e the characters '{' and '}').
161: If the opening brace is in the same line as the prefix,
162: commands my be on different lines, and the prefix applies to
163: all commands within the braces ;
164: Braces can be nested.
165: More than one prefix can modify a single command
166: The following prefixes are defined:
167: .TP 10
168: at point
169: Translation Prefixes:
170: Locations in the prefixed command are
171: taken as relative to the argument of
172: .I at.
173: .TP 10
174: expand factor
175: Expand Prefix:
176: The prefix command is expanded about the origin by
177: .I factor,
178: which is an unscaled numeric expression.
179: That is, all positions and shapes are multiplied by
180: .I factor.
181: .TP 10
182: rotate angle
183: Rotation Prefix:
184: Locations in the prefixed command are rotated about the origin by
185: .I angle
186: degrees.
187: Text will still be horizontal, unless created with an \fIstext\fR
188: command.
189: .TP 10
190: size N
191: Character Size Prefix:
192: Characters in the prefixed command have their size multiplied
193: by N. N must be and integer.
194: .TP 10
195: style solidity
196: Line Style Prefix:
197: The line drawing commands (line, ellipse, interp) will normally
198: draw solid lines but this can be changed by a \fIstyle\fR prefix.
199: Solidity is one of the following literals: solid, longdashed, dashed,
200: dotdashed, dotted, invisible.
201: Invisible lines are not drawn at all, so this style is useful in
202: taking up space in connection with the stack and shelf prefixes.
203: .TP 10
204: color colorname
205: Color prefix:
206: Every thing drawn by the following command will be in the named color.
207: Legal colors are: yellow, orange, red, green, blue, violet.
208: If the output device does not have colors this prefix is ignored.
209: .TP 10
210: boxit space
211: Boxit Prefix:
212: Space consists of two numeric expressions, a row and a column spacing.
213: Boxit draws the prefixed command and an enclosing box. The box is
214: drawn to leave the specified spaces at the top and bottom (row space),
215: and sides (column space) around the prefixed command.
216: .TP 10 ;
217: define X
218: Define macro:
219: .I X
220: is any alphabetic character (lower and upper case are considered
221: identical) and the macro is defined as equivalent to the following
222: command.
223: The prefixed command, which must be a block
224: (i.e. surrounded by braces),
225: becomes the body of the macro
226: and is not executed until the macro is invoked.
227: Once defined a macro character may not be redefined.
228: More elaborate macros can be obtained using a general
229: macro processor such as
230: .I m4
231: and the general arithmetic expressions provided by
232: .I prtx.
233: .TP 10
234: stack
235: Stack commands:
236: The prefixed command must be a block. Each command of the
237: block is interpreted as if the origin had been moved to below
238: the earlier commands. The effect is what would be achieved
239: if each command were prefixed by "at max 0", where max is the
240: maximum row contained in previous commands. A row is contained
241: in a command if the command puts a dot in the row. Text
242: commands also contain some blank space below the characters.
243: (In some circumstances, e.g. slanted text,
244: \fIprtx\fR cannot easily compute the contained rows and
245: makes a guess.
246: But, arbitrary lines, and horizontal text work
247: properly.)
248: .TP 10
249: shelf
250: Lay commands left to right. This is like the
251: stack prefix except cammands are moved to the right rather than down.
252: .SH HISTORY
253: The current version of prtx also accepts an old form of the
254: command language. It is compatibility with this old form
255: that makes the macro prefix require the prefixed command to
256: be a block. In the future this restriction will disappear.
257: .SH FUTURE PLANS
258: .SH SEE ALSO
259: .I prtx(1)
260: .SH AUTHOR
261: Jerry Schwarz (harpo!jerry)
262:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.