How to Publish a Dissertation (using LateX)

Writing a dissertation is a daunting task. As I am currently in the turmoil of writing my dissertation, I decided to write a blog on all the little things I discovered that make the process easier. My task is all the more challenging as my committee comes from three different disciplines (comp. sci, art, and art history), so their formatting criteria tends to differ a little for each chapter.. For example, my CS prof wants nice multi-part figures for showing results, while the Art Historian wants citations /w page numbers.. Needless to say, I’ve had to solve about pretty much every problem you can think of, short of publishing a book. This is a short guide for Ph.d’s in a similar situation.

A. Setup

LateX is by far the only thing you should be using for your dissertation. I did my Master’s thesis in MS Word, which was even twice as long, but it was much more painful than using LateX. LateX automatically does page numbering, figure numbering, chapter numbering, layout formatted to university standards, citations, and other stuff. I am running Windows, and I find setting up LateX is a breeze using Miktex and Texmaker.
Here are my setup steps:
1. Install Miktex
2. Install Texmaker 2
3. Goto Texmaker -> Options -> Configure Texmaker… And set every single program path so that its correct. All of them should point into the MiKTeX 2.9/miktex/bin folder, with the exception of Pdf Viewer, which should be set to your Acrobat Reader path, such as “C:/Program Files (x86)/Adobe/Reader 9.0/Reader/AcroRd32.exe”. You don’t even need ghostscript or ghostview, unless you plan to view PS files.
4. Set your Quick Build to “PdfLaTeX + View PDF”.. I find this is much faster and easier than going to DVI first. The results produces are essentially identical, and I personally can’t see any difference.
When set up properly, you should be able to write LateX in the Texmaker editor.. click the Quick Build button, and immediately see a PDF file automatically opened in Acrobat Reader.

B. Start with an Existing Dissertation Layout

You don’t want to write all the specs for a dissertation layout yourself. Page margins, left-right formatting, chapter headings, front matter.. That can all be taken care of automatically if you start with a good, existing layout. Most universities offer template LateX files for dissertations.
I started with the University of California’s thesis template:

http://www.movesinstitute.org/~kolsch/ucthesis/

This is probably of a high enough quality to be used for many universities, but be sure to check your schools own requirements. Notice that the main file is Dissertation.tex, even though you’ll be writing separate chapters. In Texmaker, you specify the main, top-level tex file by going to Options -> Define Current document as Master Document (while you have Dissertation.tex open). Its easy to forget to do this, and you’ll get lots of errors if you try and build one of your chapter.tex files directly.. Just remember to see Dissertation.tex as Master every time you work. It takes 2 seconds.

C. Making use of Packages

Unfortunately, most university packages are the bare minimum. If you’re in the arts, or many other fields, you will have more advanced stuff you want to do. Additional LateX packages let you do this.
At the top of Dissertation.tex, just under \documentclass, I specify additional packages:

\usepackage{metre,setspace,subfig,multirow,threeparttable,wrapfig}
\usepackage{graphicx,slashbox,amsmath,amssymb,rotating}
\usepackage{graphicx,longtable}

Packages will be automatically installed by Texmaker when you try and use them.
Some packages have weird compatability requirements. Feel free to contact if you get lots of package errors. For example, the setspace package requires a work-around so that it works with the ucthesis template. Overall, however, once its setup, you can use the features of all these packages seamlessly.
Here is an overview of the packages I find most important for dissertations:
1) setspace – Lets you change the line spacing throughout the document. Essential if you’re univ requires double-spacing, but sometimes you want longer quotations to be single spaced.
2) graphicx – Essential for inserting figures and images.
3) subfig – Allows you to create figures that have sub-figures, such as Fig 1a, 1b, 1c. It lets you put one caption on two figures, side-by-side, or one above the other
4) multirow – Lets you span multiple rows or columns in a table. This is really useful for nicely formatting results tables.
5) threeparttable – Lets you create more complex tables, such as tables with different sections, and tables that have footnotes just under them.
6) wrapfig – Lets you insert figures in which the text wraps around the sides of the figure. This is great for smaller pictures were you don’t want to use up half the page.
7) slashbox – Lets you put diagonal lines in the top-left cell of a table. See slashbox tutorials online for an example
8) longtable – Great for writing a table that spans multiple pages. This is useful in the Appendix, for example, if you have a user study that is written up in a table that crosses many pages.
9) amsmath, amssymb – These give you better formatting for mathematical equations, and a wider range of symbols. See their tutorials online.

With these packages, I was able to do pretty much everything I wanted for a dissertation. Obviously, you may need some other packages for yours. Its fairly easy to locate a package online, specify it at the top of your main .tex document, and let Texmaker automatically get it.

D. Graphics Paths

To get your figures organized, its helpful to put them into sub-folders by chapter.
Otherwise, you end up with a giant list of figures from all different chapters. You can tell LateX to search your chapter folders using the \graphicspath command.

\graphicspath{{ch1_intro/figures//}
{ch2_tools/figures//}
{ch3_interface/figures//}
{ch4_procedural/figures//}
{ch5_workflow/figures//}
{ch6_dynamics/figures//}
}
Then, just place your figures into these folders. I tend to name my figure image files by what they are, rather than using numbers.. Such as “fig_tree.png”, instead of “ch1_image01.png”.. That way, if latex decides to change the figure numbers around, I don’t get confused with file names. This fig_tree could go anywhere, and LateX will number it properly.

E. Little Things – Chapter and Figure Names

There are little things you want to do that can be really annoying, but are actually really easy to fix in LateX. Two examples are chapter and figure names. Lets say you have a chapter named “Creative Workflows for Media Artists”… Now, this whole line gets split by LateX on the word Media, and you’re left with something like this:

Chapter 5.
Creative Workflows for Media
Artists

Looks crappy. So you want to indicate a better split location. You change the chapter name to read: \chapter{Creative Workflows for\newline Media Artists}.. Notice the \newline command. This makes the chapter heading look good, with Media Artists on a line by itself, but you know how chapter names often appear at the top of a page? Now the chapter name at the top left of every page is also split in two lines.
To fix this, you can specify the top-of-page chapter label, as well as the heading label as follows:

\chapter[Creative Workflows for Media Artists]
{Creative Workflows for \newline Media Artists}

The [ ] version will be used at the top-of-pages for each page in the chapter, the { } version will be used in the chapter heading… Very useful.

A similar thing happens with figure captions. You have a long caption like “This figure shows a Ph.d. student playing on the beach in the sun, enjoying life without a care in the world.”. But when you do your List of Figures, that whole thing is included.
What you want is this:

\caption[Ph.D student playing in sun]{This figure shows a Ph.d. student playing on the beach in the sun, enjoying life without a care in the world.}

The first version is used in the List of Figures, tighter and more compact. The latter is used for the actual caption below the figure. Things are formatted a lot nicer now..

F. Figures and Tables

For the most part, if you write straight Latex, it will come in formatted the way you want. The real trick is when you want to do things with figures and tables.
Here is the most complex figure I printed in my dissertation:
result
Notice that it is a multi-part figure, with a) and b), and a single caption. Part a is an image and part b is a table which includes multi-column spans, and footnotes.
Here is the LateX code that generated this layout:

\begin{figure}[h!]
\centering
\subfloat[]{
\label{fig:subfig:a} %% label for first subfigure
\includegraphics[width=4in]{fig_graph}
}
\vspace{0.1cm}
\subfloat[]{
\label{fig:subfig:b} %% label for second subfigure
\begin{threeparttable}[b]
\begin{tabular} {|l|r|r|r|r|r|r|r|r|r|}\hline
\multirow{2}{*}{Model} & \multirow{2}{*}{Verts} & \multicolumn{2}{|c|}{Baseline (ms)} & \multicolumn{2}{|c|}{Houdini\footnotemark[1]} & \multicolumn{2}{|c|}{Houdini\footnotemark[2]} & \multicolumn{2}{|c|  {Luna (ms)} \\
& & eval & draw & eval & draw & eval & draw & eval & draw \\
\hline
Low res & 5k & 2 & $<$1 & 40 & 4 & 27 & 4 & 5 & 1\\
. & 22k & 10 & $<$1 & 140 & 13 & 69 & 18 & 22 & 3\\
Med res & 50k & 24 & 1 & 203 & 39 & 183 & 47 & 45 & 4\\
. & 89k & 44 & 2 & 318 & 71 & 276 & 71 & 89 & 7\\
High res & 179k & 88 & 5 & 536 & 130 & 555 & 146 & 118 & 9\\
\hline
\end{tabular}
\begin{tablenotes}
\item [1]{Naive method. Created using Copy Stamping SOP and expressions.}
\item [2]{Suggested method. Created using AttribCreate SOP and Add SOP.}
\end{tablenotes}
\end{threeparttable}
}
\caption[Performance comparison for reference model in LUNA, Houdini 10, and OpenGL baseline]{\label{fig:subfig}Performance comparison for graph evaluation and rendering time (in milliseconds) for the reference model in LUNA, Houdini 10, and OpenGL baseline.}
\end{figure}

The overall structure is whats important, which is basically this:

figure
…subfloat
……label
……includegraphic
…vspace
…subfloat
……threeparttable
……tabular
……tablenotes
…caption

I wanted to show this complex example because few tutorials really give you guidelines on how to combine figures, multi-part figures, and tables.

Notice the \vspace command is used to add some vertical space between the image and the table.
You could also replace the entire “threeparttable” with another “includegraphic” , then you would get two figures – one on top, one on bottom.

What if you want two or more figures side by side?

This is done with exactle the same structure, but by simply specifying figure “height” instead of “width”, and changing “vspace” to hspace”
Like this:

\begin{figure}[h]
\centering
\subfloat[]{
\label{fig:subfig:a}
\includegraphics[height=2.5in]{twist_grid}
}
\subfloat[]{
\label{fig:subfig:b}
\includegraphics[height=2.5in]{twist_block}
}
\subfloat[]{
\label{fig:subfig:b}
\includegraphics[height=2.5in]{twist_full}
}
\caption[Twisting and Order of Operations]{\label{fig:twist} Modifiers operate on different geometry types. a) A twisted grid with untwisted cubes, b) Twisted cubes located at an untwisted grid, and c) A regular grid with regular cubes, the whole of which is twisted.}
\end{figure}

This gives three figures side-by-side. Notice that you can specify a different sub-label for each one using \label. The file name “twist_grid” for example, is the name of your image file but without the .png or .jpg extension. *NOTE* Be careful if you use LateX instead of PdfLatex, as this requires all your images be in .eps format (you can convert them using ImageMagick).
If you use PdfLatex, like I do, then your images can also be .png or .jpg

Sometimes you will find that figures appear at the very end of your entire document. If this happens, it means LateX cannot fit your figure on the page you wanted. One way to fix this is to try this:

\begin{figure}[h!]

The exclamation (!) tells Latex, Please put my figure here! It might not always work, especially if the figure is too large. What you can do is used the (!), and then gradually decrease the figure height or width until it finally fits on the page. Or you could start really small, and slowly increase the figure size. If you have a really large figure that should go on its own page, you can also try this:

\newpage
\begin{figure}[h!]

G. Quotations

So, your dissertation guidelines say your thesis should be double-spaced.. but is it  ok to have quotations single-spaced?  Most Ph.d. guidelines may not specify, but if you put in single-space, indented quotations they may not notice or care (you can always ask). What you want, i.e. what looks nice, is to have double-spaced text, then a single-spaced indented quotation with a citation at the end.
One, be sure you have the “setspace” package installed. Then do this:

\begin{indentpar}{1cm}
\begin{singlespace}
“What is important is that having realized the limits of linear top-down models and reductionism, we are prepared to embrace a very different approach, one that looks at complexity not as a nuisance which needs to be quickly reduced to simple elements and rules, but instead as the source of life.. I am now finally ready to name the larger paradigm I see behind the visual diversity of this practice. This paradigm is complexity.” \cite{Manovich:2007}
\end{singlespace}\end{indentpar}

The indentpar tells LateX to indent this stuff, and the singlespace tells it to single-space it.. Notice the citation is placed inside of both.
* NOTE * Also notice that the quotation uses “ (two left quotes, next to the 1 key), at the beginning and ” (two right quotes, next to enter), at the end.. It does not use double-quotes ” and the beginning and end. This is because LateX is good at formatting, it lets you show either left or right quotations anywhere, but you have to specify it. So put “ at the front, and ” at the end, and it will look nice.

H. Citations

There is a lot online about citations in LateX.
Here are a few things you may not know. A regular citation is done like this:

\cite{label}, where label is the label as it appears in your .bib file. I tend to do my labels like this: \cite{Manovich:2001}

What if you want in-place page numbers to appear with your citation?
Then you do this:

\cite[p. 51]{Manovich:2001]

This is the proper way to do in-place page numbers with a reference, and LateX should correctly format it for the bibliographic style you are using.

You can also use LateX to edit your .bib bibliographic file. In your .bib file, you would have a few lines that look like this.

@book{Manovich:2001,
author = {Manovich, Lev},
title = {The Language of New Media (Leonardo Books)},
isbn = {0262632551},
month = {March},
publisher = {The MIT Press},
year = {2001}
}

There are plenty of guidelines online for formatting books, journals, articles, websites, and other things.
* NOTE * Take special note of the location of commas above!.. If you forget one of the commas, then LateX will say there are  lots of errors in your .bbl file (generated from the .bib file)
You can open the .bbl and look at the page number indicated as an error to see where you forgot the comma. Be sure you look at your .bbl file to location of the error, and then do the fix in the .bib file.
Also, if you have any ampersands & in your .bib you will also get lots of errors, so be sure to say \& if you want an ampersand.

I. Printing in B&W and Color

So you just finished your 2000 page dissertation, 20 if you’re luck, 200 if you’re normal. And you’re ready to print it. If you’re in a visual field like computer graphics, arts, or art history, among others, you may have several color pictures in your dissertation. You unversity may require color (probably not), and you’d love to give your parents a color copy.
However, you just went to the printer and found out that it costs $1 per page to print color! Thats $200 per copy, and you need 5 copies for university, department and parents.

But only a few pages are in color, and B&W costs only $0.08 per page. What you really want is to print the color pages in color, and the B&W separately.

To do this, I recommend the free, open source tool PDFsam.
http://www.pdfsam.org/

PDFsam will take any PDF document, and split it or merge it by specific pages into another PDF.
To separate color and B&W, you want the Merge operation. Which takes your full dissertation.pdf and lets you specify which pages will be merged into a new document. In the “Page Range” column, you list the pages that are in color. When you click Run, it makes a new color.pdf with just color pages, still properly numbered for collation.

Now you invert the page ranges (unfortunately, you need to do it manually), then do the process again and you will get a b&w.pdf document that is only the black & white pages.
(NOTE TO the makers of PDFsam: I would love if you had two features: 1) automatically detect color figures, and set page ranges for output based on color, 2) allow you to invert page ranges, and print just the B&W ones. For now, you must do these steps manually.)

Finally, you go to the printer and you say: “I’d like to print the color.pdf document using the color printer, and the b&w.pdf document using the black & white printer, 5 or whatever copies of each. Give me an estimate.”  Some printers may even do the collation (mixing of color back into a complete document) for you without charging much extra… The cost of printing color separately from black & white, then collating together and binding.. is MUCH cheaper than just printing it all in color.

Leave a Reply