32

Switching from docview to pdf-tools happens 'automatically' when you install pdf-tools. Once you've done this, any time Emacs tries to open a pdf in Emacs, it will use pdf-tools. However, some packages will call out to the operating system, or use different config within Emacs, to decide if they should use Emacs or another program to open a pdf. So there is ...


11

It can't do that. I have some ideas about how to implement this, but nothing has materialized yet.


11

Here's my setup, using auctex-11.89 and pdf-tools-20151224.1159: ;; Use pdf-tools to open PDF files (setq TeX-view-program-selection '((output-pdf "PDF Tools")) TeX-source-correlate-start-server t) ;; Update PDF buffers after successful LaTeX runs (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)


6

C-M-s to invoke isearch-forward-regexp then type aaa\|bbb, where aaa is your first word and bbb is your second. Alternatives, just C-s to invoke isearch, then press M-r to toggle to regex.


5

The solution is to run texdoc within an asynchronous process. The best way to do that is probably to use start-file-process instead of shell-command-to-string (which is a handy function for quick&dirty code when it's more expedient to write a little shell script than the corresponding Elisp code, but is otherwise better avoided in my experience). But ...


4

You need to set the variable pdf-misc-print-programm and possibly also pdf-misc-print-programm-args in the pdf-misc customisation group. They should be set to the system command that you will print your document with, and that program must be installed on your system. I use lpr, with the settings: '(pdf-misc-print-programm "/usr/bin/lpr") '(pdf-misc-...


4

The reason you were asked for your password was that apt-get install was being invoked to install the additional software (poppler and friends) needed by pdf-tools. 1) Is this typical? No -- the vast majority of elisp packages do not attempt to automatically install other system requirements. It's not uncommon for other system software to be required by ...


4

At first, note that pdf-sync binds mouse-double-1 in the minor mode pdf-sync-minor-mode to pdf-sync-backward-search-mouse. So one should probably only bind it in a minor mode that can be deactivated again. The following code defines a minor mode pdf-sel-mode that binds mouse-double-1 to a new command pdf-sel-mouse. pdf-sel-mouse selects the word below the ...


3

Currently, this is not possible. Several feature requests have been submitted on the project's GitHub page: Feature request: continuous view #27, and more recently, Double pages layout #303. Apparently, this will not be fixed soon, quoting the package author in one of his replies to issue #27: Generally speaking, there are two issues: Large parts ...


3

As @kaushalmodi's post notes, rotation is apparently an open issue for pdf-tools, and it's apparently trickier to implement than expected. Comments on github indicate that a workaround is to use pdftk. Either I missed the code, or it wasn't posted. So here's the code for a workaround until rotation gets implemented in pdf-tools. Two points: It requires ...


3

I don't know if it is possible with pdf-tools, but it is possible with org-noter (https://github.com/weirdNox/org-noter). Here is a little demonstration: You call org-noter in the pdf buffer. Then use the org-noter-create-skeleton function to exoprt the highlights to the org-noter notes file.


3

I'll answer your actual problem of modifying the action for following links with pdf-tools. The customizable option pdf-links-browse-uri-function holds a function that receives a string with the uri as an argument and should take the appropriate action, e.g., open the link in a browser. You can define your own function and register it there with M-x ...


2

I just set this up yesterday so all you need in your init file is. ;; to use pdfview with auctex (setq TeX-view-program-selection '((output-pdf "PDF Tools")) TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)) TeX-source-correlate-start-server t) ;; not sure if last line is neccessary ;; to have the buffer refresh after compilation (...


2

I guess one option is to add a .gitignore which prevents Git from tracking that executable. The downside of course is that it will force you to re-build that executable on every machine. Another is to set pdf-info-epdfinfo-program to a filename that includes some system info, such as (expand-file-name (concat "epdfinfo-" system-type) ...) and then to ...


2

It looks like this feature needs to be added to pdf-tools. Someone has already posted an issue on this github requesting this enhancement: pdf-tools/Issue#89 From one comment, the workaround used by someone is to, use pdftk to rotate the PDF and save it to another file.


2

Got it to work! Thanks guys! I added (add-to-list 'auto-mode-alist '("\\.pdf\\'" . doc-view-mode)) and (add-hook 'doc-view-mode-hook #'pdf-tools-install)


2

Indirect buffer need special support, since their buffer-file-name is nil. But this is currently not implemented in pdf-tools. So it seems that the answer is no.


2

Look into helm's persistent actions. Basically allows you to execute an action (like opening the PDF) without ending the helm session. If your helm-bibtex is setup to use pdf-tools for viewing PDFs (see helm-bibtex-pdf-open-function), you're basically good to go.


2

pdf-tools requires a separate executable, epdfinfo, in order to function. This executable is distributed as source code within the pdf-tools package. As such, it gets compiled whenever you install or update the pdf-tools package. This is convenient, as it provides one-step installation of the pdf-tools package, which includes code for installing the ...


2

After having pdf-tools installed (just once), put the following in your init file: (add-hook 'doc-view-mode-hook 'pdf-tools-install)


2

You need Emacs and cask installed before compiling pdf-tools. pacman -S python pacman -S git curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python git clone https://github.com/politza/pdf-tools cd pdf-tools/ export PATH=/home/<your username>/.cask/bin:/c/emax64/bin:$PATH make -s Even then the build process might fail once or twice....


2

Recapping discussion in comments: Pressing A e, for "in-emacs", opens the attachment in PDFView. o e works exactly the same.


2

Apart from choosing the right buffer, this function suggests the necessary steps. (defun pdf-search-forward (string) (interactive "sString: ") ;; Expect a pdf-window, else the highlighting won't work. (pdf-util-assert-pdf-window) ;; Get a list of matches, discarding all but the first. (let-alist (car (pdf-info-search-string "...


1

Have been able to resolve this at least for Emacs25.3 on Windows 10. In short, libpng dll's and zlib1.dll's need to be added to the bin subdirectory of the emacs folder. The version number and name of the libpng dll's needed can be obtained by evaluating (cdr (assq 'png dynamic-library-alist)) These can be obtained at https://mirror.freedif.org/GNU/emacs/...


1

Try setting the variable pdf-view-use-unicode-ligther to nil, according to the doc it speeds up the loading on systems where looking for the unicode symbols used in the mode line (⎙ and 🌙) takes a long time.


1

You can scroll the window using set-window-vscroll, but image-mode (the package pdf-view uses to display the page) will reset it soon after. Also, Emacs may just ignore your request, if the image is not larger than the window. So, it does not look good.


1

I wrote a bit of Elisp code that creates a skeletal errata entry for me and places it in the kill-ring: (defun prepare-errata-entry () "Prepare an errata entry based on pdf-mode selection and place it in the kill-ring." (interactive) (if (equal major-mode 'pdf-view-mode) (let ((page (pdf-view-current-page)) (text (replace-regexp-in-...


1

Maybe a bit late, but there is a fix that works for me, see here: https://github.com/politza/pdf-tools/issues/55 The second-to-last post has a fix which works for me. Place the functions somewhere in your Emacs config and bind them to C-M-v or C-M-S-v respectively. Not a pretty hack, but works so far for me - at least with pdf-tools.


1

(package-initialize) was missed in my init.el. Thanks to all for your help!


1

You should be able to use pdf-view-kill-ring-save to send highlighted text to the kill-ring. At that point you can yank it to a buffer as normal.


Only top voted, non community-wiki answers of a minimum length are eligible