Hide menu

Filip Strömbäck

Thesis formatting


Thesis formatting

This page contains a list of common formatting issues I see in thesis reports. Use it as a checklist to ensure that the formatting is appropriate before hand-in to avoid formatting-related comments. Instructions on how to do things properly assumes you are using LaTeX. However, the guidelines apply to other typesetting systems as well (even though I do not necessarily know how to do things "properly" there).

You will see a theme in the list below. Namely: tell LaTeX what you want at a semantic level, and let LaTeX worry about the layout. This does, however, mean that you need to configure LaTeX to use the layout you want (the thesis template already does this, so you mostly don't need to worry).

General

  • Research questions should be numbered

    Your research questions should be numbered so that you can easily refer to them later on. Often they are numbered RQ1, RQ2, and so on to make the numbering stand out.

    In LaTeX, this can be done automatically as follows (you need to \usepackage{enumitem} first)

    \begin{enumerate}[label={\textbf{RQ\arabic*}},ref={RQ\arabic*}]
      \item First research question
      \item Second research question
    \end{enumerate}
  • Abbreviations

    There are two considerations for abbreviations in academic texts. First and foremost, avoid using abbreviations except for inside parentheses. Write them out instead. This makes the text look nicer.

    For abbreviations inside parenthesis (e.g., like this), we need to consider the issue of spacing outlined above. The common consensus seems to be to include a comma after at least e.g., and i.e. This solves both the spacing issue (comma is not a full stop), and flows well with what the abbreviations mean. If we don't use the comma, then you want to escape the space as noted above.

Headings and Paragraphs

  • Capitalization of titles and headings

    There are two major styles of title capitalization. One style (sometimes called "title caps") is often found in English, particularly American English, works. In this style you capitalize each "non-trivial" word (more or less, anything except "for", "in", "and", etc.). An example would be: "Deep Studies in Computer Science".

    Another style is to just capitalize the first word in the title. This is the norm for Swedish documents.

    For English documents (particularly in computer science) I prefer Title Caps, mostly because it aligns with much of the existing literature. It is fine as long as you pick one style and stick to it throughout the document.

  • Formatting of paragraphs

    Two tools are used to help readers understand where a new paragraph starts: vertical spacing and indenting the first line. These are used differently in different types of documents. For example, English texts often indent the first line and only has little (if any) vertical space between paragraphs. The first paragraph after a heading is sometimes treated specially and has no indentation. In contrast, Swedish texts often only use vertical spacing, and never have any indentation.

    Personally, I have no strong opinions on which style is used, as long as the document is consistent.

    Luckily, when using LaTeX, one does not need to worry about paragraph formatting. LaTeX manages most of it automatically as long as you tell it where new paragraphs start. The key thing to note is that the proper way to start a new paragraph is to just leave a blank line in the source code. Once LaTeX finds one or more blank lines, it knows that the next thing will be a new paragraph and do the right thing based on the configuration (inserting spacing and/or indenting the first line).

    In particular, note that you almost never want to use \\ in your LaTeX source. It means "insert a linebreak here". It differs from starting a new paragraph by omitting any space between paragraphs, and ignores indentation. One could think that two such linebreaks (e.g. \\ \\) would be enough for a Swedish-style new paragraph. This is however not the case. The space between two paragraphs is often a different from two blank lines. Furthermore, the default paragraph space is flexible to allow LaTeX to do a better job of making your document look nice. Bottom line - it is visible (to me) if you use the wrong construct as it makes the document look less nice.

    Since the advice above is to let LaTeX do the formatting for you, you need to know how to change paragraph formatting, both globally and locally. By default, LaTeX uses the English style (i.e. indentation and only small space between paragraphs). To use the Swedish style globally, you can simply add \usepackage{parskip} to the preamble of your document. If you want the English style, but want to not indent the first line of some individual paragraph, you can add \noindent just before that paragraph.

    Finally: similar guidelines apply to documents written in e.g. Word. Here, you press return to start a new paragraph. If you want more space between paragraphs or indentation, use the "Paragraph formatting" options to achieve that for a consistent look.

  • Length of paragraphs

    In general, you don't want to start a new paragraph (or line for that matter) for every sentence in your document. That looks more like a bullet list than a coherent text. Aim for at least two-three sentences per paragraph, so that the paragraphs in your document end up spanning at least 2-3 lines.

    Of course there are exceptions to this. For example, if you want to make some sentence stand out. That is acceptable, but don't overdo it!

  • No text between a heading and a subheading

    Sometimes when structuring a chapter that covers a set of loosely related topics, it might be tempting to view the chapter as a kind of a "box" that contains nested smaller boxes for each of the subsections. For example, if we are writing about compilers, we might want to include some information about lexing, parsing, and code generation in the theory section. If we just insert the three topics under subheadings in the theory section, we will end up with a document where the Theory heading is directly followed by another sub-heading (e.g. Lexing). While this might seem natural from a structural perspective (especially for people in computer science, where we are used to this kind of nested structures from e.g. file systems), it is usually not suitable when writing texts.

    Rather than considering the text as a nested structure, it is preferable to think of the text as a sequence of information, where different levels of headings indicate how tightly coupled the next section is with the previous one. After all, the reader of your text typically reads it in a mostly linear fashion; it is quite inconvenient to jump back and forth in the report when trying to follow some part of a tree-structure.

    To get into this mindset, a good rule of thumb is to avoid having two or more headings that directly follow each other (this indicates a tree structure rather than a linear structure). In such cases, it is a good idea to help the reader by writing a short paragraph that helps the reader by describing the structure of the subsections, and possibly how they relate to each other. For example: "This chapter covers the theory that this report builds upon. It covers the topics in the order they are typically executed in a compiler. First, we cover lexing, then parsing, and finally code generation."

    It is worth noting that there are different opinions in this matter. You will most likely see two (or sometimes more) headings stacked after each other when reading conference papers, which often have very tight page limits.

Text Formatting (Typography)

  • Quotation marks

    Even though there is only one quotation key on your keyboard (i.e. "), there are actually multiple quotation characters used in text. In particular, English texts typically use what is called 66 and 99 to start and end a quote respectively. To differentiate between them, you want to write `` (i.e. two backticks) for an opening quote and '' (i.e. to ' characters) for a closing quote in LaTeX. Interestingly, " is used for other things, such as adding dots over characters (e.g. producing ö). Interestingly, Swedish text uses the same quotes for start and end of citations ('').

    In line with the theme of making LaTeX do things for you, the package \usepackage{say} can handle things for you. That way you can just type \say{my quote} and it will do the right thing.

  • Localization

    There are a number of differences in typography between different languages. For example, which quotation marks to use. The package babel helps out with configuring LaTeX for the conventions of different languages. LaTeX is configured for English by default. To adopt Swedish norms (for documents written in Swedish), use \usepackage[swedish]{babel}. Note that [swedish] may be a part of the \documentclass options.

    Another part to consider is character encoding. When working with XeLaTeX, this is mostly not an issue but you probably want to make sure to \usepackage{fontspec} if your document contains non-english characters.

  • Emphasis

    Quotation marks are sometimes used in non-academic texts to emphasize words or phrases. This is often not done in academic texts. As the name implies, quotation marks are used to quote other texts, more or less literally. If you wish to emphasize some word, it is often better to use the command \emph{text}, which produces italics by default.

  • Hyphens and dashes

    There are a number of different hyphens and dashes in typesetting. Initially they may seem the same, but looking closer you will find that they have different lengths and different uses. They are as follows:

    • Hyphens (-): Used between multiple words that belong together (e.g., high-performance), or introduced when a word is split across multiple lines. In LaTeX, this is what you get if you just type -.
    • En dash (–): Used to indicate ranges of numbers or other things (think that it means "through"). For example, 3–5, or January–March. Note that we don't combine dashes with "between" or "from". For example not "The shop is open between 3–5". Instead, write either "The shop is open between 3 and 5", or "The shop is open 3–5". In LaTeX, you get an en dash if you write two hyphens next to each other (--).
    • Em dash (—): Used to join different "segments" of sentences. For example to change direction in a text, or as a form of parenthesis. In LaTeX, you get an em dash if you write three hyphens next to each other (---).
  • Different spaces

    In LaTeX, and in typesetting in general, there are different types of horizontal spaces. Spaces between words and spaces between sentences. The latter is slightly larger than the former (some people always have two spaces after a full stop for this reason). LaTeX manages this automatically in most cases according to basic rules.

    First and foremost, LaTeX collapse all spaces you write in your document to a single one. This means that you can use spaces (and newlines!) almost anywhere you want without affecting the final document. Once LaTeX decides to output a space, it looks at the previous character it outputted to decide whether to insert a short space (between words in a sentence) or a long space (between sentences). If the last character is a full stop, exclamation mark, or question mark, it uses a long space. Otherwise it uses a short space.

    This seems to work well until you consider abbreviations. If you write for example F. Strömbäck, you would want a short space between the initial and the last name (after all, it is the same sentence). Luckily, LaTeX detects this particular case (capital letter followed by full stop). However, this is not true for abbreviations (for example: vs. or et al.). In such cases, we need to help LaTeX a bit by "escaping" the space, like so: Emacs vs.\ Vim or Strömbäck et al.\ found that.... Since we escaped the space, LaTeX uses a short space in that location. Another option would be to use a non-breaking space (~), which is always short.

    (If you experiment a bit with the above, you will actually start seeing the difference. In particular, you will start seeing where others have made mistakes in this regard. I'm sorry.)

  • Units and spacing

    In general, there should be a space between numbers and the unit following them (e.g. 3 mm, not 3mm). It is usually a good idea to use a non-breaking space (i.e. ~ in LaTeX). Otherwise there may be a line break (or even page break) between the number and its unit, which looks strange and is difficult to read.

  • Footnote marks and punctuation

    Footnote marks are typically placed after any punctuation rather than before it. As such, if you want to put a footnote at the end of a sentence, place the mark after the full stop rather than before it. To see why, look at the two examples below. Focus particularly on the space between the last word and the full stop in the incorrect example.

    Correct: This work is implemented in the Storm language platform.1

    Incorrect: This work is implemented in the Storm language platform1.

    I am fairly sure that the same rule of thumb applies to quotation marks as well.

    Note: this is different from how citations are formatted. They typically appear before full stops (and commas) rather than after them. This is because the citations are typically larger in the text compared to footnote marks.

Figures and Tables

  • Figure descriptions go below, but table descriptions go above

    It might initially be surprising to learn that the text that describes a figure go below the figure, but the text that describes a table go above the table. Stating the rule like this might initially seem inconsistent. However, as with any rule in typesetting, it is there to make it easier for the reader. I do not know the reason why, but the different type of content in tables and figures makes this different very natural.

    The way I think about it is as follows. For figures, we typically look at the figure first, and then look at the description for some clarification. For tables, we do want the description first, to act like a caption for the table. That way we know what kind of data to expect in the, often compact, table.

  • Figure and table size

    When working with figures, it is often easy to shrink the size of the figure to fit more information on the page. Since it is very easy to zoom PDFs, one easily loses track of the scale of everything. What I usually do is to look at any text in the figure and compare its size with the size of the figure description text. If they are about the same size, then the figure is probably not too small.

  • Figure resolution

    In many cases figures originate from some bitmap graphics (e.g. screenshots). In such cases it is important to make sure that the original resolution of the picture is high enough. Otherwise everything gets blurry if the reader zooms or prints your PDF on paper (printers usually have way higher resolution than screens). If you are unsure, try zooming in on figures and compare their sharpness with the surrounding text. Since the text is based on vector graphics, you can zoom it almost as much as you want without it getting blurry, while pictures get blurry quickly.

    For some types of graphics (e.g., illustrations from external sources, screenshots) there is not much to do. However, try to avoid low-resolution images whenever possible. You would be surprised about how often I see papers (written by researchers!) that have a table that is a low-resolution screenshot from Word. In some cases the characters are in the order of 6 pixels high, so zooming in the PDF does not help readability very much...

    Below are some tips:

    • Generate graphs in LaTeX directly.

      One way to avoid the issue of resolution altogether is to generate the graphics and tables in LaTeX directly. That way you get a consistent look throughout your document (same fonts, sizes, etc.), and you can even use other functionality in LaTeX (e.g., cross-references, citations, etc.).

      For tables, prefer the tabular environment (or its variants). For source code, listings is a good way to get highlighted source listings. For graphics, TikZ and pgfplots are very capable of drawing figures and graphs. However, they have a fairly steep learning curve, however, so it is understandable if you don't want to go this route.

    • Avoid screenshots whenever possible.

      Most programs let you export their contents in some well-known format. That way they can render the graphics in a higher resolution than what they show on the screen, which results in a higher quality picture in the document. If possible, try to use a vector-based format (e.g., Postscript, PDF, SVG) for line-drawings rather than bitmap formats (e.g., PNG, JPEG, ...). As with text, it is possible to zoom in almost infinitely in vector formats without images getting blurry. For bitmap formats, aim at a resolution of 400–600 DPI as a rule of thumb. Verify your setting by zooming in a bit in your PDF and checking that it looks acceptable even when zoomed in.

    • If a screenshot is your only option:

      Try to make the thing you are getting a screenshot of take up as much as possible of your screen. The screenshot will capture the exact pixels you see on the screen, so if you can get the thing you are taking a screenshot of take up as many pixels as possible on your screen, the final image will be sharper. For example, you might be able to zoom in in the application you are using (or the webpage). If that is not possible, you can adjust the DPI scaling of your monitor ("Choose how large you want objects to appear" in windows) temporarily while taking the screenshot. As with bitmap formats, verify that the screenshot looks acceptable even with some zoom in the final PDF.

  • Table formatting

    Formatting tables for readability is a bit of an art. Below are some tips that can help to aid readability:

    • Many popular tools for table formatting draw lines around all cells by default. However, this often makes it more difficult to get an overview of large amounts of data as the lines introduce visual noise. Instead, use horizontal and vertical lines sparingly to divide different sets of data and/or headings. In combination with bolding certain lines, this can greatly improve the readability of the table! For examples, see Tables 2 and 3, and Table 1 for examples.
    • It is usually a good idea to right-align numbers in tables. That way, the least significant digits line up nicely, making it easier to read the numbers. In LaTeX, this can be achieved in a number of ways. The easiest is to define the column as r in the tabular environment. For numbers with decimals, use the package \usepackage{siunitx} and then define the column as S[table-format=A.B] where A and B are the number of digits numbers are expected to have before/after the decimal point. Enclose any cells containing titles with {} to avoid them being incorrectly formatted.
    • To change alignment of individual cells, one can use the \multicolumn command to create a new column of width 1. For example, to get the title of the column center aligned and the rest of the column right aligned (e.g. for numbers), one can define the heading as: \multicolumn{1}{c}{Title} to temporary specify a new alignment. Of course, replacing the 1 with another number creates a cell that covers more than one column.
    • Even though it is possible to create tables inline with the text, it is almost always preferable to keep the table in a float, by enclosing it in the table environment (it works like figure for figures).

Cross references

  • Built-in reference management

    One strength of LaTeX is its built-in management of references. More or less, you can put \label{name} after any command that generates something with a number (e.g., \section, \caption in figures and tables, etc.). Replace name with a name that makes sense to you, and then you can use \ref{name} to refer to that particular thing later on.

    One downside with \ref{} is that it only produces the number of the thing you refer to. For example, if I want to refer to figure 3, I have to write Figure \ref{coolfigure}. That means I have to remember if I refer to a figure, table, section, or something else. I also have to remember to be consistent with whether I write "Figure 1", "figure 1", or even "Fig.~1".

    Of course I am lazy, so I want LaTeX to handle this for me. The package cleveref is good for this and provides the \cref{} command. It accepts one or more names to things you have previously marked with \label, and outputs a nice piece of text with references to them. For example \cref{introduction} may output "Section 1", and \cref{introduction,background} may output "Sections 1 and 2".

    Since \cref{} generates text, there are two versions of it: \Cref{} for use at the start of a sentence, and \cref{} for use elsewhere. In particular, \Cref{} outputs things that start with an uppercase letter, but the formatting may differ in other contexts as well.

    It is common to highlight these references by always writing Section, Figure, Table, etc. with an uppercase letter, even in the middle of a sentence. For example, "The graph in Figure 3 shows...". This is also nice as it matches what is written under the figure/table. There are, however, different opinions on this practice, so you need to tell cleveref that you want capitalization. This can be done by including the package as \usepackage[capitalize]{cleveref}.

Citations and references

The points in the list below assume that you are already using BibTeX for bibilography management. That way you can name references in your .bib file, and then just refer to them by name in your document. Personally, I prefer to name my references something useful so that I remember them. Exporting BIB entries from various pages often give them names that are not very useful. The thesis template (and many other templates) uses the natbib package to provide the integration between LaTeX and BibTeX. There are others as well.

  • Placement of citations

    Citations should be placed early in your text, inside the first sentence where you claim something based on that particular work. You can then continue to use the same source without additional citations as long as you phrase your text in a way that makes it clear that you continue to rely on the work rather than presenting new ideas. For example:

    Many students struggle with subtle concepts [1]. This is true both for introductory courses and later courses. However, our findings suggest that the same is not true for other subjects...

    Note that the wording makes it clear where the text stops relying on the work. If the text that uses the work is longer, it is often a good idea to remind the reader by using words like "The authors further found that..." or the likes (this assumes that you started the section with "X et al. [1] found that ... They further concluded ..."). In essence: make it clear to the reader where the information you use come from.

    In particular, citations should generally not appear at the end of the paragraph, or after the full stop of a sentence. That is too late. Since your readers will read from start to finish, you want to inform your reader when you start using a reference rather than when you are done using it. As such, citations at the end of paragraphs are often a sign that these guidelines have not been followed.

  • Spacing around numbered citations

    When using numbered citations (e.g., [1]) there should be a space between the citation and the word before it. Furthermore, it is nice to have a non-breaking space there, which disallows a line-break just before the reference (a line starting with [1] looks strange).

    In LaTeX, this is achieved by using a tilde. For example: Tea is tasty~\cite{source}.

  • Multiple citations and sorting

    If you cite multiple works at once, make sure that they are ordered numerically. For example, [3, 1, 5] is incorrect. Make sure that it reads [1, 3, 5] instead.

    In LaTeX, this can be achieved by passing the sort option to the natbib package. This of course requires that you pass all works to cite to the same \cite command like so: \cite{work1,work2,work3}

  • Citations as an object in the text

    There are different opinions on whether it is fine to write sentences like "In [3] the authors argue...", where a citation is treated as an object in the text. For example, if you read the sentence aloud, how do you pronounce [3]?

    Personally, I try to avoid sentences like the one before. Instead, I prefer to write "X et al. [3] argue that...". One problem with this approach is that I rarely remember all author's names (and risk misspelling names). Fortunately, one can use \citet{...} instead of \cite{...} (at least in many templates) to output a citation suitable for embedding in text (that is what I imagine the t stands for). As such, I could write the aforementioned sentence as: \citet{goodpaper} argue that.... The only thing I have to keep in mind then is whether there is just one author, or more of them (i.e. if it is "argue" or "argues"). There is also \citeauthor{goodpaper} if you only want the author names (if \citet{} is not available, you can usually define it as: \newcommand{\citet}[1]{\citeauthor{#1}~\cite{#1}}).

  • Information in citations

    When you are using citations to back up your claims you generally don't need anything else than a citation that refers to a line in your reference list. However, if you are citing a big book with hundreds of pages and dozens of chapters, it is nice to give the reader a hint of where in the work to find the information. There are different ways to do that:

    • If you are only citing one chapter of the large publication in your entire document, you can note the chapter and/or pages in the reference list (i.e. include it in the bib entry directly). Then the reader can find the relevant part of the work from the reference list.
    • If you are citing different chapters in different parts of the text, you don't want to include the same publication multiple times in the reference list. In such cases, you want to include the chapter or page in the citation, like so: [1 ch. 3]. In LaTeX: \cite[ch.~3]{publication}
    • In some cases, you might want to reference to a specific page. Note that this is most often only done when you refer to the source of a quote or figure. You are not expected to provide exact page numbers when you just use a source to support your claim. Prefer to use the page numbers that are printed on the page itself over what is reported by your PDF viewer (they are sometimes incorrect if the PDF has been cut apart, for example). This is usually done using the abbreviation "pp." for "printed page". For example: [1 pp. 22–34]. In LaTeX: \cite[pp.~22--34]{publication}.

    Individual papers (e.g. conference and journal papers) are usually small enough that you don't need to mention a particular section. Since multiple papers are bundled together into a large publication, they are already individual chapters in a book! (The book is often called "Journal X issue 2" or "Proceedings of conference X").

  • Links to sources

    You will probably find most of your references online in some form, even works that are published in scientific journals. As such, it is useful to consider how to cite such works.

    The LiU library provides a proxy that allows you to access subscription journals from home. This is very useful, but it has a pitfall. If you use the proxy, you will get links that contains https://*.e.bibl.liu.se/... (the proxy rewrites them for you, sometimes even inside PDF documents). These let you access paywalled content, but they are not usable for readers that are not affiliated with LiU. As such, when including links in your document, you want to find a link that is not behind the LiU proxy.

    Luckily, most papers you will find have an DOI nowadays. That way, you can just find the DOI and use https://doi.org/ followed by the DOI to link to the article. That way the link also still works if the publisher restructures their site in the future.

    For formally published papers, you of course also want to have other information on how to found it (e.g., journal/conference, publisher, etc.).

  • Quotes

    When you are quoting some work (i.e. a direct quote using quotation marks, see above), you more or less always want to follow the quote with a citation that includes where to find the source (e.g. a page number). Note that this is stricter than when you are citing some information. You can add this information to the citation like \cite[ch.~1]{work}. This produces something like [4 ch. 1].

    The same thing applies if you include a figure from another paper. You need a citation in the figure description (and permission to publish the figure) if you do this.

If you have gotten this far in the document, you have started your journey into the wonderful world of typography! While the list above is by no means exhaustive (there are many things I don't know still), but it is a very good step towards producing nice documents. If you are curious, the documentation for the memoir LaTeX package is one way to learn more. A big downside, however, is that you will start noticing details that others have got wrong. I'm sorry about that.


Page responsible: Filip Strömbäck
Last updated: 2026-05-19