Pseudocode

by Yaotian Liu
5
4
3
2
1
Score: 63/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

136
stars
21,732
downloads
7
forks
1,309
days
192
days
192
days
4
total PRs
1
open PRs
1
closed PRs
2
merged PRs
31
total issues
2
open issues
29
closed issues
4
commits

Latest Version

6 months 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.
AI LaTeX Generator
2 years ago by Aayush Shah
An Obsidian plugin that generates latex code from natural language inputs.
Auto Math
8 months ago by Vladislav Sorokin
Auto-expand LaTeX math snippets in Obsidian — write equations faster.
Calctex
3 years ago by Mike
An Obsidian plugin for automatic calculation of LaTeX formulas.
Completr
5 years ago by tth05
Auto-completion plugin for the obsidian editor.
Copy as LaTeX
5 years ago by mo-seph
Quick plugin to be able to copy/paste from Obsidian/Markdown into a Latex document
draw.io
5 months ago by somesanity
A plugin for Obsidian that integrates the draw.io editor into Obsidian.
Excalidraw Extras
5 months ago by zsviczian
Companion Obsidian.md plugin hosting extra add-on optional features for the main Excalidraw-Obsidian plugin
Export To TeX
6 years ago by Zach Raines
export obsidian markdown files in a format that can be pasted into a TeX file
Extended MathJax
6 years ago by Xavier Denis & Ng Wei En
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
Inline TikZ
3 months ago by Lachlan Harris
Render seamless Tikz, CircuiTikz & other PGFPlots LaTeX diagrams directly in your notes.
LaTeX Algorithms
4 years ago by SamZhang02
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
LaTeX autocomplete
a year ago by Yanis Gerst
Latex Environments
6 years ago by Zach Raines
Quickly insert and change latex environments within math blocks in Obsidian.
Latex Exporter
2 years ago by Matthew S. Scott
Obsidian plugin: export a graph of linked notes to a full LaTeX paper, with embeds, citations, theorem environments and cross-references.
LaTeX Math
a year ago by Zarstensen
Integrated CAS (via. Sympy) plugin for Obsidian, with a LaTeX focused workflow.
Latex Matrices
4 years ago by Daniele Susino
An obsidian plugin to create latex matrices.
Latex OCR
3 years ago by Lucas Van Mol
Generate LaTeX equations from images in your clipboard or vault
LaTeX Panel Helper
a year ago by Luster
A powerful and convenient LaTeX symbol panel for Obsidian to enhance your mathematical and scientific note-taking efficiency.
Latex Suite
5 years ago by artisticat1
Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
LaTeX to unicode converter
4 years ago by fjdu
Convert LaTeX commands into unicode sequences
LaTeX-OCR
3 years ago by Jack Barker
Markdown Cleaner
6 months ago by gao-qian-long
Obsidian格式化markdown插件
Math Indicator Changer
2 years ago by Ori Replication
Math+
6 months ago by ocapraro
This is an Obsidian plugin for taking math notes using Excalidraw.
MathLive
3 years ago by Dan Zilberman
The must-have plugin for math in Obsidian
MathLive in Editor Mode
2 years ago by MizarZh
MathLive input in editor mode.
MathType
2 years ago by slateblua
Math typing plugin for Obsidian
MP Publisher
4 months ago by joeytoday
自定义主题预览,并发布到公众号草稿箱。
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
Obsidian asciimath
4 years ago by widcardw
Asciimath support for Obsidian (based on asciimath-parser)
Plot Vectors and Graphs
2 years ago by Nicole Tan YiTong
Obsidian Plugin to generate graphs given the function.
Quick LaTeX
5 years ago by joeyuping
Quick Matrix
a year ago by Charlie Flowe
Plugin for Obsidian.md that allows for faster interactions with matrices in LaTeX
SwiftLaTeX Render
3 years ago by gboyd068
TikZJax
4 years ago by artisticat1
Render LaTeX and TikZ diagrams in your notes
Transfer LaTeX from GPT
2 years ago by Xixia
Typst Mate
9 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.
Wypst
3 years ago by 0xpapercut
High quality rendering of Typst in Obsidian, powered by wypst.