[comp.unix.questions] Need help with NROFF, VI

jbh@mibte.UUCP (James Harvey) (02/20/88)

We are doing word processing using VI and NROFF on the Pyramid
here.  We hooked an HP LaserJet II to the printer ports of our
terminals through a Logical Connection sharing box.  

Question:
  How does one get an escape sequence out of NROFF?  I would
like to use bold face, italics, underline etc. that are available
from within the LaserJet.  These require the construction of a
macro to transmit the appropriate character string starting with a
real escape ($1b).  How do I get VI to put a literal value in the
file, alternately, some sequence that NROFF will translate into a
hex 1b?  I can't find anything in the books I have.

-- 

Jim Harvey                        |      "Ask not for whom the bell
Michigan Bell Telephone           |      tolls and you will only pay
29777 Telegraph                   |      Station-to-Station rates."
Southfield, Mich. 48034           | 

   ihnp4!mibte!jbh   or try   ulysses!gamma!mibte!jbh
     

ugfailau@sunybcs.uucp (Fai Lau) (02/21/88)

In article <2519@mibte.UUCP> jbh@mibte.UUCP (James Harvey) writes:
>
>Question:
>  How does one get an escape sequence out of NROFF?  I would
>like to use bold face, italics, underline etc. that are available
>from within the LaserJet.  These require the construction of a
>macro to transmit the appropriate character string starting with a
>real escape ($1b).  How do I get VI to put a literal value in the
>file, alternately, some sequence that NROFF will translate into a
>hex 1b?  I can't find anything in the books I have.
>
	Using control-V in VI would enable you to put practically
any control character in the editing file. In your case, you
can try C-V ESC, you would get something looking like "^[" which
is a standard representation of ESC in VI, and it does have
a value of hex 1b.

Fai Lau
SUNY at Buffalo (The Arctic Wonderland)
UU: ..{rutgers,ames}!sunybcs!ugfailau
BI: ugfailau@sunybcs INT: ugfailau@joey.cs.buffalo.EDU

jbh@mibte.UUCP (James Harvey) (02/24/88)

In article <2519@mibte.UUCP>, jbh@mibte.UUCP (James Harvey) writes:
> 
> We are doing word processing using VI and NROFF on the Pyramid
> here.  We hooked an HP LaserJet II to the printer ports of our
> terminals through a Logical Connection sharing box.  
> 
> Question:
>   How does one get an escape sequence out of NROFF?  
> 
>      
I have several comments on getting an escape into a VI file by
using Control-V.  Thanks, this works fine and helps a lot in
creating the scripts that I use to spool to the LaserJet (do a
reset, set noskipoverperf, set 66 lines and some set landscape).
The NROFF problem remains however.  I can't get an escape through
NROFF.  This thing uses several printer drivers, does anyone know
where these printer drivers are stored?  Mabye I can figure out
how to modify one to configure the LaserJet.

Oh, yes, the computer is eight miles away, not too practical to
connect the printer directly.  We don't all have the luxury of
our own machines.  The LaserJet is currently shared by two
5420/2's, one vt240, and two IBM AT's running dedicated
applications.

-- 

Jim Harvey                        |      "Ask not for whom the bell
Michigan Bell Telephone           |      tolls and you will only pay
29777 Telegraph                   |      Station-to-Station rates."
Southfield, Mich. 48034           | 

   ihnp4!mibte!jbh   or try   ulysses!gamma!mibte!jbh
     

hugh@BRL.ARPA (USAFAS | Howard) (02/24/88)

You *can* put control characters in an nroff file.  Example, think of the
backspace.  That's what nroff uses to underline.

You need to watch out for your lpr command though.  Mine runs the file
through a filter specified by printcap.  The filter then strips out
all non-printing characters.  To bypass the filter, I must specify
lpr -l filename

OS:  Xenix 3.4
Machine:  Intel 310

Hugh Dempsey

wswietse@eutrc3.UUCP (Wietse Venema) (02/25/88)

In article <2519@mibte.UUCP>, jbh@mibte.UUCP (James Harvey) writes:
> Question:
>   How does one get an escape sequence out of NROFF?  I would
> like to use bold face, italics, underline etc. that are available
> from within the LaserJet.  

How about writing a small filter program that translates the
underscores and backspaces in output from nroff to printer escape 
codes? I wrote various of them for matrix printers or daisywheels, 
and it even worked with eqn. lex(1) is quite convenient for this 
sort of work, and it certainly is fast enough for printers :-)

		Wietse Venema
-- 
uucp:	mcvax!eutrc3!wswietse	| Eindhoven University of Technology
bitnet:	wswietse@heithe5	| Dept. of Mathematics and Computer Science
surf:	tuerc5::wswietse	| Eindhoven, The Netherlands.

wnp@dcs.UUCP (Wolf N. Paul) (02/26/88)

In article <2523@mibte.UUCP> jbh@mibte.UUCP (James Harvey) writes:
>The NROFF problem remains however.  I can't get an escape through
>NROFF.  This thing uses several printer drivers, does anyone know
>where these printer drivers are stored?  Mabye I can figure out
>how to modify one to configure the LaserJet.
>
>Oh, yes, the computer is eight miles away, not too practical to
>connect the printer directly.  We don't all have the luxury of
>our own machines.  The LaserJet is currently shared by two
>5420/2's, one vt240, and two IBM AT's running dedicated
>applications.
>

If the NROFF is pre-version 2.0, it has printer-specific driver tables in
a directory /usr/lib/term, called tabXXXX, where XXXX is what you specify
to the nroff -T option. These driver tables can be uncompiled, modified,
and re-compiled (or written from scratch and then compiled) using a package
posted to comp.sources.unix a couple of days ago, Bruce Townsend's Nroff
Driver Tables Utilities, v13i069.

If the NROFF is version 2.0 or later, it has its driver tables in ASCII 
form, modifyable with any editor (i.e. vi), and stored in either
/usr/lib/term or /usr/lib/nterm.

BTW, Bruce Townsend's package includes a sample printer driver for HP-LJ+.

Hope this helps.
-- 
Wolf N. Paul                  Phone: (214) 306-9101 (h)   (214) 404-8077 (w)
3387 Sam Rayburn Run          UUCP: ihnp4!killer!{dcs, doulos}!wnp
Carrollton, TX 75007          INTERNET: wnp@dcs.UUCP       ESL:  62832882
Pat Robertson does NOT speak for all evangelical Christians--not for me, anyway!