Niklas Vincent

Master Thesis Colophon

In June I presented the final version of my master’s thesis Simulations of III-V NWFET Double-Balanced Gilbert Cells with an Improved Noise Model. I will link to it when it becomes available online through the Lund University website.

In this post I am going to summarise the different tools and tricks used in the making of the thesis report.

Git for Revision Control

I have been using BitBucket for years to handle software projects, both for customers and things I do in my spare time. Both BitBucket and GitHub offer accounts with private repositories for students.

Git allows for selectively committing certain lines within a file, which helps with keeping commits clean and easy to follow. However, using this feature from the command line might sometimes be a daunting task. I used SourceTree to work with my main Git repository.

SourceTree

I used a Git post.commit hook (.git/hooks/post-commit) in order to include the current Git revision in my LaTeX document:

REVISION_FILE="$(pwd|sed -e 's/thesis.*//g')thesis/version.tex"
git log --pretty=format:'%h' -n 1 > "${REVISION_FILE}"</pre>

After including version.tex in the header, the result looked like this:

Git revision in LaTex

LaTeX for Typesetting

I used a LaTeX template I have had laying around since freshman year for lab reports. Most universities provide their own templates and it turns out I should probably have gone with the standard one by the faculty.

Using the hyperref package and some nice options from the xcolor package, the final PDF had clickable hyper references for things like citations and definitions:

<img alt=Linking inside the PDF” src=”https://cdn.niklasvincent.se/images/pdf-hyperref.png” style=”border: 1px solid black;” />

The document class is article and the following packages were used:

  • graphicx
  • wrapfig
  • amsmath
  • import
  • inputenc
  • fontenc
  • fancyhdr
  • float
  • hyperref
  • doi
  • glossaries
  • pbox
  • tikz
  • pgf
  • amsfonts
  • listings
  • color
  • booktabs
  • xcolor
  • mhchem
  • amsthm
  • setspace
  • biblatex

MatLab for Plotting

For prettier plots rendered by LaTex I used Matfig2PGF for all MatLab exports:

matfig2pgf('figwidth', 17, 'filename', '../../doc/figures/asymmetrical_scaling.pgf');

The final plots are instructions for the PGF package on how to render using LaTeX. This means the fonts used in the plot will be the same as the rest of the document.

The final plot

Google Docs for Drawing Figures

The thesis relies heavily on electrical circuit schematics, but none of the tools I tried (Circuit Lab, Scheme-it) produced satisfying results. I ended up using this Google Docs Drawing template.

Of course Google Docs Drawings do not treat lines as wires or provide easy snapping for perfect alignment, so everything was done by hand. Placing components, drawing lines, adjusting for alignment, etc.

Google Docs designed circuit

After exporting to PDF from Google Docs I used PDFCrop (a small Perl script) for removing unnecessary white space.

References using DOI

I found most of the published work I cite through IEEE Xplore and I used a set of shell scripts to manage a directory structure for each reference to keep them numbered and searchable (kind of rolling my own citation software).

To get BibTex entries for each article I found something really neat about the DOI (Digital Object Identifier) format, which most publications use today. You can actually request a citation in BibTex format directly:

function retrieve_bibtex()
{
	curl -LH "Accept: application/x-bibtex" "http://dx.doi.org/${1}"
}

I also made sure the citations in the report are clickable and link to their appropriate DOI.