{{indexmenu>:computing:department:unix}}
====== TeX and LaTeX ======
TeX and LaTeX is a mathematical computer typesetting system much used for scientific documents. To use the system effectively, you probably have to refer to one of the reference manuals. The LaTeX "bible" has always been **LaTeX: A document preparation system** by Leslie Lamport. Some good online guides to start with also include:
* **{{:computing:department:unix:lshort.pdf|The Not So Short Introduction to LaTeX 2e}}** by Tobias Oetiker.
* **A Beginner's Guide to Typesetting with LaTeX**, by Peter Flynn ([[http://www.ctan.org/tex-archive/info/beginlatex/html/|html]] or [[http://www.ctan.org/tex-archive/info/beginlatex/beginlatex.pdf|pdf]]).
You can find these guides and much other useful information through the [[http://www.tug.org/|TeX Users Group]] web site.
* In particular, the [[http://www.tug.org/interest.html|TuG resources page]] has many links to good documentation.
* The University of Cambridge Engineering Department also has a good [[http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/|introduction to LaTeX]].
===== Important information about our LaTeX installation =====
To activate the Physics TeXLive environment, use the command:
module load texlive
If you don't use the ''module load'' command, you may just get the default Scientific Linux LaTeX distribution, because it's installed as a dependency from other packages. But we don't support it, so please don't try to use it, and don't become confused by finding style files, etc beneath ''/usr/share...'' which are not used!
Here's the documentation for TeXLive: http://www.tug.org/texlive/doc/texlive-en/texlive-en.html
===== Some basic commands =====
* To process your prepared tex document, ''file.tex'':
latex file
* To view the resulting DVI file, ''file.dvi'':
xdvi file
* To produce a PostScript file from the DVI file:
dvips file
* To view the resulting PS file, ''file.ps'':
gv file.ps
* To print the PS file, two-sided, on printer 216:
lpr -P216 -K2 file.ps
===== Adding your own resources to TeX =====
It's useful to be able to add extra things to TeX (new classes, or macros from publishers, etc).You can do this by adding them beneath a directory in your home area defined by TEXMFHOME.
The default value for TeXLive's TEXMFHOME variable is ''~/texmf''. TEXMFHOME, like all trees, must be organized according to the {{:computing:department:unix:tds.pdf|TeX Directory Structure}}, or files may not be found. In other words, the file structure must mirror that of /usr/share/texmf, so that, for example, the directory containing revtex would be added to ''~/texmf/tex/latex''. See the TeXLive documentation for more help.
===== Thesis style files =====
The graduate school has downloadable LaTeX style files as well as some directions on their use, at this URL:
* http://www.grad.umn.edu/students/degree_completion/doctoral/ElectronicDissertationSubmission/index.html
===== LyX =====
A easy-to-use graphical "front end" for LaTeX, called LyX, is available. Run it by typing the command ''lyx''. Further documentation is available at the LyX web site:
* [[http://www.lyx.org/]]
We are told that in order to use the elsarticle document class in LyX, it may be necessary to turn off the 'natbib' citation style under Document->Settings->Bibliography->Citation Style