My experience putting my documents through Version Control with LaTeX and Git

Monica Aspiras Labbao
5 min readAug 23, 2018

--

One of the things I am grateful for my work as a developer is that I have Git as a VCS. I can branch out whenever I don’t feel so sure about my output. I can roll back to the latest revision. I can also see my progress in a neat graph of commits. Without Git I am not sure how I can manage my code. I am pretty sure many developers will agree how Git is such a powerful tool.

But what about artifacts? Documents? Wireframes? Image assets? Everyday we get sent documents and wireframes; things like that. And as the software development progresses, the documents update from time to time. Many times you’d ask the team which version is the latest, which do you follow? On my account, we normally look into Google Docs and Sheets to also see real time changes.

But not everything is managed with Google Docs and Google Sheets. Sometimes it gets sent to us as dated PDF documents. Sometimes it’s on Invision.

Wouldn’t it be convenient that our designers and our project managers would simply send us documentation that is the latest and final? But software requirements change — the final document isn’t always final.

And how about you — once you have to make documents yourself?

If you’re the sort of person who is a stickler for version control and wants to have a chance to roll back from errors— like me, then you might want to use LaTeX.

My lecture about Dagger Dependency Injection, made with LaTeX

One of my best friends, Earl Adrian Hans, who is a registered chemist, introduced me to LaTeX several months ago this year. But I hadn’t given LaTeX a second glance until I had to do a presentation in my office about Dependency Injection. I could have done it normally on Google Slides. But internet in the Philippines is among the slowest in Asia Pacific region, and having too much time on my hands, I wanted to try something novel.

Installing LaTeX

The first thing I did was to get TeX for Mac. Put off by the sheer size of MacTeX, and considering that I only needed LaTeX to make my presentation at that time, I resorted to installing BasicTeX instead. I ended up having TexShop, like so:

I like having TexShop on my workstation. Nothing too complicated. I did not have to look for resources on how to begin using TexShop. Simply clicking on Typeset and I’m on business.

It did not take long before I figured out that I should use \documentclass{beamer} instead of \documentclass{article} to indicate that I am making slides, not documents. Rather, Earl pointed it out to me.

Beamers for slides. Articles for documents

After asking him several questions about how I should make a particular slide or how to make bolds, italics, etc., I ended up knowing how to style the text, how to make slides in a particular order, select a theme, like so:

Just found out that we need to use a package called lstlisting to render code blocks.

Having got the hang of the structure of a basic Beamer document, I resorted to searching for answers in case I needed to know more. Since the .tex file does look like code, I was excited that I could place this under Version Control:

Look at that! So many files all at once!

I’m pretty sure I am only actively editing the .tex file here (the one above).

And so made a gitignore:

Files I don’t need to track on Git

*.synctex files are particularly interesting, as they only appear whenever I am editing a .tex file, then get deleted as soon as I quit my TexShop.

Ultimately, I only end up committing the files I want, giving me a nice diff every time I make small changes:

Diffs like this I want to see.
Can accurately describe my little changes in my wee Beamer tex file

My presentation theme doesn’t look right for my presentation. At all.

I understood that LaTeX is made for scientific and academic circles. Having no time to make a Material Design-compliant theme for my deck I resorted to using Boadilla as my theme for my Beamer document. Depending on your persuasion you can say that my choice of font, serif, is probably out of place for my kind of presentation. But I just can’t abide with Beamer’s default font, sorry.

Uncomfortable with the indentation

This I did not like with lstlisting at all:

I just wanted to indent the code block without affecting what it looked like on the resulting PDF document.

As you can see, I made indentations to make my tex file easier to read and manage, but then the indentations also get accounted for in the typesetting. I included two un-indented Android classes for comparison. I’m a little let down by TeX on this one.

I also wanted to know how to manage my growing amount of slides, as my tex file is growing longer and longer and I am finding it harder to manage the slides. Earl told me that it is possible I can separate sections of my deck into separate tex files and simply order them into one master tex file.

But my presentation is drawing near. I will do that next time.

TeX has made a good impression on me.

Overall, I like using TeX. With Git, right now I would prefer making my documents with TeX files than over any document editor. I get to leave the version control to Git instead of versioning my own document file names manually, thus only generating artifacts on any commit whenever necessary and thus saving on storage space.

But using TeX to make slides… I’d probably stick with doing presentations using front-end web development for maximum aesthetic quality. That and I can place the same thing under Git as well so.

--

--

Monica Aspiras Labbao
Monica Aspiras Labbao

Written by Monica Aspiras Labbao

Main hustle is Android development. Secondary hustle is teaching Android development, doing iOs, Unity, and UWP.