### cPbL's LaTeX page

I have advice on (now more than) five things here (and a specific page on Economics elsewhere):

#### Introduction

If you are writing a thesis or a scientific paper and you do not know what LaTeX is, I wish you to break out of your Microsoft-imposed matrix dream and try some software that was built to work well rather than to make money.  The top-level place to start or to finish seeking TeX-related material is the CTAN. For introductory material, choose "search" and see the bottom of the page.  Most of the software described in this document is available through the CTAN, and many references will be made to it.  To get LaTeX running on your system, you will want to get both LaTeX (or MikTeX on Windows 9?/NT) and ghostscript software, and you will likely want to use Emacs or LyX.  These are all free.  A lot of (La)TeX documentation is online, but you will find that for details these resources will all refer to two paper books which are the classic bibles: "LaTeX" by Leslie Lamport, and "The Latex Companion" by Goossens, Mittelbach, and Samarin. A newer, and reportedly even better, bible is the guide by Kopka and Daly.

An update [2006]: I now use the LyX interfact to LaTeX nearly exclusively. I am also facing another dissertation, and may be able to do it most of the way this time in a recent version of LyX.

Feel free to ask me questions on material below; I haven't written everything here. Also feel free to send me an email if something was especially useful.

#### Stanford University Thesis style

Many universities provide LaTeX style files to fulfill their thesis requirements.  You can find Stanford's yourself.  In 1999 it was at CSLI's site. The version of suthesis-2e.sty which I have was last updated in September 1995; it is extremely useful.

One bug exists with the suthesis-2e style as of 2001. That is that if you make a 2-sided printout and the preface ends on an odd page, an extra blank page is needed and missing. Hugh Holbrook (Stanford) provides the following solution, which is implemented in my copy (old?) of suthesis-2e.sty:

Add the three linesdenoted with '+' below to the afterpreface macro in suthesis-2e.sty toforce a clearpage at the end of the preface.        \fi+       \if@twoside+               \cleardoublepage+       \fi        \pagenumbering{arabic}        \pagestyle{headings}}

What I have to offer is help on modifying the font size of the chapter and section headings from this style, as they are large and ugly.  As I write my thesis, I am keeping style changes in cpbl.sty.

From this, you can see how to adjust the look of these headings, as well as several other key modifications / fixes to the standard software. So, the beginning and end bits of my thesis looks as shown below. Note: there are many things listed here, but they are mostly commented out, and the indexing stuff (and more) can be eliminated. My thesis is available on my home page in pdf, hyperlinked pdf, and HTML versions, so you can see whether you like what I got.

Please see the bibliography section below for an explanation of the last item. This can make life very pleasant! Above, I use the caption2 package, version 1999-Oct-9. All you need is caption2.sty and two documentation files, caption2.dvi and caption.dvi. The preface.tex file which is included above, looks like this:
\title{\sc Fast Photometric Imaging of High Altitude Optical Flashes Above Thunderstorms}\author{Christopher Paul Barrington-Leigh}\dept{Applied Physics}\principaladvisor{Umran S. Inan}\firstreader{Sebastian Doniach}\secondreader{Martin Walt}\submitdate{September 2000}\copyrightyear{2001}\beforepreface\dedication{To the god of fire.}\prefacesection{Abstract}Lightning in the Earth's troposphere is among the largest impulsive...\prefacesection{Acknowledgements}How can I adequately thank everyone who has made the past five yearsthe most fun period of my life? ...\figurespagetrue\tablespagefalse        % change to \tablespagetrue if you have tables\afterpreface

#### Writing papers for AGU journals

This is straight from the CTAN, and new for late 1999.  If you are tired of using the archaic American Geophysical Union (AGU) style files, get AGUplus from CTAN.  Without all the documentation, the core is aguplus.cls.  It is self-documented.

#### LaTeX Bibliography

I have found it baffling how many people (in my group and discipline) have tried to reinvent the wheel, or, more often, not to use one, when it comes to bibliographies.  Everything you can imagine has already been written very nicely by someone else.  Having said that, here are: (1) a piece of software to extract bibliographic data from INSPEC, written by Dave Lauben from my group at Stanford; (2) a new possibility for generating BiBTeX data directly from literature searches for free; and (3) the agu.bst format and natbib.sty style from CTAN, both written by Patrick Daly.

I never need to enter any bibliographics information by hand.  Here is the process I have been going through:

1. Periodically search INSPEC, which is available for Stanford students from library.stanford.edu, for any publications since 1968 that are of interest.  When you have sought some references (e.g. "find abstract sprites") you can export your findings into a format which we can convert to a .bib file.  (I  believe this format is also used by EndNote, and thus I suspect that bibliographic databases analogous to Inspec for other fields could also export into this format. If not, you will need to modify a Perl program below.)  For instance, I use
2. mail all export to cpblnova
to send the search results to myself in the EXPORT format (and then save the text file as "inspec.txt" from my email inbox) or better, if I'm using SAMSON (a Stanford telnet program), I can just type
save all export to c:/inspec.txt
to save it to disk on a p.c.
3. Next, run a modified version of Dave Lauben's program, to be run on Unix.  His package includes export2bib which calls cit2let2bib.pl, and I run it like this:
4. export2bib inspec.txt > sprites.bib
This produces a file in standard format (see Lamport's "LaTeX", section B.1) which can be read by BibTeX.  Not standard is the algorithm for choosing a keyword associated with each reference.  You could change that easily by editing the cit2let2bib.pl file.  I am using a key such as InanApr99 for a work published by Inan (and others) in April of 1999.
5. To make use of this bibliography database, I now include the line
6. \usepackage{natbib} % From CTAN.  Used in association with a huge variety of .bst bibliography formats.
in the preamble of my LaTeX file and at the end of the document write:
\bibliography{sprites,elves} % Include references in sprites.bib, elves.bib\bibliographystyle{aguCpbl}      % Use the brilliant author-year referencing system of agu.bst
The latest versions of the natbib.sty package and agu.bst package are available from CTAN. Without all the documentation, etc, all you need is natbib.sty and agu.bst.   However, as you can see in the \bibliographystyle line above, I use aguCpbl.bst, in which I have made a small modification so that it doesn't de-capitalize title words. Now when I need to reference a source, I can use one of the varieties of the \cite command documented in agu.bst to make a reference mid-sentence, at the end of a sentence, in a list, or whatever (honestly -- any formulation I could need!), and to automatically add the item to the printed bibliography.  If there are references with identical author/year designations, they will automatically have a, b, c, etc appended to the designations.
Note [Feb 2000]: There is now a vastly easier way to create BibTeX databases.  This will likely make the Perl programs (steps 1 and 2, above) obselete, but at the moment there are a few limitations to this new service. Axiom provides free INSPEC literature searches AND will output up to 200 of them at a time in BibTeX format!  However, the citation keys are essentially random numbers, so you have to go through and provide them yourself.  Since the information included in the records is limited, it may be difficult to automate this to match the format described above.
Presumably with time, the option of exporting searches to BibTeX format will become increasingly ubiquitous.

#### VLF Group Bibliography Database

If you are working in the VLF group at Stanford, please help to create a group resource if you find yourself spending time making bibliographies.  If running Perl scripts is an imposition, just use the latest version of the group bibliography files, which I will maintain while I'm here, at http://nova.stanford.edu/~vlf/bibliography, and if have something to add to it, please don't keep the change to yourself!

There are only two important issues for creating and maintaining such a database. One is the format of the citation key. I have decided that Dave Lauben's method of FirstauthorMonthYear (e.g. SmithApr99) is the best alternative. This could be made YnK-compliant. The second is how to organise and update the various database (.bib) files. This is still an open question. The good thing is that they can be multiply redundant when listed (see above) in a \bibliography command. So feel free to suggest new subjects for .bib files... I will be happy to do the INSPEC search and conversion if you can't.

Please help contribute something, and suggest changes. There are a number of things that need working on.

#### Composing a poster

This is sort of obvious, but if you have material that is already in LaTeX format and you can print out to a large printer (or else use software like Adobe Illustrator to tile a large document onto the printable areas of many pages -- also easy), then it would be silly to use anything other than the a0poster LaTeX class for the job. Get the most up-to-date version of it from CTAN, and you can find instructions in English by searching the web. You can use the A0 format in either landscape or portrait orientation. We still need to make a sample document in English (they're in German so far) for each of these to make life really easy. (I may do this, or tell me if you've done it). And to top it off, you can install the PSUtils package (search the web!) on your system and use its "psresize" command to make a one-page version of your poster for proofing and handouts. For instance, to make a one-page version of my portrait A0 poster, I used:
psresize -H46.78in -W33.05in -pletter bigposter.ps onepage.ps
in North America, or
psresize -H46.78in -W33.05in -pA4 bigposter.ps onepage.ps
elsewhere.

#### Composing "slides" for digital or overhead projection

There's nothing clever here; this seems to be a matter of style, and everyone puts up their favourite style file for slides. I started using "slides" in 2005 and use LyX with foils.cls and its built-in LyX style, augmented with my own cpblFoils.sty (achieves first item below, along with some modest header / footer info; ask me for it), in order to satisfy most of my requirements:
• if material does not fit on a page, it does not disappear; an extra page gets created (like the ancient slitex slides.sty). That is, pagination is automatic. Like in other document classes, you can start a new page (slide, with title, etc) when you want, but you don't need to worry about things fitting on a single page if you don't want to.

• The title is repeated on these extra slides (ie subsequent slides without a new title). They appear in smaller text on the right, above a header line. Alternatively, they could appear with a cont'd'' suffix or etc.
• The point is that I'd like to be able to use an existing (e.g. article) document and convert it to slides very easily.
• I'd like to be able to use LyX with it.
• I'd like to be able to use not-so-huge fonts, and turn off all glitz, but
• it should generate PDF bookmarks/TOC etc, and be able to give PDF directives like fullscreen'' when compiled to PDF
• some smart image sizing would be nice

So, to use it in LyX: Under document layout, set document class to "foiltex", options to "dvips,headrule,color", and pagestyle to "foilheadings", and under document paper, choose "landscape". Under document preamble, enter:

\usepackage{cpblFoils}
\usepackage[cspex,bbgreekl]{mathbbol} % Eek! This is necessary for expect %mathbb symbol in foils...?!

See my Software page, for the moment, for more details.

December 1999 [Jan 2000:cPbL][Feb 2000:cPbL][Jul 2000:cPbL][Oct 2000:cPbL][May 2001:cPbL][June 2001: cPbL][March 2005:cPbL][Note: contact me for updates]
Christopher Paul Barrington-Leigh / Stanford / cpbl@