ROCKTAKEY / lsp-latex

Emacs lsp-mode client for LaTeX, on texlab.
GNU General Public License v3.0
69 stars 4 forks source link

Opening TeX doc inside emacs #33

Closed DrWaleedAYousef closed 2 years ago

DrWaleedAYousef commented 3 years ago

Currently, in spacemacs I can hit M-m m h d, which runs the command TeX-doc that suggest opening the appropriate pdf help document. However, it opens it in an external viewer. Do you have any idea how to open it in emacs using pdf-tools (it seems to be a very elisp/emacs question).

stewmehr commented 2 years ago

Hi,

I do not use spacemacs but I stumbled upon your question when googling for an answer to the same problem. As texdoc is a standalone application its pdf viewer has to be configured in the appropriate settings file. To find out where that file is located type

texdoc -f

in a terminal. The output should look similar to this:

/usr/share/texmf/scripts/texdoc/texdoclib.tlu 3.3
Configuration file(s):
    active      /usr/share/texmf/texdoc/texdoc.cnf
Recommended file(s) for personal settings:
    /home/westerholt/texmf/texdoc/texdoc.cnf

I had to create the recommended file because it did not exist yet. Since I use emacs in daemon mode I added the line

viewer_pdf = emacsclient

You can also use viewer_pdf = emacs instead, but this will most likely open a new frame which is not what I wanted.

ROCKTAKEY commented 2 years ago

@DrWaleedAYousef Sorry for late reply. See below section on readme. https://github.com/ROCKTAKEY/lsp-latex#pdf-tools-integration

DrWaleedAYousef commented 2 years ago

@DrWaleedAYousef Sorry for late reply. See below section on readme. https://github.com/ROCKTAKEY/lsp-latex#pdf-tools-integration

Thanks for your reply. I have no problem with the forward search and going back and forth between the tex code and the pdf. I am asking about opening a help on tex library or module within emacs.

ROCKTAKEY commented 2 years ago

@DrWaleedAYousef I got it. As far as I saw TeX-documentation-texdoc definition here, there is no option to specify viewer. So I think texdoc setting is needed as @hwesterholt said. Or you can request it to AUCTeX.