In these days of cheap laser printers, can there be anyone who uses an
Epson LQ dot matrix device to produce text with Greek and other special
characters, equations, and relatively complex tables, yet that is clean
enough for submission to a journal?  If you are among the hard-core few
who find the Epson useful, read on.

These programs provide the following:

(1) Nroff driver tables for LQ-1500-compatible printers, for Elite and
Pica modes.  There is an essentially complete set of nroff special
characters (Greek, math, etc).  Neqn and tbl work properly.  The nroff
drivers (/usr/lib/term/tabepson*) are compiled from "tabepson*.c" and
"code.epson".

(2) The nroff output must be processed before printing, first by the
UNIX filter "col", to convert reverse movements to the half and full
line forward movements allowed by the Epson, and then by "epf", to
convert the driver codes to Epson LQ-1500 printer control strings for
user-defined characters.

(3) If text contains both (a) reverse line feeds and (b) bold or italic
font in a reverse line-feed section, then bold and italic must be
implemented by overstriking, rather than by Epson "font" changes.  This
is because "col" processing changes the ordering of characters.  The
"nobs" filter handles overstriking like "col" handles carriage
movements; it is needed for printers than cannot overstrike a character
with itself, and is generally convenient for reducing chatter.

(4) Miscellaneous:  Test files (specialgrk, specialtbl, specialeqn1,
specialeqn2).  Man pages (epf.1, nobs.1).  Mk.code.list (shell script 
gives a table of the non-ascii special characters -- showing nroff
notation, description, tabepson code, SO-SI code).  Epseqnchar
(/usr/pub/eqnchar modified to use the tabepson driver table). A
prototype lp interface script ("epson").


Code from the following public domain sources was used:

(1) John Nellen, Delft Univ. of Technology 
..!{decvax,philabs}!mcvax!dutesta!john 
Newsgroups: net.sources
Subject: Epson filter to type nroff Non-ASCII char's (no 1 of 4)
Date: 30 Oct 85 09:54:20 GMT

This package is not in the comp.sources archives.  It is on simtel20.arpa.

The LQ-1500 user-defined characters were taken over without change. A
few math symbols were added.  This code is in matrix.h.  The generating
programs and pictures are in the Matrix directory.  The graphics designed
by John Nellen are notably good.

The code for the driver tables ("tabepson.c" and "code.epson") was
rewritten.  In order to get compatiblity with "col", and thus the
capability of using "tbl" and "neqn", all special characters not
obtained from the printable ascii set are represented by strings of the
form SO-<single printable char>-SI; half-line forward and reverse line
movements are represented by ESC-[789]; printer setup and reset is
minimal (better to do this in the "lp" interface); bold and italics are
implemented by overstriking; the horizontal and vertical motions
possible with the Epson are described properly in parameter values used
by tbl and eqn.

The filter for translating the driver table code to Epson LQ printer
control strings ("epf.c") was rewritten, to be compatible with the
driver tables and with "col".  


(2) The "nobs" filter, which handles overstriking, is loosely based on:

	comp.sources.misc: Volume 3, Issue 44
	Submitted-By: "A. Nonymous" <chad@anasaz.UUCP>
	Archive-Name: nobs

It is fully compatible with "col" (SO-<char>-SI and ESC-[789]), and
with "epf".


(3) Compilation of the driver tables relies on the package by
Bruce Townsend (bnr-vpa!bruce)	Phone:	(613) 726-3008:

	Subject:  v13i069:  Nroff driver table utility
	Newsgroups: comp.sources.unix,comp.text
	Posting-number: Volume 13, Issue 69
	Archive-name: nroff-driver

The two files needed for making the driver tables ("table.c" and
"table.h") are included here.  The full sources can be obtained from the
comp.sources.unix archives, and they are well worth acquiring (elbat, a
disassembler for nroff drivers; table.5, the man page; and other
goodies).


COMMENTS:

Tested with sysV.rel2 only.  The driver tables appear to be compatible
with our cs department's nroff, running under BSD4.3.

Some thought might to be given to configuration of the printer and printer
port.  This can be done by building configuration commands into the
interface in /usr/spool/lp, or if this is not possible, by wrapping them
in a shell script.  It may be convenient also to wrap "col", "nobs",
"epf", etc, into the interface or a shell script.  A prototype
lp interface, "epson", is included.

The "col", "nobs", and "epf" filters signicantly increase the size of
the output from nroff, if there are reverse carriage movements or
user-defined characters, or worse, overstruck user-defined characters.
"Epf" expands each such character to a 105-byte printer control sequence
and "col" and "nobs" work by adding half-spaced or overwriting with
largely space-filled lines.  Generally the raw nroff output should be
piped through the filters directly to a printer.  The test targets of
the makefile, however, generate intermediate files, for inspection
during testing.

The widths of the user-defined characters are significantly greater than
the 1/12" of Epson Elite mode.  They are close to 1/10" and thus more
suitable for Epson Pica mode.  For best-looking results, use
unidirectional printing.  And if using user-defined characters heavily,
better not use Elite mode.

There are control characters in the makefile, in the script
"nroff.to.epson", and in "epseqnchar". For the first two files, 
mnemonics for the control characters are given in a makefile comment.
For the latter, compare "epseqnchar" and "epseqnchar.ctl", the latter
obtained as:
	cat -v epseqnchar >epseqnchar.ctl

The Townsend package and the driver table code provided here are for the
"old" nroff version, with compiled tables in /usr/lib/term.  For
interconversion between old and new styles, see:

	Subject:  v15i046:  Tools for nroff graphics on dot-matrix printers
	Newsgroups: comp.sources.unix
	Submitted-by: snark!eric (Eric Raymond)
	Posting-number: Volume 15, Issue 46
	Archive-name: nroffgraphics (2 parts)

For packages for MX80 compatibles, see the above distribution and also the
following one, obtainable from simtel20.arpa:

	From: "Thomas E. Tkacik" <tet@uvaee.uucp>
	Newsgroups: net.sources
	Subject: UNIX PC epson printer driver for nroff
	Date: 18 Feb 86 16:28:15 GMT

This driver implements Epson bold and italic modes, rather than using
overstriking for them.


TESTING:

(1) Create two files in "/usr/lib/term" that you can write upon, that
can be recognized as tab files by nroff, and that do not conflict with
system file names (makefile defaults are tabepstst and tabepstst-12).
If the default names are not used, redefine T and T12.  Uncomment the
lines marked "careful" in the *.tab targets.

(2) Identify a device in LP and LP12 that can pass a file through to an
LQ-type printer, without altering it.  The makefile default is
">/dev/epson".  If you use it, you probably will have to configure the
printer ports by hand, to put them into raw mode.  The drivers put the
printer into pica or elite mode, but do no other configuration.  The
file "epson" is a printer interface script that has options for printer
configuration and calls a routine to configure the printer ports.

(3) run: 	make test test12



Would appreciate learning of improvements.

Cheers,

John Rupley
 uucp: ..{uunet | ucbvax | cmcl2 | hao!ncar!noao}!arizona!rupley!local
 internet: rupley!local@megaron.arizona.edu
 (H) 30 Calle Belleza, Tucson AZ 85716 - (602) 325-4533
 (O) Dept. Biochemistry, Univ. Arizona, Tucson AZ 85721 - (602) 621-3929
