Printing in the Department of Mathematics

Currently, there are two public-use printers available in the Department of Mathematics.

lab  - located in the grad lab

mail  - located in mail room

Ensuring that the print job goes to the right printer can be accomplished in several ways:

  1. If you set the LP_DEST variable to the name of the printer you want to use, most print commands will send the print job there. (The PRINTER variable has the same effect as the LP_DEST variable.)
  2. Each time you queue a print job, you can use a command-line option to decide where to send your print job.

Setting Environment Variables

The method for setting environment variables differs depending on whether you are using the Bourne Shell (or one of its derivatives) or the C Shell (or one of its derivatives).

If you are using the Bourne Shell, you must issue the following command at the prompt to set the LP_DEST environment variable:

LP_DEST=printer
export LP_DEST
Note, printer must be replaced by the name of the destination printer, either 2225 or cage.

If you are using the C Shell, issue the following command:

setenv LP_DEST printer
Again, replace printer by the name of the printer you want to use.


Sending Documents to a Printer

There are several different families of commands which can be used in the printing process. They are, Note that the BSD and System V family of commands can be used to print text and PostScript only. E.g., if you want to print a dvi file using these commands, you must first convert it to PostScript using dvips.

The BSD family of commands include lpr, lpq and lprm. lpr is used to send a job to the printer. Simply type,

lpr filename
This will send filename to the printer specified by LP_DEST. You may use the P option to specify which printer you want the job to go to,
lpr -P2225 filename
will send filename to 2225, whatever LP_DEST is set to. lpq is used to get information about the printer, it also uses the P option. Finally, lprm is used to cancel a print job, but it does not work reliably, so do not use it.

The System V family of commands include lp, lpstat and cancel. lp functions in the same way as lpr, with the exception that lpr's P option is replaced by d. The lpstat command is functionally equivalent to lpq. Finally, cancel is functionally equivalent to lprm (except that it actually works).

For more information on any of these commands, use the man command. Finally, there is the locally installed perl script print. This script recognizes a limited number file types and converts them to the proper format for printing. In particular, print recognizes and deals correctly with PostScript files, dvi files, [ntg]roff files, man pages, and ASCII files. To print files using this script, simply type,

print filename
If you want to send filename to a particular printer, simply use the P option, as follows.
print -Pprinter filename

What about printing pdf files?

Use acroread to open the file.   Select  file, print   and change the Printer command to   lpr -Pprinter   Where printer is the name of the printer you would like to print to.    [ example]

Last Modified on 16 Jan 2002