\*\*EDIT\*\* I found the solution:
[https://github.com/vedang/pdf-tools/issues/123](https://github.com/vedang/pdf-tools/issues/123)
​
I am trying to set up emacs to use AUCTeX. Everything works fine, if I use the default macOS pdf viewer. However, that does not allow for syncing between source and pdf, which I use quite a bit. So I installed pdf-tools. I can get it to work fine, except for a few important details, which frankly ruin the experience:
* Pages don't load properly. If I have the pdf open in a (emacs) window and press `n` (for next page) or `p` (for previous page) , the windows goes blank until I scroll over it with the trackpad. After a while, though, it starts working fine and I can navigate with `n` and `p`. The pdf files I'm viewing are very light, just regular maths papers.
* The pdf file is rendered in low resolution for a retina display. I have tried to implement all the proposed fixes I could find on the internet, including `(setq pdf-view-use-scaling t)` and `(defun pdf-util-frame-scale-factor () 2)` which are on the official doumentation but don't change anything.
* pdf sync only works from source to pdf, not from pdf to source. According to the pdf-tools documentation, going to pdf to source is bound to C-mouse-1. But doing that in the pdf I get "C-<mouse-1> is undefined" (granted, I'm using a trackpad, so I'm not sure if that's the problem).
The main features work fine, but without a working pdf sync + a high resolution pdf display, there is no reason not to stick with TeXShop, which I used before.
I installed pdf-tools from the emacs interface itself, supposedly from [https://github.com/vedang/pdf-tools/](https://github.com/vedang/pdf-tools/). And the pdfs are not being viewed in DocMode. My emacs is version 28.1, and I got it from homebrew iirc.
I'm including my .emacs file below, if anyone can see anything wrong with it, it would be greatly appreciated. Also, I'm pretty new to emacs, so be gentle!
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(TeX-source-correlate-mode t)
'(custom-enabled-themes '(deeper-blue))
'(font-latex-fontify-script nil)
'(package-selected-packages '(pdf-tools company))
'(pdf-view-continuous t)
'(pdf-view-use-imagemagick nil)
'(ring-bell-function 'ignore))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(require 'reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'latex-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-auctex t)
(pdf-tools-install)
(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)
;; revert pdf-view after compilation
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
(setq pdf-view-use-scaling t)
;;(setq pdf-view-use-imagemagick nil)
(defun pdf-util-frame-scale-factor () 2)
(add-hook 'after-init-hook 'global-company-mode)
(add-to-list 'default-frame-alist '(height . 75))
(add-to-list 'default-frame-alist '(width . 120))