# TeX Software

SEP uses LaTeX to typeset its reports, books, and theses. LaTeX gives us a way to use a simple text source file from which we can derive both Postscript and HTML versions of our documents. You can find our documents on SEP's public documents site. Sergey Fomel has been getting all geophysicists to use and contribute to a standard TeX class. Check out the RSF SEGtex website for the latest.

TeX is a typesetting language, created by Donald Knuth, a famous professor from Stanford. TeX typesets complex documents beautifully and is the system of choice for most people who put mathematical equations and figures in their texts. SEP's LaTeX environment for paper and report building has been synched with the LaTeX environment with the Madagascar RSF data processing package RSF in a SCons build environment.

Currently, the LaTeX package and RSF are installed on pompei, and this is where you should build your documents.

## Building a Paper

Building papers with the SCons/RSF package is quite straightforward. Before beginning, make sure that you have set the correct environmental paths. On (t)csh shells, this requires setting the following:

   setenv RSFROOT /opt/RSF/ \\
setenv PYTHONPATH $(PYTHONPATH):$(RSFROOT)/lib \\

In the directory where your paper.tex file is located, you need to make a SConstruct file that passes the necessary arguments to SCons. The general structure of the SConstruct file is:

   #------------------\\
# SConstruct for building papers\\
from rsftex import *\\
End(resdir=' ',use=' ',options=' ')\\
#------------------\\

In the call to End(), the resdir option informs SCons where the Figure directory is located. The use option passes on the names of LaTeX packages commonly included in building. Some common ones include amsmath, amsfonts and color. The options flag passes on settings about the layout of the document. For example, when you want to prepare something in a manuscript format (i.e. double-spaced) then you can use manuscript. Other options include single-sided and double-sided. You can also change the font size with 11pt and 12pt.

## Building a Report

Building a report requires a slightly more involved SConstruct file; however, the process is fairly modular (not completely though!) so individuals will not have to change much in their own directory. Again, make sure that you have set the correct environmental paths:

   setenv RSFROOT /opt/RSF/ \\
setenv PYTHONPATH $(PYTHONPATH):$(RSFROOT)/lib \\

The main report directory (liked located at /net/koko/wrk1/sep1??) should contain each author's report(s) in subdirectories. The default naming convention is your login name followed by a number (e.g. jeff3). One then has to make a report SConstruct file. As an example, the one used to generate SEP134 is:

   #-----------------------------------------------
from rsfbook import *\\
report =  ( \\
('Imaging Hessian', 'yaxun1 claudio1 gayeni1'),\\
('Velocity Analysis','biondo1 claudio2 altheyab1 sjoerd2'),\\
('Imaging with non-standard coordinates and sources', 'jeff1 jeff2 jeff3 sjoerd1'),\\
('Interpolation','bill2 jon1 xukai1'),\\
('Amplitudes and anisotropy','jim1 jim2 jim3 mohammad1') )\\
Papers(\\
copyr='by the Board of Trustees of the Leland Stanford Junior University\\\\ \\vspace{2.0in} Copying \\
permitted for all internal purposes of the Sponsors of Stanford Exploration Project',\\
report='SEP-134',\\
group='Stanford Exploration Project',\\
line='Report Number 134, April 2008',year=2008,\\
fig=('Filler','cover','width=\\textwidth'),\\
resdirs={'jim3':"FIG",'biondo1':'Fig/Psfig'},\\
papers=report,bios = '/usr/local/share/TEX/database')\\
End(use='amsmath,amsfonts,amssymb',options='onecolumn')\\
#-----------------------------------------------

Note that if individuals have different naming conventions for their figures, then these can be specified using the resdirs option.

Other report making issues:

• Bios - New SEPers will have to create a biography entry and have their picture (in .pdf) taken for inclusion at the end of the report. This requires creating new entries in /usr/local/share/TEX/database .
• Running headers - Make sure that each one of the papers in the reports have the running headers. If they do not exists, then the running header from the previous paper will continue over to the next paper.

### LATEX NOTICE

• Use AMS Math. package.
• Do not put PDF text documents(pages>1) in Fig folder
• Do not use underscores in figure filenames, e.g., \plot{model_vel} breaks the report.
  \lefthead{Maysami}
\footer{SEP--138}

• Do not use \email command.
• In order to fully test each of your papers, you need to make a duplicate copy of the directory containing it (e.g. mohammadA and mohammadB) into the main report directory and try to build it. For this purpose, you may make a local copy of the report directory in your own home directories and create two copies of each of your paper directories (e.g. mohammadA and mohammadB). Then try to build the report with only your own papers in it and see if it works fine or not. If not, you may consider debugging your paper to fix the problems.

## TeX

TeX is a typesetting language, created by Donald Knuth, a famous professor from Stanford. TeX typesets complex documents beautifully and is the system of choice for most people who put mathematical equations and figures in their texts.

You can download TeX-related software from a set of mirrors of the Comprehensive TeX Archive Network (CTAN).

At SEP's Unix servers, we use the teTeX package. For Windows machines, I recommend MikTeX package, found in miktex.org. Both these packages are from Germany. A good DVI viewer for Windows is DVIWIN.

Mac users will probably want to install TeXShop, a really comprehensive package that can be found at TeXShop. This does not interface well with all of SEP's TeTeX environment; however, it is quite handy for doing TeXy things on Macs.

 Donald Knuth's Home Page CTAN on the Web teTeX package for Unix MikTeX package for Windows NT/95

## LaTeX

Leslie Lamport developed a popular TeX macro package, LaTeX. LaTeX source files are processed into DVI (device independent) files. You can inspect the dvi files on a computer screen or process them into a Postscript file for printing. LaTeX2HTML converter is another very useful application of LaTeX.

LaTeX source files are processed with a plain text editor or word processor. The editor of choice is GNU Emacs, empowered by AUC TeX package. On Windows, there is a nice shareware program, Texmaker, found on http://www.xm1math.net/texmaker/.

 Leslie Lamport 's Home Page LaTeX documentation All about LaTeX2HTML GNU Emacs as a religion, Windows port AUCTex package for Emacs

Recommended books on LaTeX are

LaTeX: A Documentation Preparation System, 2nd edition
ISBN: 0-201-52983-1
272 pages, $32.95 2. My favorite LaTeX book: Helmut Kopka and Patrick W. Daly A Guide to LaTeX2e, 3rd edition Addison-Wesley, 1999 ISBN: 0201398257 600 pages,$44.99
3. Another standard reference: Michel Goossens, Frank Mittelbach, and Alexander Samarin
The LaTeX Companion
ISBN: 0-201-54199-81
528 pages, \$32.95

## SEP2e (with THESIS options)

LaTeX2e allows users to add their own classes to the standard classes (“article”, “letter”, “book”, “report”, etc.), supplied in the base LaTeX2e distribution. SEP2e is a LaTeX2e class, used at SEP for writing reports, books, and theses. A brief documentation is available as a compressed postscript and HTML.

February 2007, Brad Artman added an example Adm directory for your Thesis directory. All chapter directories live in the Thesis directory. All the files you need in Thesis/Adm are included here: Thesis/Adm. Check out the thesis faq too. One- and two-sided printing now supported (and accepted by the University).

To help new users start writing SEP report papers, we provide an example paper in compressed postscript and HTML.

 sep2e.ps.gz (52K) - SEP2e documentation in postscript paper.ps.gz (121K) - example article in postscript

## Scripts

For a convenient LaTeX processing, we use a set of site make rules and Perl scripts. The scripts will be available soon on this server.

 SEP Stanford Exploration Project GP Department of Geophysics SES School of Earth Sciences Stanford Stanford University

Page Maintainer: webmaster@sep.stanford.edu