1

Finish up notetaking post

This commit is contained in:
Evan Pratten 2020-08-23 16:04:46 -04:00
parent beb5606bb7
commit fbbafc54d1
No known key found for this signature in database
GPG Key ID: 93AC7B3D071356D3
3 changed files with 53 additions and 4 deletions

View File

@ -0,0 +1,51 @@
---
layout: page
title: "Taking notes with Markdown and LaTeX"
description: "Using a lot of tech to replace a piece of paper"
date: 2020-08-23 10:30:00
categories: pandoc latex bazel
redirect_from:
- /post/68df02l4/
- /68df02l4/
---
Recently, I have been on a bit of a mission to improve my school workflow with software. Over the past month, I have built a cleaner [student portal](https://github.com/Ewpratten/student_portal#unofficial-tvdsb-student-portal-webapp) for my school and [written a tool](https://github.com/Ewpratten/timeandplace-api#timeandplace-api--cli-application) for automating in-class attendance. Alongside working on these projects, I have also been refining my notetaking system for school.
Since 9th grade, I have been taking notes in a private GitHub repository in markdown, and have been compiling them to HTML using a makefile for each course. While this system has worked ok, It has been far from perfect. Recently, I have been working very hard to give this system a much-needed upgrade. Here is the new tech stack:
- The [Bazel buildsystem](https://bazel.build)
- [Markdown](https://en.wikipedia.org/wiki/Markdown)
- [LaTeX](https://en.wikipedia.org/wiki/LaTeX)
- [MathJax](https://www.mathjax.org/)
- [Beamer](https://ctan.org/pkg/beamer)
- [Tikz & PGF](https://ctan.org/pkg/pgf)
- [Pandoc](https://pandoc.org/)
- [Zathura](https://pwmt.org/projects/zathura/)
- [Starlark](https://docs.bazel.build/versions/master/skylark/language.html)
- [Github Actions](https://github.com/features/actions) CI
The idea is that every course I take becomes its own Bazel package, with subpackages for things like assignments, papers, notes, and presentations. I can compile everything just by running the command `bazel build //:all`. All builds are cached using Bazel's build caching system, so when I run the command to compile my notes (I love saying that), I only end up compiling things that have changed since the last run. The setup for all of this is quite simple. All that is really needed is a Bazel workspace with the [`bazel_pandoc`](https://github.com/ProdriveTechnologies/bazel-pandoc) rules loaded (although I have opted to use some custom [genrules](https://docs.bazel.build/versions/master/be/general.html#genrule) instead). Using these rules, markdown files can be concatenated, and compiled into a PDF. I also use a modified version of the [Eisvogel](https://github.com/Wandmalfarbe/pandoc-latex-template) Pandoc template to make all my documents look a little neater.
In terms of workflow, I write all my notes as markdown files with [embedded LaTeX](https://pandoc.org/MANUAL.html#math) for any equations and charts I may need. All of this is done inside of VSCode, and I have a custom `tasks.json` file that lets me press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>b</kbd> to re-compile whatever I am currently working on. I also keep Zathura open in a window to the side for a nearly-live preview system.
<script src="https://gist.github.com/Ewpratten/163aa9c9cb4e8c20e732e3713c95c915.js" ></script>
![](/assets/images/hs_notes_workflow.png)
*A screenshot of my workspace*
Now, the question came up of *"how do you easily distribute notes and assignments to classmates and professors?"*. That question got me stuck for a while, but here is the system I have come up with:
1. I write an assignment
2. I push it to the private GitHub repository
3. GitHub Actions picks up the deployment with a custom build script
4. Every document is built into a PDF, and packaged with a directory listing generated by [`tree -H`](http://mama.indstate.edu/users/ice/tree/tree.1.html#XML/JSON/HTML%20OPTIONS)
5. Everything is pushed to a subdomain on my website via GitHub pages
6. I can share documents via URL to anyone
This is almost entirely accomplished by a shell script and a custom CI script.
<script src="https://gist.github.com/Ewpratten/4a69af01250291eb2981510feddef642.js"></script>
---
If you have any questions about this system, want me to write another post about it, or would like me to walk you through setting up a notes workspace of your own, [contact me](/about)

View File

@ -8,11 +8,9 @@ backing_scalar: "height:90%;"
{{site.about}}
## Chat with me
If you want to contact me, you can do so via email (ewpratten @ \<this website's domain name\>).
If you want to contact me, you can do so via email to `ewpratten@<this_domain>`.
I use PGP keys (mt keys and history are listed below), so feel free to sign your messages via GPG.
My current PGP key fingerprint is: `3D98 479A DE42 85A3 21F6 6DE4 DAB2 7917 6352 D880`.
I use PGP keys (mt keys and history are listed below), so feel free to sign your messages via GPG. My current PGP key fingerprint is: `3D98 479A DE42 85A3 21F6 6DE4 DAB2 7917 6352 D880`.
```
pub rsa4096/0xDAB279176352D880 2019-08-10 [SC]
Key fingerprint = 3D98 479A DE42 85A3 21F6 6DE4 DAB2 7917 6352 D880

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB