https://github.com/samzhang02/obsidian-latex-algorithms
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
https://github.com/samzhang02/obsidian-latex-algorithms
Last synced: about 1 year ago
JSON representation
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
- Host: GitHub
- URL: https://github.com/samzhang02/obsidian-latex-algorithms
- Owner: SamZhang02
- License: wtfpl
- Created: 2023-02-20T14:35:56.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T21:19:17.000Z (over 2 years ago)
- Last Synced: 2025-03-14T22:03:20.684Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 1.41 MB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# LaTeX Algorithms for Obsidian
A simple plugin for writing Algorithms and pseudocodes in Obsidian.
## About
Obsidian is a great notetaking tool, I often find myself opening Obsidian instead of compiling a new `.tex` document for documents that I do not need to submit, simply due to how easy it is to use. However, Obsidian uses MathJax for its LaTeX functionality, which does not allow for package imports, such as `algpseudocode`.
I wrote this plugin so that I can easily take notes for my Algorithm and proof-based classes in Obsidian as well.
## Usage
This plugin reads previous user inputs and converts them into standard LaTeX algorithm format upon detecting keywords, such as `\If`, `\For`, etc.
A great addition to this plugin could be [Quick LaTeX for Obsidian](https://github.com/joeyuping/quick_latex_obsidian) and/or VIM keybindings. With these tools, you can achieve quite a fast workflow.
The functionalities of this plugin currently include:
- Fast indentation with `Shift+Tab`.
- Algorithm titles and subtitles.
- Conditionals (If/ElseIf/Else, Switch cases).
- For/While loops.
- Proof keywords.
### Currently supported keywords
| Titles and Subtitles | Conditionals | Loops | Proofs |
| -------------------- | ------------ | ---------- | ------------ |
| \\Algorithm | \\If | \\For | \\Theorem |
| \\Input | \\Elseif | \\EndFor | \\Lemma |
| \\Output | \\Else | \\While | \\Corollary |
| \\Ensure | \\Endif | \\EndWhile | \\Definition |
| \\Return | \\Switch | \\Break | \\Remark |
| \\State | \\Case | \\Continue | \\Proof |
| | \\Default | | \\QED |
## Credits
The development of this plugin used the API wrapper from [Obsidian](https://github.com/obsidianmd/obsidian-api).
The idea of this plugin was heavily inspired by [Quick LaTeX for Obsidian](https://github.com/joeyuping/quick_latex_obsidian). (In fact, one of the functions in my code is taken straight from them, simply due to how great it is)