Creating your own LaTeX master notebook

Terrence Tao recommends that all students and mathematicians write down everything they’ve done. For professional mathematicians, this presumbly includes insights into problems they are working on, and perhaps references for interesting things found in papers. Students should write down lecture notes and solutions to exercises. This raises the question of where to write it down and how to organize it all, and that’s where having a master notebook comes in.

A LaTeX master notebook is a directory tree of LaTeX source files, all feeding in to a single “root.tex” file which, when compiled, theoretically produces a pdf with all the mathematics you’ve ever written (which according to Tao, should be all the mathematics you’ve ever done). I’ll answer the first objection right here: yes, that would take an age to compile, and that’s why you don’t actually do this. The notebook is organized so that entire chapters can easily be added and removed by commenting out a single line.

Picture showing a LaTeX source file with some \input commands commented out
Here I’ve commented out some parts I’m not using at the moment

Advantages to using a master notebook

  • The master notebook contains a journal, with sections for each day. This is very useful, as the chronological structure provides a simple way to organize your notes that doesn’t require any thought or planning. Once you realize you have several journal entries about a similar theme, you can easily create a specialized chapter in the notebook and transfer those entries to organize them more efficiently. Personally, I also use my journal section for homework assignments, since these tend to be specific to a particular time.

    A screenshot of the journal part of the notebook, showing some homework
    Number Theory In November
  • All your notes operate from a single preamble and bibliography file. There are advantages and disadvantages to this. The most obvious disadvantage is you will often be loading packages that are unnecessary for your current project, leading to some compiler overhead. On the other hand, I just love the convenience of being able to start writing without having to worry about what to include in the preamble.
  • You can (and should) make your master notebook folder into a git repository so that you have version control. By the way, if you’re a student, you can get a bunch of free github benefits, including private github repositories. I keep a copy of my master notebook in a private github repository.
  • Use hyperlinks to connect your notebook entries together. This is easy with the hyperref package.
  • It’s easy to output different sections that you need as appropriate. For example, when it comes to submitting my homework, I have one file called “homeworktemp.tex“. It’s an article class file that’s not part of the master notebook, but just by changing one line, I can swap one homework out for another and compile it.

    All I have to do to produce a homework file is change line 5
  • Do you have lots of handwritten notes too? You can scan them and use \includepdf to drop them into appropriate places in your master notebook. This is a great way to keep handwritten notes organized and accessible.
  • You can synchonize a version of the output file of your master notebook with your mobile device. Now you have all your mathematical notes in your pocket.
  • It’s pretty satisfying to track how much you’ve been writing by compiling everything in the directory at once and looking at the total page count of the pdf you produce.

How to get started with a master notebook

This was something I’d wanted to try for a little while but never found the time to get up and running. However, on Reddit I stumbled on this person’s implementation of the same concept, which he or she calls their logbook. I found it very easy to clone this repo and tweak it to my needs.

Here’s how to get it up and running

  1. Download or clone the github repo, and run the bash script to create the journal files. If you’re on Windows you’ll need a way to run bash scripts. This script creates journal files and directories for every for the next few years.
  2. Customize the directory structure to suit your needs. I have directories for Homework, Exercises, Projects, and notes on specific topics, all containng sub-directories for different classes and subjects. Of course, you should customize the \input commands in Riboch’s template to match your directory structure and your needs.

    Sub-directories of my lecture notes folder
  3. Customize the CommandLibrary.tex and DocumentSetup.tex files to your liking, and move your .bib files into the Citations folder.
  4. Run your compiler and biber a bunch of times and fix any mistakes you made while setting up.

 

Finally some miscelleneous tips I’ve found helpful when using a master notebook. Use a LaTeX editor that’s good at working with multi-file projects, for example allowing you to easily search for things across multiple files, and that will complete references spread across multiple files. On a similar theme, come up with a logical naming system for labels within your notebook early on, to make it easier to cross-reference different parts of the notebook. Last of all, make sure your notebook is backed up in several places!

Leave a Reply

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