Printing from Athena (AC-18)The Athena network makes it possible to print on any public Athena printer (i.e., any printer in an Athena cluster) from any Athena workstation. You can print part or all of a file or document, unformatted or formatted. You can print output from programs, images of your screen, and more.
Athena has approximately 25 Hewlett Packard LaserJet 4si and 5si MX printers. These print plain text and files written in PostScript, a language used by printers. Not all programs and text formatters on Athena produce output in these formats; fortunately, Athena provides programs that translate from one format to another. (For example, LaTeX, a text formatting program, produces device independent, or dvi output. You must convert this file to PostScript using dvips to print it on an Athena printer.) The necessary utilities for the different kinds of output are explained here.
This document assumes that you are familiar with Athena's printing policy (if not, see the section Athena Account Policies in the document Welcome to Athena for details).
The sections of this document cover the following topics:
Athena's printing policy exists to protect the printers. Printers are a limited resource, and Athena printers get a lot of use, often much more than they are able to handle successfully. This heavy use, especially near the end of the term, can result in poor print quality and printer failure.
Here are a few suggestions to ease the printers' load:
A8. Do not violate the official priorities for the use of printers; in particular, do not be a printer hog or use the Athena printers as copy machines.The Copy Tech Centers have three locations:
To find out the current status of all Athena printers, type cview printers at the Athena prompt, or select Help>>Help on Athena>>Athena Cluster Map from the Dash menubar (the blue menubar on the top of your screen, if you are logged in at an Athena terminal). You can also call up xcluster by typing xcluster at your Athena prompt, or on a workstation without actually logging in by clicking on the Other Options button of the main login window (which says Welcome to Athena) and selecting the option Map/Status of Athena Clusters.
Each Athena printer is also labeled with its name and type, as well as the name of the cluster.
If you want to see if your workstation has a default printer, you can use any command that tells you the name of your printer, such as the lpq command. If, when you type this at your Ahena prompt, it returns lpq: default: unknown printer, you have no default printer; otherwise, the printer named in the second line is the default. Here:
athena% lpq MULCH.MIT.EDU... no entries in fiberfiber is the default printer. When there is a printer error, this will not necessarily work. In this situation, you can use a command such as xcluster and look for your current location.
If there is no default printer for your workstation, or if you want to use a different printer than the default, you can use the -P option to the print command. Following -P with the printer name will tell the print command to send the document to the stated printer. Also, if the specific application you are using has a printer selection command, you can use that.
Additionally, you can set the PRINTER environment variable. By doing this, you avoid having to type the printer name every time you use a print command such as lpr, lpq, ez, and xmh. To set this variable for the duration of your login session, type:
athena% setenv PRINTER printernameYou will need to type this once in each window that you print from. This lets you omit the -P option to commands like lpr when you type them in the same window. This command also sets the printer for programs like xmh, if you type the setenv command before you start the program.
To specify a default printer for every time you log in, put an appropriate setenv line in your ~/.environment file. If you do not have a ~/.environment file, you can create one; using you favorite text editor, create a file in your home directory named .environment with only this line. You can always override your default with the -P option (or the appropriate printer selection command, if any, in a specific application).
Many of the commands listed have special options not described here. To learn more about a particular previewing command, type a command of the form man commandname at the Athena prompt. For example, to learn more about the more command, type the following:
athena% man more
athena% xdvi filename &Here filename is the file that LaTeX created when it processed your .tex file. This file should have the same first portion of its name as your .tex file did, and end in .dvi. The following options are available when the mouse cursor is in the xdvi window:
| Quit | Ends the xdvi session. |
| Shrink2 | Enlarges the screen greatly from the default. |
| Shrink4 | Enlarges the screen slightly from the default. |
| Shrink6 | Makes the page the default size. |
| Shrink8 | Reduces the screen from the default. |
| Page-10 | Goes back ten pages. |
| Page-5 | Goes back five pages. |
| Prev | Goes to the previous page. |
| Next | Goes to the next page. |
| Page+5 | Goes forward five pages. |
| Page+10 | Goes forward ten pages. |
If you need to edit your .tex file and run LaTeX again, you do not need to exit from xdvi every time you want to preview a new version. After you have created a revised .dvi file, type R in the xdvi window to load the new version of the .dvi file.
xdvi is not able to display all the fonts that LaTeX can produce. If it can't find a font, it gives you a warning and substitutes a similar font.
Processing preview request.After a few moments, the mouse pointer returns to normal and a new message appears in the message box:
Preview window should appear soon.The preview window has its own set of menus that are used for moving from page to page, printing specific pages, and scaling the text displayed on the previewer. Keep in mind that files are loaded into the previewer page by page; therefore, later pages of your document are not immediately ready for viewing when the viewer first pops up. Note that the Quit option in the viewer closes the viewer window, not the original EZ window.
athena% more filenameWhen more has filled up the screen, you must give it a subcommand to tell it to continue. There are many such subcommands. Here are the most common ones:
| Spacebar | Move forward one screenful |
| Return | Move forward one line |
| b | Move back one page |
| /word (RETURN) | Search forward for word (case sensitive) |
| q, Ctrl-c | Quit |
| ? | Help |
athena% ghostview filename &The ghostview window will immediately appear; your document will appear as ghostview loads it in. (Sometimes this takes a little while.) There are bars on the right and bottom of the document; click on these to maneuver about the page. The file name will appear in the upper left corner. Below that is the time it was last edited; below that, there are five choices.
| File | Lets you open, reopen, or print a file, mark pages (for later printing), or quit ghostview. |
| Page | Lets you go to the next and previous pages, redisplay the current page, center the document in the window, and mark and unmark pages. |
| Magstep | Allows you to magnify or demagnify the page which you are viewing. |
| Orientation | Lets you switch between portrait, landscape, upside-down, and seascape (an upside-down landscape) orientations. |
| Media | Allows you to state the sort of paper you will be printing on. |
All of these printing commands have more options than are described here. To see the full set, type a command of the form man commandname at the Athena prompt. For example, to see the full list of options for the lpr command, you would type the following command:
athena% man lpr
athena% lpr filenameIf you wish to use a different printer than the default:
athena% lpr -Pprintername filenameFor printername, use the name of the printer to which you want to send the file (look at the printer if you are uncertain of the name). For filename, use the name of the file (or files) you want to print. For example, to print the file mydoc to the printer ajax, type the following:
athena% lpr -Pajax mydocYou can also use the lpr command to send the output from another command directly to the printer without having to create a file. To do this, "pipe" the output of the command through lpr:
athena% program_name | lpr -PprinternameThe | is a vertical bar, also known as a "pipe" (Shift-\ on most keyboards). A pipe takes the output from one program and sends it as the input to another program. You can use this method for any program whose output normally goes to "standard output" (i.e., your screen). For example, if you want a printed copy of the list of files in your directory, send the output from the ls command directly to the printer of your choice by typing:
athena% ls | lpr -Pprinternameand to print out the manual page for a command, type:
athena% man command | lprThe lpr command acknowledges a number of other useful switches in addition to the -P option, including the following (type man lpr for the complete list):
To print a document double-sided, add a numeral 2 to the regular printername in the print command. For example, to print file mydoc in duplex mode on the printer ajax, type:
athena% lpr -Pajax2 mydocThis sends the job to ajax's duplex queue (ajax2), which adds the necessary PostScript code to enable duplex mode.
You can also use the 2 appendix to specify double-sided output with all other printing commands. For example:
athena% setenv PRINTER ajax2 athena% ls | lpr -Pajax2 athena% ezprint -Pajax2 mydoc.ez athena% dvips -Pajax2 mydoc.dvi
To print normal text or a PostScript file, you can use the lpr2 command in the consult locker. To do so, type:
athena% add consult athena% lpr2 -d -Pprinter filenameThe -d option turns on duplex mode for the given files. You may also use any other options associated with lpr, such as -h or -z.
For tumble mode, use -m instead of -d.
lpr2 does not work with standard input. This means that you cannot pipe things through lpr2 in the fashion that you can pipe them through lpr.
For more information, type man lpr2 after adding the consult locker.
If your file does not print right away, it might be waiting in line for the printer. To find out what print jobs are waiting to be printed, type lpq at your Athena prompt. For a printer different from your default, use:
athena% lpq -PprinternameFor example:
athena% lpq -Pajax PAPER-PUSHER.MIT.EDU... ajax is ready and printing Rank Owner Job Files Total Size active joeuser 2 report.abstract.PS 8069 bytes 1st janeuser 3 letter.PS 12841 bytes 2nd joeuser 3 lab.report.PS 19942 bytesSpecifying ajax or ajax2 shows all the jobs in line for that printer. The lpq command also gives limited information about the physical status of the printer. For example, typing lpq -Pbob might give back:
IO.MIT.EDU... bob is ready and printingor:
IO.MIT.EDU... Warning: bob is down: Warning: bob queue is turned off no entries in bobYou might also receive Zephyr windowgrams from the print server telling you about problems. For example, if the printer runs out of paper while your job is printing, you may receive a zephyr telling you so.
athena% lprm jobnumberHere, jobnumber is the number in the "Job" column of the lpq information. For example, to remove the file lab.report.PS from the print queue for ajax, jruser would type the following command:
athena% lprm -Pajax 3It doesn't matter whether jruser specifies ajax or ajax2; the job numbers are unique. If you want to remove all of your jobs on the printer, type:
athena% lprm -The final dash is important.
athena% dvips filename.dviTo print selected pages of LaTeX .dvi files, use the -p (page) and -l (last) options to dvips. For example, to print the first 7 pages of a .dvi file to the printer bob, type:
athena% dvips -l =7 -Pbob filenameUse the = sign before the number to specify a sequence number rather than a real number, so that you print the first 7 pages regardless of how the pages are actually numbered.
To print out pages 22 to 31:
athena% dvips -p 22 -l 31 -Pprintername filenameTo print a .dvi file two-sided with dvips, use the -h option, located in the sipb locker:
athena% add sipb athena% dvips -h duplex -Pprinter file.dviFor tumble mode, the command would read:
athena% dvips -h tumble -Pprinter file.dviFor more information about duplex and tumble mode, see the section Printing Two-Sided Documents.
dvips has many other useful options. Type man dvips for more information.
You must set the printer name for each EZ window before you select Print from that window's File menu.
You can now select the Print menu option from the File menu. This sends the current version of your document to the printer you specified with the Printer Setup command.
To print selected pages of EZ documents, you need to use the EZ previewer. Set a printer as noted above, then open the preview window by choosing Preview from the File menu. When the document is loaded in, view the page of interest and choose Print Page from the front menu card of the preview window. (EZ has no way to print a selected range of pages; it prints the entire document or only one page at a time.)
athena% ezprint -Pprintername filenameThe Athena prompt returns after a short pause indicating that your file has been sent to the printer.
If you are printing out a large number of files, you can avoid specifying the printer on each ezprint command line by making a certain printer your default printer for the duration of your login session. To do this, use the setenv command explained in Specifying a Default Printer.
athena% setenv PRINTER printernameThe prompt should return almost immediately. You need to execute this command only once in each of the xterm windows you will use for sending files to the printer. Now to send an EZ file to the printer, type:
athena% ezprint filename
athena% enscript -pnewfile myfileTo send output from enscript directly to the printer, type:
athena% enscript -Pprintername filenameor simply:
athena% enscript filenameNote that the option for sending a file to a printer is a capital P; use a lowercase p for sending output to a file.
The enscript command offers options to scale, rotate, and change the font of the text, as well as to produce two-columned text and add headers to a page. For example, you can print a plain text file rotated (landscape, -r) in two columns (-2) mode by typing:
athena% enscript -2r -Pprintername filenameThis is often done with code, for instance. For more information about enscript and its options, type man enscript at your Athena prompt.
athena% show message-number | lprFor example, to print message number 10 on the printer ajax:
athena% show 10 | lpr -PajaxBecause this command involves a pipe, the header page of the printed file is labeled with the filename stdin, which means "standard input".
You can print the files containing your messages directly (i.e., without the pipe). The files are stored in the ~/Mail/inbox directory, by default. So, if you type:
athena% lpr ~/Mail/inbox/1your first mail message is sent to your default printer.
athena% setenv PRINTER printernameIf you do not do this, xmh will assume your default printer. Then start xmh from the same window. You can select one message or a range of messages, then use the Print command on the Message pull-down menu, and the selected message or messages are sent to the printer.
M-x set-variable(The notation used here is the same as in the Emacs documentation: M-x stands for Meta-x, which means holding down the Meta key -- i.e., Alt, Esc, or a black diamond, depending on your workstation type -- while pressing the x.)
When prompted, type the variable and its value in the minibuffer at the bottom of the Emacs screen:
Set variable: lpr-switches
Set lpr-switches to value: '("-Pajax")
To print the contents of the current buffer, use the print buffer command. From the Tools menu in Emacs, choose Print Buffer, or type:
M-x print-bufferYou will get messages like:
Loading lpr... Spooling... Spooling...done
You can also choose Postscript Print Buffer from the Tools menu. This option adds a header to each page of the printout with the filename, date, and page number.
Additionally, you can simply lpr or enscript the file at your Athena prompt.
If you have a default printer, you can use any version of the print buffer command without setting the variable first.
To print in modes other than normal single-sided printing, use the following entries in place of the printer name:
| duplex | duplex:printername |
| tumble | tumble:printername |
| draft | draft:printername |
The draft option places the word "draft" diagonally across the page behind the text of the document.
olc> !olc replay | lprThis sends the entire replay of the OLC conversation to the default printer. You can use the -P option to lpr to specify a printer. See Specifying a Default Printer and The Basic Printing Command for more information.
>> print -PajaxJust typing print will send the image to the default printer.
Occasionally, when printing a file from Netscape, you will get a "lpr: copy file is too large" error; often, webpages can get very large with graphics and such. To circumvent this error, try removing the graphics if you can; if you cannot, try cutting and pasting portions of the page (with the Copy and Paste commands in the Edit menu) into an Emacs buffer, and printing these as plaintext.
Selecting options can be done by selecting Printer Options from the Options menu. Here, you can specify whether you want to send the printout to a printer, file, or both; specify a print area (if you do not highlight one); or dictate a print command. You can also select a printer here; if you do not do so, Xess assumes your default printer.
To actually print, select Print or Print As from the File menu. Print As allows you to access the above options; Print prints with the most current settings.
On Athena, you can use EZ, LaTeX, or FrameMaker to format the file if you want to print more than plain text. You can then process the file appropriately and print it on any Athena printer.
When printing complicated images (such as photographs, not simple graphs), keep in mind that these take large amounts of time and printer resources such as toner. If you have to print these, please try to do so when the cluster is not busy out of consideration for other users.
athena% xdpr -PajaxWhen the mouse cursor changes into a plus sign ("+"), move the cursor to the window you wish to print and click any mouse button. To print the whole screen, click on the root window (the background). You will hear a beep as xdpr begins and two beeps when it has finished sending the window dump to the printer.
athena% xwd -out filenameAgain, when the mouse cursor changes into a plus sign ("+"), move the cursor to the window you wish to save and click any mouse button. If you wish to save an image of the whole screen, click on the root window (the background). You will hear a beep as xwd begins and two beeps when it has finished writing to the file. To redisplay that window, use the command xwud (type man xwud for details). To print a window dump file, type:
athena% xpr -device ps window_dump_filename | lpr -PprinternameSee the man pages for other options to xpr, xdpr, and xwd.
athena% add consult athena% showbitmap mybitmap & athena% xwd -out mybitmap.dumpWhen the cursor changes into a plus sign, click on the bitmap window and it will be saved to file mybitmap.dump. To save this X dump file to a PostScript file named mybitmap.ps, type:
athena% xpr -device ps -output mybitmap.ps mybitmap.dumpYou now have a PostScript file, mybitmap.ps, containing the bitmap. You can print this file as any other PostScript file, or you can include it in larger PostScript documents. To get rid of the bitmap window, click on it again.
When there is something physically wrong with a printer, the message on the front panel should be self-explanatory. If a printer needs a toner cartridge or a service call, please phone the Athena Hardware Hotline (x3-1410) and let them know the name of the printer, its location, and the error.
To insert more paper into a printer:
If there is no paper located near the printer, or when supplies begin to run very low, please call the Athena Hardware Hotline (x3-1410) to have more delivered to that site.
If you try to print out a PostScript file and instead get a printout of the PostScript commands, check to make sure that you are sending the file to a PostScript printer. (All Athena printers are PostScript printers.) Also, all PostScript files should begin with the characters %!. There cannot be any blank lines or spaces before these two characters. The percent sign and exclamation point tell a PostScript printer to execute the commands in that file rather than print out the text of those commands. If your file is missing these two characters, you can edit the file with Emacs and insert them; or, if the PostScript file was generated by a software package, try generating the file again.
|
|
Comments and feedback to olh-suggest@mit.edu
|