Swiftpack.co - latex-lsp/tree-sitter-latex as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by latex-lsp.
latex-lsp/tree-sitter-latex v0.4.0
LaTeX grammar for tree-sitter
⭐️ 82
🕓 3 weeks ago
iOS macOS
.package(url: "https://github.com/latex-lsp/tree-sitter-latex.git", from: "v0.4.0")


CI npm

This repo provides a LaTeX grammar for the tree-sitter parser generator.

Originally, this grammar is based off the parser of the texlab language server and primarily focuses on the constructs that are relevant for the language server.

This repository does not provide the accompanying highlighting definitions, instead they live in the nvim-treesitter repository.

To generate the parser, run

npx tree-sitter generate

after checking out the repository.


As widely known, parsing LaTeX is Turing complete so there is no way to handle every construct in a tree-sitter grammar. Instead, the grammar relies on a best effort approach while focusing on the LaTeX specific constructs like environments or sections instead of dealing with TeX internals like catcode.


Stars: 82
Last commit: 5 days ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 weeks ago


  • Add support for definition commands found in xparse package (#82)
  • Add rules for parsing subscript and superscript expressions (#63)
  • Add Swift package description (#76)
  • Add Go package description


  • BREAKING: Don't check parser.c into git repository anymore


  • Parse pycode environments correctly (#67, #66)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics