Taking My University Course Computer Science Notes in LaTeX

How I use my XPS 15 with Linux, Vim, and TeX Live/Pandoc to take high-quality notes that will last forever

Dominik Tarnowski
Feb 14 · 5 min read

My Background

I’m a first-year computer science student at the University of Southampton, England. I don’t like taking notes on paper. For my A-levels, I used my Note 8 with its stylus to take my notes.

I tend to lose my paper notes or spill things on them, leading to me rewriting them which becomes counter-productive really quickly.

Writing my notes on a laptop allows me to access them anywhere, anytime. I can also go back to them in five to ten years if I forget something, without having to keep thick folders with old paper notes. I’m also much faster at typing (95+ wpm) than I am at writing (approximately 15 wpm).

I spent a lot of time at the start of this semester on the internet trying to find the best solution for a computer science student to take notes and I think I finally settled on the best solution for me.


LaTeX and Markdown

I realized that I can split my notes into two different categories; those that require complex mathematical equations/figures, and those that don’t.

For the latter, would be a better choice, as it can also include code snippets, however, is much better if we are doing things with vectors, more complex equations, or simply want to do some document alignment.

There are many great solutions for writing LaTeX and Markdown that do all the setting-up for you, including:

  • Feel free to leave a comment with any other alternatives, I’ll make sure to include them in the list.

However, after giving the above solutions a try, there was always something missing; theming, exporting files, offline support, and LaTeX blocks.


My Workflow

For taking notes with a lot of maths and algebra but not much code (if at all), I use to compile my LaTeX notes written in and I view the resulting PDF in real-time with .

On the left, you can see my editor setup, on the right, the preview of the PDF in Zathura.

I’m currently using 19.10 (based on Ubuntu) with as I find GNOME 3.34 with Pop’s default drivers and battery optimizations the best setup for my laptop at the moment.

However, the specific distro/desktop environment shouldn’t make a difference here, you should be able to get this working on almost any Linux workspace.

In terms of the Markdown notes, I decided to go with , which is widely popular, simple, and easy to set up.

The code highlighting is done automatically for us, and there are many smart Markdown features included in Neovim, such as being able to collapse section content and spell-check.

You can also make a README file that allows you to quickly navigate/group your notes into years and modules:

I like to compile my notes to PDFs for two specific reasons:

  • We are often asked to print documents, such as our lab prep (see figure above).
  • Although I prefer taking notes on my computer, revising from computer notes is definitely not as convenient as looking at nicely laid-out paper notes on a desk. I simply find myself much more productive when revising from my notes on paper, so I simply print out this semester’s notes when exams start coming up.

I use Git to back up my notes and be able to view them from any device, even my phone. For a developer familiar with Git, backing up can’t be more simple than running:

git add .
git commit -m "comp1203: add ram notes"
git push

And if you want to sync the notes on another computer, use:

git pull

This way, you never have to rely on any third-party note-taking app or some kind of a cloud subscription. As long as GitHub is up and running, your notes will be there too.

This also enables you and your course mates to share your notes with each other, or even collaborate and have a shared repository with your notes.

In terms of commit messages, I try to stick with the template below, so the module name followed by the type of commit (lab, coursework, lab prep) and short description of the change:

git add Main.java
git commit -m "comp1202cw: fix part 2 unit tests"
  • lab — Source code to a specific lab
  • cw — Coursework
  • prep — Lab prep

Installation/Dotfiles Config

If you’re still here, you’re probably wondering how you could set up a similar environment. If you’ve used Vim before and you’re running Linux, you’re in luck.

For VS Code users, you could check out instead of following the Vim setup part, but I’d still recommend you learn Vim, it’s easy to use and especially great for note-taking.

Installing the tools

Firstly, you’ll need to install the following:

sudo apt install neovim zathura zathura-pdf-poppler texlive-full git curl pandoc

Keep in mind that the texlive installation will take a while and take up a few GBs.

Now that everything is installed, we can install vim-plug which will be used to load external plugins:

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs 

Now all you need to do is move the config to your init.vim file:

mkdir ~/.config/nvim
cd $_
wget

Then, simply run nvim and install the provided plugins:

:PlugInstall

If you’d like to enable the simplistic layout with large padding and no line numbers, use :Goyo.

LaTeX

To compile latex notes, open any valid .tex file and use \ll to compile it and show the preview. Then, the notes should update whenever you save the file (:w).

Markdown

To compile Markdown notes, press F6. The notes should also recompile whenever you save the file (with :w). Make sure to open the PDF by running zathura {{file}}.pdf in another tab.

Thanks for reading!

Better Programming

Advice for programmers.

Dominik Tarnowski

Written by

Don't forget to clap 👏 and follow. Student & Software Developer. React. Go. Rust. https://tdom.dev

Better Programming

Advice for programmers.

More From Medium

More from Better Programming

More from Better Programming

More from Better Programming

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade