duh@psueclb.BITNET (07/28/87)
I'm a new UNIX user, as is everyone else here, so we are having some troubles with our new Harris HCX-7 running UNIX. My question involves nroff. I'm trying to print a Spice user's manual, which happens to be an nroff document. The problem is that nroff doesn't put form feed characters in. I tried every terminal option (with the -T option), but none of them worked. I tried defining a macro which inserted FF at the end of each page, but nroff appears to have filtered them out. How do I do it? Do I need to make a new terminal definition file? If so, I don't know how, and can't find it in any of the documentation we have. We looked at the nroff source code, but no one here knows C well enough to extract anything useful from it. Also, one of the appendicies is full of equations, and uses the eqn program. With eqn, I get zillions of "Floating Exception" errors, and I can't figure out why. I tried neqn, and it worked. But, the escape sequences it put in to do upward and downward cursor movements don't work on our laser printer (DEC ln03), or line printer (DEC lg02). I'm stumped. Help!!! Thanks in advance.
gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/30/87)
In article <774@PSUECLB> duh@psueclb.BITNET writes: >The problem is that nroff doesn't put form feed characters in. Standard nroff never outputs form-feeds; it uses new-lines to advance to the next page. Normally this wouldn't much matter, but if you're using a sheet feeder, usually the feeder needs about an inch of extra paper travel. You can get around this problem by telling nroff (or perhaps a macro package) that your paper length is an inch longer than it really is, and adjusting the top and bottom margins (header/footer traps) appropriately. Yes, it's a pain. > Also, one of the appendicies is full of equations, and uses the >eqn program. With eqn, I get zillions of "Floating Exception" errors, >and I can't figure out why. I tried neqn, and it worked. I don't know what is wrong with your eqn, but you should always use neqn with nroff (eqn with troff). > But, the >escape sequences it put in to do upward and downward cursor movements >don't work on our laser printer (DEC ln03), or line printer (DEC lg02). Nroff looks up control codes from a table for your terminal. If you don't specify it, nroff assumes your terminal type is "37" (Teletype model 37). Specify the correct type with the -Tterminal-type option to nroff. It may happen that your LN03 or LG02 don't correspond to any entries provided with your nroff, in which case you need to come up with them somehow. The most useful generic terminal type is -Tlp (-Tlpr on some systems), which assumes output will be for a generic ASCII line printer. Generic Diablo daisy-wheel emulators (perhaps your laser printer?) work with -T450. The final thing to be aware of is that some nroff output, especially equations, uses half-line and reverse vertical motions, which not all printers support. In such a case, filter the output through "col".
tim@ora.UUCP (Tim O'Reilly) (07/30/87)
In article <774@PSUECLB>, duh@psueclb.BITNET writes: > I'm trying to print a Spice user's manual, which happens to > be an nroff document. The problem is that nroff doesn't put form > feed characters in.... Nroff uses line feeds, not form feeds to advance. The problem is probably that your laser printer needs a certain number of lines on the page before it thinks its time to eject the page. Try adjusting the page length or adding extra line feeds to trigger a page break in your laser printer. > How do I do it? Do I need to make a new terminal definition file? > If so, I don't know how, and can't find it in any of the documentation > we have. I don't think this is your problem. However, if you're using nroff a lot, it may be worthwhile to learn about this. I seem to recall a piece by Eric Allman on writing nroff terminal definition files floating around the net about 6 or 7 months ago. Does anyone have this? > Also, one of the appendicies is full of equations, and uses the > eqn program. With eqn, I get zillions of "Floating Exception" errors, > and I can't figure out why. I tried neqn, and it worked. But, the > escape sequences it put in to do upward and downward cursor movements > don't work on our laser printer (DEC ln03), or line printer (DEC lg02). You should always use neqn with nroff (eqn goes with troff). Then pipe the output through col before printing. This filters out the reverse line feeds and puts everything in the proper order for printing on a line printer. -- Tim O'Reilly (617) 527-4210 O'Reilly & Associates, Inc., Publishers of Nutshell Handbooks 981 Chestnut Street, Newton, MA 02164 UUCP: seismo!uunet!ora!tim ARPA: tim@ora.uu.net
warren@pluto.UUCP (Warren Burstein) (08/05/87)
Do you absolutely need formfeeds? Can't your printer break things up at the end of each page? If not, try a little program to insert a formfeed after every 66 lines, I had it hanging around from the last time I had such a problem. No way to change 66 save edit/recompile, it's a throwaway. /* * Copy stdin to stdout, insert formfeed every 66 lines. */ #include <stdio.h> main() { int line = 0; int c; if ( (c = getchar()) == EOF) return; for (;;) { if (c == '\n') line++; putchar(c); /* * An odd place to leave the loop, but it keeps a final * formfeed from being generated when the last page * has exactly 66 lines. */ if ( (c = getchar()) == EOF) break; if (line >= 66) { putchar('\f'); line = 0; } } } -- /|/~\~~\ The entire world Warren Burstein |__/__/_/ is a very strange carrot. | But the farmer philabs!tg!pluto!warren / is not afraid at all. Why doesn't life come with subtitles?
finegan@uccba.UUCP (Mike Finegan) (08/13/87)
> > Also, one of the appendicies is full of equations, and uses the > >eqn program. With eqn, I get zillions of "Floating Exception" errors, > >and I can't figure out why. I tried neqn, and it worked. > > I don't know what is wrong with your eqn, but you should always use > neqn with nroff (eqn with troff). I had the same problem on an 11/750 running Ultrix 1.2, even using neqn. The problem was an incorrect ternminal driving file. When I simply modified one that worked for another printer (say default) using the sequences out of the ln03 manual, it worked (except square root, posted elsewhere ...). I didn't analyze the original file too much, but it was either incorrect syntax (though it compiled) or (I think more likely) the people at DEC put some crazy numbers in for `resolution' values. > > > But, the > >escape sequences it put in to do upward and downward cursor movements > >don't work on our laser printer (DEC ln03), or line printer (DEC lg02). This stuff worked fine once I threw away the DEC supplied file. No col -f (or whatever) was needed, although it was passed directly to the laser printer (no output filter ...). Also LOST, Mike Finegan ...!uccba!ucece1!finegan