Astro-ThesisTeX

Writing a doctoral thesis is painful enough without the added frustration of LaTeX! Many astrophysics grad students are familiar with writing papers using the AASTeX package--an add-on to LaTeX published by the American Astronomical Society and the format of choice for most astronomical journals. JHU has a strict formatting requirement for official disertations. Fortunately, there is a very useful package to put your generic LaTeX document into the approved thesis format (double spacing, margins that are just so, title pages, and all the rest). Unfortunately, the thesis package and AASTeX are incompatible and result in much bloodshed, angry words and general bad juju. Generations of grad students have coped with these technical difficulties through a mixture of hand-me-down code, vague rumors and experimentation.

Hopefully this document will make life easier for everyone...



Preliminaries

First things first: do you know how to use LaTeX? If not, much of this will be quite cryptic and not terribly useful.

Why shouldn't I just use Word or some other word processor? This is a valid question. LaTeX is not a word processing program but a typesetting program. Your document is written in plain text with tags much like HTML. This can be done in any word processing program (Emacs, vi, Simpletext, MSWord, clay tablets) on any platform. It is then compiled into a Postscript or PDF file which can be read and printed out by pretty much everyone. The output looks the same for everyone regardless of which fonts they have installed, or what operating system they're using. Word documents and the like are only legible by some of the population and will look different on different machines. More importantly, most of the astronomical community (including all the journals) use LaTeX and some require submissions in this format. You'll be writing all your papers in it; so you might as well get used to it. LaTeX is extremely geeky with more degrees of freedom than you can possibly imagine. Best of all, there are lots of astronomer-specific add-ons one can use to make your life easier.

Learning LaTeX: As always, the best way to learn is by example. Norman Matloff has created a nice page of introductory notes with simple examples and links to lots of resources. There's another nice primer and lexicon maintained by David Wilkins.

Familiar with LaTeX? Great! How about AASTeX? AASTeX is just a package of routines to optimize LaTeX for the astronomical community. There are loads of handy symbols, formatting options, bibliography tools, and other handy goodness. Moving on...

The Thesis Class

Now for the actual thesis writing. You'll need the JHU Thesis style file written by Ian Goh. He has written a nice bit of documentation. Be sure to download the thesis class definition file (thesis.cls) and one or more the point size files (jhu10.clo, jhu11.clo, jhu12.clo) and save them in your local directory where you will be working. The files are also located on Ian's website http://engspec2.cer.jhu.edu/~ian/jhuthesis/new/v03.1/

There are various tags accepted by the thesis class pertaining to what kind of degree you're getting (PhD, MA, MS, etc) and the type of document (Dissertation, Essay, etc). It's also convenient in a large document such as a thesis to split things up into multiple files corresponding to individual chapters and insert them appropriately with \input{file} or \include{file}.

Preamble

In particular, you should start your document off with a \documentclass[10pt]{thesis} line. This tells LaTeX to read the thesis class file to learn about margins, formatting and various other conventions different from normal LaTeX. In the example above, I'm using 10pt type, but you can change this to 11 or 12pt.

Next you need the line \begin{document} which matches an \end{document} at the end. All your text, figures, tables and so forth will go between these two lines.

Title Page

\title and \author are pretty self explanatory. Next comes a line defining what kind of document it is. This can be any one of the following: \thesis, \essay, \dissertation; you'll probably want the last. Next comes what kind of degree you're getting: \masterarts, \masterscience, or \doctorphilosophy. Including the line \copyrightnotice puts in a line about how it's copywritten to you (whether or not you've actually filed the copyright paperwork is a separate matter). You'll also need to specify \degreemonth{} and \degreeyear{}. The command \maketitle turns the above information into a nice-looking title-page.

Front Matter

Next comes the front matter (tables of contents, abstracts, tables of figures and so forth). This is defined in a block bracketted by \begin{frontmatter} \end{frontmatter}. Inside you'll have an abstract bracketted by \begin{abstract} \end{abstract}. Your abstract shouldn't be more than 350 words and must include the name of your academic advisor (usually in the last sentence). Then come the three lines \tableofcontents, \listoffigures, and \listoftables which will generate the obvious tables. The beauty of LaTeX is that, as the text changes, the page numbers on these contents lists will be updated effortlessly.

Dedications, Acknowledgements

Some people may wish to include additional information in the front matter. If you wish to acknowledge help, ideas or support (financial or otherwise), you can place this text between \begin{acknowledgement}\end{acknowledgement} tags. Typically, this will immediately follow your abstract both in your code and in the final printed text.

Similarly, if you want to dedicate all your collossal thesis-writing efforts to some significant person, pet, diety, event or natural phenomenon, include a \begin{dedication} \end{dedication} tag. The dedication will appear, unlabeled on a blank page, immediately before the first chapter and after all the tables of contents and figure lists. Both dedications and acknowledgements are optional and their use varies by personal preference.

Bibliography, Appendices and Vitae

After all the text, figures and whatnot that comprise 90% of the work, comes the bibliography. This should look something like this:
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{}
\setlength{\itemsep}{-2mm}
\bibitem[{Smith} {et al.}(1972)]{Smith72}
{Smith}, J., {Ardeberg}, A., {Brunet}, J.~P., {Maurice}, E., \& {Pr{\'e}vot}, L.\ 1972, \aaps, 6, 249 
\end{thebibliography}
The first line above adds the Bibliography to the table of contents. The mechanics of citations and referencing is covered in more detail later in the Natbib tutorial.

Everyone likes appendices! It's where you get to dump your code, your massive quantities of data or huge tables. Readers skip them and it transforms your meager, skinny work into a two-volume bug killer. In the code, simply put in the tag \appendix when you want the appendices to start. From then on, use \chapter{Loads o' Data} as normal. The first chapter after the \appendix tag will now be called "Appendix A: Loads o' Data" instead of just "Chapter 7: Loads o' Data" and all the figure numbers, equations, and tables will be "Figure A.1" instead of "Figure 7.1", etc. Subsequent chapters called after this will be labeled B, C, D....

Finally, many people include a vita where they give a brief autobiography. The vita page is the last page of the thesis and is a brief biographical sketch. This "life" or "vita" should record the date and location of your birth and the salient facts of academic training and experience in teaching and research. This may seem egotistical, but it's probably easier and more fun to write than any other part of your thesis so why not? As usual, there is a \begin{vita} \end{vita} tag. It should go at the end of your document, however, just before the \end{document} tag.

See Randy Telfer's FAQ for information on how to get these to appear in your table of contents. When in doubt, read the actual thesis.cls file; it's not nearly as bad as you might think!

Incorporating the AASTeX functionality

Now here's where it gets interesting! The Thesis class and the AASTeX style aren't compatible! In order to take advantage of useful AASTeX commands like \ion, \citep and so forth extreme measures must be taken. Tim Hamilton, Randy Telfer, Larry Bradley and I (with trouble-shooting help from a host of others) have hacked up various files to include much of this functionality. These style files are called with the \usepackage command in the document preamble after the thesis class has been called in the \documentclass command. I've also written a short routine called mydefs.sty which defines certain functions used frequently in my work. This could also be incorporated into aastex_hack.sty, or into the preamble (between the \documentclass and \begin{document} lines) of the TeX document itself instead.

Here are some useful packages:


User Feedback: Bugs, Corrections, Other Weirdness...

This is definitely a work in progress. Contributions from users have made the whole package and process easier.

  • Randy Telfer has discovered and found fixes for several bugs already. See his Thesis LaTeX FAQ for answers to the more common and annoying problems.

    Other random tricks

  • How do I get rid of the spaces between bibliography items?
  • How do I place Tables and Figures where I want them? (I haven't been able to get this to work with deluxetables yet.)
  • How do I prevent figures from appearing on a page by themselves?
  • What's the difference between \include{blah} and \input{blah}? The first will start a new page, the latter will not.


    Limitted Tutorial

    Natbib

    The Natbib package allows the use of the highly flexible \citep (paranthetical citiation) and \citet (textual citation) commands in LaTeX. In a document, you would cite something as follows:
      This theory was first advanced by \citet{Smith86} but was later 
      disproven by several other research groups \citep{Jones90,Brown92}.
      
         ...
      
      \begin{thebibliography}{}
      
      \bibitem[Smith et~al.(1986)]{Smith86}
      Smith, G. S., Bang, R. T., Slosh, F. F., \& Dingle, Q. 1986, \apj, 299, 444
      
      \bibitem[Jones(1990)]{Jones90}
      Jones, X. Y. 1990, \baas, 188, 45
      
      \bibitem[Brown \& Wakka(1992)]{Brown92}
      Brown, T., \& Wakka, W. 1992, \apjl, 234, 45L
      
      \end{thebibliography}
      
    Important points with this package are that dates in the square brackets in the \bibitem command must be enclosed in parentheses and there must not be a space between the date and the characters immediately before it (see example above). If you have everything formatted correctly, the above text would compile into:
      This theory was first advanced by Smith et al. (1986) but was later disproven by several other research groups (Jones 1990; Brown & Wakka, 1992).

      ...

      Smith, G. S., Bang, R. T., Slosh, F. F., & Dingle, Q. 1986, ApJ, 299, 444
      Jones, X. Y. 1990, BAAS, 188, 45
      Brown, T., & Wakka, W. 1992, ApJL, 234, 45L

    Deluxe Tables

    These tables are a feature absent in LaTeX2e but added by AASTeX. They're very spiffy and can handle multi-page tables, footnoting, multi-column headers, cutin headers, and much more with great ease. Here are examples simple and more interesting deluxe tables:

    Putting it all together

    That's pretty much it. Here's my thesis!
      \documentclass[10pt]{thesis}
      \usepackage{epsfig, natbib, deluxetable}
      \usepackage{aastex_hack}
      \usepackage{mydefs}  % <---- personalized shortcuts
      
      \begin{document}
      
      \title{Interstellar Matter Kinematics in the Magellanic Clouds}
      \author{Charles Weston Danforth}
      \doctorphilosophy
      \dissertation 
      \copyrightnotice
      \degreemonth{April}\degreeyear{2003}
      \maketitle
      
      \begin{frontmatter}
      
        \begin{abstract}
          Abstract here!
        \end{abstract}
      
        \begin{acknowledgement}
          Thanks to everyone for everything
        \end{acknowledgement}
      
        \tableofcontents
        \listoffigures
        \listoftables
      
        \begin{dedication}
        In loving memory of Whiskers the Gerbil...
        \end{dedication}
      
      \end{frontmatter}
      
      \cleardoublepage
      
      %\include{intro}
      \include{fuseatlas}
      \include{echelleatlas}
      \include{chapter3}
      \include{s119}
      \include{n66}
      %\include{conclusions}
        \addcontentsline{toc}{chapter}{Bibliography} 
      \include{bibliography}
      \appendix
      \include{appendix1}
      \include{appendix2}
      \include{vita}
      
      \end{document}
      
      
    And
    here is the output (minus the several hundred pages of boring text and figures) that the above produces.

    That's All, Folks!


    Please send comments, corrections and suggestions to Charles Danforth | http://fuse.pha.jhu.edu/~danforth
    Last modified: Fri Jan 24 16:28:05 EST 2003