[comp.unix.questions] troff, C/A/T and dvi ?

stef@zweig.sun (Stephane Payrard) (07/13/90)

Where I can find a complete definition of the C/A/T format?  What is
the relationship between the C/A/T format and the dvi format.  Do
every possible troff (ATT troff, Berkeley troff...) called by "troff
-t ..." line command emit always C/A/T format (if yes, read instead
"always the same C/A/T format")?

        thanks

        stef

--
Stephane Payrard -- stef@sun.com -- (415) 336 3726
Sun Microsystems -- 2550 Garcia Avenue --  M/S 10-09 -- Mountain View  CA 94043

                     
                     

lauther@janus.Berkeley.EDU (Ulrich Lauther) (07/13/90)

In article <STEF.90Jul12181552@zweig.sun> stef@zweig.sun (Stephane Payrard) writes:
>
>
>Where I can find a complete definition of the C/A/T format?  What is
> 
on SIMTEL in
PD2:<UNIX-C.POSTSCRIPT> you will find
    PSROFF.TAR-Z
	Converts "old" troff (for the C/A/T) to PostScript.  Can also output
	device-independent troff intermediate files.  NOTE:  This is NOT
	the "psroff" program from Adobe.
	Contributor: Chris Lewis <eci386!lewis@uunet.uu.net>

This contains also a man-page describing C/A/T-format.
-----------------------------------------------------------------
Ulrich Lauther               Internet: lauther@janus.berkeley.edu
Siemens / UCB                ph: +1 415 642 3338 fax: 642 2739
				 +1 415 658 8529 home

gwyn@smoke.BRL.MIL (Doug Gwyn) (07/16/90)

In article <STEF.90Jul12181552@zweig.sun> stef@zweig.sun (Stephane Payrard) writes:
>Where I can find a complete definition of the C/A/T format?

Presumably you would have to get the C/A/T programmer's manual from Wang.
Somebody (possibly Henry Spencer) once posted a UNIX manual entry that
described the format sufficiently for use in designing otroff postprocessors.

>What is the relationship between the C/A/T format and the dvi format.

There isn't any.  There do exist programs that translate from one to the
other.

>Do every possible troff (ATT troff, Berkeley troff...) called by "troff
>-t ..." line command emit always C/A/T format (if yes, read instead
>"always the same C/A/T format")?

No, in fact modern troff produces a device-independent text format that
requires postprocessing for whatever device you happen to want the image
displayed on.  Old versions of troff, known as otroff to those using
modern troff, either directly open /dev/cat or else, with the -t option,
send C/A/T codes to the standard output.  New troff (sometimes known as
ditroff to those using old troff) always sends to standard output; -t is
not needed.

If you need to adapt troff to some new device, I highly recommend starting
with modern troff as found in the Documenter's WorkBench package (also
sold with enhancements by various third-party VARs).

clewis@eci386.uucp (Chris Lewis) (07/20/90)

In article <13360@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
> In article <STEF.90Jul12181552@zweig.sun> stef@zweig.sun (Stephane Payrard) writes:
> >Where I can find a complete definition of the C/A/T format?
 
> Presumably you would have to get the C/A/T programmer's manual from Wang.
> Somebody (possibly Henry Spencer) once posted a UNIX manual entry that
> described the format sufficiently for use in designing otroff postprocessors.

Yes, Henry Spencer wrote cat(5).  It's what I used to build psroff.
(which can generate postscript, HPLJ PCL or ditroff codes).
Henry's man page isn't complete (it doesn't have the FLASH code to
actual glyph correspondances - which is semi-hard to find out without
troff sources), but is more than enough to get you started.  There is
also a section in Sun's docs "Using NROFF and TROFF" (pn 800-1755-10,
Rev A, 1988 Appendix E) which has the same information.
cat(5) is included in psroff 1.0.  Psroff 2.0 (in comp.sources.unix
when Rich gets back from vacation) has cat(5) plus a source file with
the precise FLASH correspondances (and width table indexes).  If you
can't find them somewhere else, send me mail and I'll send you cat(5)
and cattab.c.

> If you need to adapt troff to some new device, I highly recommend starting
> with modern troff as found in the Documenter's WorkBench package (also
> sold with enhancements by various third-party VARs).

To clarify a bit.... modern troff is capable of much better printer
independence than CAT troff, and has considerably more features
(such as line drawing, and extensible character set).  Therefore,
to support a new printer, you should implement a "DITROFF format
(as opposed to CAT format)-to-your-printer" converter.  You will
also need to find a way to build the ditroff width tables for
your printer.  Ditroff format is somewhat easier to handle than C/A/T.
(at least to a first approximation - at least it's ASCII ;-)

HOWEVER, almost all ditroffs cost money, and you may not have one.
Almost all UNIXs come with a cheap (or bundled in) CAT Troff.
In such a case, *still* build your printer stuff to handle
ditroff, and use psroff (or "cat2dit") to generate ditroff
format from CAT Troff.

Doing it this way (using ditroff input) gives you the best of both
worlds - all ditroff owners can use your software directly, and CAT
troff owners can use your driver with psroff generating ditroff from
CAT troff.  Building your driver to accept C/A/T codes would be
a bit pointless - ditroff users could never use it (only an insane
person would convert ditroff format to CAT format).
-- 
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list