Files
org-roam/20230522125454-pdf_tools.org
2025-11-05 09:18:11 +01:00

2.0 KiB

pdf-tools

PDF Tools is an Emacs package for rendering PDF in Emacs.

It is intended to replace doc-view and work well with org-annotate and Roam.

It works with synctex and auctex.

The packages in Emacs are currently not working (as of <2023-02-18 Sat>) and it must be installed via pacman or AUR-Helpers.

The corresponding package is called: emacs-pdf-tools-git.

But without configuratiion it is not possible to use it like this, so you have to add the following to the con

Configuration

  (use-package pdf-tools
   :pin manual
   :config
   (pdf-tools-install)
   (setq-default pdf-view-display-size 'fit-width)
   (define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
   :custom
   (pdf-annot-activate-created-annotations t "automatically annotate highlights") )

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

(add-hook 'TeX-after-compilation-finished-functions
          #'TeX-revert-document-buffer)

(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))

;kann auch in evince geändert werden:
;(setq TeX-view-program-selection '((output-pdf "Evince")))
;; kann auch über M-x customize-group angepasst werden

;;pdf-view-blinken
(evil-set-initial-state 'doc-view-mode 'normal)
(add-hook 'doc-view-mode-hook
  (lambda ()
    (setq blink-cursor-mode nil)))


;;pdf-view-blinken
(evil-set-initial-state 'pdf-view-mode 'emacs)
(add-hook 'pdf-view-mode-hook
  (lambda ()
    (setq blink-cursor-mode nil)))

Im Evil-mode blinkt die Anzeige, cursor blinken muss also Deaktiviert werden (siehe oben). Funktioniert NICHT! mit linum mode.