How To Print in Lindley Hall

This document is supposed to help people print things out the way they want them the first time. Anything that isn't included here is most likely omitted because I don't know about it.

Send all comments and contributions to Bill Dueber , or Bruce Shei for the information presented herein or to Tom Loos for HTML queries.

Table Of Contents


What's it called?

The current listing of printers can always be found in /etc/printcap of whatever machine you're on.

As a general rule a printer that is ps# (for # in 1..n) from the sparcs (i.e. sharks, orchard) or any other cs machine (including moose)

will be cs_ps# from Silver (and, I assume, bronze).

What are Portrait and Landscape Modes? Why Care?

Note that most all of the CS department printers have 3 names:
  1. ps# for generic vertical orientation or portrait mode -- think of a Rembrandt or Picasso portrait of someone sitting up straight and TALL.
  2. ps#duplex for duplex portrait mode printing,
  3. ps#tumble for duplex horizontal orientation or landscape mode -- here think of one of those bucolic French landscapes painted on a big WIDE canvas that painters seemed to love.
Generally, the right thing to do if you're going to print in portrait mode is to use ps#duplex and print to ps#tumble when printing in landscape mode.

A Short List of Filters and Printing Programs that I know about and use

This is, once again, based only on my own experience (and the advice of everyone who puts up with my annoying questions, of course).

Conventions

Commands will be listed in keyboard style (for browsers that support it) and all printer output described below will be routed to the the printer ps2, which is assumed to be a duplex printer (explained below). Unless you really like ps2, you don't have to route all your output there... Files ending in .gz are files compressed using the gzip utility (a newer compression program than compress) -- if you use compress replace the .gz with .Z

Printer Queue Manipulation

COMMANDS

DESCRIPTION

These utilities allow you to examine the jobs in a printer's queue (lpq) and the possibly remove a job from that queue (lprm).

USAGE

lpq -Pps2 gives you a list of all jobs in the queue for ps2 their job numbers, and their owners and size.

lprm -Pps2 jobnumber removes the job with the given jobnumber from the queue, assuming that you own it.

Generic Printing

COMMANDS

DESCRIPTION

The most basic of the basic printing utilities, lpr can be used by itself or on the end of a pipe.

FILE TYPES

lpr takes text (straight ASCII) or PostScript without needing any switches to be set. It can do .dvi files, but it is not recommended.

SWITCHES (or Command Line Options, for UNIX types...)

COMMON USAGE


Printing Text Files in a More Fancy Way

COMMANDS

DESCRIPTION

enscript changes a text file to PostScript and then sends it off to the printer. My most common use for it is to print text files two up, or to turn a text file into PostScript so it can be manipulated with some of the other filters -- psduplex and 2up spring to mind.

FILE TYPES

enscript takes text files and outputs PostScript.

SWITCHES (or Command Line Options, for UNIX types...)

COMMON USAGE


Printing Double Sided Text -- the Hard Way

COMMANDS

SPECIAL NOTE:

psduplex should be the LAST filter before lpr.

DESCRIPTION

psduplex is a filter which makes a file print out on both sides of the paper (only on printers which support that, of course).

FILE TYPES

PostScript only. Note, however, that enscript outputs PostScript.

SWITCH/Command Line Option

COMMON USAGE


Printing in 2-up Mode

COMMANDS

DESCRIPTION

2up takes a PostScript file (in filename or from stdin) and causes it to be printed in landscaped mode, with two pages side-by-side on a sheet of paper. Its output is similar to enscript.

FILE TYPES

PostScript

SWITCHES

None that I know of. 2up, as well as other ?up filters, are shell scripts provided in /usr/local/bin (on the SPARCs) that make use of the general program up.

COMMON USAGE


Printing in n-up Mode

COMMANDS

DESCRIPTION

All these work just like 2up does, with the obvious change in number of pages per sheet. 16up, for me, is impossible to read. 8up is workable, and 4up I find quite easy to read. Remember that these work only on PostScript, so if you want to print a text file 8 up (for example) you have to run it through enscript first.

Printing DVI Files

COMMANDS

DESCRIPTION

dvips takes a dvi file produced by TeX or LaTeX and turns it into a PostScript file, which it will try and print on the "standard" printer (whatever that is) unless told otherwise.

FILE TYPES

Takes TeX- and LaTeX-produced .dvi files, and outputs PostScript.

SWITCHES/Command Line Options

COMMON USAGE


Printing TROFF Files

COMMANDS

DESCRIPTION

These are troff to PostScript converters. Psroff requires ditroff which might not be available on all machines. Ptroff will always work (although the output might be uglier). Groff is a GNU substitution for ditroff and is recommended.

SWITCHES/COMMAND LINE OPTIONS

psroff/ptroff

groff

COMMON USAGE


Printing Only Part of a DVI or PostScript File

COMMANDS

DESCRIPTION

If for some reason you need to print only part of the document, you can use dvips or psrev depending on the type of the document you want to print. You can use dvips to selectively print part of a DVI file. Unfortunately psrev requires that the PostScript file be an EPSF (Encapsulated PostScript File). Fortunately most of the modern PS generating filters (such as dvips, enscript, idraw, xfig, etc.) generate EPSF. So this problem should fade away as time goes.

FILE TYPES

psrev takes PostScript files while dvips takes DVI files

SWITCHES/COMMAND LINE OPTIONS

psrev

dvips

COMMON USAGE


Some Favorite Printing Methods

REMEMBER that ps# from a cs machine is cs_ps# from a UCS machine.

Text Files:

  1. Print out a text file, 1 page/sheet, one-sided.

    lpr -Pps2 -h filename.txt

  2. Print out a text file, 2 pages/sheet, one-sided, gaudy headers, landscape mode.

    enscript -Pps2 -2rGh filename.txt

    OR

    enscript -hl -p- filename.txt | 2up | lpr -Pps2 -h

  3. Print out a text file as in 1. but on both sides of the paper.

    enscript -lh filename.txt | lpr -Pps2tumble -h

    OR

    enscript -hl -p- filename.txt | 2up | lpr -Pps2duplex -h

  4. Print out a text file as in 2. but on both sides of the paper, with you owning the job but getting a header page.

    enscript -2rG -p- filename.txt | lpr -Pps2duplex

  5. Print out as in 1. on both sides of the paper.

    enscript -2rGh -Pps2duplex filename.txt

  6. Print out a text file on both sides of the paper, with 4 or 8 pages per side of one sheet. This saves LOTS of paper.

    enscript -hl -p- filename.txt | 4up | lpr -Pps2duplex -h

PostScript Files

  1. Print out a PS file, 1 page/sheet, one-sided

    lpr -Pps2 -h filename.ps

  2. Print out a PS file, 2 pages/sheet, landscape, one-sided

    2up filename.ps | lpr -Pps2 -h

  3. Print out a compressed PS file as in 1.

    zcat filename.ps.gz | lpr -Pps2 -h

  4. Print out a compressed PS file as in 2.

    zcat filename.ps.gz | 2up | lpr -Pps2 -h

  5. Print a PS file as in 1. but double-sided.

    cat filename.ps | lpr -Pps2duplex -h

  6. Print a PS file as in 2. but double-sided

    2up filename.ps | lpr -Pps2duplex -h

REMEMBER: you can substitute 4up or 8up for 2up in any of these examples.

DVI Files

  1. Produce a PS file from a dvi file

    dvips -o outfilename.ps filename.dvi

  2. Print a dvi file single sided, one page/sheet.

    dvips -f < filename.dvi | lpr -Pps2 -h

  3. As in 2. but double-sided:

    dvips -f < filename.dvi | lpr -Pps2duplex -h

  4. As in 2. but two pages/sheet.

    dvips -f < filename.dvi | 2up | lpr -Pps2 -h

    (or use 4up or 8up if you want).

  5. As in 3. but two pages / sheet.

    dvips -f < filename.dvi | 2up | lpr -Pps2duplex -h

    (or use 4up or 8up)


Acknowledgements

Created by wdueber on October 30, 1992.

Last updated by shei on November 3, 1992.

HTML and minor updates by tloos on May 17, 1995.