### Writing a thesis with LaTeX

##### [ Monday, 21 January 2008, TLu ]

A dissertation is composed of two elements: the content and the form. The author is certainly the person best qualified to speak about the content. We, however, will focus on the form. We are going to see how to get a fine composition with low time expenditure using LaTeX.

Author: Tomasz Łuczak

### Is writing in LaTeX really worth it?

Certain universities, faculties or departments ventured to formalize the typesetting requirements of a thesis. Writing a dissertation in LaTeX enables us to adjust the graphical composition to the requirements irrespective of the content. The separation of form and content notably facilitates the task of working on the matter of the thesis. The graphical composition can be defined immediately with a shipped class (there are premade dissertation classes available) or chosen at the end.

The table of contents, figures or literature will all be created by the computer. The automatic numbering of annotations and quotations or sorting the references is also a task for the program. All that is left for us is to write the content since we will satisfy the remaining requirements at the end.

### Structure

Every dissertation has a similar layout:

Title page
Acknowledgments and dedications
Statement of authorship
Introduction with the following chapters
Table of figures
Table of charts
Bibliography

The first few pages are usually precisely defined and that is where we shall need to adjust the composition to the requirements.

As we have mentioned before, we do not have to bother with creating the indexes. We just need to choose or define our own style sheet to be used to generate the bibliography.

LaTeX provides us with some ready-made commands to divide the text into logical structures like chapters, sections, paragraphs, enumerations or footnotes. Taking advantage of these commands enables us to change the form of each structure globally, in the entire document.

### Let’s start writing

Our advisors usually expect us to present the progress of our work in the subsequent chapters. Let’s begin with the content.

For our convenience it is advisable to divide the text into several separate files: the title page and preliminary pages, the introduction, chapters and conclusion. Consequently, we will be working on a smaller part of the text at a time. If our chapters are voluminous we may want to divide them into subchapters as well.

The resulting main document includes the above files via the \include{file} command. A change in any of the separate files will be reflected in the main document every time it is compiled.

If, however, our text is not especially long or if we do not find working on a large file particularly troublesome we may decide to keep it as a single file.

### The main document

The thesis will presumably contain several chapters and therefore the most suitable class for our case will be ‘book’. The title page and preliminary pages will be left for the dessert in the title.tex file.

For a start all we need is a table of contents, which can be inserted with the \tableofcontents command.

If we use charts in the text and a list of tables is required then we can insert it with the \listoftables command.

The main document will have the following structure:

% set sans-serif headings, paper format,
% font size and the main class
% set encoding
\\usepackage{latin1}{inputenc}
\\begin{document} % Let's go!
\\include{title}
\\tableofcontents
% \\lisoftables
\\include{introduction}
\\include{chapter1}
\\include{chapter2}
\\include{conclusion}


### Introduction and the following chapters

Introduction is the part that is being read the most often, so obviously it should be well written. As for the typesetting, it is one of the easiest sections, since it usually contains just plain text without charts or figures.

Sections and chapters can be numbered or not numbered. The default is numbered, so if we want to exclude a section from the numbering we need to add an asterisk to the command.

For example, the introduction is an un-numbered chapter comprised of one or more paragraphs. We can insert it with the \chapter*{Introduction} command.

The chapters of our thesis, on the other hand, should be numbered, so we should begin our chapter’s file with, for example, the \chapter{Mathematical Model}command

The text in chapters can be divided into sections and subsections with the \section, \subsection and \subsubsection commands respectively, for example: \section{Process Identification}.

### Spacing

Monosyllable conjunctions at the end of a line are generally not desired and should be gotten rid of. LaTeX does not move them to the next line automatically so we need to instruct it by inserting non-braking spaces between the conjunction and the following word. A non-braking space is simply a tilde “~”, for example “so~it”.

Double spaces are not particularly appealing, either. In this case, however, TeX knows what to do and no matter how many spaces we type it will render just one. A mark ending a line is also considered to be a space.

The feature of adding a comment is also remarkable. A line beginning with “%” is treated as a comment and is not being processed. Therefore

We can write	as we like
no matter what TeX will
compile the text %look! a comment!
the right way
with~one character   spacing between the words.


An empty line — that is, two newline characters — marks an ending of a paragraph and a beginning of a new one.

### Enumerations

LaTeX supports three kinds of enumerations: numbered, not numbered and description. The first two are the ‘enumerate’ and ‘itemize’ environments which we know already. The last one is a variant of the not numbered enumeration. In this case, a description is used instead of a symbol. Each enumeration begins with the item command.

Numbered enumeration:
\\begin{enumerate}
\\item One
\\item Two
\\item Three
\\end{enumerate}

Not numbered enumeration:
\\begin{itemize}
\\item One
\\item Two
\\item Three
\\end{itemize}

Description enumeration:
\\begin{description}
\\item[Iron] -- an element
\\item[Steel] -- an alloy
\\item[Caffe latte] -- a mixture
\\end{description}


### Horizontal lines.

The keyboard allows us to enter only two types of dashes directly — a hyphen and an underscore. LaTeX, however, delivers the following horizontal lines:

hyphen: "-" to join words, i.e daughter-in-law
en-dash: "--" to join digits, i.e 1937--2007
em-dash: "---" to denote a pause, i.e yes --- or no?
underscore to join file names: "_"


In practice, we use just the hyphen and en-dash; mathematical expressions are a good material for a separate article.

### Fonts and sizes

To write in bold font we need to use the \textbf{text-in-bold} command; to write in sans-serif font there is the \textsf{sans-serif-text} command; italics can be enabled with the \textit{text-in-italics} command, and finally \textsl{caps} renders the text in small caps.

A word of advice: underlining text should be avoided because it makes the text more difficult to read by crossing the parts of glyphs descending below the baseline. The custom of underlining text dates back to the times of typewriters which had just one typeface. Likewise, the text should not be highlighted with bald font since a black element in a grey rectangle of text draws readers’ attention and disturbs the rhythm of reading.

### References in the text

Frequently in a thesis we refer to some other part of it, for example a chart or a figure. In order to refer to any place, we need to label it. In labels’ names, spaces and diacritical marks should not be used. Preferably, a label should contain only Latin letters, digits and dashes. A label can be inserted with the \label{fig_1} command.

A label inherits the information from the environment that precedes it. Placing a label just behind the name of a section or chapter will show its number in the reference. Analogically, placing it behind a caption of a figure will show the figure’s number in the reference. A reference to a label can be inserted with the \ref{fig_1} command.

TeX processes our file sequentially, so in order to get the references rendered properly we need to compile the document twice. During the first processing TeX will generate the numbers of all the chapters and captions; in the second one it will place correct references where necessary. Rendering a table of contents also requires double compilation.

### Footnotes

Frequently we need to place a footnote under the main flow of text or at the end of the document. In that case, we need to place a footnote with \footnote{footnote-content} command.

### Summary

The number of “spells” needed to write a thesis, excluding figures, charts, bibliography and mathematical expressions, is just a few commands. It is not much work, considering that a text created with LaTeX can be given directly to our advisor and the time expenditure to create a visually appealing composition is minimal.

In the next article we will finish writing the dissertation and we will describe how to insert tables, figures, a bibliography and how to prepare the preliminary pages of our work.

You can download an example dummy thesis from our server: Thesis in LaTeX [examples, tar.gz]. It is properly divided into small tex files for better granularity.

This text is based on the article published in Dragonia Magazine, a Polish online magazine about Free and Open-Source Software. You can download the latest Dragonia issue (first one in English from our mirror). The article has been slightly modified compared with the original version by the PolishLinux team.

Translated by Jan Misiak, Proof-read by Jake Conroy

Warning: include_once(/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php): failed to open stream: No such file or directory in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Warning: include_once(): Failed opening '/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Joan Arling  Tuesday, 22 January 2008 o godz. 8:42 am #     +0

When I began writing short stories, I decided on LaTeX to render them as pdfs. I wish I could have read this fine introduction back then!

(Comments wont nest below this level)

LiMan  Tuesday, 22 January 2008 o godz. 9:09 am #     +0

For those interested, you might want to also have a look at TeaM-TL (TeXLive in LinuxLive) http://team-tl.livenet.pl/index-eng.php?show=home-eng

(Comments wont nest below this level)

Joan Arling  Tuesday, 22 January 2008 o godz. 10:21 am #     +0

Hmm, just to make a good thing even better, here’s what my LaTeX installation did not like in your tar.gz:

In main.tex (and in the text above as well):

It’s \documentclass[...]{…} and
\usepackage[...]{…} — brackets, then braces.

In chapter1.tex there’s a line missing (but it’s
correct in the text above):

\begin{description}
(after \subsection{Description})

(Comments wont nest below this level)

Wawrzyniec Niewodniczański  Tuesday, 22 January 2008 o godz. 12:18 pm #     +0

I think it is worthy to mention BibTeX. References is the most important reason I’ve written my thesis using LaTeX.

I hope have some more time to share some of my settings soon.

(Comments wont nest below this level)

Michal  Tuesday, 22 January 2008 o godz. 3:03 pm #     +1

hi,

I’d add some important points concerning LaTeX :

- I’ve written my PhD thesis back in 1993 and I’d still be able to typeset it again if I wanted to modify something ex. a font or page format. ask people who’ve written things at this epoch if they can still read their documents (and preserve the formatting)

- I’ve also used LaTeX for writing a technical documentation. The advantage is that I was able to create both pdf (for printing) and html (using latex2html, LaTeX references being converted to html links) for online viewing from the same source.

- mathematical equations are really clean compared to other products so if your document contains equations typesetting with LaTeX gives much better results

happy typesetting,
michal

(Comments wont nest below this level)

latex  Saturday, 2 February 2008 o godz. 11:23 pm #     +0

Is there a tutorial that starts from the very beginning? I mean , like for someone who knew nothing about latex till this very moment. The reason I am asking is because anything I input from the above article produces errors, so I must be doing it wrong, but, simple as it may seem, I have no idea how to proceed.

(Comments wont nest below this level)

latex  Saturday, 2 February 2008 o godz. 11:42 pm #     +1

Never mind, just found one. As a beginner, I’d much recommend it over the above article. Here you go http://en.wikibooks.org/wiki/LaTeX/Introduction

PS: What a dumb request to submit emails before commenting.

(Comments wont nest below this level)

Dibakar Datta  Saturday, 22 November 2008 o godz. 12:44 am #     +0

(Comments wont nest below this level)

Victor  Friday, 18 December 2009 o godz. 9:04 am #     +0

I have a problem. I want the words Chapter1, Chapter2, Chapter3, etc appear in the tableofcontent of my report, instead of their corresponding numbers.
Thanks.

(Comments wont nest below this level)

Isaac Gonzalez  Sunday, 22 August 2010 o godz. 8:13 pm #     +0

i do article writing on the topics that mostly interests me. i love to do article writing;;”

(Comments wont nest below this level)

Electric Cement Mixer %0A  Saturday, 4 December 2010 o godz. 8:22 am #     +0

writing is my passion that is why it is easy for me to do article writing in less than a hour or so “-

(Comments wont nest below this level)

Caterina  Wednesday, 30 May 2012 o godz. 5:01 pm #     +0

thank you for your tips! useful for mehttp://www.kitsucesso.com

(Comments wont nest below this level)

Marlana Raleigh  Saturday, 20 April 2013 o godz. 3:22 pm #     +0

When writing an article to promote your site, you need to ensure that the content is entertaining to a reader. Keep your writing style similar to your niche. Even if you happen to be writing about a very technical topic, take the edge off of it by introducing the information in layman’s terms. Do not alienate your readers with boring content.;

Take a look at the newest post at our new web site
http://www.caramoan.ph/5-reasons-to-visit-caramoan/

(Comments wont nest below this level)

http://aquaponicsgood.com/  Sunday, 15 September 2013 o godz. 12:55 am #     +0

Why Backyard aquaponics magazine Works. As you respond to this article I
will seek to show you reasonable prices/sources for IBC s and 55-gallon barrels.
There are so many species of fish to reproduce within your holding tank, the water goes to a clarifying tank
where the fish are kept healthy and happy.

(Comments wont nest below this level)

Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)

You can use simple HTML in your comments. Some examples are as follows:
• A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
• Strong text: <strong>Strong text</strong>,
• Italic text: <em>italic text</em>,
• Strike: <strike>strike</strike>,
• Code: <code>printf("hello world");`</code>,
• Block quote: <blockquote>Block quote</blockquote>

#### Tomasz Łuczak

TeaM-TL developer, Dragonia Magazine's editor, TeX and Tcl/Tk enthusiast. Lives in Katowice, Poland.