Typesetting my Master’s Thesis in LaTeX

When I saw the LaTeX thesis template provided by my department I cringed. It seemed like the only goal of the unknown creator was to preserve paper, completely neglecting aesthetics and readability. Fortunately I was allowed to create my own template.

Problem: Find and adapt a LaTeX thesis template that meets both established and my own aesthetic standards.

Thesis full page view

Full page view of my Thesis.

A lot of thought has gone into the age old art of typesetting and typography. Although I am very interested in these topics, I’m not an expert. I therefore looked for a good LaTeX thesis template and finally found the classicthesis package by André Miede which is inspired by Robert Bringhurst’s “The Elements of Typographic Style”.

My thesis features a lot of figures that need to be displayed as large as possible. I therefore defined commands that allow figures to reach into the margin of the page. In combination with my numerous margin quotes, this is a great trade-off between keeping the proper page area for readability and providing enough space for wide figures. Having a floating, multi-picture figure extend to the left on odd pages and to the right on even pages was no easy task, but I finally managed to define the new commands \bigfigure\bigdoublefigure, and \bigtriplefigure. An example of \bigtriplefigure is shown at the top left of the above image. The code is too long to feature here, if you have any questions feel free to contact me.

Thesis quotation.

Example quotation in the Thesis.

I also made heavy use of the \graffito command for margin notes and quotations. Margin notes are useful for providing contextual, interesting information that is not important for the primary content. If something is too insignificant for a footnote, it might be a good margin note. More frequently however, I used quotations to make the thesis more lively and less bland. The following command ensures that all quotations look the same. The first parameter is the quote, while the second is the quoted person.
\newcommand{\quotegraffito}[2]{\graffito{#1\\--~\emph{#2}}}

For more information on the typographic side of my thesis you can read the colophon at the very end of my thesis.

Download Master’s Thesis

Edit (2015-06-27): Since I repeatedly get requests for actual LaTeX code, I uploaded my full source code. The code does not compile with current LaTeX distributions, mainly because of dirty hacks that work around previous errors in other LaTeX packages. I also did not include the required data and images with the code. If I were you, I would download the latest ClassicThesis version and try to incorporate the parts you need from this code. The figure definitions are in
SpecialDefinitions.tex, their usage is all around the source code in /Chapters.

5 Comments:

  1. Hi Benjamin

    I would like to make some modifications to the classicthesis template to allow figures to expand into the margin, just like how you have done. I would appreciate some pointers as to how you achieved it. I’ve been using latex for a couple of years but previously I had always stuck with the same basic template.

    • I currently have no time to create a minimal working example. I will copy the according code parts into here.
      The code is quite complex, because
      – firstly, I’m no LaTeX expert,
      – secondly, I needed many different configurations (for example triple-figures with sub-captions), and
      – thirdly, I wanted to switch between normal figures and big figures (i.e., extenting into margin) without changing anything but the command.

      What basically happens is that I use the changepage package to determine if I am on the right or left page, and then align a minipage with my figures accordingly.

      Usage example for a single figure extenting into the margin:


      \bigfigure[pos=tbhp,
      %width=13.75cm,
      label={fig:intro:designprocess-combined},
      shortcaption={Resistance graph design process.}]
      {intro-designprocess-combined}
      {Design process using a few \protect\acs{CFD} simulations and converting them to resistance graphs. \protect\acs{CFD} simulations are applied to the \threeD-model for some operation points (OP2 and OP5), which usually takes a few hours per simulation on a standard workstation. The resulting flow fields of these simulations are then partitioned and converted to flow graphs which again can be converted to a resistance graphs. If the resistance graphs are also valid for similar operation points (\eg, OP1 and OP3 are similar to OP2, OP4, and OP6 are similar to OP5), these similar operation points can be directly simulated using the resistance graphs and computation time can be decreased significantly. The process is an iterative optimization process, \ie, after design changes are made, simulations have to be redone.}

      A usage example for a double-figure extending into the margin:


      \bigdoublefigure[pos=tbhp,
      mainlabel={fig:intro:simple-vector-field},
      maincaption={A simple \twoD vector field partitioned into two good (left) and two poor (right) regions, from a homogeneity standpoint. The smaller top right copies represent the information reduction after conversion to the flow graph: Each region is represented by only one average velocity. Clearly, the good partition retains more information about the flow field. The poor partition however, is almost as descriptive as using only one region for the whole field (small blue figure).},
      mainshortcaption={Good and poor flow partitions.},%
      %leftopt={width=0.47\textwidth},
      leftlabel={fig:intro:simple-vector-field-homogeneous},
      leftcaption={Good, homogeneous partition.},
      leftshortcaption={},%
      %rightopt={width=0.47\textwidth},
      rightlabel={fig:intro:simple-vector-field-nonhomogeneous},
      rightcaption={Bad, inhomogeneous partition.},
      rightshortcaption={},
      spacing={\hspace{1cm}}
      ]
      {intro-simple-vector-field-good}{intro-simple-vector-field-bad}

      These are the underlying definitions, the following packages (and maybe some more?) will be required:

      \usepackage[strict]{changepage}%to know on which page we are (left or right)
      \usepackage{xkeyval}
      \usepackage{subfig}
      \usepackage{graphicx}


      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %
      % FIGURE TOOLS
      %
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %%helper functions, no direct use

      \newlength\fullmarginwidth
      \fullmarginwidth=\marginparwidth
      \advance\fullmarginwidth by \marginparsep

      \newlength\fullwidth
      \fullwidth=\textwidth
      \advance\fullwidth by \fullmarginwidth

      % #1 #2 #3 #4 #5
      %\subFloatCorrCaps{Cap}{ShortCap}{Label}{Opt}{path}
      \newcommand{\subFloatCorrCaps}[5]{
      \ifthenelse{\equal{#1}{}}%
      {
      %subfloat without captions
      \subfloat{%
      \expandafter\includegraphics\expandafter[#4]{#5}
      \label{#3}
      }
      }
      {
      \ifthenelse{\equal{#2}{}}%
      {
      %subfloat with same captions
      \subfloat[#1][#1]{%
      \expandafter\includegraphics\expandafter[#4]{#5}
      \label{#3}
      }
      }
      {
      %subfloat with different captions
      \subfloat[#2][#1]{%
      \expandafter\includegraphics\expandafter[#4]{#5}
      \label{#3}
      }
      }
      }
      }

      %Parameters: [keyvals (see below)]{file}{caption}

      \makeatletter
      \define@key[FigTools]{OneFig}{pos}{\def\FtPos{#1}}
      \define@key[FigTools]{OneFig}{opt}{\def\FtOpt{#1}}
      \define@key[FigTools]{OneFig}{label}{\def\FtLabel{#1}}
      \define@key[FigTools]{OneFig}{shortcaption}{\def\FtShortCaption{#1}}

      \define@key[FigTools]{TwoFig}{pos}{\def\FtPos{#1}}
      \define@key[FigTools]{TwoFig}{mainlabel}{\def\FtMainLabel{#1}}
      \define@key[FigTools]{TwoFig}{maincaption}{\def\FtMainCaption{#1}}
      \define@key[FigTools]{TwoFig}{mainshortcaption}{\def\FtMainShortCaption{#1}}
      \define@key[FigTools]{TwoFig}{leftopt}{\def\FtLeftOpt{#1}}
      \define@key[FigTools]{TwoFig}{leftlabel}{\def\FtLeftLabel{#1}}
      \define@key[FigTools]{TwoFig}{leftcaption}{\def\FtLeftCaption{#1}}
      \define@key[FigTools]{TwoFig}{leftshortcaption}{\def\FtLeftShortCaption{#1}}
      \define@key[FigTools]{TwoFig}{rightopt}{\def\FtRightOpt{#1}}
      \define@key[FigTools]{TwoFig}{rightlabel}{\def\FtRightLabel{#1}}
      \define@key[FigTools]{TwoFig}{rightcaption}{\def\FtRightCaption{#1}}
      \define@key[FigTools]{TwoFig}{rightshortcaption}{\def\FtRightShortCaption{#1}}
      \define@key[FigTools]{TwoFig}{spacing}{\def\FtSpacing{#1}}
      \define@key[FigTools]{TwoFig}{topspace}{\def\FtTopSpace{#1}}

      \define@key[FigTools]{ThreeFig}{pos}{\def\FtPos{#1}}
      \define@key[FigTools]{ThreeFig}{mainlabel}{\def\FtMainLabel{#1}}
      \define@key[FigTools]{ThreeFig}{maincaption}{\def\FtMainCaption{#1}}
      \define@key[FigTools]{ThreeFig}{mainshortcaption}{\def\FtMainShortCaption{#1}}
      \define@key[FigTools]{ThreeFig}{leftopt}{\def\FtLeftOpt{#1}}
      \define@key[FigTools]{ThreeFig}{leftlabel}{\def\FtLeftLabel{#1}}
      \define@key[FigTools]{ThreeFig}{leftcaption}{\def\FtLeftCaption{#1}}
      \define@key[FigTools]{ThreeFig}{leftshortcaption}{\def\FtLeftShortCaption{#1}}
      \define@key[FigTools]{ThreeFig}{midopt}{\def\FtMidOpt{#1}}
      \define@key[FigTools]{ThreeFig}{midlabel}{\def\FtMidLabel{#1}}
      \define@key[FigTools]{ThreeFig}{midcaption}{\def\FtMidCaption{#1}}
      \define@key[FigTools]{ThreeFig}{midshortcaption}{\def\FtMidShortCaption{#1}}
      \define@key[FigTools]{ThreeFig}{rightopt}{\def\FtRightOpt{#1}}
      \define@key[FigTools]{ThreeFig}{rightlabel}{\def\FtRightLabel{#1}}
      \define@key[FigTools]{ThreeFig}{rightcaption}{\def\FtRightCaption{#1}}
      \define@key[FigTools]{ThreeFig}{rightshortcaption}{\def\FtRightShortCaption{#1}}
      \define@key[FigTools]{ThreeFig}{spacing}{\def\FtSpacing{#1}}
      \define@key[FigTools]{ThreeFig}{spacingtwo}{\def\FtSpacingTwo{#1}}
      \makeatother

      \newcommand{\bigplot}[3][]{%
      \bigfloatinternal[#1]{#2}{#3}{plot}
      }

      \newcommand{\bigfigure}[3][]{%
      \bigfloatinternal[#1]{#2}{#3}{graph}
      }

      \newcommand{\bigfloatinternal}[4][]{%
      \begingroup
      \setkeys[FigTools]{OneFig}{ pos=!htp,
      label={fig:#2},
      shortcaption={#3},
      opt={}%width=0.95\textwidth}
      }
      \setkeys[FigTools]{OneFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      \checkoddpage
      \edef\side{\ifoddpage l\else r\fi}
      \makebox[\textwidth][\side]{%
      \begin{minipage}[t]{\fullwidth}
      \centering
      \ifthenelse{\equal{#4}{plot}}
      {
      \input{\evalDir{#2}}
      }{
      \expandafter\includegraphics\expandafter[\FtOpt]{#2}
      }
      \caption[\FtShortCaption]{#3}
      \label{\FtLabel}
      \end{minipage}
      }%
      \end{figure}
      \endgroup
      }

      \newcommand{\bigdoublefigure}[3][]{%
      \begingroup
      %Default values:
      \setkeys[FigTools]{TwoFig}{ pos=!htp,
      mainlabel={fig:#2-#3},
      maincaption={#2-#3},
      mainshortcaption={},%
      leftopt={},%0.45\textwidth,
      leftlabel={fig:#2-left},
      leftcaption={},
      leftshortcaption={},%
      rightopt={},%0.45\textwidth,
      rightlabel={fig:#3-right},
      rightcaption={},
      rightshortcaption={},
      spacing={\hfill},
      topspace={}
      }
      %User provided values:
      \setkeys[FigTools]{TwoFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      \FtTopSpace
      %Check on which side whe are (right or left)
      \checkoddpage
      \edef\side{\ifoddpage l\else r\fi}
      %Ensure there will be no overfull box message
      \makebox[\textwidth][\side]{%
      \begin{minipage}{\fullwidth}
      \centering
      \subFloatCorrCaps{\FtLeftCaption}
      {\FtLeftShortCaption}
      {\FtLeftLabel}
      {\FtLeftOpt}
      {#2}
      \FtSpacing
      \subFloatCorrCaps{\FtRightCaption}
      {\FtRightShortCaption}
      {\FtRightLabel}
      {\FtRightOpt}
      {#3}
      \caption[\FtMainShortCaption]{\FtMainCaption}
      \label{\FtMainLabel}
      \end{minipage}
      }
      \end{figure}
      \endgroup
      }

      \newcommand{\bigtriplefigure}[4][]{%
      \begingroup
      %Default values:
      \setkeys[FigTools]{ThreeFig}{ pos=!htp,
      mainlabel={fig:#2-#3},
      maincaption={#2-#3},
      mainshortcaption={},%
      leftopt={},%0.45\textwidth,
      leftlabel={fig:#2-left},
      leftcaption={},
      leftshortcaption={},%
      midopt={},%0.45\textwidth,
      midlabel={fig:#3-mid},
      midcaption={},
      midshortcaption={},%
      rightopt={},%0.45\textwidth,
      rightlabel={fig:#4-right},
      rightcaption={},
      rightshortcaption={},
      spacing={\hfill},
      spacingtwo={}
      }
      %User provided values:
      \setkeys[FigTools]{ThreeFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      %Check on which side whe are (right or left)
      \checkoddpage
      \edef\side{\ifoddpage l\else r\fi}
      %Ensure there will be no overfull box message
      \makebox[\textwidth][\side]{%
      \begin{minipage}{\fullwidth}
      \centering
      \subFloatCorrCaps{\FtLeftCaption}
      {\FtLeftShortCaption}
      {\FtLeftLabel}
      {\FtLeftOpt}
      {#2}
      \FtSpacing
      \subFloatCorrCaps{\FtMidCaption}
      {\FtMidShortCaption}
      {\FtMidLabel}
      {\FtMidOpt}
      {#3}
      \FtSpacing
      \FtSpacingTwo
      \subFloatCorrCaps{\FtRightCaption}
      {\FtRightShortCaption}
      {\FtRightLabel}
      {\FtRightOpt}
      {#4}
      \caption[\FtMainShortCaption]{\FtMainCaption}
      \label{\FtMainLabel}
      \end{minipage}
      }
      \end{figure}
      \endgroup
      }

      \newcommand{\normplot}[3][]{%
      \normfloatinternal[#1]{#2}{#3}{plot}
      }

      \newcommand{\normfigure}[3][]{%
      \normfloatinternal[#1]{#2}{#3}{graph}
      }

      \newcommand{\normfloatinternal}[4][]{%
      \begingroup
      \setkeys[FigTools]{OneFig}{ pos=!htp,
      label={fig:#2},
      shortcaption={#3},
      opt={}%{width=0.95\textwidth}
      }
      \setkeys[FigTools]{OneFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      \centering
      \ifthenelse{\equal{#4}{plot}}
      {
      \input{\evalDir{#2}}
      }{
      \expandafter\includegraphics\expandafter[\FtOpt]{#2}
      }
      \caption[\FtShortCaption]{#3}
      \label{\FtLabel}
      \end{figure}
      \endgroup
      }

      \newcommand{\normdoublefigure}[3][]{%
      \begingroup
      %Default values:
      \setkeys[FigTools]{TwoFig}{ pos=!htp,
      mainlabel={fig:#2-#3},
      maincaption={},
      mainshortcaption={},%
      leftopt={},%width=0.45\textwidth},
      leftlabel={fig:#2-left},
      leftcaption={},
      leftshortcaption={},%
      rightopt={},%width=0.45\textwidth},
      rightlabel={fig:#3-right},
      rightcaption={},
      rightshortcaption={},
      spacing={\hfill}
      }
      %User provided values:
      \setkeys[FigTools]{TwoFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      \centering
      \subFloatCorrCaps{\FtLeftCaption}
      {\FtLeftShortCaption}
      {\FtLeftLabel}
      {\FtLeftOpt}
      {#2}
      \FtSpacing
      \subFloatCorrCaps{\FtRightCaption}
      {\FtRightShortCaption}
      {\FtRightLabel}
      {\FtRightOpt}
      {#3}
      \caption[\FtMainShortCaption]{\FtMainCaption}
      \label{\FtMainLabel}
      \end{figure}
      \endgroup
      }

      \newcommand{\normtriplefigure}[4][]{%
      \begingroup
      %Default values:
      \setkeys[FigTools]{ThreeFig}{ pos=!htp,
      mainlabel={fig:#2-#3},
      maincaption={},
      mainshortcaption={},%
      leftopt={},%width=0.45\textwidth},
      leftlabel={fig:#2-left},
      leftcaption={},
      leftshortcaption={},%
      midopt={},%width=0.45\textwidth},
      midlabel={fig:#3-mid},
      midcaption={},
      midshortcaption={},%
      rightopt={},%width=0.45\textwidth},
      rightlabel={fig:#4-right},
      rightcaption={},
      rightshortcaption={},
      spacing={\hfill},
      spacingtwo={}
      }
      %User provided values:
      \setkeys[FigTools]{ThreeFig}{#1}
      \def\efigure{\begin{figure}}%
      \expandafter\efigure\expandafter[\FtPos]
      \centering
      \subFloatCorrCaps{\FtLeftCaption}
      {\FtLeftShortCaption}
      {\FtLeftLabel}
      {\FtLeftOpt}
      {#2}
      \FtSpacing
      \subFloatCorrCaps{\FtMidCaption}
      {\FtMidShortCaption}
      {\FtMidLabel}
      {\FtMidOpt}
      {#3}
      \FtSpacing
      \FtSpacingTwo
      \subFloatCorrCaps{\FtRightCaption}
      {\FtRightShortCaption}
      {\FtRightLabel}
      {\FtRightOpt}
      {#4}
      \caption[\FtMainShortCaption]{\FtMainCaption}
      \label{\FtMainLabel}
      \end{figure}
      \endgroup
      }

      • Thanks for sharing your code, I appreciate it. I’ve had a quick play with it and managed to incorporate it into my code (kind of). I still need to do some tweaking but I think I should be able to get it working nicely.

        Thanks again!

  2. I’m an insurance broker, I’m looking for a personalice calc to use with my clients, do you do that work ?

    • In theory yes, I worked at an insurance company before.
      In practice I work mainly in scientific data visualization and 3d processing right now.
      All calculations that are not provided by your insurance companies’ software can most likely easily be done in a spreadsheet program (Google Docs, Excel, …).

Leave a Reply

Your email address will not be published. Required fields are marked *