Closed hongyi-zhao closed 1 year ago
See here for more discussions:
Re: use pdf-tools in Emacs.
From: Hongyi Zhao Subject: Re: use pdf-tools in Emacs. Date: Wed, 26 Apr 2023 10:01:24 +0800
On Tue, Apr 25, 2023 at 11:10 PM Rudolf Schlatte <rudi@constantly.at> wrote: > > Hongyi Zhao <hongyi.zhao@gmail.com> writes: > > > I try to use pdf-tools [1] in Emacs, but meet the following problem: > > Have you tried M-x pdf-tools-install RET ? Yes. This way works. > That command compiles the > helper program that pdf-tools needs to display pdfs. Also see the > documentation of `pdf-loader-install`, which is another function > provided by pdf-tools that I think is meant to be added to the user's > init.el file. In fact, I already have the following configuration in my init.el file, but it doesn't seem to automatically compile and install pdf-tools: (use-package pdf-tools ;;https://github.com/jwiegley/use-package#magic-handlers :magic ("%PDF" . pdf-view-mode) :config (pdf-tools-install :no-query) ;; C-h o pdf-loader-install RET ;; This function acts as a replacement for ‘pdf-tools-install’ and ;; makes Emacs load and use PDF Tools as soon as a PDF file is ;; opened, but not sooner. ;;(pdf-loader-install) ) Regards, Zhao
As explained in the thread, this bit of configuration works with use-package
(use-package pdf-tools
:ensure t
:init
(pdf-tools-install))
I will add this to the documentation (or would really love a PR adding this to the README under the INSTALL section). Closing the ticket.
In fact, the current document is break:
See my following testing:
Then I run the steps here, but see the following chaos in pdf buffer:
How to fix it?
Regards, Zhao