{"id":17026048,"url":"https://github.com/ytliu74/obsidian-pseudocode","last_synced_at":"2026-01-01T23:30:23.160Z","repository":{"id":142379017,"uuid":"613233044","full_name":"ytliu74/obsidian-pseudocode","owner":"ytliu74","description":"An obsidian plugin that helps to render a LaTeX-style pseudocode inside a code block.","archived":false,"fork":false,"pushed_at":"2024-06-05T18:19:26.000Z","size":1670,"stargazers_count":72,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-06T02:39:11.350Z","etag":null,"topics":["latex","obsidian-plugins"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ytliu74.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-13T07:05:16.000Z","updated_at":"2024-06-05T18:19:30.000Z","dependencies_parsed_at":"2024-01-18T01:15:54.352Z","dependency_job_id":"17e0e850-56bc-438e-9bc1-e1612ea02eee","html_url":"https://github.com/ytliu74/obsidian-pseudocode","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":"obsidianmd/obsidian-sample-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytliu74%2Fobsidian-pseudocode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytliu74%2Fobsidian-pseudocode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytliu74%2Fobsidian-pseudocode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytliu74%2Fobsidian-pseudocode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytliu74","download_url":"https://codeload.github.com/ytliu74/obsidian-pseudocode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219847890,"owners_count":16556345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latex","obsidian-plugins"],"created_at":"2024-10-14T07:30:23.448Z","updated_at":"2026-01-01T23:30:18.133Z","avatar_url":"https://github.com/ytliu74.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Obsidian-Pseudocode\n- [Obsidian-Pseudocode](#obsidian-pseudocode)\n  - [Features](#features)\n    - [Future Features](#future-features)\n  - [Usage](#usage)\n    - [Basic](#basic)\n    - [Preamble style customization](#preamble-style-customization)\n      - [Use a `.sty` file](#use-a-sty-file)\n      - [Use in-block preamble](#use-in-block-preamble)\n      - [Supported macros](#supported-macros)\n    - [Export to a compilable LaTeX file](#export-to-a-compilable-latex-file)\n  - [Installation](#installation)\n  - [Credits](#credits)\n\nThis is a plugin for [Obsidian](https://obsidian.md/) that allows you to render LaTeX-style pseudocode inside a code block. The plugin is based on [pseudocode.js](https://github.com/SaswatPadhi/pseudocode.js), a JavaScript library that typesets pseudocode beautifully to HTML.\n\n## Features\n\n- Intuitive grammar: The plugin takes a LaTeX-style input that supports the algorithmic constructs from LaTeX's algorithm packages. With or without LaTeX experience, a user should find the grammar fairly intuitive.\n- Print quality: The HTML output produced by the plugin is (almost) identical with the pretty algorithms printed on publications that are typeset by LaTeX.\n- Math formula support: Inserting math formulas in the pseudocode is as easy as LaTeX. Just enclose math expression in `$...$` or `\\(...\\)`.\n- Auto-completion inside `pseudo` code block. (Release 1.1.0)\n- [Preamble style (macros) customization.](#preamble-style-customization) (Release 1.2.0 \u0026 1.5.0)\n- [Export a LaTeX file that can be compiled, including any required additional macros.](#export-to-a-compilable-latex-file) (Release 1.3.0)\n- Pseudocode block follows Obsidian theme and supports both light and dark ones. (Release 1.6.0)\n\n### Future Features\n\n- [ ] Syntax highlighting.\n\n## Usage\n\n### Basic\n\nTo use the plugin, simply create a code block in your Obsidian note and add your pseudocode inside it. Then, add the language specifier `pseudo` (short for \"pseudocode\") to the code block. The plugin will automatically render the pseudocode as LaTeX.\n\n**Rocommend: use the command `Pseudocode: Insert a new pseudocode block` to start.**\n\nHere is an example:\n\n```\n    ```pseudo\n    \\begin{algorithm}\n    \\caption{Quicksort}\n    \\begin{algorithmic}\n      \\Procedure{Quicksort}{$A, p, r$}\n        \\If{$p \u003c r$}\n          \\State $q \\gets $ \\Call{Partition}{$A, p, r$}\n          \\State \\Call{Quicksort}{$A, p, q - 1$}\n          \\State \\Call{Quicksort}{$A, q + 1, r$}\n        \\EndIf\n      \\EndProcedure\n      \\Procedure{Partition}{$A, p, r$}\n        \\State $x \\gets A[r]$\n        \\State $i \\gets p - 1$\n        \\For{$j \\gets p$ \\To $r - 1$}\n          \\If{$A[j] \u003c x$}\n            \\State $i \\gets i + 1$\n            \\State exchange\n            $A[i]$ with $A[j]$\n          \\EndIf\n        \\State exchange $A[i]$ with $A[r]$\n        \\EndFor\n      \\EndProcedure\n      \\end{algorithmic}\n    \\end{algorithm}\n    ```\n```\n\nThis will be rendered as (to render line number, you need to toggle it in setting tab):\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/example.png\" alt=\"example\" width=\"70%\"\u003e\n\u003c/div\u003e\n\n### Preamble style customization\n\n#### Use a `.sty` file\n\nYou can use a `.sty` file (actually the suffix does not matter) to customize with some macros. The plugin will locate the file according to the setting. The default path is `preamble.sty`. \n\nPlease reload the plugin after you change the preamble file.\n\n#### Use in-block preamble\n\nYou can simply write your own macros in the pseudocode block before `\\begin{algorithm}`. These macros will only be applicable within this specific block.\n\n#### Supported macros\n\nCurrently supported macros can be found at [this link](https://katex.org/docs/supported.html#macros) and below(might not be fully supported):\n\n1. `\\DeclarePairedDelimiter`\n2. `\\DeclareMathOperator*`\n3. `\\DeclareMathOperator`\n\n\n### Export to a compilable LaTeX file\n\nYou can easily export a compilable LaTeX file by clicking the `Export to clipboard` button at the bottom right corner for each pseudocode block. The plugin will automatically generate a compilable LaTeX file, including any required additional macros, to your clipboard.\n\n\n## Installation\n\n\u003c!-- ### Install from the Community Plugins in Obsidian. --\u003e\n\n:tada: The Pseudocode plugin is now available in the Community Plugins section of Obsidian. To install it, simply search for **Pseudocode** and click on the installation button.\n\n\u003c!-- ### Use [BRAT](https://github.com/TfTHacker/obsidian42-brat#Quick-Guide-for-using-BRAT)\n\n1. Install **Obsidian-42 BRAT** from the Community Plugins in Obsidian.\n2. Open the command palette and run the command `BRAT: Add a beta plugin for testing`. Input this repo's URL `https://github.com/Yaotian-Liu/obsidian-pseudocode`.\n3. Click on **Add Plugin** -- wait a few seconds and BRAT will tell you what is going on.\n4. After BRAT confirms the installation, in Settings go to the **Community plugins** tab.\n5. Refresh the list, find `Pseudocode` and enable it.\n\n### Manual install\n\n1. Create a folder named `pseudocode-in-obs` in your Obsidian vault plugin folder (which is {Your Vault}/.obsidian/plugins).\n2. Download `main.js`, `manifest.json` and `styles.css` from the [releases page](https://github.com/yaotian-liu/obsidian-pseudocode/releases/latest), to the folder you just created in step 1.\n3. Open your Obsidian, and enable the plugin in \"Community Plugins\" setting page.\n4. Enjoy. --\u003e\n\n\u003c!-- ## Known Issues --\u003e\n\n## Credits\n\nThis plugin is based on [pseudocode.js](https://github.com/SaswatPadhi/pseudocode.js), a JavaScript library that typesets pseudocode beautifully to HTML. Many thanks to the pseudocode.js team for their great work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytliu74%2Fobsidian-pseudocode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytliu74%2Fobsidian-pseudocode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytliu74%2Fobsidian-pseudocode/lists"}