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

Opening TeX doc inside emacs

Open DrWaleedAYousef opened this issue 4 years ago • 2 comments

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).

DrWaleedAYousef avatar Oct 20 '21 21:10 DrWaleedAYousef

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.

stewmehr avatar Jan 17 '22 15:01 stewmehr

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

ROCKTAKEY avatar Oct 01 '22 11:10 ROCKTAKEY

@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.

DrWaleedAYousef avatar Oct 25 '22 18:10 DrWaleedAYousef

@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.

ROCKTAKEY avatar Oct 30 '22 16:10 ROCKTAKEY