Function: TeX-pdf-tools-sync-view

TeX-pdf-tools-sync-view is a byte-compiled function defined in tex.el.

Signature

(TeX-pdf-tools-sync-view)

Documentation

Focus the focused page/paragraph in pdf-view-mode.

If TeX-source-correlate-mode(var)/TeX-source-correlate-mode(fun) is disabled, only find and pop to the output PDF file. Used by default for the PDF Tools viewer entry in TeX-view-program-list-builtin.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-pdf-tools-sync-view ()
  "Focus the focused page/paragraph in `pdf-view-mode'.
If `TeX-source-correlate-mode' is disabled, only find and pop to
the output PDF file.  Used by default for the PDF Tools viewer
entry in `TeX-view-program-list-builtin'."
  ;; Make sure `pdf-tools' is at least in the `load-path', but the user must
  ;; take care of properly loading and installing the package.  We used to test
  ;; "(featurep 'pdf-tools)", but that doesn't play well with deferred loading.
  (unless (fboundp 'pdf-tools-install)
    (error "PDF Tools are not available"))
  (unless TeX-PDF-mode
    (error "PDF Tools only work with PDF output"))
  (add-hook 'pdf-sync-backward-redirect-functions
            #'TeX-source-correlate-handle-TeX-region)
  (if (and TeX-source-correlate-mode
           (fboundp 'pdf-sync-forward-search))
      (with-current-buffer (or (when TeX-current-process-region-p
                                 (get-file-buffer (TeX-region-file t)))
                               (current-buffer))
        (save-restriction
          (widen)
          (pdf-sync-forward-search)))
    (let ((pdf (TeX-active-master (TeX-output-extension))))
      (pop-to-buffer (or (find-buffer-visiting pdf)
                         (find-file-noselect pdf))))))