Latex Suite

by artisticat1
5
4
3
2
1
Score: 87/100

Description

Category: Note Enhancements

The Latex Suite plugin enhances the LaTeX typing experience in Obsidian by offering intuitive shortcuts and customizable snippets for rapid typesetting. With features like auto-fraction formatting, matrix navigation shortcuts, and visual snippet tools, it simplifies complex LaTeX inputs into quick keystrokes. Users can enjoy cleaner displays through concealed LaTeX markup and benefit from automatic bracket resizing for readability. Matching brackets are color-highlighted for easy identification, and commands like equation selection and boxing further streamline workflows. Fully customizable, the plugin empowers users to adapt it to their preferences, making LaTeX editing faster and more efficient for both beginners and advanced users.

Reviews

No reviews yet.

Stats

2340
stars
462,030
downloads
84
forks
1,482
days
12
days
23
days
130
total PRs
9
open PRs
19
closed PRs
102
merged PRs
366
total issues
54
open issues
312
closed issues
142
commits

Latest Version

24 days ago

Changelog

Note: not sure what unintended bugs this would cause so releasing it right after it was found.

README file from

Github

Obsidian Latex Suite

A plugin for Obsidian that aims to make typesetting LaTeX math as fast as handwriting.

Inspired by Gilles Castel's setup using UltiSnips.

demo

The plugin's main feature is snippets, which help you write LaTeX quicker through shortcuts and text expansion! For example, type

  • "sqx" instead of "\sqrt{x}"
  • "a/b" instead of "\frac{a}{b}"
  • "par x y " instead of "\frac{\partial x}{\partial y}"

See Gilles Castel's writeup for more information.

The plugin comes with a set of default snippets, loosely based on Gilles Castel's. You can modify them, remove them, and write your own.

Usage

To get started, type "dm" to enter display math mode. Try typing the following:

  • "xsr" → "x^{2}".

  • "x/y Tab" → "\frac{x}{y}".

  • "sin @t" → "\sin \theta".

Have a look at the cheatsheet for a list of commonly used default snippets.

Once these feel familiar, you can check out the default snippets for more commands. e.g.

  • "par Tab f Tab x Tab" → "\frac{\partial f}{\partial x}".

  • "dint Tab 2pi Tab sin @t Tab @t Tab" → "\int_{0}^{2\pi} \sin \theta \, d\theta".

You can also add your own snippets! For more info on writing snippets, see here. You can view snippets written by others and share your own snippets here.

Aside from snippets, the plugin also comes with several other features that aim to make writing LaTeX easier.

Features

Auto-fraction

Lets you type "1/x" instead of "\frac{1}{x}".

For example, it makes the following expansions:

  • x/\frac{x}{}
  • (a + b(c + d))/\frac{a + b(c + d)}{}

and moves the cursor inside the brackets.

Once done typing the denominator, press Tab to exit the fraction.

auto-fraction

Matrix shortcuts

While inside a matrix, array, align, or cases environment,

  • Pressing Tab will insert the "&" symbol.
  • Pressing Enter will insert "\\" and move to a new line.
  • Pressing Shift + Enter will move to the end of the next line (which you can use to exit the matrix).

matrix shortcuts

Conceal

This feature must be enabled in the plugin settings.

Make your equations more readable by hiding LaTeX markup and instead displaying it in a pretty format.

For example, "\dot{x}^{2} + \dot{y}^{2}" will be displayed as "ẋ² + ẏ²", and "\sqrt{ 1-\beta^{2} }" will be displayed as "√{ 1-β² }".

To reveal the LaTeX syntax, move your cursor over it. You can also choose to delay the reveal for a moment, which makes navigation with arrow keys more intuitive.

conceal demo 2 conceal demo 3 conceal demo

[!NOTE] One of your selected monospace fonts in obsidian needs to support these symbols. JuliaMono has been known to work for all symbols. Either install the font or add the following to your css file:

@font-face {
    font-family: JuliaMono;
    src: url(https://github.com/cormullion/juliamono/raw/refs/heads/master/webfonts/JuliaMono-Regular.woff2) format("woff2");
    text-rendering: optimizeLegibility;
}

body {
  --font-monospace-override: JuliaMono;
}

Tabout

To make it easier to navigate and exit equations,

  • Pressing Tab while the cursor is at the end of an equation will move the cursor outside the $ symbols.
  • If the cursor is inside a \left ... \right pair, pressing Tab will jump to after the \right command and its corresponding delimiter.
  • Otherwise, pressing Tab will advance the cursor to the next closing bracket: ), ], }, \rangle, or \rvert.

Preview inline math

When your cursor is inside inline math, a popup window showing the rendered math will be displayed.

Visual snippets

Sometimes you want to annotate math, or cancel or cross out terms. Selecting some math with the cursor and typing

  • "U" will surround it with "\underbrace".
  • "O" will surround it with "\overbrace".
  • "C" will surround it with "\cancel".
  • "K" will surround it with "\cancelto".
  • "B" will surround it with "\underset".

visual snippets

Auto-enlarge brackets

When a snippet containing "\sum", "\int" or "\frac" is triggered, any enclosing brackets will automatically be enlarged with "\left" and "\right".

auto-enlarge brackets

Color and highlight matching brackets

To help make your equations more readable,

  • Matching brackets will be displayed in the same color.
  • When your cursor is adjacent to a bracket, that bracket and its pair will be highlighted.
  • When your cursor is inside brackets, the enclosing brackets will be highlighted.

color and highlight matching brackets demo

Editor commands

The plugin also adds the following commands to the Command palette:

  • Box current equation — surround the equation the cursor is currently in with a box, using "\boxed{ ... }".
  • Select current equation – select the equation the cursor is currently in.

Snippets

Snippets are shortcuts that allow you to insert certain text based on certain triggers. For example, the default snippet

{trigger: "@l", replacement: "\\lambda", options: "mA"}

will expand "@l" to "\lambda".

Snippets can be edited in the plugin settings. The structure of a snippet is as follows:

{
  trigger: string | RegExp,
  replacement: string,
  options: string,
  priority?: number,
  description?: string,
  flags?: string,
  triggerKey?: string,
  language?: string,
}
  • trigger : The text that triggers this snippet.
  • replacement : The text to replace the trigger with.
  • options : See below.
  • priority (optional): This snippet's priority. Snippets with higher priority are run first. Can be negative. Defaults to 0.
  • description (optional): A description for this snippet.
  • flags (optional): Flags for regex snippets.
  • triggerKey (optional): Shortcut for snippets.
  • language (optional): code language for snippets.
Options
  • t : Text mode. Only run this snippet outside math
  • m : Math mode. Only run this snippet inside math. Shorthand for both M and n
  • M : Block math mode. Only run this snippet inside a $$ ... $$ block
  • n : Inline math mode. Only run this snippet inside a $ ... $ block
  • A : Auto. Expand this snippet as soon as the trigger is typed. If omitted, the Tab key must be pressed to expand the snippet. This doesn't always work for IME keyboards (like chinese/pinyin, gboard, german/french diacritic keyboards).
  • r : Regex. The trigger will be treated as a regular expression
  • v : Visual. Only run this snippet on a selection. The trigger should be a single character
  • w : Word boundary. Only run this snippet when the trigger is preceded (and followed by) a word delimiter, such as ., ,, or -.
  • c : Code mode. Only run this snippet inside a ``` ... ``` block

Insert tabstops for the cursor to jump to by writing "$0", "$1", etc. in the replacement.

For examples and more details on writing snippets, including regex snippets and function snippets, have a look at the documentation.

You can view snippets written by others and share your own snippets here.

[!WARNING] Snippet files are interpreted as JavaScript and can execute arbitrary code. Always be careful with snippets shared from others to avoid running malicious code.

Cheatsheet

Trigger Replacement
mk $ $
dm $$$$
sr ^{2}
cb ^{3}
rd ^{ }
_ _{ }
sq \sqrt{ }
x/y Tab \frac{x}{y}
// \frac{ }{ }
" \text{ }
text \text{ }
x1 x_{1}
x,. \mathbf{x}
x., \mathbf{x}
xdot \dot{x}
xhat \hat{x}
xbar \bar{x}
xvec \vec{x}
xtilde \tilde{x}
xund \underline{x}
ee e^{ }
invs ^{-1}

When running a snippet that moves the cursor inside brackets {}, press Tab to exit the brackets.

Greek letters

Trigger Replacement Trigger Replacement
@a \alpha eta \eta
@b \beta mu \mu
@g \gamma nu \nu
@G \Gamma xi \xi
@d \delta Xi \Xi
@D \Delta pi \pi
@e \epsilon Pi \Pi
:e \varepsilon rho \rho
@z \zeta tau \tau
@t \theta phi \phi
@T \Theta Phi \Phi
@k \kappa chi \chi
@l \lambda psi \psi
@L \Lambda Psi \Psi
@s \sigma
@S \Sigma
@o \omega
ome \omega

For Greek letters with short names (2-3 characters), just type their name, e.g. "pi" → "\pi".

Acknowledgements

  • VimTex provides concealments in vim and more quality of life features for using vim in latex.
  • UltiSnips provides a snippet engine for vim.
  • LuaSnip provides a snippet engine for neovim, allowing more customization through declaring snippets in lua.
  • Hypersnips provides a similar snippet engine to one of UltiSnips in vscode.
  • Snippetleaf is a ported version of this plugin to codemirror only (the backend editor of obsidian). Works for editors such as overleaf.
  • LaTeX Utilities provides a snippet engine for latex only in vscode.
  • AUCTeX provides extensive quality of life features for latex.

Contributing

Any contributions and PRs are welcome! See here for more info.

Support

If you like this plugin and want to say thanks, you can buy me a coffee here.

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
2 months ago by Vladislav Sorokin
Auto-expands LaTeX snippets. External rules with live reload, Custom Rules Editor, and default math pack.
Auto-\displaystyle Inline Math
2 years ago by Ryota Ushio
An Obsidian.md plugin to automatically make all inline maths \displaystyle.
Calctex
3 years ago by Mike
An Obsidian plugin for automatic calculation of LaTeX formulas.
Completr
4 years ago by tth05
Auto-completion plugin for the obsidian editor.
Copy as LaTeX
4 years ago by mo-seph
Quick plugin to be able to copy/paste from Obsidian/Markdown into a Latex document
Desmos
4 years ago by Nigecat
Embed graphs directly into your obsidian notes
Export To TeX
5 years ago by Zach Raines
export obsidian markdown files in a format that can be pasted into a TeX file
Extended MathJax
5 years ago by Xavier Denis & Ng Wei En
Function Plot
4 years ago by leonhma
A obsidian.md plugin for rendering maths graphs.
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
IMSwitch in Math Block
a year ago by XXM
LaTeX Algorithms
3 years ago by SamZhang02
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
LaTeX autocomplete
6 months 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
a year ago by Matthew S. Scott
LaTeX Math
a year ago by Zarstensen
Integrated CAS (via. Sympy) plugin for Obsidian, with a LaTeX focused workflow.
Latex Matrices
3 years ago by Daniele Susino
An obsidian plugin to create latex matrices.
Latex OCR
2 years ago by Lucas Van Mol
Generate LaTeX equations from images in your clipboard or vault
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 to unicode converter
3 years ago by fjdu
Convert LaTeX commands into unicode sequences
LaTeX-OCR
2 years ago by Jack Barker
Linter
5 years ago by Victor Tao
An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
Math Booster
3 years ago by Ryota Ushio
A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
Math Indicator Changer
2 years ago by Ori Replication
Mathematica Plot
2 years ago by Marcos Nicolau
Insert functions on Obsidian using Wolfram Mathematica!
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
a year ago by slateblua
Type math faster
Meld Calc
5 years ago by meld-cp
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
Numerals
3 years ago by RyanC
An obsidian plugin which turns a math code block into a full featured calculator
Obsidian asciimath
3 years ago by widcardw
Asciimath support for Obsidian (based on asciimath-parser)
Obsidian Math+
4 years ago by Oscar Capraro
This is an Obsidian plugin for taking math notes using Excalidraw.
Obsidian matrix
4 years ago by Jonas Mohr
Plot Vectors and Graphs
2 years ago by Nicole Tan YiTong
Obsidian Plugin to generate graphs given the function.
Project Euler Stats
a year ago by Artem Korsakov
Get statistics from Project Euler.
Pseudocode
3 years ago by Yaotian Liu
An obsidian plugin that helps to render a LaTeX-style pseudocode inside a code block.
Quick LaTeX
5 years ago by joeyuping
Quick Matrix
5 months ago by Charlie Flowe
Plugin for Obsidian.md that allows for faster interactions with matrices in LaTeX
SwiftLaTeX Render
2 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
3 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.
Typst Renderer
3 years ago by fenjalien
Renders typst code blocks in Obsidian into images using Typst through the power of WASM!
Wypst
2 years ago by 0xpapercut
High quality rendering of Typst in Obsidian, powered by wypst.