Open doronbehar opened 5 years ago
Thanks for flagging this! I am not familiar with Texlab, but I am all about LaTeXy things written in Rust!
CC @pfoerster and @efoerster who seem to be the people behind it.
With the latest version of TexLab (1.2.0), kpsewhich
is no longer required so tectonic and TexLab should work fine together. The only thing, that is not supported yet, is the preview feature. At the moment, the code to render an equation relies on latex
and dvipng
. However, we are evaluating to use pdfium
and tectonic
as a library instead.
That is great to hear! I am happy to do my best to answer any questions that you may have while you're looking at things. The aspiration is that Tectonic-as-a-library will be super useful for tools like TexLab, but that use case isn't super well explored, so there might be rough edges that we can smooth out.
Hey @doronbehar, @pfoerster; I also like TexLab but I'm not very knowledgeable on how to test it, can you provide us an update of where the current support / integration is as of 2021? ❤️
can you provide us an update of where the current support / integration is as of 2021?
At the moment, tectonic
and texlab
should work just fine together. texlab
is mostly independent of the TeX distro. The kpsewhich
feature mostly related to the feature of being able to load locally installed packages (in these cases we would use a best effort strategy to detect the defined commands and environments). Besides that, texlab
does not read or require any files of the TeX distro.
Lately, I have been thinking about adding another way to analyze TeX to texlab
. At the moment, we use a "traditional" approach in the parser and treat LaTeX as an ordinary programming language, which works fine most of the times but obviously it has its limits. In particular, it can be difficult to produce good results, when the source code leans more to the TeX side of doing things. I think, tectonic
could be helpful in this case. Ideally, texlab
could hook into tectonic
and let tectonic
compile the current workspace and output lots of diagnostic information like the steps of macro expansion. To produce fast results, one would need a mode that does not output a PDF file and does not do any expensive layout algorithms (so basically "just" a macro expansion engine). However, I think that there is an enormous effort associated with this problem so I am unsure if this is practical. Also there is a problem with potential infinite loops in the macro expansion.
TIL about a project called Texlab. It's a language server for Latex also written in Rust. I've installed it with ease thanks to coc-texlab (A coc.nvim extension) and I tried to give it a go. Having tectonic installed and not any other TeX distribution, I got the following error:
In contrast to the classic / old TeX distributions, Tectonic doesn't provide an executable called
kpsewhich
. I think there are other executables which Tectonic doesn't provide and that Texlab relies upon but I haven't investigated that thoroughly yet.Anyway, this is a mere example. Both projects strive to bring some modernity into the TeX ecosystem, I think an integration between the two should be considered by both projects' authors. Considering the fact both are written in Rust, perhaps Texlab could use tectonic as a library? Or perhaps even the other way around? Another option could be adding to Tectonic
kpsewhich
and perhaps other executables provided by standard TeX distributions in a compatible manner.This is a call for discussion. I'm not sure what will be the best way to make Tectonic and Texlab work together.