Pseudocode

by Yaotian Liu
5
4
3
2
1
Score: 66/100

Description

Category: Coding & Technical Tools

The Pseudocode plugin allows you to render LaTeX-style pseudocode inside Obsidian code blocks, giving you beautiful and professional-looking algorithms with ease. With an intuitive grammar and math formula support, this plugin is perfect for those who want to add visually appealing pseudocode to their notes. You can also customize the preamble style using .sty files or in-block macros, and export your pseudocode as a compilable LaTeX file.

Reviews

No reviews yet.

Stats

133
stars
18,882
downloads
6
forks
1,120
days
4
days
4
days
3
total PRs
0
open PRs
1
closed PRs
2
merged PRs
30
total issues
2
open issues
28
closed issues
16
commits

Latest Version

4 days ago

Changelog

New release 1.6.5

README file from

Github

Obsidian-Pseudocode

This is a plugin for Obsidian that allows you to render LaTeX-style pseudocode inside a code block. The plugin is based on pseudocode.js, a JavaScript library that typesets pseudocode beautifully to HTML.

Features

  • 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.
  • Print quality: The HTML output produced by the plugin is (almost) identical with the pretty algorithms printed on publications that are typeset by LaTeX.
  • Math formula support: Inserting math formulas in the pseudocode is as easy as LaTeX. Just enclose math expression in $...$ or \(...\).
  • Auto-completion inside pseudo code block. (Release 1.1.0)
  • Preamble style (macros) customization. (Release 1.2.0 & 1.5.0)
  • Export a LaTeX file that can be compiled, including any required additional macros. (Release 1.3.0)
  • Pseudocode block follows Obsidian theme and supports both light and dark ones. (Release 1.6.0)

Future Features

  • Syntax highlighting.

Usage

Basic

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

Rocommend: use the command Pseudocode: Insert a new pseudocode block to start.

Here is an example:

    ```pseudo
    \begin{algorithm}
    \caption{Quicksort}
    \begin{algorithmic}
      \Procedure{Quicksort}{$A, p, r$}
        \If{$p < r$}
          \State $q \gets $ \Call{Partition}{$A, p, r$}
          \State \Call{Quicksort}{$A, p, q - 1$}
          \State \Call{Quicksort}{$A, q + 1, r$}
        \EndIf
      \EndProcedure
      \Procedure{Partition}{$A, p, r$}
        \State $x \gets A[r]$
        \State $i \gets p - 1$
        \For{$j \gets p$ \To $r - 1$}
          \If{$A[j] < x$}
            \State $i \gets i + 1$
            \State exchange
            $A[i]$ with $A[j]$
          \EndIf
        \State exchange $A[i]$ with $A[r]$
        \EndFor
      \EndProcedure
      \end{algorithmic}
    \end{algorithm}
    ```

This will be rendered as (to render line number, you need to toggle it in setting tab):

Preamble style customization

Use a .sty file

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

Please reload the plugin after you change the preamble file.

Use in-block preamble

You can simply write your own macros in the pseudocode block before \begin{algorithm}. These macros will only be applicable within this specific block.

Supported macros

Currently supported macros can be found at this link and below(might not be fully supported):

  1. \DeclarePairedDelimiter
  2. \DeclareMathOperator*
  3. \DeclareMathOperator

Export to a compilable LaTeX file

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

Installation

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

Credits

This plugin is based on pseudocode.js, a JavaScript library that typesets pseudocode beautifully to HTML. Many thanks to the pseudocode.js team for their great work!

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Latex Suite
4 years ago by artisticat1
Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
Quick LaTeX
5 years ago by joeyuping
Completr
4 years ago by tth05
Auto-completion plugin for the obsidian editor.
Extended MathJax
5 years ago by Xavier Denis & Ng Wei En
TikZJax
4 years ago by artisticat1
Render LaTeX and TikZ diagrams in your notes
Math Booster
3 years ago by Ryota Ushio
A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
Latex Environments
6 years ago by Zach Raines
Quickly insert and change latex environments within math blocks in Obsidian.
MathLive
3 years ago by Dan Zilberman
The must-have plugin for math in Obsidian
Latex OCR
2 years ago by Lucas Van Mol
Generate LaTeX equations from images in your clipboard or vault
Copy as LaTeX
4 years ago by mo-seph
Quick plugin to be able to copy/paste from Obsidian/Markdown into a Latex document
Typst Mate
3 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.
Obsidian matrix
4 years ago by Jonas Mohr
Export To TeX
5 years ago by Zach Raines
export obsidian markdown files in a format that can be pasted into a TeX file
Obsidian asciimath
3 years ago by widcardw
Asciimath support for Obsidian (based on asciimath-parser)
Calctex
3 years ago by Mike
An Obsidian plugin for automatic calculation of LaTeX formulas.
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
Image2LaTEX
3 years ago by Hugo Persson
This is a plugin for obsidian that will read your latest copied image from clipboard and generate math latex from it
LaTeX Math
a year ago by Zarstensen
Integrated CAS (via. Sympy) plugin for Obsidian, with a LaTeX focused workflow.
SwiftLaTeX Render
2 years ago by gboyd068
LaTeX Algorithms
3 years ago by SamZhang02
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
LaTeX to unicode converter
3 years ago by fjdu
Convert LaTeX commands into unicode sequences
Latex Matrices
3 years ago by Daniele Susino
An obsidian plugin to create latex matrices.
Wypst
2 years ago by 0xpapercut
High quality rendering of Typst in Obsidian, powered by wypst.
Auto-\displaystyle Inline Math
2 years ago by Ryota Ushio
An Obsidian.md plugin to automatically make all inline maths \displaystyle.
Latex Exporter
a year ago by Matthew S. Scott
MathLive in Editor Mode
2 years ago by MizarZh
MathLive input in editor mode.
Math Indicator Changer
2 years ago by Ori Replication
Transfer LaTeX from GPT
2 years ago by Xixia
LaTeX-OCR
2 years ago by Jack Barker
Plot Vectors and Graphs
2 years ago by Nicole Tan YiTong
Obsidian Plugin to generate graphs given the function.
MathType
a year ago by slateblua
Type math faster
AI LaTeX Generator
2 years ago by Aayush Shah
An Obsidian plugin that generates latex code from natural language inputs.
LaTeX Panel Helper
5 months ago by Luster
A powerful and convenient LaTeX symbol panel for Obsidian to enhance your mathematical and scientific note-taking efficiency.
LaTeX autocomplete
6 months ago by Yanis Gerst
Auto Math
2 months ago by Vladislav Sorokin
Auto-expands LaTeX snippets. External rules with live reload, Custom Rules Editor, and default math pack.
Quick Matrix
5 months ago by Charlie Flowe
Plugin for Obsidian.md that allows for faster interactions with matrices in LaTeX