An Obsidian.md vault for my math course notes in university (integrated with my dotfiles).
These notes are meant to be a distilled version of the math I've learnt where ideas, formulations, and important results are broken down into their atomic components of definitions, propositions, and theorems for clarity, precision, and accessibility.
- Note Types and Templates; the basic templates and outgoing links for each type of note.
- Configurations and Scripts; snippets, pluggins, and my bash scripts.
- MathJax in Links; a script that handles links containing MathJax.
- Currently replacing this with MathLinks, a work-in-progress Obsidian plugin.
- TikZ Images; my workflow invloving TikZ images.
- Sample Pages; some sample screenshots.
Each note is currently one of four types:
-
Definition, either of an
object
or of anotion
, which links to:- Types: Objects/notions of type
object
/notion
with additional restrictions. - Examples: Specific examples or counterexamples of
object
/notion
(but not of any of itstypes
). - Constructions: Objects/notions derived from
object
/notion
. - Generalizations: Abstractions of
object
/notion
. - Properties: Statements regarding
object
or necessary conditions ofnotion
. - Sufficiencies: Proofs that other objects are of type
object
or sufficient conditions ofnotion
- Equivalences: Equivalent definitions for
object
or biconditionals between notions andnotion
. - Justifications: Proofs of well-definition of
object
/notion
.
- Types: Objects/notions of type
-
Proposition and Theorem (differentiated by 'importance'), including both
statement
andproof
regardingobject
/notion
, which links to:- Proved by: Statements in which
proof
depends crucially on. - Justifications: Proofs of implicit assumptions of
object
/notion
instatement
. - Generalizations: Statements and proofs of generalizations of
statement
. - Counterexamples: Illustrations of why hypotheses in
statement
are necessary forproof
.
- Proved by: Statements in which
-
Axiom, written as a formal
statement
within a certain framework, which links to:- Equivalences: Equivalent statements - including its proof.
- Constructions: Objects/notions that crucially depend on
statement
.
These templates are automatically inserted whenever a note is created. After the links, the main content is written with remarks where appropriate.
I do not directly write my notes in Obsidian since I have my own Neovim setup; see dotfiles/nvim. Therefore, most of my Obsidian customization is on its appearance (via snippets) and navigation hotkeys.
Theme: Minimal.
Pluggins:
- Admonition: A replacement for the
mdframed
package in LaTeX. - Advanced Appearance: Set the font to
CMU Serif
(default LaTeX font). - Extended MathJax: Add macros in
preamble.sty
. - MathLinks: Manage and display MathJax in links.
- Hider: Hide title bars, scroll bars, YAML, etc.
- Sliding Panes (Andy's Mode): Stack panes side-by-side (v3.2.5).
I wrote some bash scripts to (try) maintain the consistency of the notes; main.sh acts as a hub for me to run them.
- Updating links of the form
[MathJax](link)
is handled by mathLinks.sh; its usage is detailed below. - Images are handled by newTikz.sh, getCurrentImage.sh, and updateImages.sh; see my workflow here.
- Search and replace patterns, including the ability of excluding additional patterns, is handled by searchReplace.sh.
- Operations on all lines containing patterns, including appending text, inserting a line before/after, and deleting lines, are handled by massEditing.sh.
- Basic stats of the vault (and updating them below) is handled by stats.sh.
- Displaying all links that have yet to be created and all notes that have those links, are handled by ghost.sh.
- Resetting the modification time of each note to its creation time is handled by resetModifyTime.sh.
Some stats: 572 notes, 1364 links, 55 images (updated every commit).
Currently replacing this with MathLinks, a work-in-progress Obsidian plugin.
As far as I know, the standard wiki-style links of the form [[...]]
used in Obsidian does not support MathJax. Instead, one should use markdown-style links which are of the form [text](link)
; here, text
can contain $...$
. However, text
remains unchanged when link
is updated, so, if one wishes to have links with math, one needs to update them manually.
I wrote a script that partially automates this process. Every note whose link should contain math is declared an alias
; when link
is updated, text
is checked against the alias and is updated when they differ. The alias
es are declared in a YAML front matter and is either written as alias: auto_aliasing
or custom_alias: ...
.
-
auto_aliasing
: This is used when the text that needs to be replaced with math is 'standard'. For instance, "Invertible iff bijective" is auto-aliased into "Invertible$\Leftrightarrow$ bijective", which is whattext
will be checked against. See here for a list of standard aliases. -
custom_alias
: If the alias is not standard (a one-time alias specific to this note), then it is written manually.
The script can be used to update math links as well as generate new ones.
- If flagged with
-u
, it updates every math link of the form[text](link)
by comparingtext
with thealias
oflink
.- If the note is auto-aliased, it can be run once the note is renamed.
- If the note has a custom alias, the
alias
also needs to be updated manually in the front matter of the note before it can be run.
- If flagged with
-n
, it generates a new math link[text](link)
from all Obsidian-style links[[...]]
whose note is aliased.
When run, the script updates/generates math links for every note that links to link
; for this reason, every update/generation displays the difference and needs to be confirmed (by pressing "Y" or Enter
) before the script proceeds. If link
is repeated in many notes (which is the entire point of this script), one does not need to confirm this for every note that links to link
since the update/generation is the same.
Here is a sample of how the script interface looks.
This is the main downside of using MathJax in Obsidian since Obsidian uses sanitizates HTML which ignores <script>
tags and prevents one from using this tool.
My solution is to bind a key in Neovim which inserts
<center><img src="app://local/PATH_TO_VAULT/Images/UNIQUE_IDENTIFIER/image.svg"></center>
in the current line and runs a script that creates a standalone image.tex
file from a template where the TikZ code can be written. Once finished, another key can be pressed which executes
pdflatex -shell-escape image.tex && pdfcrop image.pdf image.pdf && pdf2svg image.pdf image.svg
All images are centered and have a 15px
top and bottom margin; see this obsidian snippet. This can be modified to only apply to those images in a certain class.