Code Monkey home page Code Monkey logo

mathwiki's Introduction

MathWiki

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

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.

A statically-generated site containing this vault is currently work in progress.

Contents

Graph View

Graph view

Note Types and Templates

Each note is currently one of four types:

  • Definition/Example, 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/Theorem (differentiated by 'importance'), including both statement and proof regarding object/notion, which links to:

    • Proved by: Statements in which proof depends crucially on.
    • References: Notes in which the proofs of statement (or corollaries thereof) are delegated to.
    • Justifications: Proofs of implicit assumptions of object/notion in statement.

    • Specializations: Reformulations/proofs of instances of statement.
    • Generalizations: Statements and proofs of abstractions of 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.

Plugins:

I wrote some bash scripts to (try) maintain the consistency of my notes; main.sh acts as a hub for me to run them.

  • Images are handled by newTikZ.sh, getCurrentImage.sh, and updateImages.sh; see my workflow here.
  • Global search and replace, 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.
  • Toggling between light and dark mode is handled by toggleDark.sh.
  • Resetting the modification time of each note to its creation time is handled by resetModifyTime.sh.

Some stats: 368 notes, 1091 links (ratio: 2.964), 23 images (updated every commit).

MathLinks

An Obsidian.md plugin to render and manage MathJax in your links.

Associate a mathLink to your note, containing arbitrary MathJax, and have it displayed in all links to the note.

  • Works in both reading and live-preview modes, as well as canvases.
  • Add custom templates for mathLinks.
  • Render MathJax in aliases for both Wikilinks and Markdown Links.
  • Compatible with Extended MathJax and Dataview.

Description and Usage

Assigning a mathLink in the YAML frontmatter of note.md as shown below will make all links of them form [[note]] and [note](note.md) display as the rendered MathJax of yourMathLink. No changes are made to your notes, and updates to yourMathLink will be reflected once the note with the link is reopened.

---
mathLink: yourMathLink
---

Content starts here.

This plugin also makes Wikilinks and Markdown Links compatible with MathJax, so links like [[note|yourAlias]] and [yourAlias](note.md) will be displayed as the rendered MathJax of yourAlias. A mathLink in note, if present, will be overridden by yourAlias.

Links to Blocks/Headings

Additionally, Obsidian also supports links to blocks [[note#^block-id]] and headings like [[note#section]]. Any MathJax in #section will be rendered, and you can associate a mathLink to ^block-id as well by adding a YAML frontmatter like so:

---
mathLink-blocks:
    block-id: yourMathLink
---

Templates

Oftentimes, mathLinks of notes involve replacing some text with its math counterpart. For instance, you might have many notes whose title is of the form ... iff ....

Instead of setting the mathLinks of each note manually as ... $\Leftrightarrow$ ..., simply use mathLink: auto. This will generate its mathLink via a template that replaces iff with $\Leftrightarrow$. A template consists of a string to be matched (iff), its replacement ($\Leftrightarrow$), and some options (global match, case sensitive, and match whole words). They are created and maintained in the MathLinks settings window.

TikZ Images

This is the main downside of using MathJax in Obsidian since it sanitizes HTML which ignores <script> tags and prevents one from using this tool.

My solution is to bind a key in Neovim which inserts

![[Images/UNIQUE_IDENTIFIER/image.svg]]

in the current line and runs a script that creates the corresponding .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. This can be modified to only apply to those images in a certain class.

Sample Pages

mathwiki's People

Contributors

shahriarkh avatar zhaoshenzhai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mathwiki's Issues

Misc

A very interesting repository with useful knowledge for other students/obsidian lovers like me. May I ask you which Arch Linux DE/themes were you using in the screenshots in your README? That's really beautiful.

Can I cite your Admonition styles in the doc of my plugin?

Hi! I'm writing the documentation for the plugin I've been working on recently.
I plan to make a section for examples of CSS snippets for styling theorem callouts.

And I found your custom admonition styles really beautiful!
Do you mind if I include them with your credit (after translating the Admonition format to my own "math callout" format)?

Keybinding in nvim

Hello,

First I want to say this whole workflow is fantastic. I have a question regarding the section of the Readme about TikZ diagrams. You mention that you have a keybinding that does what you say. What keybinding are you using for this? In other words, in the .vimrc file (or its nvim analog), what code do you have for this keybinding?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.