A super basic latex-ts-mode implementation with syntax highlighting shamelessly taken from nvim people!
Disclaimer:
⚠️ I mainly wanted to try how to do a tree-sitter major mode and that’s why this repo exist. I’m not sure if I will be able to maintain it reliably and for know it’s really super basic.As such I’ll provide the bare minimum of information to make it work for those who want to try and/or improve it
- Clone the repo at https://github.com/latex-lsp/tree-sitter-latex/tree/master
- src_sh{tree-sitter generate}
- compile it using src_sh{gcc}
- move the generated library (.so) to your emacs variable
treesit-extra-load-pathdirectory
Clone the repo and load it using use-package as usual
Once in a latex file use latex-ts-mode
Tested via tectonic V2
In your .dir-locals.el
((nil .
((eglot-workspace-configuration
. (texlab (:build (:executable "tectonic"
:args ["-X" "build" "--keep-logs" "--keep-intermediates"]
:onSave t
:auxDirectory "build/<output_dir>/")))))))
Then call eglot-texlab-build
- [X] syntax highlighting
- [X] indentation based on treesit
- [ ] Imenu support
- [-] extend eglot for texlab
- [X] BuildResquest
- [ ] Forward Search
- [ ] maybe as a separate package?
- [ ] make basic configuration for tectonic
- [ ] instant latex preview using org-latex preview (could be done fast as we can use the tree-sitter parser?)
- [ ] maybe as a separate package?