[comp.text] Unix v10 changes to troff, pic, tbl and eqn

jjc@jclark.UUCP (James Clark) (10/14/90)

Here's a description of the features of troff, pic, tbl, and eqn
described in the 10th edition of Unix Research System manual that
aren't implemented in DWB 2.0.  If I've missed anything, I would
appreciate hearing about it.  I would also like to hear about any
differences between the versions of troff, pic, eqn, and tbl in DWB
3.1 and those in Unix v10.

TROFF

Troff reads the ASCII versions of the device and font description
files rather than the binary .out versions.  The charset section in
the device description file is optional.  Unrecognized commands are
permitted in both device and font description files (before the
charset section) and are ignored by troff.  There is no limit on the
number of special characters.

In a font description file, a character name of `---' refers to an
unnamed character.

Long character names can be accessed using the syntax \C'xxx'.

The `fp' request has an optional third argument giving the long name
of the font which is used to find the font description file.

Two digit point sizes can be used with the \s escape sequence using
the syntax \s+-(nn.

One of the characters ?!. followed by any number of the characters
"')]*\(dg is recognized as the end of a sentence if followed by a
newline or more than one space.

PIC

Arguments of the form `X anything X' are now allowed to be of the form
`{ anything }'. For example,
  for i = 1 to 10 do { for j = 1 to 10 do { circle at i,j }}
is allowed instead of
  for i = 1 to 10 do X for j = 1 to 10 do Y circle at i,j Y X

A bare expression can be used as an attribute, implying motion in the
current direction.

`^' can be used in numeric expressions to indicate exponentiation.

The rand() function does not take an argument and returns a number
between 0 and 1.

`sprintf("format", arg1,...)' can be used in all the places that a
quoted string can be used.  [The plot statement seems to have
disappeared.]

The height of a text object is the number of text strings associated
with the object times the value of the `textht' variable; the width is
the value of `textwid'. Initially `textwid' and `textht' have a value
of 0.

The maximum width and height of a picture is taken from the variables
`maxpswid' and `maxpsht'. Initially these have a value of 8.5 and 11.

Pre-defined variables can be reset to their default values using
  reset var1 var2
If no arguments are supplied, all pre-defined variables are reset.

In the `for' statement the expression in the `by' clause can be
prefixed with `*' to indicate that the step is multiplicative.

There is a limited facility for filling objects.  Boxes, circles and
ellipses can be given an attribute of `fill' with an optional argument
giving the gray-level to use for filling.  If the argument is omitted,
the gray-level is taken from the variable `fillval'. A gray-level of 0
indicates black, 1 white, and values in between shades of gray, as in
PostScript.

Multiple positioning attributes can be specified for each text string.
For example,
	box "text" above ljust

Arrowheads can be filled. This is controlled by the `arrowhead'
variable.

The statement
  undef foo
will remove the definition of `foo'.

TBL

I didn't notice any new features.

EQN

`utilde' puts a tilde accent underneath a box.

There are some limited facilities for tuning eqn output without
changing the source.  The macros `vec_def', `dyad_def', `hat_def',
`tilde_def' `dot_def', `dotdot_def', `utilde_def', `sum_def',
`union_def', `inter_def', `prod_def', and `int_def' contain the
strings that are used to print the corresponding type of object.  The
macros `Supbase' and `Subbase' contain numbers that control the
positioning of subscripts and superscripts.

James Clark
jjc@jclark.uucp
jjc@ai.mit.edu

npn@cbnewsl.att.com (nils-peter.nelson) (10/16/90)

In article <JJC.90Oct13192908@jclark.jclark.UUCP>, jjc@jclark.UUCP (James Clark) writes:
> Here's a description of the features of troff, pic, tbl, and eqn
> described in the 10th edition of Unix Research System manual that
> aren't implemented in DWB 2.0.  If I've missed anything, I would
> appreciate hearing about it.  I would also like to hear about any
> differences between the versions of troff, pic, eqn, and tbl in DWB
> 3.1 and those in Unix v10.
> 
> TROFF
> 
> Troff reads the ASCII versions of the device and font description
> files rather than the binary .out versions.  The charset section in
> the device description file is optional.  Unrecognized commands are
> permitted in both device and font description files (before the
> charset section) and are ignored by troff.  There is no limit on the
> number of special characters.
> 
> In a font description file, a character name of `---' refers to an
> unnamed character.
> 
> Long character names can be accessed using the syntax \C'xxx'.
> 
> The `fp' request has an optional third argument giving the long name
> of the font which is used to find the font description file.
> 
> Two digit point sizes can be used with the \s escape sequence using
> the syntax \s+-(nn.
> 
> One of the characters ?!. followed by any number of the characters
> "')]*\(dg is recognized as the end of a sentence if followed by a
> newline or more than one space.
> 
> PIC
> 
> Arguments of the form `X anything X' are now allowed to be of the form
> `{ anything }'. For example,
>   for i = 1 to 10 do { for j = 1 to 10 do { circle at i,j }}
> is allowed instead of
>   for i = 1 to 10 do X for j = 1 to 10 do Y circle at i,j Y X
> 
> A bare expression can be used as an attribute, implying motion in the
> current direction.
> 
> `^' can be used in numeric expressions to indicate exponentiation.
> 
> The rand() function does not take an argument and returns a number
> between 0 and 1.
> 
> `sprintf("format", arg1,...)' can be used in all the places that a
> quoted string can be used.  [The plot statement seems to have
> disappeared.]
> 
> The height of a text object is the number of text strings associated
> with the object times the value of the `textht' variable; the width is
> the value of `textwid'. Initially `textwid' and `textht' have a value
> of 0.
> 
> The maximum width and height of a picture is taken from the variables
> `maxpswid' and `maxpsht'. Initially these have a value of 8.5 and 11.
> 
> Pre-defined variables can be reset to their default values using
>   reset var1 var2
> If no arguments are supplied, all pre-defined variables are reset.
> 
> In the `for' statement the expression in the `by' clause can be
> prefixed with `*' to indicate that the step is multiplicative.
> 
> There is a limited facility for filling objects.  Boxes, circles and
> ellipses can be given an attribute of `fill' with an optional argument
> giving the gray-level to use for filling.  If the argument is omitted,
> the gray-level is taken from the variable `fillval'. A gray-level of 0
> indicates black, 1 white, and values in between shades of gray, as in
> PostScript.
> 
> Multiple positioning attributes can be specified for each text string.
> For example,
> 	box "text" above ljust
> 
> Arrowheads can be filled. This is controlled by the `arrowhead'
> variable.
> 
> The statement
>   undef foo
> will remove the definition of `foo'.
> 
> TBL
> 
> I didn't notice any new features.
> 
> EQN
> 
> `utilde' puts a tilde accent underneath a box.
> 
> There are some limited facilities for tuning eqn output without
> changing the source.  The macros `vec_def', `dyad_def', `hat_def',
> `tilde_def' `dot_def', `dotdot_def', `utilde_def', `sum_def',
> `union_def', `inter_def', `prod_def', and `int_def' contain the
> strings that are used to print the corresponding type of object.  The
> macros `Supbase' and `Subbase' contain numbers that control the
> positioning of subscripts and superscripts.
> 
> James Clark
> jjc@jclark.uucp
> jjc@ai.mit.edu


My sincere apologies for reprinting James Clark's letter
in it's entirety, but the most common question I'm asked
is "What's the difference between DWB 3.1 and DWB 2.0?"
Jim's list is a good start. Add the fact that several
hundred bugs were fixed, the PostScript support added,
and the Picasso drawing program (not in the V10 book!)
and you've pretty much got the picture. The V10 manual
and DWB 3.1 were issued at about the same time and
represent the same "state-of-the-art". The description
in the V10 book corresponds to the 3.1 source code.