 |
 |
- Home -
Feedback
|
 |
 |
 |
HOWTO Print and View LaTeX Documents
Purpose:
Explain how to format the Linux Training materials we distribute as LaTeX source code for printing or viewing on screen.
Assumptions:
- You have a RECENT Linux Distribution installed on your computer
- You have installed all the components of the LaTeX typsetting system which came with Linux (usually teTeX), or an alternative LaTeX distribution (e.g. CD Live from the TeX Users' Group).
- You have installed and configured these Linux utilities: gs, gv, dvips, xdvi, lpr
- You know how to use a Linux command-line interface
- You have the X windowing system working properly, and you are giving shell commands from an xterm window.
- You have a fully-functioning default printer
Understanding the Process:
| COMPILING |
Turning human-readable ascii text in the LaTeX source file (.tex) into machine-readable formats (e.g. .dvi, .ps, or .pdf), which look beautiful when printed to a printer or to a screen |
| DISPLAYING |
Simply open one of the machine-readable file-formats (.dvi, .ps, .pdf) in an appropriate viewer (xdvi, gv, xpdf, respectively) |
| PRINTING |
Send one of the machine-readable files (.dvi, .ps, .pdf, etc) to a printer. The ghostscript utility (gs) allows Linux users to send .dvi and postcript (.ps) files directly to a printer using the normal printing command (lpr). You can also print from inside the viewers. |
| CONVERSION |
There are so many conversion utilities to turn LaTeX source into other popular document formats (e.g. .rtf, .html, etc) that we can't document them here. Please see the documentation for those utilities for details. |
How to do it all:
- To turn filename.tex into filename.dvi, give this command from the directory which holds filename.tex:
$ latex filename.tex
To do this with the linuxtraining materials, move to the directory which you extracted linux_training.tar.gz into and then change into the subdirectory within it called "build", e.g.
$ cd build
Once inside the "build" directory, type:
$ latex masterfile.tex ; latex masterfile.tex
N.B. Repeating the command separated by the semicolon ensures that the "contents" listing and any other form of indexing is fully completed.
- To view filename.dvi, give this command:
$ xdvi filename.dvi &
This launches the xdvi viewer and opens the file. See man xdvi for details on xdvi keyboard shortcuts (they are worth knowing)
N.B. The ampersand (&) simply detaches the xdvi viewer application from the xterm which launched it. DO NOT use this command string outside the X windows environment, because the ampersand puts console apps into the background, i.e. renders them invisible!
- To print filename.dvi to your default printer, give this command:
$ lpr filename.dvi
To print to another networked printer, try this
$ lpr -P printername filename.dvi
- To get complete control over every aspect of printing filename.dvi, use the dvips utility, e.g.
$ dvips filename.dvi
N.B. dvips has dozens of options for setting page ranges, reverse printing, etc. See man dvips for details
- To turn filename.dvi into postscript (filename.ps), give this command:
$ dvips -f filename.dvi > filename.ps
- To view filename.ps:
$ gv filename.ps &
- To print filename.ps to your default printer:
$ lpr filename.ps
See man lpr for full details on printing options, or use the many printing options available in the gv viewer
- To create portable document format (filename.pdf) output from the LaTeX source filename.tex, use this command:
$ pdflatex filename.tex
- To view filename.pdf
$ xpdf filename.pdf &
or
$ acroread filename.pdf &
- To print filename.pdf, use the options provided by your viewer.
There are ways of sending .pdf straight to a Linux printer, but I don't know them. Can any body help?
Problems?
We know how hard it can be for newbies without a UNIX background to get going in Linux.
Unfortunately, we do not have the resources to answer non-commercial queries on the use of Linux and LaTeX. Please refer to these sources for free help and documentation:
| On your own machine |
/usr/share/texmf/doc/index.html or /texmf/doc/index.html under another directory |
| The TeX Users Group |
www.tug.org |
| teTeX Homepage |
www.tug.org/tetex |
| teTeX Mailing List |
mail to [email protected] containing the lines "subscribe tetex" |
| The Linux Documentation Project |
http://metalab.unc.edu/LDP/ or its many mirrors |
| xdvi Homepage |
math.berkeley.edu/~vojta/xdvi.html |
| Oficial dvips Homepage |
www.radicaleye.com/dvips.html |
| Ghostscript (gs) Homepage |
www.cs.wisc.edu/~ghost/ |
| pdfLaTeX |
www.tug.org/applications/pdftex/index.html |
| Usenet News Groups |
comp.text.tex
comp.os.linux.*
comp.lang.postscript |
Suggestions:
One of the principal reasons that we are releasing our Linux training materials as open source is that we never consider them a finished product. If you can suggest any improvements to this HOWTO (or any other document on this site), send them to: [email protected]
GBdirect Ltd, Monday, 5th July, 1999
|
 |
 |