- typst
- tinymist
tinymist preview main.typtypst compile test.typ
M-x typst-ts-lsp-download-binary to download the LSP in "~/.emacs.d/.cache/lsp/tinymist/tinymist"
(use-package typst-ts-mode
:ensure t)
(add-hook 'typst-ts-mode-hook 'eglot-ensure)
(setq typst-ts-lsp-download-path
(string-trim (shell-command-to-string "which tinymist")))
(with-eval-after-load 'eglot
(with-eval-after-load 'typst-ts-mode
(add-to-list 'eglot-server-programs
`((typst-ts-mode) .
,(eglot-alternatives `(,typst-ts-lsp-download-path
"tinymist"
"typst-lsp"))))))
(defun typst-ts-tinymist-preview ()
"Run `tinymist preview` on the current file."
(interactive)
(let ((file (buffer-file-name)))
(if file
(compile (format "tinymist preview %s" (shell-quote-argument file)))
(user-error "Buffer is not visiting a file"))))
(with-eval-after-load 'typst-ts-mode
(define-key typst-ts-mode-map (kbd "C-c C-x") #'typst-ts-tinymist-preview))
C-c C-c typst-ts-compile C-c C-p typst-ts-preview C-c C-w typst-ts-watch-mode = When you save or edit the file, it automatically recompiles C-c C-S-c typst-ts-compile-and-preview
~/Videos/gob/typst/
#set heading(numbering: "1.a")
= Introduction
#lorem(100)
= Background
#lorem(100)
= Methods
#lorem(100)- use full links
- https://forum.typst.app/t/are-there-any-best-practices-for-how-to-do-typst-in-emacs/850/8
- https://myriad-dreamin.github.io/tinymist/frontend/emacs.html
- https://github.com/Myriad-Dreamin/tinymist/tree/main/editors/emacs
- https://codeberg.org/meow_king/typst-ts-mode/wiki/
- https://youtu.be/mO0957nYAwk?si=RsNTP7_NtFzNj0au
- https://youtu.be/6yavP1gLnXM?si=eRsD9gyPbMl6wy6B
- https://typst.app/docs/reference/text/
- https://typst.app/docs/reference/syntax/