Skip to content

An Obsidian.md vault for my math course notes in university

License

Notifications You must be signed in to change notification settings

juestchaos/MathWiki-zhaoshenzhai

 
 

Repository files navigation

📝 MathWiki

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.

📑 Contents

🔭 Graph View: #63BFEE Definitions | #E665B7 Propositions | #65FB65 Theorems | #F95D5D Axioms

Graph view

✏️ Note Types and Templates

Each note is currently one of four types:

  • Definition, either of an object or of a notion, 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 its types).
    • Constructions: Objects/notions derived from object/notion.
    • Generalizations: Abstractions of object/notion.

    • Properties: Statements regarding object or necessary conditions of notion.
    • Sufficiencies: Proofs that other objects are of type object or sufficient conditions of notion
    • Equivalences: Equivalent definitions for object or biconditionals between notions and notion.
    • Justifications: Proofs of well-definition of object/notion.
  • Proposition and Theorem (differentiated by 'importance'), including both statement and proof regarding object/notion, which links to:

    • Proved by: Statements in which proof depends crucially on.
    • Justifications: Proofs of implicit assumptions of object/notion in statement.

    • Generalizations: Statements and proofs of generalizations of statement.
    • Counterexamples: Illustrations of why hypotheses in statement are necessary for proof.
  • 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.

⚙️ Configurations and Scripts

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:

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).

🔗 MathJax in Links

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 aliases 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 what text 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 comparing text with the alias of link.
    • 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.

math_links_demo

🎨 TikZ Images

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.

📃 Sample Pages

1

2

3

4

5

About

An Obsidian.md vault for my math course notes in university

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Markdown 88.1%
  • TeX 6.3%
  • Shell 3.4%
  • CSS 2.2%