Skip to content

[feat] fast LaTeX syntax typesetting (snippets / text expansion) #474

Description

@ShowhyT

Summary

Add a feature that allows fast typesetting of LaTeX syntax through snippets and text expansion, similar to what obsidian-latex-suite implements for Obsidian.

Motivation

Writing LaTeX math by hand is slow and repetitive — typing out commands like \frac{}{}, \sqrt{}, \alpha, \left( \right) etc. breaks the flow of note-taking or writing. A snippet-based expansion system would let users type short triggers (e.g. sr → ^{2}, x/y + Tab → \frac{x}{y}, @A → \alpha) and have them auto-expand into full LaTeX syntax, dramatically speeding up math typesetting.

Proposed features (based on obsidian-latex-suite)

  • Snippets / text expansion — user-defined and default triggers that expand into LaTeX commands (e.g. sqx → \sqrt{x}, a/b → \frac{a}{b}).
  • Auto-fraction — typing x/ automatically expands to \frac{x}{} with the cursor placed inside the braces.
  • Matrix/array shortcuts — Tab inserts &, Enter inserts \ inside matrix/array/align/cases environments.
  • Tabout — Tab moves the cursor past closing brackets or out of math mode instead of typing a literal character.
  • Visual snippets — wrap a text selection in commands like \underbrace{}, \cancel{}, \overbrace{}.
  • Auto-enlarge brackets — automatically wraps brackets with \left/\right when a snippet like \sum, \int, or \frac is triggered.
  • Configurable snippet list — ability to add, edit, and remove custom snippets (ideally with regex/function-based triggers for advanced use cases).
  • (Optional/nice-to-have) Conceal mode — hide raw LaTeX markup and render it as compact math symbols, revealed on cursor hover.
    Reference implementation

https://github.com/artisticat1/obsidian-latex-suite — MIT-licensed, open source. Could be a useful reference for snippet syntax, default snippet list, and UX patterns (though license/attribution should be checked before reusing code directly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions