Skip to main content

Command Palette

Search for a command to run...

A Reproducible LaTeX Thesis Workflow with CI/CD and Public PDF Links on Your Own Terms.

Updated
•3 min read•View as Markdown
A Reproducible LaTeX Thesis Workflow with CI/CD and Public PDF Links on Your Own Terms.

Before I started the heavy work on my thesis, I wanted to make sure down the line I can focus as much on just content and I wont end up spending time fighting with configs and struggling to manage my writing/code. This is why when I started the monorepo of my work, I created a latex template as most people will. I decided that I will not use Overleaf because it's vendor lock-in is something I do not want to deal with and my preference to write in Emacs dose not really align with that either.

With the paper/ directory setup I then created a few entries in my Makefile which helps me orchestrate everything else in my research. I have paper.build and paper.watch as targets which help with the day-to-day writing and the watch target will re-compile and render my paper in zathura which I could not recommend more.

The beauty of my workflow comes in the CI/CD stage. I want my advisor and stakeholders to always see the updated version of my work in the same place, like you can in Overleaf. I do not however want to make anyone clone my repo and self compile my work. That is why I built an on-commit build of my paper which ofcourse creates an artifact on GitHub. This however is still a bit cumbersome. Then I thought, what if I could use object storage like CloudFlare R2 (because setting up AWS S3 is a bit too tedious) to host my work?

![](https://cdn.hashnode.com/uploads/covers/6793605016666de203f20485/a28af780-d708-4220-bca4-c1ecb0a282b1.png align="middle")

Every commit, triggers a build, which triggers a push to the 'paper registry' under a timestamp aswell as -latest.pdf tag. Originally I wanted a persistent undo-tree for all the source files of my thesis, this however proved to not be such a good idea, nor would it make sense since each edit is tracked in a git repository. With this I have a full history of all the states of my work aswell as a unified place for the head of the process with a publicly sharable URL.

Since my work has multiple possible stakeholders each with different things they want to see, I created an automated mirroring pipeline which leverages codex to use per-mirror instructions to create perishable edits to the main work of the body and compiles the adjusted version. This way I can create a less technical or more technical mirror alongside my main fully humanly authored work.