lsp-latex icon indicating copy to clipboard operation
lsp-latex copied to clipboard

Question : difference between lsp-latex and lsp-mode/lsp-tex

Open deb75 opened this issue 3 years ago • 4 comments

Hello,

Just a simple question, I noticed that there is already a support in lsp-mode for latex with lsp-tex which relies on either texlab or digestif servers.

What are the differences between this repository and the lsp-tex embedded package ?

Also, which server, texlab or digestif would oy recommend (on windows 10) ?

Regards

deb75 avatar Mar 30 '21 09:03 deb75

lsp-latex supports all features of texlab, while lsp-tex does not. In contrast, lsp-latex does not support digestif, while lsp-tex does.

client texlab digestif
lsp-tex basically supported supported
lsp-latex fully supported not supported

I don't know which server is recommended, and I have never used digestif, but texlab sometimes heavy, even though I don't know whether digestif is heavier than texlab or not. See also other issue in lsp-latex and texlab.

ROCKTAKEY avatar Mar 30 '21 10:03 ROCKTAKEY

Thanks for your answeer.

It actually starts, but make emacs hang

Withe texlab, do I still need auctex ?

deb75 avatar Mar 30 '21 19:03 deb75

It seems a known problem that texlab freezes emacs. I downgraded texlab to version 1.10 and it works well. However, if I intentionally introduces an error, the server does not seem to notice it.

When I want to build the pdf with lsp-latex-build , I get :

Rc files read:
  C:\Users\edebry/.latexmkrc
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.
Latexmk: Filename '%f' contains character not allowed for TeX file.
Latexmk: Stopping because of bad filename(s).

But it works well with auctex ?

deb75 avatar Mar 30 '21 23:03 deb75

lsp-latex does NOT need AUCTeX at all.

Sorry, I don't have any idea about emacs hanging. I think %f error occurs because %f feature is not supported by texlab v1.10. Try the function below, instead:

(defun lsp-latex-build-old (&optional sync)
  "Same as `lsp-latex-build', except `%f` is replaced by Emacs.
Older texlab cannot replace `%f`, so use this function instead in that case.

Build synchronously if SYNC is non-nil."
  (interactive "P")
  (let ((lsp-latex-build-args
         (mapcar
          (lambda (arg)
            (if (string= arg "%f")
                (buffer-file-name)
              arg))
          lsp-latex-build-args)))
    (lsp-latex-build sync)))

This function is not tested, so I'd like you to try it and tell me whether it works or not, on your older texlab.

I will add this function to lsp-latex if it works.

ROCKTAKEY avatar Mar 31 '21 07:03 ROCKTAKEY