Skip navigation

STANFORD UNIVERSITY

INFORMATION TECHNOLOGY SERVICES

Special Information, Tips, and Tricks

Applications Requiring Special Consideration

Most applications support printing using the standard commands, or allow a user simply to specify a printer by name; some applications, however, use peculiar commands, have restrictions on the use of standard commands, or require the additional processing of output to make it suitable for printing.

Adobe Reader (acroread)

This application does not properly support the UNIX "pipe" character in the print dialog window. As a result, only simple lpr printing will work. In order to use a compound command (like psnup) a file must first be saved as PostScript and then printed using the UNIX command line.

LaTeX (latex)

LaTeX files must be processed using the latex command to produce DVI output:

latex file.latex

DVI files can then be viewed using the xdvi command, or converted to PostScript and printed using dvips. The command takes a single argument specifying the file to be printed and requires a single option, -P, specifying a particular target printer; for example:

dvips -Psweet1 file.dvi

It is also possible to save PostScript output to a file for further processing before printing using the -o option:

dvips -o file.ps file.dvi

Mathematica (mathematica)

Most Mathematica documents can be printed normally, but some with complex formulae or graphical elements may not print correctly. These can be converted to TeX format using the application's "Save as Special" menu item, and the resulting file processed as with LaTeX.

Matlab (matlab)

To print a figure, use the Matlab print command. The command requires two options, -d and -P, describing the output format and specifying a particular target printer:

print -dps -Psweet1

Minitab (minitab)

Minitab output can be saved as a plain-text file using that application's outfile command, which takes a single argument specifying a name for the new file. The resulting file can be printed using lpr or enscript; the printing of Minitab binary output is not supported.

Printing Files Created on a Desktop Computer

The Engineering lab printers support only plain-text (ASCII) and PostScript-formatted files. Binary files, especially common desktop formats like those used by Microsoft Office on Macintosh and Windows-based computers, are not supported. Printing files of this type is sometimes possible, but requires special preparation on the desktop system before transfer to a lab computer for printing.

Printing Files Created on Mac OS X

Mac OS X supports saving files as PostScript in any application that uses the standard print dialog.

  1. Select "Print..." from the "File" menu or press command-P.
  2. Click the "PDF" button and choose "Save PDF as PostScript..."
  3. Choose a name and location for the PostScript file and click "Save."

Printing Files Created on Windows

Windows supports saving files as PostScript, but only using installed printers with driver support for PostScript printing. The generic Microsoft ImageWriter printer driver can be installed and used for this purpose if the driver for an existing printer does not include the required support.

  1. Select "Print..." from the "File" menu or press control-P.
  2. Specify a printer with proper driver support, check the box labeled "Print to file," and click "OK" or "Print."
  3. Choose a name and location for the PostScript file and click "OK" or "Save."

Troubleshooting Problem Files

If a print job fails to print, or prints incorrectly, the following suggestions may help to correct the problem. When troubleshooting a printing error, please do not turn a printer off while it is printing, as this may cause it to jam; instead, cancel the job. Also, do not try to re-queue a file that fails to print using a different printer without attempting to repair the file first. All lab printers are identical: if a file does not print correctly on one of them, it will fail to print correctly on all.

Problems with a Plain-text File

Binary files can contain text but will not print correctly on lab printers. The less command can be used to verify that a file is a true, plain-text file. This command takes a single argument specifying the file to be examined and a single option, -u, specifying that non-standard characters should be identified by a highlight; for example:

less -u file.txt

If a file contains highlighted characters other than ^M, it is a binary file and cannot be printed. If the file contains only ^M characters in addition to plain text it may be possible to repair the file.

The presence of ^M characters indicates a plain-text file may have been prepared on a Macintosh or Windows-based computer. These desktop computer systems treat plain-text files in slightly divergent ways, each using a different character (or combination of characters) to identify the end of a line. These extraneous end-of-line characters must be removed before printing.

The col command can be used to repair plain-text files containing ^M characters that otherwise preserve line-breaks. This command takes two arguments specifying the source file and the name that should be used for storing the repaired file, and requires a single option, -b; for example:

col -b < file.txt > newfile.txt

If a file containing ^M characters does not preserve line-breaks (i.e., these characters appear in the middle of a line of text) the tr command must be used to repair it instead. This command takes four arguments, two specifying how to repair the extraneous characters, and two specifying the source file and the name that should be used for storing the repaired file:

tr \\r \\n < file.txt > newfile.txt

Problems with a PostScript File

Some PostScript files prepared on desktop computer systems may contain extraneous end-of-line characters that must be removed before printing as described above. Others may contain non-standard PostScript commands, especially those created using HP printer drivers; for example:

ESC%-12345X
@PJL JOB
@PJL SET RESOLUTION = 600
@PJL ENTER LANGUAGE=POSTSCRIPT


A text editor should be used to remove these additional commands before printing.

Converting Between Various Formats

Lab computers include as standard software a utility for converting between many common file formats. The convert command takes two arguments specifying the name and type of the source file and the name and type that should be used for storing the converted file; for example:

convert eps:file.eps ps2:file.ps

In this example an Encapsulated PostScript file (a format not supported by the lab printers) is converted to a standard PostScript-formatted file. For a complete list of supported formats, refer to the UNIX manual pages for the convert command:

man convert

The convert command can also be used to repair some improperly formatted PostScript files when other troubleshooting techniques have failed:

convert ps2:file.ps ps2:newfile.ps
Last modified Monday, 14-Aug-2006 01:26:44 PM

Stanford University Home Page