OSU Navigation Bar

The Ohio State University

Department of Statistics

Cockins Hall
rollover image OSU Statistics
            Home

design element

OSU Statistics

Home

News

Research & Consulting Groups

People

For Visitors

For Prospective Students

For Current Students, Staff & Faculty

Contact Us



rollover image

For Current Students & Faculty

rollover image

Courses

rollover image

Links

rollover image

Computer Support

rollover image

Internal Documents

rollover image

webmail

How to Print Various Types of Files

There are man pages available for nearly all these commands

Printers Available in the Department

There are many printers in the department. Each is named by prefixing the room it is in by 'lw', for example lw341 is the printer in room 341.

Setting a Default Printer

To set a default printer add the following line:

setenv LPDEST lw341

to your .cshrc.more file in your home directory. Replace lw341 with whichever printer is closest to you. By setting a default printer you no longer need to specify a particular destination with any of the following commands.

Printing a Text or PostScript File

Using the lp command, only text or PostScript (a special text language) files can be printed. To see if you have a printable file, use the command more filename if it looks like gibberish or more says: Not a text file, you cannot print the file with lp. Generally, text files are what you create, or can edit, with an editor, like emacs or vi.

The syntax for lp is as follows:

lp -dlw341 filename

The -d gives the destination where to print the file, in this case lw341. filename is simply the file you want to print.

Note: On a workstation, you can view a PostScript file before printing it with the gv command.

Printing a .dvi File

To print a dvi file (created from LaTeX), the command to use is dvips. Its syntax is as follows:

dvips -Plw341 filename.dvi

The -P gives the destination where to print the file, in this case lw341. filename.dvi is the dvi file you want to print.

Printing in 132 Columns

To print wide text documents use the enscript command, for example:

enscript -dlw341 -B -r filename

The -d gives the destination where to print the file, in this case lw341, -B omits page headings, -r prints in landscape mode and filename is simply the file you want to print. (Enscript has many more options, including selecting the font, multiple columns, and heading styles.)

Printing from S

The following describes how to create postscript files in S, and then print them.

  1. Before printing, type graphics.off() in S, to make sure you have no other graphics devices active.

  2. To print: in S, type postscript(file="a.ps",print.it=F), (Note: use a different that "a.ps" for each plot).

  3. Do your plot.

  4. Type graphics.off() to make the plot go to the specified file.

  5. At the Unix prompt, you can type: lp -dlw341 a.ps for each file you created.

Other Printing Commmands

The command lpstat is used to check on the status of a print queue. lpstat lw341 will list all the jobs in the 341 printer's queue.

If you want to stop a job, once you have its job name from lpstat, you can use the cancel command to remove it from the queue. For example, cancel lw341-43 will remove that particular job from the queue. Sometimes, though, once a job has already started printing, cancel will not stop it. Then you must hit the reset button on the printer.

The command up can also be quite useful, plus enscript has may more options. See their man pages more information.



Many useful examples below.


Examples of Printing Files:

  • To the color printer, on transparency: lp -dcolor335 -o media=Tray1

  • To the 404 printer, on letterhead: lp -dlw404 -o media=Tray2

  • Putting four sheets on a page: lp -o number-up=4

  • In landscape mode: lp -o landscape

  • Duplex: lp -o sides=two-sided-long-edge

  • One-sided: lp -o sides=one-sided

  • In reverse order: lp -o outputorder=reverse

  • Odd (or even) pages: lp -o page-set=odd

  • Select certain pages: lp -o page-ranges=1-4,7,9-12

  • Most features can be combined: lp -o landscape -o outputorder=reverse

Examples of Adjusting Print Quality:

  • Brighten by 20%: lp -o brightness=120

  • Gamma correction (1000 is normal): lp -o gamma=1700

Examples of Printing Text Files:

  • Set characters per inch: lp -o cpi=10

  • Set lines per inch: lp -o lpi=8

  • Multi-column: lp -o columns=2

  • Prettyprint (highlight C code, headers): lp -o prettyprint

Examples of Printing Images:

  • Image placement: lp -o position=center
    (Available positions: center, top, left, right, top-left, top-right, bottom, bottom-left, bottom-right)

  • Scale relative to page size (0 to 800): lp -o scaling=100

  • Scale relative to image size (0 to 800): lp -o natural-scaling=100

  • Scale using pixels per inch: lp -o ppi=300

  • Adjust hue (-360 to 360): lp -o hue=100

  • Adjust saturation (0 to 200): lp -saturation=100

Examples for Amusement:

  • Mirror output: lp -o mirror

  • Front banner: lp -o job-sheets=standard

  • Front and back banners: lp -o job-sheets=classified,classified
    (Available banners: none, classified, confidential, secret, standard, topsecret, unclassified)



If you have trouble accessing this page, or need an alternate format contact webmaster@stat.osu.edu.