[fa.info-mac] MacWrite to Script/Troff translator: info

info-mac@uw-beaver (01/31/85)

From: Norman Meyrowitz <nkm%iris%brown.csnet@csnet-relay.arpa>

[ This can also be found in <info-mac>writetotroff.dco -jma ]

              MACWRITE TO SCRIPT/TROFF TRANSLATOR


As promised earlier,  here is a source distribution of the MacWrite to Script
and MacWrite to Troff translator written at Brown. This has been fairly-well
tested at Brown, and has proven to be crash-free over the last few months.
It runs with Version 2.2 MacWrite documents only right now, and will be
updated for the new version when a stable one arrives.

The SCRIPT version runs with University of Waterloo SCRIPT, and
is customized for a Xerox 9700 laser printer with a file
called "mwprof script". This will be included in the distribution as well.

The TROFF version is customized for an TROFF output device, but will work with
NROFF as well. Users of the MacWrite to Troff translator are encouraged to
look at the already archived translator done by Mike Caplinger at Rice
University to determine if this software is more appropriate for their use.

USE

The translator accepts the data fork of a MacWrite file as standard input and
generates a translated file as standard output. For example:

     mwscript <bazinga.data >bazinga.script
     mwtroff <bazinga.data >bazinga.me

translates the MacWrite file bazinga.data to the script file bazinga.script,
and
the MacWrite file bazinga.data to the troff/me file bazinga.me.

Once a translated the Script file is processed normally on the VM side (running
it through the appropriate Xerox 9700/SCRIPT execs if available at your site)
with the CPI=32 option.
The translated troff file is simply run through troff with the -me package.

The translator was written not to generate SCRIPT/TROFF files that an end
user would want to edit, but to generate files that would be processed and
sent directly to a laser printer. Thus, some of the SCRIPT/TROFF codings are
concerned with getting accurate output, not providing an elegantly readable
SCRIPT/TROFF file.

KNOWN BUGS/FEATURES

The software has several known bugs/features not implemented:

- Headers and footers are not implemented. Given the shortcomings of
  SCRIPT and TROFF in processing these and MacWrite in storing valuable
  semantic information about page numbers and the like, this was left
  out in the hopes that the newer versions of MacWrite might correct
  some of this.

- Tabs are not guaranteed to work after the first line of the paragraph
  (TROFF only). Troff does character placement following tabs based
  upon where the tab falls on the INPUT line, not on the OUTPUT line
  that is being built up. Thus, it is extremely difficult to get tabs
  correct for any but the first line, since the translator wraps lines
  when it needs to.

- Tabs are not guaranteed to work on lines with font changes (TROFF only).
  Again, because Troff determines tabs based upon the INPUT line, and
  because changing leading in TROFF cannot be done inline, one runs into
  the above problem.

- Decimal tabs are treated as right-aligned tabs in TROFF. (TROFF does
  not implement decimal tabs.)

- Only plain, bold, and italic are implemented in TROFF.

- Only plain, bold, italic, and bold-italic are implemented in SCRIPT.

- Point size changes are not implemented in SCRIPT.

- Pictures are treated as a page advance at all times.

CAVEATS

Because this is not a WYSIWYG (what you see is what you get) system, the
formatting (line breaks and page breaks) will not be exactly as seen on
the screen, though attempts are made to use character fonts that most closely
match the size of those in use on the Macintosh. Be warned that because of
fluctuations in character sizes, tabs with very close tolerances may not work
properly, as the characters in a previous tab field might spill over into the
next tab field. When working with tabbed columns, leave a little extra room for
safety.

As well, SCRIPT and TROFF commands do not pass through the translator as
commands -- they are treated as if they are normal text. This allows one to
have lines that begin with periods, for example:

   ...and seven years ago

without causing the SCRIPT or TROFF processors to interpret and as a command
and subsequently choke.

INSTALLATION

Script

Currently the SCRIPT version runs on VAXes and SUNs running 4.2 UNIX; it
has not been ported to the Waterloo C Compiler for VM, but it should port
with little effort. To compile the script version for UNIX, simply do

   cc -o mwscript mwxlate.c -DWSCRIPT

As well, on the VM system where it will be appropriately accessible,
install the file "mwprof script" so that it can be imbedded properly
in each individual's script document (this file contains the appropriate
input translations to get special characters).

Troff

The TROFF version runs on VAXes and SUNs running 4.2 UNIX and has produced
output for 240, 300, and 480 dot/inch Imagens and a 240 dot/inch Varian
plotter. To compile the troff version for UNIX, simply do

   cc -o mwtroff mwxlate.c -DTROFF

This is all that should be needed for this version.

SUPPORT

We expect to be keeping this version up-to-date with any bug fixes that
may be reported, or an additions that people may desire to make. You are
encouraged to mail any additions or problems to

   nkm%brown@csnet-relay   (CSNET) or
   nkm@browncs             (BITNET)

so that we may include them in subsequent releases. If you do find bugs,
that you believe are worthy of reporting, please send a written description of
the problem, a machine down-loadable version of the original MacWrite document,
and the translated version to the above address. Because of limited manpower,
we won't be able to provide telephone consulting for individual problems,
but will try to answer electronic mail that comes our way.

DISTRIBUTION FORMAT

Mailed to net.sources and archived on info-mac will be two files:

   mwxlate.c  -- the source code for both the troff and script translators
   mwprof.script -- the script include file for the script translated
documents.

COPYRIGHT

The translator is (c) 1984 Brown University. It is distributed at no cost,
with no warantees expressed or implied, and may used and modified, but not
sold without permission.

FINAL THOUGHTS

Good luck. We know that this is but a first crack at the problem, but hope
it will be of some use to those of you out there, and encourage additions,
criticisms, complaints, and anything else you might like to add. Bon Voyage!

Norman Meyrowitz
Institute for Research in Information and Scholarship (IRIS)
Brown University
Box 1946
Providence, RI  02912

 Return-Path: <nkm%IRIS%brown.csnet@csnet-relay.arpa>
Received: from csnet-relay by SUMEX-AIM.ARPA with TCP; Wed 30 Jan 85 21:07:01-PST
Received: from brown by csnet-relay.csnet id bv04948; 30 Jan 85 21:21 EST
Received: from mailhost.IRIS.Brown.CSNet with SMTP via ethernet
	  by nancy.CS.Brown.CSNet; 30 Jan 85 (Wed) 18:59:33 EST
Message-Id: <8501302359.AA01976@mailhost.IRIS.Brown.CSNet>
Date:     30 Jan 85 (Wed) 18:59:58 EST
From:     Norman Meyrowitz <nkm%iris%brown.csnet@csnet-relay.arpa>
To:       info-mac%sumex-aim.arpa@csnet-relay.arpa
Subject:  MacWrite to Script character translation table: mwprof script

[ Find this file in mwprof.script -jma
   Does that name make sense? ]
30-Jan-85 21:19:26-PST,95887;000000000001
Return-Path: <nkm%IRIS%brown.csnet@csnet-relay.arpa>
Received: from csnet-relay by SUMEX-AIM.ARPA with TCP; Wed 30 Jan 85 21:08:40-PST
Received: from brown by csnet-relay.csnet id bw04948; 30 Jan 85 21:24 EST
Received: from mailhost.IRIS.Brown.CSNet with SMTP via ethernet
	  by nancy.CS.Brown.CSNet; 30 Jan 85 (Wed) 18:59:51 EST
Message-Id: <8501302359.AA01973@mailhost.IRIS.Brown.CSNet>
Date:     30 Jan 85 (Wed) 18:59:34 EST
From:     Norman Meyrowitz <nkm%iris%brown.csnet@csnet-relay.arpa>
To:       info-mac%sumex-aim.arpa@csnet-relay.arpa
Subject:  MacWrite to Script/Troff translator: mwxlate.c (src code)

[ This file is archived in mwxlate.c -jma  ]
-------