First, you have to convert your latex source into a "device-independent" format:
latex filename.texThe result is left in filename.dvi
Next, you convert it to PostScript, suitable for printing on most PostScript printers:
dvips -o filename.ps filename.dviNote: You do have to specify the output filename for dvips. Its default action is to send it directly to your default printer.
While PostScript output is useful for viewing (with ghostview) or printing locally, the most portable format for viewing and printing on the web today is PDF (Portable Document Format). Not only is a free PDF viewer/printer available, but PDF files are much smaller than the PostScript files from which they were generated. The program to generate PDF files from PostScript is distill:
distill filename.psThe result is filename.pdf, which can be put on the web.
Finally, you should probably clean up your intermediate files:
rm filename.dvi filename.ps
alias latex2pdf 'set TEMP = `echo \!* | sed '"'"'s;\.tex''$'';;'"'"'` ; \ latex $TEMP.tex ; \ dvips -f < $TEMP.dvi | distill > $TEMP.pdf ; \ /bin/rm $TEMP.dvi ; \ unset TEMP'In the alias as defined, a PostScript file is not produced. The PostScript output of dvips is piped directly to distill.
To use the alias, just type