UNIX PC epson printer driver for nroff

Thomas E. Tkacik tet at uvaee.UUCP
Wed Feb 19 02:28:15 AEST 1986


The following shell file contains the program epx,
a driver for epson printers using nroff on an ATT 7300 (maybe any UNIX).
It should work with all Epson and epson compatible printers in draft mode.
It may work with epson compatible printers in near letter quality mode.

Also included is an nroff driver table for epson printers (tabepson.c), that
should be compiled with Bruce Townsend's table utility (thanks Bruce).
Epx will not work without it.

			Have fun with it, and good luck.
					 Tom Tkacik
		...decvax!mcnc!ncsu!uvacs!uvaee!tet

########################### cut on the dotted line ##########################
# To unbundle, sh this file
echo Makefile 1>&2
cat >Makefile <<'End of Makefile'
CFLAGS = -O
LDFLAGS = -s
epx:	epx.o nlq.o draft.o
	$(CC) $(LDFLAGS) epx.o nlq.o draft.o -o epx
test:
	neqn special | nroff -Tepson | col -fx | epx | lp -dEpson_R
lint:
	lint epx.c nlq.c draft.c


End of Makefile
echo epx.l 1>&2
cat >epx.l <<'End of epx.l'
.TH EPX l
.SH NAME
epx \- nroff postprocessor for epson printers
.SH SYNOPSIS
\fBepx\fP [ -\fBi\fP ] [ -\fBn\fP ]
.SH DESCRIPTION
.I Epx
is a postprocessor for
.IR nroff (1)
which generates printer codes for Epson compatible printers.
Usage is almost always:
.sp
.in +0.5i
nroff -Tepson files | col -fx | epx | lp -dEpson_R
.sp
.in
or equivalent.
.I Epx
reads from
.IR stdin
and writes to
.IR stdout .
It supports the built-in bold and italic fonts, half-line spacings
for super, and subscripts, and all of the greek and special characters.
.sp
It has been written to be compatible with
.IR col (1)
using the
.RB - x ,
and
.RB - f
options.
Output must be sent to the print spooler in raw mode,
using
.B lp -dEpson_R.
.I Epx
requires that the nroff driver table
.RB /usr/lib/term/ tabepson
exist and be used with
.I nroff.
.sp
Normally
.I epx
underlines words that would be italicized in
.IR troff (1).
The
.RB - i
option causes the printer to use true
.IR italics ,
(if possible).
If the printer is not capable of printing in
.I italics
the text will \fBnot\fP be underlined.
The
.RB - n
option puts the printer in Near Letter Quality mode.
No
.I italics
are possible in NLQ mode, so when the
.RB - n
option is used, italics are turned off, and any italic characters will
be underlined.
.SH SEE ALSO
nroff(1), col(1), lp(1), term(7).
.SH AUTHOR
Thomas E. Tkacik  (University of Virginia)
.SH BUGS
The greek and special character sets were designed using a Canon printer.
These characters may or may not look right, depending on the actual
printer used.
Perhaps, italics and NLQ mode should not be mutually exclusive.
End of epx.l
echo README 1>&2
cat >README <<'End of README'
	Epx generates nroff output for epson compatible printers.
This should work on any compatible printer in draft mode.
Some playing may be needed for NLQ mode.

To make the program type
$ make epx

	Create the nroff driver table tabepson using Bruce Townsend's program
that was posted to the net, and move it to /usr/lib/term/tabepson.

	After epx and tabepson have been installed (tabepson in /usr/lib/term),
test the program by typing (with the printer on)
$ make test

	On close examination of an actual Epson FX-85 manual, it has been
discovered that epson compatible printers are only compatible in draft mode.
The command to put the printer in NLQ mode may be different.  Look at the
subroutines tonlq(), and frnlq(), to make sure they are correct for your
printer.  In tonlq(), the string "\033(" should be replaced with "\033x"
on real epson printers.  Real epson printers do not allow user
defined characters in NLQ mode, so epx will only work in draft mode anyway.

	Some printers allow italics in NLQ mode,
so the statement turning off italics in NLQ mode may also be removed.

	This program may be used with any printer that have the needed
capabilities by changing the routines
tobold(),frbold(),toitalic(),fritalic(),tounder(),frunder(),tospec(),frspec(),
tonlq(),frnlq(),halfline(),backhalf(),backfull(),download()
as required.

	If you have trouble installing epx, or find any bugs
	e-mail your report to
		Tom Tkacik
		University of Virginia   E.E. Department
	...decvax!mcnc!ncsu!uvacs!uvaee!tet
End of README
echo epx.c 1>&2
cat >epx.c <<'End of epx.c'
/*  epx - take the output of 'nroff -Tepson | col -xf'	*/
/*	  and generate output for an epson printer	*/
/*							*/
/*	Author: Thomas E. Tkacik  uvaee!tet		*/
/*							*/
/*	To be modified or given away freely		*/
/*							*/
#include <stdio.h>
#define	NORMAL	0
#define	BOLD	1
#define	UNDER	2	/* underscore - italic */
#define	ITALIC	4
#define	SPEC	8	/* special characters - greek */
#define	NUMSPEC	60	/* number of defined special characters */
#define	FIRST	'@'	/* first special character is defined as FIRST */
#define	NO	0
#define	YES	1

int	cur;	/* current character */
int	ctype;
int	italics = NO;	/* use italics instead of underline */
int	nlqmode = NO;	/* print in Near Letter Quality mode */
int	copy=0;	/* no special characters yet */
int	cmark[NUMSPEC];
extern	char	special[NUMSPEC][12];	/* character definitions	*/
extern	char	nlq[NUMSPEC][48];	/* nlq character definitions	*/

main(argc,argv)
int	argc;
char	*argv[];
{
	int c;
	int i,x;
	void putch(),putstr(),inspec(),outspec(),donormal();
	void tobold(),frbold(),tounder(),frunder(),toitalic(),fritalic();
	void tonlq(),frnlq(),halfline(),backhalf(),backfull();

	/* cannot use both NLQ and italics at the same time */
	nlqmode = NO;
	italics = NO;
    
	for(x=0;x<argc;x++)
		if(argv[x][0] = '-')
			switch(argv[x][1]) {
			case 'i': italics = YES;
			  	break;
			case 'n': nlqmode = YES;
			  	tonlq();	/* put printer in NLQ mode */
			  	break;
			}

	/* remove this statement if your printer can print italics in NLQ */
	if(nlqmode==YES) italics = NO;
    
    for(i=0;i<NUMSPEC;i++) cmark[i]=0; /* initialize special characters */
    cur =  0; /* no current character */
    ctype = NORMAL;  /* normal character */
    while((c=getchar()) != EOF) {
      switch (c) {
      default:          /* normal or special characters being printed */
          donormal();
          cur = c;
          break;
      case '\016':	/* special character set */
          inspec();
          break;
      case '\017':	/* normal character set */
          outspec();
          break;
      case '\033':	/* escape character */
	  if(cur)
	    putch(cur);
	  cur = 0;
	  if((c=getchar())==EOF) break; /* reached the end of file */
	  switch(c) {
	    case '7':
		backfull();		/* reverse full line feed */
		break;
	    case '8':
		backhalf();		/* reverse half line feed */
		break;
	    case '9':
		halfline();		/* forward half line feed */
	        break;
	    default:
	        putch('\033');	/* output escape character */
	        putch(c);
	        break;
	  }
	  break;
      case '\b':   /* a backspace - see if we must change print mode */
          while(((c=getchar())=='\016') || (c=='\017'))
            if(c=='\016')
              inspec();
            else
              outspec();
          if(c==EOF) break;  /* reached end of the file */
          if((cur==0) && (c!=0)) {     /* just do the overstrike */
            (void)putchar('\b');
	    (void)ungetc(c,stdin);  /* check the character next time around */
          }
          else if((cur=='_') && (c!='_')) { /**** ITALIC MODE ****/
            switch(ctype) {
              case BOLD:
              case (BOLD | SPEC):
		frbold();
                ctype &= ~BOLD;
		toitalic();
                ctype |= ITALIC;
                break; 
              case UNDER:
              case (UNDER | SPEC):
		frunder();
                ctype &= ~UNDER;
		toitalic();
                ctype |= ITALIC;
                break;
              case NORMAL:
              case SPEC:
		toitalic();
                ctype |= ITALIC;
                break;
              default:  /* ITALIC or (ITALIC | SPEC) */
                break;
            }
            putch(c);
            cur = 0; /* have output the current character */
          }
          else if((cur!='_') && (c=='_')) { /**** UNDERSCORE MODE ****/
	    /* do not print in underscore mode */
	    /* because '_' and underscore are not the same thing */
            putch(cur);
	    putch('\b');
            putch('_');
            cur = 0; /* have output the current character */
          }
          else if(cur==c) {             /**** BOLD MODE ****/
            switch(ctype) {
              case UNDER:
              case (UNDER | SPEC):
		frunder();
                ctype &= ~UNDER;
		tobold();
                ctype |= BOLD;
                break;
              case ITALIC:
              case (ITALIC | SPEC):
		fritalic();
                ctype &= ~ITALIC;
		tobold();
                ctype |= BOLD;
                break;
              case NORMAL:
              case SPEC:
		tobold();
                ctype |= BOLD;
                break;
              default:
                break;
            }
            putch(cur);
            /* find the beginning of the next character */
            while((c=getchar())=='\b') {
              c=getchar();
              if(cur != c) {
                putch('\b');  /* a different character - print it */
                (void)ungetc(c,stdin); /* check  character next time around */
                cur = 0;
		break;
              }
            }
	    if(cur) {
	      (void)ungetc(c,stdin); /* check character next time around */
	      cur = 0;
	    }
          }
          else { /* simple overstrike - do not change mode */
            if(cur) putch(cur);
	    cur = 0;
            (void)putchar('\b');
	    (void)ungetc(c,stdin); /* check character next time around */
          }
          break;
      } 
    }
    if(cur!=0) putch(cur);    /* print the last character */
    if(nlqmode==YES) frnlq();
}

/* put printer into alternate character set - user defined characters */
void tospec()
{
	void putstr();
	putstr("\033%");
	(void)putchar(1);
	(void)putchar(0);
}

/* the next characters are normal characters */
void frspec()
{
	void putstr();
	putstr("\033%");
	(void)putchar(0);
	(void)putchar(0);
}

/* print next characters in bold */
void tobold()
{
	void putstr();
	putstr("\033E");
}

/* do not print next characters in bold */
void frbold()
{
	void putstr();
	putstr("\033F");
}

/* print the next characters in italic */
void toitalic()
{
	void putstr(),tounder();
	if(italics == YES)
		putstr("\0334"); /* italicize next chatacters */
	else
		tounder();	 /* underline next characters */
}

/* do not print the next characters in italic */
void fritalic()
{
	void putstr(),frunder();
	if(italics == YES)
		putstr("\0335");
	else
		frunder();
}

/* underline the next characters */
void tounder()
{
	void putstr();
	putstr("\033-1");
}

/* do not underline the next characters */
void frunder()
{
	void putstr();
	putstr("\033-0");
}

/* put the printer in NLQ mode - this command may vary depending on printer */
void tonlq()
{
	void putstr();
	putstr("\033(");
}

/* restore printer mode */
void frnlq()
{
	void putstr();
	putstr("\033@");
}

/* cause the printer to generate a half linefeed */
void halfline()
{
	void putstr();
	putstr("\033J\022");
}

/* cause the printer to back up a half line spacing */
void backhalf()
{
	void putstr();
	putstr("\033j\022");
}

/* cause the printer to back up a full line spacing */
void backfull()
{
	void putstr();
	putstr("\033j\044");
}

/* download a special character before printing it */
void download(c)
char c;
{
	int i,j;
	void putstr(),frspec(),tospec();
	j = c - FIRST;
	putstr("\033&");
	(void)putchar(0);
	(void)putchar(c);
	(void)putchar(c);
	if(nlqmode==YES) {
		for(i=0;i<48;i++)
			(void)putchar(nlq[j][i]);
	} else {
		for(i=0;i<12;i++)
			(void)putchar(special[j][i]);
	}
}

void putstr(s)
char *s;
{
    while(*s!=0)
      (void)putchar(*s++);
}

/* check if the character to be printed is a special character */
/*     if it is and it has not been loaded into the printer then do it first */
void putch(c)
char c;
{
	int j;
	void download();
	j = c-FIRST;		/* index of special character */
	/* check if we are in SPEC mode  and the special character is defined */
	if(((ctype & SPEC) == SPEC) && (j>=0) && (j<NUMSPEC) && (cmark[j]==0)) {
		if((copy==0)&&(nlqmode==NO)) { /* copy the PGC ROM to RAM */
			(void)putchar('\033');
			(void)putchar(':');
			(void)putchar(0);
			(void)putchar(0);
			(void)putchar(0);
			copy = 1;
		} 

		download(c);
		cmark[j] = 1;
	}
	if(c!=0) {
		if((ctype & BOLD)&&(nlqmode==YES)) {
			(void)putchar(c);
			(void)putchar('\b');
			(void)putchar(c);
		} else
			(void)putchar(c);
	}
}

/* output the current character as a normal character */
/* 	then change to the special characters */
void inspec()
{
	void tospec();
	if(cur!=0) putch(cur); /* output the current character first */
	tospec();
	ctype |= SPEC;
	cur = 0;
}

/* output the current character as a special character */
/*	then change to normal character output */
void outspec()
{
	void frspec();
	if(cur!=0) putch(cur); /* output the current character first */
	frspec();
	ctype &= ~SPEC;
	cur = 0;
}

/* force the printer to print normal characters */
/*	then output the current character	*/
void donormal()
{
    if(cur!=0) {
      switch(ctype) { /* if not in normal mode - then enter normal mode */
        case BOLD:
        case (BOLD | SPEC):
	  frbold();
          ctype &= ~BOLD;
          break;
        case UNDER:
        case (UNDER | SPEC):
	  frunder();
          ctype &= ~UNDER;
          break;
        case ITALIC:
        case (ITALIC | SPEC):
	  fritalic();
          ctype &= ~ITALIC;
          break;
        case SPEC:  /* if special or normal mode, then do not change */
        case NORMAL:
        default:
          break;
      }
      putch(cur); /* output the current character */
    }
}
End of epx.c
echo draft.c 1>&2
cat >draft.c <<'End of draft.c'
/* draft mode special character definitions for epx	*/
/*							*/
/*	Author: Thomas E. Tkacik  uvaee!tet		*/
/*							*/
/*	To be modified or given away freely		*/
/*							*/
#define	NUMSPEC	60	/* number of defined special characters */

/*	first byte - attribute data					     */
/*	last bytes - character data					     */
char	special[NUMSPEC][12] = {
	{139,32,28,2,0,4,0,8,0,48,0,0},			/* nu                */
	{139,28,0,34,0,34,24,4,8,50,0,0},		/* alpha             */
	{139,1,126,0,148,2,144,2,108,0,0,0},		/* beta              */
	{139,28,32,2,0,12,0,2,32,28,0,0},		/* omega             */
	{139,12,66,16,162,0,146,0,76,0,0,0},		/* delta             */
	{139,6,24,96,128,0,128,96,24,6,0,0},		/* LAMBDA            */
	{139,16,0,40,130,124,130,40,0,16,0,0},		/* PHI               */
	{139,254,0,128,0,128,0,128,0,192,0,0},		/* GAMMA             */
	{139,64,48,8,2,252,2,8,48,64,0,0},		/* PSI               */
	{139,16,0,32,0,34,28,32,0,32,0,0},		/* tau               */
	{139,32,0,62,0,32,0,62,0,32,0,0},		/* pi                */
	{11,1,30,32,0,72,0,72,0,48,0,0},		/* rho               */
	{139,130,0,68,40,16,8,4,0,2,0,0},		/* lambda            */
	{139,1,62,0,2,0,2,0,60,2,0,0},			/* mu                */
	{139,32,30,0,32,0,32,0,30,1,0,0},		/* eta               */
	{139,56,68,0,146,0,146,0,68,56,0,0},		/* THETA             */
	{139,128,126,128,0,128,0,128,126,128,0,0},	/* PI                */
	{139,0,24,165,0,69,0,130,0,0,0,0},		/* zeta              */
	{139,130,68,170,0,146,0,130,0,130,0,0},		/* SIGMA             */
	{139,28,0,42,0,42,0,34,0,0,0,0},		/* epsilon - member  */
	{139,0,56,68,146,0,146,68,56,0,0,0},		/* theta             */
	{139,8,0,20,1,62,64,20,0,8,0,0},		/* phi               */
	{11,64,56,4,0,255,0,4,24,96,0,0},		/* psi               */
	{139,6,24,34,64,130,64,34,24,6,0,0},		/* DELTA             */
	{139,0,8,181,64,21,64,2,64,0,0,0},		/* xi                */
	{139,28,0,34,0,34,0,60,0,32,0,0},		/* sigma             */
	{139,50,72,6,128,0,128,6,72,50,0,0},		/* OMEGA             */
	{139,32,16,40,4,34,4,40,16,32,0,0},		/* del - gradient    */
	{11,128,0,65,2,52,8,16,32,64,0,0},		/* gamma             */
	{139,14,81,0,81,8,33,30,0,0,0,0},		/* partial           */
	{139,1,0,1,126,128,0,128,0,0,0,0},		/* infinity          */
	{139,8,0,8,0,8,0,12,0,0,0,0},			/* not               */
	{139,130,0,146,0,146,0,146,0,130,0,0},		/* XI                */
	{139,8,0,14,1,2,4,8,16,32,64,128},		/* square root       */
	{139,128,0,128,0,128,0,128,0,128,0,128},	/* root en           */
	{139,62,65,8,85,0,85,0,65,62,0,0},		/* copy right        */
	{139,28,0,34,0,28,0,34,0,28,0,0},		/* infinity          */
	{139,28,0,62,0,62,0,62,0,28,0,0},		/* bullet            */
	{139,0,0,64,160,0,160,64,0,0,0,0},		/* degree            */
	{139,16,0,32,0,127,0,32,0,16,0,0},		/* up arrow          */
	{139,4,0,2,0,127,0,2,0,4,0,0},			/* down arrow        */
	{139,0,0,0,0,63,64,128,0,128,0,0},		/* left top          */
	{139,0,0,0,0,252,2,1,0,1,0,0},			/* left bottom       */
	{139,128,0,128,64,63,0,0,0,0,0,0},		/* right top         */
	{139,1,0,1,2,252,0,0,0,0,0,0},			/* right bottom      */
	{139,0,8,0,20,227,0,0,0,0,0,0},			/* left center       */
	{139,0,0,0,0,227,20,0,8,0,0,0},			/* right center      */
	{139,0,0,0,0,255,0,0,0,0,0,0},			/* bold verticle     */
	{139,0,0,0,0,255,0,1,0,1,0,0},			/* left floor        */
	{139,1,0,1,0,255,0,0,0,0,0,0},			/* right floor       */
	{139,0,0,0,0,255,0,128,0,128,0,0},		/* left ceiling      */
	{139,128,0,128,0,255,0,0,0,0,0,0},		/* right ceiling     */
	{139,62,0,34,0,34,0,34,0,62,0,0},		/* square            */
	{139,62,65,0,93,0,81,0,65,62,0,0},		/* registered        */
	{139,12,18,0,18,0,12,0,18,0,18,0},		/* proportional to   */
	{139,0,0,9,52,65,22,72,0,0,0,0},		/* section	     */
	{139,126,0,128,0,128,0,128,0,126,0,0},		/* intersection      */
	{139,34,0,34,0,34,0,34,0,34,0,28},		/* superset of       */
	{139,28,0,34,0,34,0,34,0,34,0,34},		/* subset of         */
	{139,56,0,68,0,68,0,68,0,56,0,0}		/* circle	     */
};
End of draft.c
echo nlq.c 1>&2
cat >nlq.c <<'End of nlq.c'
/* nlq node special character definitions for epx	*/
/*							*/
/*	Author: Thomas E. Tkacik  uvaee!tet		*/
/*							*/
/*	To be modified or given away freely		*/
/*							*/
#define	NUMSPEC	60	/* number of defined special characters */

/*	first two bytes - attribute data				     */
/*	last 46 bytes   - character data				     */
char	nlq[NUMSPEC][48] = {
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,4,28,0,224,7,4,0,8,0,0,0,8,0,16,0,0,
	 0,16,0,32,0,64,7,128,0,0,0,0,0,0,0,0,0,0},	/* nu		     */
	{128,23,0,0,0,0,0,224,1,16,0,8,2,0,0,8,4,4,0,0,4,4,0,0,4,4,0,8,2,0,
	 1,136,0,80,0,32,1,208,2,8,4,4,0,0,0,4,0,0},	/* alpha             */
	{128,23,0,0,0,0,0,0,0,7,0,56,1,192,14,0,16,0,33,8,0,0,33,4,0,0,33,4,0,0,
	 33,4,0,128,18,8,12,128,0,112,0,0,0,0,0,0,0,0},	/* beta		     */
	{128,23,0,0,0,0,0,224,1,16,2,8,0,4,4,0,0,4,0,8,0,16,0,224,0,16,0,8,0,4,
	 4,0,0,4,2,8,1,16,0,224,0,0,0,0,0,0,0,0},	/* omega	     */
	{128,23,0,0,0,0,0,0,0,0,0,96,0,144,1,8,0,0,26,8,4,4,34,0,4,4,32,0,4,4,
	 34,8,0,0,18,8,1,16,0,224,0,0,0,0,0,0,0,0},	/* delta	     */
	{128,23,0,0,0,0,0,4,0,0,0,12,0,48,0,68,1,128,2,0,12,0,16,0,32,0,16,0,
	 12,0,2,0,1,128,0,68,0,48,0,12,0,0,0,4,0,0,0,0},/* LAMBDA	     */
	{128,23,0,0,0,0,1,128,2,64,4,32,0,0,4,32,8,16,32,4,8,16,32,4,31,248,
	 32,4,8,16,32,4,8,16,4,32,0,0,4,32,2,64,1,128,0,0,0,0}, /* PHI	     */
	{128,23,0,0,0,0,0,0,32,4,0,0,32,4,31,248,32,4,0,0,32,4,0,0,32,0,0,0,
	 32,0,0,0,32,0,0,0,32,0,0,0,56,0,0,0,0,0,0,0},	/* GAMMA	     */
	{128,23,0,0,0,0,16,0,0,0,16,0,8,0,7,192,0,32,32,20,0,0,32,20,31,232,
	 32,20,0,0,32,20,0,32,7,192,8,0,16,0,0,0,16,0,0,0,0,0},/* PSI	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,4,0,0,12,4,112,3,128,4,0,0,0,
	 4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0},		/* tau		     */
	{128,23,0,0,0,0,0,0,0,0,2,0,4,0,0,12,4,112,3,128,4,0,0,0,4,0,0,0,4,0,
	 0,0,4,12,0,112,7,128,0,0,4,0,0,0,0,0,0,0},	/* pi		     */
	{128,23,0,0,0,0,0,0,0,0,0,7,0,24,0,96,0,128,1,8,0,0,2,4,0,0,2,4,0,0,
	 2,4,0,0,1,8,0,144,0,96,0,0,0,0,0,0,0,0},	/* rho		     */
	{128,23,0,0,0,0,0,0,0,0,0,0,32,4,0,0,32,8,16,16,8,32,4,64,2,128,1,0,
	 0,128,0,64,0,32,0,16,0,8,0,4,0,0,0,4,0,0,0,0},	/* lambda	     */
	{128,23,0,0,0,0,0,0,0,0,0,1,7,254,0,0,0,8,0,0,0,4,0,0,0,4,0,0,0,4,0,0,
	 0,8,0,0,7,248,0,4,0,0,0,0,0,0,0,0},		/* mu		     */
	{128,23,0,0,0,0,0,0,4,0,0,0,4,0,3,252,0,0,1,0,0,0,2,0,0,0,4,0,0,0,4,0,
	 0,0,4,0,2,0,1,252,0,3,0,0,0,0,0,0},		/* eta		     */
	{128,23,0,0,0,0,1,128,6,96,8,16,0,0,17,8,0,0,33,4,0,0,33,4,0,0,33,4,0,0,
	 33,4,0,0,17,8,0,0,8,16,6,96,1,128,0,0,0,0},	/* THETA	     */
	{128,23,0,0,0,0,32,4,0,0,32,4,31,248,32,4,0,0,32,4,0,0,32,0,0,0,32,0,
	 0,0,32,4,0,0,32,4,31,248,32,4,0,0,32,4,0,0,0,0},/* PI		     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,16,34,8,20,0,0,5,24,0,0,5,16,0,
	 0,5,32,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0},		/* zeta		     */
	{128,23,0,0,0,0,32,4,0,0,48,12,0,0,40,20,0,0,36,36,0,0,34,68,0,0,33,132,
	 0,0,32,4,0,0,32,4,0,0,32,4,16,8,8,16,0,0,0,0},	/* SIGMA	     */
	{128,23,0,0,0,0,0,0,0,0,0,224,1,16,2,72,0,0,2,72,4,4,0,64,4,4,0,64,4,4,
	 0,64,4,4,0,0,2,8,0,0,0,0,0,0,0,0,0,0},		/* epsilon	     */
	{128,23,0,0,0,0,0,0,0,0,1,128,6,96,9,16,0,0,17,8,0,0,33,4,0,0,33,4,0,0,
	 17,8,0,0,9,16,6,96,1,128,0,0,0,0,0,0,0,0},	/* theta	     */
	{128,23,0,0,0,0,0,0,0,96,0,144,1,8,0,0,1,8,2,4,0,3,2,28,0,224,3,4,12,0,
	 2,4,1,8,0,0,1,8,0,144,0,96,0,0,0,0,0,0},	/* phi		     */
	{128,23,0,0,0,0,0,0,2,0,1,240,0,8,0,4,0,3,0,28,0,224,3,4,12,0,0,4,0,8,
	 0,48,0,192,1,0,0,0,2,0,0,0,0,0,0,0,0,0},	/* psi		     */
	{128,23,0,0,0,0,0,0,0,4,0,8,0,52,0,64,1,132,2,0,12,4,16,0,32,4,16,0,
	 12,4,2,0,1,132,0,64,0,48,0,8,0,4,0,0,0,0,0,0},	/* DELTA	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,48,0,72,6,0,9,133,32,0,16,133,0,0,16,133,
	 0,2,16,128,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* xi		     */
	{128,23,0,0,0,0,0,0,0,224,1,16,2,8,0,0,2,8,4,4,0,0,4,4,0,0,4,4,0,0,4,4,
	 2,8,4,0,2,8,5,16,0,224,4,0,0,0,0,0},		/* sigma	     */
	{128,23,0,0,0,0,0,0,7,8,8,132,0,64,16,36,0,16,32,12,0,0,32,0,0,0,32,0,
	 0,0,32,12,0,16,16,36,0,64,8,132,7,8,0,0,0,0,0,0},/* OMEGA	     */
	{128,23,0,0,0,0,0,0,4,0,2,0,5,0,0,128,4,64,0,32,4,16,0,8,4,4,0,8,
	 4,16,0,32,4,64,0,128,5,0,2,0,4,0,0,0,0,0,0,0},	/* del - gradient    */
	{128,23,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,2,1,1,2,0,132,0,104,0,16,0,32,
	 0,64,0,128,1,0,6,0,0,0,0,0,0,0,0,0,0,0},	/* gamma	     */
	{128,23,0,0,0,0,0,0,0,0,0,240,1,8,0,0,1,8,18,4,0,0,34,4,0,0,34,4,
	 17,8,0,0,16,136,8,16,7,224,0,0,0,0,0,0,0,0,0,0},/* partial	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,2,0,1,56,0,71,1,128,226,0,28,
	 128,0,64,0,32,0,64,0,0,0,0,0,0,0,0,0,0,0},	/* integral	     */
	{128,23,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,
	 1,0,0,0,1,0,0,0,1,224,0,0,0,0,0,0,0,0},	/* not		     */
	{128,23,0,0,0,0,0,4,0,8,8,16,16,136,33,0,18,8,1,0,16,8,1,0,16,8,1,0,
	 16,8,1,0,16,136,1,4,18,8,8,16,16,0,32,0,0,0,0,0},/* XI		     */
	{128,23,1,0,0,0,1,0,0,0,1,128,0,112,0,14,0,1,0,2,0,4,0,8,0,16,0,32,0,64,
	 0,128,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,0},	/* square root	     */
	{128,23,128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,
	 128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,128,0},/* root en */
	{128,23,0,0,0,0,0,0,1,192,2,32,4,16,0,0,4,144,9,72,2,32,8,8,2,32,8,8,
	 2,32,8,8,4,16,0,0,4,16,2,32,1,192,0,0,0,0,0,0},/* copyright	     */
	{128,23,0,0,0,0,1,128,2,64,0,0,4,32,0,0,4,32,0,0,2,64,0,0,1,128,0,0,
	 2,64,0,0,4,32,0,0,4,32,0,0,2,64,1,128,0,0,0,0},/* infinity	     */
	{128,23,0,0,0,0,0,0,1,192,2,32,5,208,2,32,5,208,10,40,5,208,10,40,5,208,
	 10,40,5,208,10,40,5,208,2,32,5,208,2,32,1,192,0,0,0,0,0,0},/* bullet*/
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,136,0,0,0,136,0,0,0,
	 136,0,0,0,136,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0},/* degree	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,63,252,0,0,
	 16,0,0,0,8,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0},	/* up arrow	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,16,0,0,0,8,0,0,63,252,0,0,
	 0,8,0,0,0,16,0,0,0,32,0,0,0,0,0,0,0,0,0,0},	/* down arrow	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,32,0,64,0,
	 0,0,128,0,0,0,128,0,0,0,128,0,0,0,0,0,0,0},	/* left top	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,248,0,4,0,2,
	 0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0},		/* left bottom	     */
	{128,23,0,0,0,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,64,0,32,0,31,255,0,0,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* right top	     */
	{128,23,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,4,255,248,0,0,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* right bottom      */
	{128,23,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,128,4,64,248,63,0,0,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* left center	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,63,4,64,
	 2,128,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},	/* right center	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* bold verticle     */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
	 0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0},	/* left floor	     */
	{128,23,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,255,255,0,0,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* right floor       */
	{128,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,128,0,
	 0,0,128,0,0,0,128,0,0,0,128,0,0,0,0,0,0,0},	/* left ceiling      */
	{128,23,0,0,0,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,128,0,0,0,255,255,
	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},	/* right ceiling     */
	{128,23,0,0,0,0,0,0,7,252,0,0,4,4,0,0,4,4,0,0,4,4,0,0,4,4,0,0,
	 4,4,0,0,4,4,0,0,4,4,0,0,7,252,0,0,0,0,0,0},	/* square	     */
	{128,23,0,0,0,0,0,0,1,192,2,32,4,16,0,0,4,16,10,8,1,224,8,8,2,0,8,8,
	 2,0,9,8,4,16,0,0,4,16,2,32,1,192,0,0,0,0,0,0},	/* registered	     */
	{128,23,0,0,0,0,1,128,2,64,0,0,4,32,0,0,4,32,0,0,2,64,0,0,1,128,0,0,
	 2,64,0,0,4,32,0,0,4,32,0,0,4,32,0,0,0,0,0,0},	/* proportional to   */
	{128,23,0,0,0,0,0,0,0,0,0,0,35,4,84,2,0,128,136,1,0,64,132,1,0,32,130,1,
	 0,16,129,1,0,8,64,130,32,20,0,96,0,0,0,0,0,0,0,0},/* section	     */
	{128,23,0,0,0,0,0,0,0,0,0,0,15,252,16,0,0,0,32,0,0,0,32,0,0,0,32,0,0,0,
	 32,0,0,0,16,0,15,252,0,0,0,0,0,0,0,0,0,0},	/* intersection      */
	{128,23,0,0,0,0,2,4,0,0,2,4,0,0,2,4,0,0,2,4,0,0,2,4,0,0,2,4,
	 0,0,2,4,0,0,2,4,0,0,2,4,1,8,0,0,1,8,0,240},	/* superset of       */
	{128,23,0,240,1,8,0,0,1,8,2,4,0,0,2,4,0,0,2,4,0,0,2,4,0,0,2,4,
	 0,0,2,4,0,0,2,4,0,0,2,4,0,0,2,4,0,0,0,0},	/* subset of         */
	{128,23,0,0,0,0,0,0,1,192,2,32,4,16,0,0,4,16,8,8,0,0,8,8,0,0,8,8,
	 0,0,8,8,4,16,0,0,4,16,2,32,1,192,0,0,0,0,0,0},	/* circle	     */
};
End of nlq.c
echo tabepson.c 1>&2
cat >tabepson.c <<'End of tabepson.c'
#ifndef	INCH
#define	INCH	240
#endif

struct t {
	int bset;
	int breset;
	int Hor;
	int Vert;
	int Newline;
	int Char;
	int Em;
	int Halfline;
	int Adj;
	char *twinit;
	char *twrest;
	char *twnl;
	char *hlr;
	char *hlf;
	char *flr;
	char *bdon;
	char *bdoff;
	char *iton;
	char *itoff;
	char *ploton;
	char *plotoff;
	char *up;
	char *down;
	char *right;
	char *left;
	char *codetab[256-32];
	char *zzz;
	} t = {
/*bset    */		00,
/*breset  */		00,
/*Hor     */		INCH/10,
/*Vert    */		INCH/12,
/*Newline */		INCH/6,
/*Char    */		INCH/10,
/*Em      */		INCH/10,
/*Halfline*/		INCH/12,
/*Adj     */		INCH/10,
/*twinit  */		"",
/*twrest  */		"",
/*twnl    */		"\n",
/*hlr     */		"\0338",
/*hlf     */		"\0339",
/*flr     */		"\0337",
/*bdon    */		"",
/*bdoff   */		"",
/*iton    */		"",
/*itoff   */		"",
/*ploton  */		"",
/*plotoff */		"",
/*up      */		"",
/*down    */		"",
/*right   */		"",
/*left    */		"",
/* space  */         	"\001 ",
/* ! */             	"\001!",
/* " */             	"\001\"",
/* # */             	"\001#",
/* $ */             	"\001$",
/* % */             	"\001%",
/* & */             	"\001&",
/* ' close */       	"\001'",
/* ( */             	"\001(",
/* ) */             	"\001)",
/* * */             	"\001*",
/* + */             	"\001+",
/* , */             	"\001,",
/* - hyphen */      	"\001-",
/* . */             	"\001.",
/* / */             	"\001/",
/* 0 */             	"\2010",
/* 1 */             	"\2011",
/* 2 */             	"\2012",
/* 3 */             	"\2013",
/* 4 */             	"\2014",
/* 5 */             	"\2015",
/* 6 */             	"\2016",
/* 7 */             	"\2017",
/* 8 */             	"\2018",
/* 9 */             	"\2019",
/* : */             	"\001:",
/* ; */             	"\001;",
/* < */             	"\001<",
/* = */             	"\001=",
/* > */             	"\001>",
/* ? */             	"\001?",
/* @ */             	"\001@",
/* A */             	"\201A",
/* B */             	"\201B",
/* C */             	"\201C",
/* D */             	"\201D",
/* E */             	"\201E",
/* F */             	"\201F",
/* G */             	"\201G",
/* H */             	"\201H",
/* I */             	"\201I",
/* J */             	"\201J",
/* K */             	"\201K",
/* L */             	"\201L",
/* M */             	"\201M",
/* N */             	"\201N",
/* O */             	"\201O",
/* P */             	"\201P",
/* Q */             	"\201Q",
/* R */             	"\201R",
/* S */             	"\201S",
/* T */             	"\201T",
/* U */             	"\201U",
/* V */             	"\201V",
/* W */             	"\201W",
/* X */             	"\201X",
/* Y */             	"\201Y",
/* Z */             	"\201Z",
/* [ */             	"\001[",
/* \ */             	"\001\\",
/* ] */             	"\001]",
/* ^ */             	"\001^",
/* _ dash */        	"\001_",
/* ` open */        	"\001`",
/* a */             	"\201a",
/* b */             	"\201b",
/* c */             	"\201c",
/* d */             	"\201d",
/* e */             	"\201e",
/* f */             	"\201f",
/* g */             	"\201g",
/* h */             	"\201h",
/* i */             	"\201i",
/* j */             	"\201j",
/* k */             	"\201k",
/* l */             	"\201l",
/* m */             	"\201m",
/* n */             	"\201n",
/* o */             	"\201o",
/* p */             	"\201p",
/* q */             	"\201q",
/* r */             	"\201r",
/* s */             	"\201s",
/* t */             	"\201t",
/* u */             	"\201u",
/* v */             	"\201v",
/* w */             	"\201w",
/* x */             	"\201x",
/* y */             	"\201y",
/* z */             	"\201z",
/* { */             	"\001{",
/* | */             	"\001|",
/* } */             	"\001}",
/* ~ */             	"\001~",
/* narrow sp */     	"\000\0",
/* hyphen */        	"\001-",
/* bullet */        	"\001\016e\017",
/* square */        	"\001\016t\017",
/* 3/4 em */        	"\001-",
/* rule */          	"\001_",
/* 1/4 */           	"\0031/4",
/* 1/2 */           	"\0031/2",
/* 3/4 */           	"\0033/4",
/* minus */         	"\001-",
/* fi */            	"\202fi",
/* fl */            	"\202fl",
/* ff */            	"\202ff",
/* ffi */           	"\203ffi",
/* ffl */           	"\203ffl",
/* degree */        	"\001\016f\017",
/* dagger */        	"\001|\b-",
/* section */       	"\001\016w\017",
/* foot mark */     	"\001'",
/* acute accent */  	"\001'",
/* grave accent */  	"\001`",
/* underrule */     	"\001_",
/* slash (longer) */	"\001/",
/* half narrow space */	"\000\0",
/* unpaddable space */	"\001 ",
/* alpha */         	"\201\016A\017",
/* beta */          	"\201\016B\017",
/* gamma */         	"\201\016\\\017",
/* delta */         	"\201\016D\017",
/* epsilon */       	"\201\016S\017",
/* zeta */          	"\201\016Q\017",
/* eta */           	"\201\016N\017",
/* theta */         	"\201\016T\017",
/* iota */          	"\201i",
/* kappa */         	"\201k",
/* lambda */        	"\201\016L\017",
/* mu */            	"\201\016M\017",
/* nu */            	"\201\016@\017",
/* xi */            	"\201\016X\017",
/* omicron */       	"\201o",
/* pi */            	"\201\016J\017",
/* rho */           	"\201\016K\017",
/* sigma */         	"\201\016Y\017",
/* tau */           	"\201\016I\017",
/* upsilon */       	"\201v",
/* phi */           	"\201\016U\017",
/* chi */           	"\201x",
/* psi */           	"\201\016V\017",
/* omega */         	"\201\016C\017",
/* Gamma */         	"\201\016G\017",
/* Delta */         	"\201\016W\017",
/* Theta */         	"\201\016O\017",
/* Lambda */        	"\201\016E\017",
/* Xi */            	"\201\016`\017",
/* Pi */            	"\201\016P\017",
/* Sigma */         	"\201\016R\017",
/* Tau */           	"\201T",
/* Upsilon */       	"\201Y",
/* Phi */           	"\201\016F\017",
/* Psi */           	"\201\016H\017",
/* Omega */         	"\201\016Z\017",
/* square root */   	"\001\016a\017",
/* terminal sigma */	"\201\016Y\017",
/* root en */       	"\001\016b\017",
/* >= */            	"\001>\b_",
/* <= */            	"\001<\b_",
/* identically equal */	"\001=\b_",
/* equation minus */	"\001-",
/* approx = */      	"\001=\b~",
/* approximates */  	"\001~",
/* not equal */     	"\001=\b/",
/* right arrow */   	"\002->",
/* left arrow */    	"\002<-",
/* up arrow */      	"\001\016g\017",
/* down arrow */    	"\001\016h\017",
/* eqn equals */    	"\001=",
/* multiply */      	"\001x",
/* divide */        	"\001/",
/* plus-minus */    	"\001+\b_",
/* cup-union */   	"\001U",
/* cap-intersection */	"\001\016x\017",
/* subset of */     	"\001\016z\017",
/* superset of */   	"\001\016y\017",
/* improper subset */	"\001\016z\017\b_",
/* improper superset */	"\001\016y\017\b_",
/* infinity */      	"\001\016d\017",
/* pt deriv */      	"\001\016]\017",
/* gradient */      	"\001\016[\017",
/* not */           	"\001\016_\017",
/* integral */    	"\001\016^\017",
/* proportional to */	"\001\016v\017",
/* empty set */     	"\001\016{\017\b/",
/* member of */     	"\001\016S\017",
/* equation plus */ 	"\001+",
/* registered */	"\001\016u\017",
/* copyright  */  	"\001\016c\017",
/* box rule */      	"\001\016o\017",
/* cent sign */     	"\001c\b/",
/* dbl dagger */    	"\001|\b=",
/* right hand */    	"\002=>",
/* left hand */     	"\002<=",
/* math *  */       	"\001*",
/* bell system sign */	"\000\0",
/* or (was star) */ 	"\001|",
/* circle */        	"\001\016{\017",
/* left top of big curly */	"\001\016i\017",
/* left bottom of big curly */	"\001\016j\017",
/* right top of big curly */	"\001\016k\017",
/* right bottom of big curly */	"\001\016l\017",
/* left center of big curly */	"\001\016m\017",
/* right center of big curly */	"\001\016n\017",
/* bold vertical rule */	"\001\016o\017",
/* left bottom of big bracket */	"\001\016p\017",
/* right bottom of big bracket */	"\001\016q\017",
/* left top of big bracket */	"\001\016r\017",
/* right top of big bracket */	"\001\016s\017",
};
End of tabepson.c
echo special 1>&2
cat >special <<'End of special'
This is a test of the special character set.
.sp
.nf
.ta 2i 4i 6i
ALPHA \(*A	alpha \(*a	BETA \(*B 	beta \(*b
GAMMA \(*G	gamma \(*g	DELTA \(*D 	delta \(*d
EPSILON \(*E 	epsilon \(*e	ZETA \(*Z 	zeta \(*z
ETA \(*Y 	eta \(*y	THETA \(*H 	theta \(*h
IOTA \(*I 	iota \(*i	KAPPA \(*K 	kappa \(*k
LAMBDA \(*L 	lambda \(*l	MU \(*M 	mu \(*m
NU \(*N 	nu \(*n	XI \(*C 	xi \(*c
OMICRON \(*O 	omicron \(*o	PI \(*P 	pi \(*p
RHO \(*R 	rho \(*r	SIGMA \(*S 	sigma \(*s
TAU \(*T 	tau \(*t	UPSILON \(*U 	upsilon \(*u
PHI \(*F 	phi \(*f	CHI \(*X 	chi \(*x
PSI \(*Q 	psi \(*q	OMEGA \(*W 	omega \(*w
1/4  \(14	1/2  \(12	3/4  \(34	degree \(de
dagger \(dg	double dagger \(dd	footmark \(fm	cent sign \(ct
registered \(rg	copyright \(co	math +  \(pl	math -  \(mi
math =  \(eq	math *  \(**	section  \(sc	underrule \(ul
acute accent \(aa	grave accent \(ga	backslash \(sl	square root \(sr
root en extender \(rn	plus minus \(+-	>= \(>=	<= \(<=
identically = \(==	approx. = \(~=	approximates \(ap	not equal \(!=
right arrow \(->	left arrow \(<-	up arrow \(ua	down arrow \(da
multiply \(mu	divide \(di	union \(cu	intersection \(ca
subset of \(sb	superset of \(sp	improper subset \(ib	improper superset \(ip
infinity \(if	partial \(pd	gradient \(gr	not \(no
integral \(is	proportional to \(pt	empty set \(es	member of \(mo
box verticle rule \(br	Bell System Logo \(bs	right hand \(rh	left hand \(lh
or \(or	circle \(ci	left to curly \(lt	left bottom \(lb
right top curly \(rt	right bottom \(rb	left center curly \(lk	right center \(rk
left floor \(lf	right floor \(rf	left ceiling \(lc	right ceiling \(rc
bold verticle \(bv	bullet \(bu	square \(sq
.sp 2
.ft B
Greek Characters
.ft P
\(*a\(*b\(*g\(*d\(*e\(*z\(*y\(*h\(*i\(*k\(*l\(*m\(*n\(*c\(*o\(*p\(*r\(*s\(*t\(*u\(*f\(*x\(*q\(*w
\(*A\(*B\(*G\(*D\(*E\(*Z\(*Y\(*H\(*I\(*K\(*L\(*M\(*N\(*C\(*O\(*P\(*R\(*S\(*T\(*U\(*F\(*X\(*Q\(*W
.sp 2
.in 1i
.ft B
A Big Equation - \fIFrom the EQN User's Guide\fP
.ft R
.sp
.EQ
G(z)~mark =~ e sup { ln ~ G(z) }
~=~ exp left [
sum from k>=1 {S sub k z sup k} over k right ]
~=~ prod from k>=1 e sup { S sub k z sup k /k}
.EN
.sp 2
.EQ
lineup =~ left ( 1 + S sub 1 z +
{ S sub 1 sup 2 z sup 2 } over 2! + "..." right )
left ( 1 + {S sub 2 z sup 2 } over 2
+ { S sub 2 sup 2 z sup 4 } over { 2 sup 2 ~ 2! }
+ "..." right ) "..."
.EN
.sp 
.EQ
lineup =~ sum from m>=0 left {
sum from
pile { k sub 1 ,k sub 2 ",...," k sub m >=0
above
k sub 1 +2k sub 2 ",...," +mk sub m = m }
{S sub 1 sup {k sub 1} } over {1 sup k sub 1 k sub 1 ! } ~
{S sub 2 sup {k sub 2} } over {2 sup k sub 2 k sub 2 ! } ~
"..."
{S sub m sup {k sub m} } over {m sup k sub m k sub m ! } ~
right } z sup m
.EN

End of special



More information about the Comp.sources.unix mailing list