Latex-Template and information
The template for a bachelor or master thesis can be found here:
The template for an expose can be found here:
- English: Template_Expose_English.zip (Example)
- German: Template_Expose_Deutsch.zip (Beispiel)
The LaTeX template is structured into a few folders and files:
- `parts`: all text files for the chapters and sections and ...
- `_acronyms.tex`: the definitions of acronyms you use
- `_bibliography.bib`: the definitions of your BibTeX references
- `_glossary.tex`: the definitions of terminologies you use
- `template`: all LaTeX style files for this template, that is ...
- `custom_commands.sty`: the definitions of custom commands
- `custom_listings.sty`: definitions of languages for your listings
- `template.sty`: the main file of this template
- `titlepage_*.sty`: die title page for the respective text type
- `data.sty`: the document information
- `main.tex`: the main file of this document
Some of the files will be further explained in [Structural elements]
You should also add some resource folders for images, tables, etc., depending on your needs.
Edit helpers
This template provides four options that enable edit helpers: `notes`, `coloredrefs`, `grid` and `pagebreaks`.
`coloredrefs` colors all references and URLs blue.
This is nice to keep in the digital version, but you might want to disable it before printing.
`edit` enables the following four commands, which can help you to keep track of todos, notes, finished parts and annotations from your reviewers.
- `\todo{message}` to keep track of what you have to do (in red),
- `\note{message}` to make a simple note (in orange),
- `\annot{Name}{message}` to add an annotation by a reviewer (in orange),
- `\done{}` to simply mark something as done (in green).
`grid` puts a grid behind the content and frames around the text.
This can help to adjust and position figures, tables and listings as well as to identify overlong lines.
`pagebreaks` inserts a page break before every section, sub-section and sub-sub-section.
This shall just help to better navigate through the document but should not be used for the final, printed version.
Note that before finalizing this document you should deactivate the helpers.
If you forgot to remove any todo, note or annotation, you will be warned by a compiler error, whilst any remaining `\done{}` will be removed silently.
First Steps
- Fill in your information in `data.sty`.
Last Steps
- Remove the edit helpers `edit`, `grid`, `pagebreaks`.
- You can keep `coloredrefs` for the digital version, but remove it for the printed one.
File names
We encourage you to split your text into separate files.
This way, you do not end up with one enormous file that contains your whole document.
Use the command `\input` for inserting these files into the `main.tex`.
There are common ways of structuring these files, with pros and cons:
- Simple1: one file per chapter, e.g., `introduction.tex`
- Simple2: one file per chapter and section (or even subsection), e.g., `introduction.tex` and `research_questions.tex`,
- Prefix1: one file per chapter, files are prefixed by the chapter numbers, e.g., `1_introduction.tex`,
- Prefix2: one file per chapter and per section (or even subsection), prefixed by the chapter and section numbers, e.g., `1_introduction.tex` and `1_2_research_questions.tex`,
- Nested1: one file and subdirectory per chapter, where the subdirectory contains one file per section, e.g., `introduction.tex` and `introduction/research_questions.tex`, and
- Nested2: Nested1 with prefixes, e.g., `1_introduction.tex` and `1_introduction/2_research_questions.tex`
These structures have pros and cons:
- __Sorting__: Overleaf sorts the files alphabetical by default (Simple1, Simple2, Nested1). Prefixing the files by the chapter (and section) numbers (Prefix1, Prefix2 and Nested2) sorts the files the same way as they appear in the text. However, if you need to add, move or remove a section (or subsection), you need to adjust all subsequent file prefixes and update the `\input` commands in your `main.tex.` Especially in the early phase this can be a real waste of time. For Nested2 this problem is at least reduced.
- __File size__: The files in Simple1 and Prefix1 are still large and scrolling takes long. The other structures have smaller files, which eases scrolling.
- __Searching__: Overleaf does not provide a global search, just a file-wise one. You can search in the PDF using the browser's search and then jump to the respective source code, but only in compiled text and not in comments. Hence, searching is easier in Simple1 and Prefix1 if you need to search in comments.
Structural Elements
The template supports the following commands for structural elements:
- `\chapter{}`
- `\section{}`
- `\subsection{}`
- `\subsubsection{}`
- `\paragraph{}`
- `\subparagraph{}`
Use the `description` environment for concise definitions or explanations.
In LaTeX, you initiate a new paragraph only with a blank line. This ensures proper text flow and indentation, especially at page breaks. **Do not use** `\\` or `\newline` for starting new paragraphs; these commands do not create the correct paragraph structure. For additional vertical spacing, employ `\vspace`, `\baselineskip` or alike.
Further details on writing
Visual elements like images can significantly enhance the understanding of complex information at a glance. They add color and dynamics, offering a visual break from continuous, monotonous text, thus maintaining reader engagement. Therefore, do incorporate them effectively in your document to enrich the reader's experience and aid in the comprehension of your material.
Criteria for Figures
Your figures should adhere to specific criteria:
- Content: Select content that is most relevant and illustrative of your point.
- Resolution: Opt for scalable vector graphics (such as SVG) or high-resolution images (minimum 300dpi). For diagrams or charts, consider using LaTeX-native graphics like TikZ or PGF.
- Colors: The choice of color depends on your printing method:
- Colored: Use colors with significant contrast in hue, saturation, and lightness. You can find various color palettes online that suggest harmonious combinations. Ideally, choose palettes that are accessible to those with color vision deficiencies [^1] [^2]. In your descriptions, opt for universally recognized color names like "dark red" or "light blue" rather than obscure ones.
- Gray scale: If printing in gray scale, ensure adequate contrast between different shades. Avoid using very light grays as they might not print well. In diagrams, differentiate elements through distinct shapes or strokes, as you would with color.
- Dimensions: Figures do not necessarily have to span the entire page width. They should be appropriately scaled (e.g., to 60%) and centered.
- Scaling: Maintain consistent scale across similar types of figures, such as bar charts, ensuring uniform bar widths and font sizes.
- Labeling: Ensure that all diagrams are fully labeled, particularly the axes. Utilize legends or detailed captions to explain each component's significance. Captions appear in the lists of figures and should be informative yet concise; if needed, provide a shortened version for lengthy descriptions.
Layout
LaTeX's layout algorithms automatically place figures, tables, and listings in your text.
Unfortunately, these positions are not always ideal. Still, you should not waste time tweaking their positions throughout the writing process; it's more efficient to adjust their placement only towards the end, once your full text is finished.
If you need to reposition these elements manually, it is advisable to position them preferably only at the top or only at the bottom of the page. This approach prevents isolated lines of text from getting sandwiched between them.
When multiple graphics are related or shall be compared, you can place them together on a special page. This page will then contain only graphics, no text.
In the figure, table and listings environments, prefer the position arguments `t` for top of the page, or `p` for a special page.
Simple figures
If you have an existing image, including it in your document is straightforward, as demonstrated with Figure 1. Additionally, it's essential to accompany each image with a descriptive caption that explains the image's content, including relevant details like colors, shapes, and groups. This is also the appropriate place to cite the source of the image using the \cite command if it is not originally yours. For the List of Figures, you may provide a shortened version of the caption if necessary. Lastly, assigning a label to the figure is crucial, as it enables you to refer to the figure elsewhere in your text efficiently. This approach ensures that your figures are not only well-integrated but also informative and correctly referenced.
\begin{figure}[t]
\centering
\includegraphics[width=.3\textwidth]{imgs/latex}
\caption[Example figure]{An included image file showing the writing \LaTeX{}. Source: \cite{sample:wiki:latexlogo}}
\label{fig:sample-latex}
\end{figure}
Subfigures
If you provide related figures, use subfigures as shown in Figure 2. Assign individual captions and labels to each subfigure and an overall caption and label for the entire group.
\begin{figure}[t]
\centering
\subcaptionbox
[Black text on white background]
{Black text on white background. Source: [1]}
[.48\textwidth]
{\includegraphics{samples/imgs/latex}}
\hfill
\subcaptionbox
[White text on black background]
{White text on black background. Adopted from: [1]}
[.48\textwidth]
{\includegraphics{samples/imgs/latex_dark}}
\caption[Figure with two subfigures]
{An example figure that contains two related subfigures.}
\label{fig:subfigures}
\end{figure}
TikZ and PGF
For creating graphs consider using the TikZ and PGF packages. With these, similar to LaTeX, you simply supply the content and select a style; the layout is then generated automatically.
Many mathematics and statistics applications support direct export to TikZ and PGF formats.
In R you can use the `tikzDevice` library and in Python projects with `matplotlib` you can use the `tikzplotlib` library to transform your graph into TikZ.
Note, TikZ consists of various libraries tailored for specific functionalities, so you may need to incorporate additional ones depending on your needs. To do this, include the necessary libraries using the command `\usetikzlibrary` in your `main.tex` file.
Utilize tables to present structured data effectively, like comparisons or evaluation results.
Ensure all essential information is included and clearly label each column and/or row. Also, provide a descriptive caption to concisely explain the table's content.
However, avoid overcrowding tables. It's often more effective to split dense tables into smaller ones to enhance clarity and underscore their significance.
In terms of design, use lines sparingly as separators: typically, a table requires only three lines:
- `\toprule` above the header,
- `\midrule` below the header, and
- `\bottomrule` at the bottom.
This minimalist approach takes advantage of cell alignment and spacing to naturally delineate the data. For more complex structures, like in Table 2, only a few additional lines may be necessary.
Creating tables
Creating tables manually is a very tedious task. We recommend the [Tables Generator](https://www.tablesgenerator.com/), which provides you with a graphical user interface.
Table environments
LaTeX offers several table environments, including `tabular`, `tabular*`, and `tabularx`. These differ in layout, column styling, and compatibility. Choose the format that best fits your data. While `tabular*` is a good starting point, switch to `tabular` or `tabularx` as needed based on the specific requirements of your table.
Examples
\begin{table}[]
\centering
\begin{tabular}{l|rr} \toprule
\thead{Task} & \thead{Group 1} & \thead{Group 2} \\ \midrule
A & 15 & 4 \\
B & 22 & 23 \\
C & 3 & 4 \\
D & 15 & 13 \\ \bottomrule
\end{tabular}
\caption{A simple table (tabular)}
\label{tab:simple}
\end{table}
\RequirePackage{tabularx} // from template.sty
\begin{table}[t]
\centering
\begin{tabularx}{0.8\linewidth}{XX} \toprule
\thead{Pros} & \thead{Cons} \\ \midrule
\vspace{-\topsep}
\begin{itemize}[topsep=0pt, partopsep=0pt, nosep, before=\setstretch{1}]
\item structured
\item easy to read
\item not too verbose
\item compact
\end{itemize}
\vspace{-\topsep}
&
\vspace{-\topsep}
\begin{itemize}[topsep=0pt, partopsep=0pt, nosep, before=\setstretch{1}]
\item sometimes hard to layout
\item need to be simplified
\item might require further explanations in the text
\end{itemize}
\vspace{-\topsep} \\[-\topsep] \bottomrule
\end{tabularx}
\caption{A table with enumerations (tabularx)}
\label{table:sample-pros-cons}
\end{table}
\RequirePackage{multicol} // from template.sty
\begin{table}[t]
\centering
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}llllr} \toprule
\thead{Category}
& \multicolumn{2}{l}{\thead{Tool (long title over two columns)}}
& \thead{For} & \thead[l]{Random} \\
& \thead{Developer} & thead{Name} & & \thead[l]{Number} \\ \midrule
Version & GitHub & Git & Git & 456 \\
Control & GitLab & Git & Git & 75452 \\ \midrule
IDE & Jetbrains & CLion & C/C++ & 7856632 \\
& Jetbrains & IntelliJ IDEA & Java/Kotlin & 1566 \\
& Jetbrains & Webstorm & HTML, CSS, Javascript & 379194 \\
& Misrosoft & Visual Studio Code & C/C++ & 751 \\ \midrule
Editor & & Sublime Text & anything & 132 \\
& & Overleaf & \LaTeX{} & 1337 \\ \bottomrule
\end{tabular*}
\caption{A complex table (tabular*)}
\label{table:sample-tools}
\end{table}