How to Write and Compile your University of Calgary Thesis in LaTeX

This document is NOT a LaTeX guide, to find help on LaTeX, refer to The Not So Short Introduction to LaTeX, a Hypertext Help with LaTeX, a short list of LaTeX symbols, a very extensive list of LaTeX symbols (also found here) or, for best results: google.ca.

Here, I collected the files necessary to write your thesis in LaTeX, and some suggestions concerning:

The compilation section of this guide is based on the assumption that you are using LaTeX on a Linux system, and have access to a command prompt. If you are using MikTeX (often combined with TeXnicCenter), then "Step 3" does not apply to you, the rest does. If you are using Scientific Word then all I can suggest you is to stop doing it and write your document in the old and EASY way with a simple text editor under Linux, or use Miktex (and TeXnicCenter) under Windows.

At the end of this page, you find a Discussion section with other usefull remarks that involve topics like creating a "List of Symbols", Most recent thesis guidlines, etc.

Step 1: Download

Unzip this file, it will create a thesis folder with the following files in it:

Step 2: Write your thesis

Use chap1.tex, chap2.tex, ... to write your thesis. Whenever you need to define a new command, do it in mycommands.tex.

The rest is ...

Step 3: Compile your thesis

Obviously, you will compile your thesis several times while writing it. Here, I assume that you are logged in to a Linux system, and have access to a command prompt.

Make sure that you are in your thesis directory. Issue the following commands in your Linux command prompt:


>latex thesis
>bibtex thesis
>latex thesis
>latex thesis

This will produce a thesis.dvi file. You can view this file with

>xdvi thesis.dvi &

though, some figures might not be displayed. That's OK.

Note that you don't need to run bibtex when compiling your document if you did not make changes to the bibliography. In this case, running latex (maybe twice, to make sure references are included) is sufficient.

To produce a ps file from the dvi file, type

>dvips thesis.dvi -o thesis.ps

You can view the PostScript file by typing

>gv thesis.ps

To produce a .pdf file from the dvi file, type

>dvipdf thesis.dvi
or
>dvipdfm thesis.dvi

To view the pdf file, type

>acroread thesis.pdf
or
>xpdf thesis.pdf

Note that on some systems dvipdf does not produce a particulary nice and optimal size (small) pdf file. In this case, log on to ms0, and run dvipdf thesis.dvi there. You need to have your thesis.dvi and all the included .eps files in the directory where you run the above command.

To check that your system is configured properly and you have all the files,

you can compile the files that you downloaded at Step 1 without any modification. If you compile them into .pdf format, you should obtain a file that looks like this.

How to include graphics

There are several ways to include graphics in your LaTeX document. I am only discussing one here: the method that I find the safest. You can consult several LaTeX resources to obtain a more complete picture. Note again that the figures might not be displayed by your dvi viewer. In that case, convert your thesis.dvi into ps (see the section on compiling), and view the ps file.

How to build your bibliography easily

Use BibTeX!

Q: Can't I just use the usual method to build my bibliography?

\begin{bibliography}
\bibitem ...
\end{bibligraphy}

Answer: Well, you can, but bibtex really makes your life easier, and there is not much to learn about it. It's worth the effort. Here is how bibtex works:

You collect all the bibliography items in a bibliography database file, called biblio.bib, and then it takes care of everything provided that you follow the compillation method set out in the compilation section; that is, you latex, then bibtex, then latex, and latex again your document.

Q: How do I collect my bibliography references?

Answer: That's VERY easy, in fact, that is the main reason why you should use bibtex. First, go to MathSciNet and find the publication. Then click on the red text "Clipboard" under the name of the article/book. Then, the blue word "Clipboard" appears in the upper left corner of the page. Click on it, and select "Citations (BibTeX)" from the pull-down menu. Click "Save clip", and you see the citation in bibtex format. Copy and paste it into your biblio.bib file. You are done, it will be included in your bibliography next time you compile your document.

This is one major advantage of using bibtex over the "ususal" latex method: You can't make a typo. Your references are as accurate as MathSciNet. The other major advantage is that the stlye of referencing is uniform and follows the standards of the AMS.

Q: How do I cite?

Answer: If you want to cite a bibliography item in your text, open biblio.bib, and replace the MR number at the top of the item by a label of your chice. Then, you can cite this reference as

\cite{the label you used}

anywhere in your document.

Note that you don't need to run bibtex when compiling your document if you did not make changes to the bibliography. In this case, running latex (maybe twice, to make sure references are included) is sufficient.

Q: Where do I find more information on BibTeX?

Answer: You don't need to know more to write your thesis. However, if you are interested, check The BibTeX format, Wikipedia -- Bibtex, How to use Bibtex, LaTeX tricks: Bibtex or, for best results: google.ca.

A note on amsplain2.bst

for those who are interested in the history of this bibliography style sheet (You don't need to read it in order to use it). I took the file amsplain.bst and made three minor changes:

1. I modified "Function(fin.entry)". I commented out the field mrnumber, this way the MRNUMBER of a paper is not shown in the bibliography.

2. I modified "Function(format.names)". Now, only initials are displayed for firs and middle names (I copied it from abbrv.bst).

3. I modified "FUNCTION {format.authors}". Three lines are commented out. According to amsplain.bst, if the same author published several papers that appear consecutively in the bibliography, the name of the author is replaced by a line ------. Now, names of authors are allways displayed.

Discussion

This section contains comments that I recieved.

The most recent thesis guidelines

can be found at:

http://www.ucalgary.ca/gs/policy/pdf/t_thesis_guidelines.pdf

This document deals with fonts sizes, spacing, the order of sections (does the "Dedication" go before or after the "Table of Contents", which sections are optional, and so on), margins, and just about everything else a thesis should do or have. The LaTeX thesis template handles most of these, except for making sure the various optional sections show up in the correct order.

by Alan Silvester

List of Symbols, Abbreviations, Nomenclature (Outline)

If you want to add a "List of Symbols, Abbreviations, Nomenclature", it's very easy to use LaTeX's index commands to automatically add, sort, and list page numbers of symbols. Commands like:

\index{$symbol$}{This is a useful symbol}
\index{$symbol2$}{So is this one}

can turn into:

List of Symbols, Abbreviations, Nomenclature

symbol This is a useful symbol.............11
symbol2 So is this one......................14

This idea can also be extended to make another very useful section, the "List of Things To Do". Throughout your thesis, you can insert commands like \todo{Fix this} or \todo{Find a reference for this} to make a list of things to do (complete with automatically updated page numbers). If anyone is interested in these, I can dig the various parts out of my thesis files and share them.

by Alan Silvester

For help on index, see this page, this page or, for best results: google.ca.

List of Symbols, Abbreviations, Nomenclature (Details)

First, you need the three files from this folder. Thesisindex.sty is a modified version of index.sty that allows you to make two-column indices. Makeidx.sty is the LaTeX style file that gives you the indexing commands. Thesis.isty is the makeindex style file. This will all make sense in a moment.

Place the thesisindex.sty and makeidx.sty in your texmf directory and thesis.isty in the same folder as your thesis.tex file.

Include thesisindex and makeidx with a \usepackage{thesisindex, makeidx} command.

Create the indices with:

\newindex{not}{idx}{inx}{List of Symbols, Abbreviations, Nomenclature}
\newindex{todo}{idt}{int}{List of Things to Do}
\newindex{defn}{idd}{ind}{Index}

This command indexes a to-do item and includes it in-place in the text: \newcommand{\todo}[1]{\index[todo]{#1}{\tt [[ TODO: #1 ]]}}

Once compiled, it will look like:



List of Things to Do

Fix this statement .........................page

and on "page", you get:

blah blah [[ TODO: Fix this statement ]] blah blah

This command formats the list of symbols to look nicer: \newcommand{\symindex}[2]{\index[not]{\parbox{1.5in}{#1} #2}}



This way you get:

List of Symbols, Abbreviations, Nomenclature

symbol Description........................page

instead of:

List of Symbols, Abbreviations, Nomenclature

symbol,Description..............................page

To generate the indices, use: \begin{singlespace}
\printindex[todo]
\printindex[not]
\end{singlespace}
...
(all your chapters go here)
...
\begin{singlespace}
%\printindex[defn] % One-column
\printindextwo[defn] % Two-column
\end{singlespace}

Finally, to use these in your actual chapters: \index[defn]{ whatever you are defining }
\symindex{ the symbol }{ description of symbol }
\todo{ your reminder }

To compile your thesis, you need to run:

latex thesis
bibtex thesis
/usr/bin/makeindex -s thesis.isty -o thesis.inx thesis.idx
/usr/bin/makeindex -s thesis.isty -o thesis.int thesis.idt
/usr/bin/makeindex -s thesis.isty -o thesis.ind thesis.idd
latex thesis
latex thesis
latex thesis

You'll have to find makeindex on your computer; I only know where it is in linux. The nice thing about the list of things to do is that it will only show up in the compiled thesis file if there are any \todo commands.

Just remember, LaTeX has weird (but consistent) sorting rules. When it produces the list of symbols; certain fonts have precedence over other fonts. You can force it to do per-chapter ordering by replacing:


\newcommand{\symindex}[2]{\index[not]{\parbox{1.5in}{#1} #2}}
\symindex{ symbol }{ description of symbol }


by

\newcommand{\symindex}[3]{\index[not]{Chapter #1!\parbox{1.5in}{#2} #3}}
\symindex{ chapter number }{ symbol }{ description of symbol }

This way you get:

List of Symbols, Abbreviations, Nomenclature

Chapter 1
sym Description of sym...................page
sym2 Description of sym2..................page

Chapter 2
sym3 Description of sym3..................page
sym4 Description of sym4..................page

instead of:

List of Symbols, Abbreviations, Nomenclature

sym Description of sym...................page
sym2 Description of sym2..................page
sym3 Description of sym3..................page
sym4 Description of sym4..................page

You can get fancy in the defn index, too (actually these work in any of the indices, but it's especially good for the defn index):


\index[defn]{Riemann!hypothesis}
\index[defn]{Riemann!hypothesis!general}
\index[defn]{Riemann!$\frac{math}{formula}$ and text}
\index[defn]{Riemann!hypothesis!extended}
\index[defn]{Something else|see{Riemann}}

produces:

Index

Riemann
hypothesis ...................................page
general ..................................page
extended .................................page
math
------- and text .............................page
formula
Something else ............................see Riemann

You can only do that many sub-levels. It's also smart enough to automatically turn a page list like "24,25,26,28,32" into "24-26,28,32".

by Alan Silvester