Skip to content

Commit 0ebe2e3

Browse files
authoredMar 19, 2025
feat(images): add support for rendering latex math expressions (#935)
adds a treesitter query for representing latex math expressions in org code blocks. by using snacks.images, they are shown as rendered image. Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
1 parent 5d7c03a commit 0ebe2e3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎queries/org/images.scm

+9
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,12 @@
22
(#gsub! @image.src "^file:" "")
33
(#match? @image.src "(png|jpg|jpeg|gif|bmp|webp|tiff|heic|avif|mp4|mov|avi|mkv|webm|pdf)$")
44
)
5+
6+
(block
7+
name: (expr) @name
8+
parameter: (expr) @lang
9+
contents: (contents (expr) @image.content)
10+
(#match? @name "(src|SRC)")
11+
(#eq? @lang "math")
12+
(#set! injection.language "latex")
13+
(#set! image.ext "math.tex"))

0 commit comments

Comments
 (0)