[net.text] fixed format displays in troff

colin@torch.UUCP (colin) (10/23/86)

I am trying to include some formatted output from a program in a document
which is being formatted using troff. To do this I am using the .DS and .DE
macros (MM macros), e.g:

.DS
$ ls7
fred     bill     bert     albert
harold   jim      egbert   jane
janet    john
$
.DE

I am using troff in conjunction with TranScript (from Abobe) together with
a PostScript laser printer.  The TranScript system provides Times and Helvetica 
proportional fonts for use with troff which consequently do not produce aligned 
output in such a display.

Does anyone know a way round this problem ? Thanks in advance for any help.

guy@sun.UUCP (10/27/86)

> I am trying to include some formatted output from a program in a document
> which is being formatted using troff. ... I am using troff in conjunction
> with TranScript (from Abobe) together with a PostScript laser printer.
> The TranScript system provides Times and Helvetica proportional fonts for
> use with troff which consequently do not produce aligned output in such a
> display.
> 
> Does anyone know a way round this problem ? Thanks in advance for any help.

1) System V, Release 1 had a "cw" command that provided some sort of support
for a "constant-width" font.  Unfortunately, the old-style "troff" provided
with S5R1 didn't support more than four fonts; "cw" required you to choose
whether to mount the constant-width font on font position 1, 2, or 3, so you
had your choice of giving up the regular, Italic, or boldface version of the
standard font.

2) "troff" disappeared from S5R2; you have to buy the Documenter's Workbench
software to get it.  However, you then got Typesetter-Independent "troff",
which can handle more fonts simultaneously.  I believe TranScript supports
translating TITROFF output to PostScript.  We have a constant-width font
named "L" here (I don't know whether it comes with TranScript or not) and
that's how we produce that sort of stuff.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)

crocker@ihwpt.UUCP (ron crocker) (10/28/86)

> 
> I am trying to include some formatted output from a program in a document
> which is being formatted using troff. To do this I am using the .DS and .DE
> macros (MM macros), e.g:
> 
> .DS
> $ ls7
> fred     bill     bert     albert
> harold   jim      egbert   jane
> janet    john
> $
> .DE
> 
> I am using troff in conjunction with TranScript (from Abobe) together with
> a PostScript laser printer.  The TranScript system provides Times and Helvetica 
> proportional fonts for use with troff which consequently do not produce aligned 
> output in such a display.
> 
> Does anyone know a way round this problem ? Thanks in advance for any help.


You can do this using tbl, a program that formats data into tables.

Use the following:

.DS
$ ls7
.TS
l l l l.
fred->bill->bert->albert
harold->jim->egbert->jane
janet->john
.TE
$
.DE

where -> represents a TAB (ASCII ^I).  When you format this, do

	tbl filename | troff (the same old options you had)

This should give you something better.

Ron Crocker
AT&T Bell Laboratories
Room IH 6D535
Naperville-Wheaton Road
Naperville, IL  60566

(312) 979-4051

chris@umcp-cs.UUCP (Chris Torek) (10/29/86)

In article <2@torch.UUCP> colin@torch.UUCP writes:
>I am trying to include some formatted output from a program in a
>document which is being formatted using troff. ...

Fixed width text looks awful unless you have a fixed width font.
There are some constant width troff fonts available, but I have
never found them pleasant to use (on the other hand, I switched to
TeX before trying ditroff).  Your particular example is probably
best done with tables; see the tbl documentation.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu