auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to set pdf viewers as local variables


From: Uwe Brauer
Subject: Re: how to set pdf viewers as local variables
Date: Sun, 06 Mar 2022 18:12:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> Hi Uwe,


> `TeX-view-program-selection' ? See (info "(auctex)Starting Viewers") .

I came up with the following crude solution 

(defun TeX-viewer-set-to-okular ()
  (interactive)
  "Small hack to set the PDF viewer to Okular"
  (setq TeX-view-program-selection
        '(((output-dvi style-pstricks)
           "dvips and gv")
          (output-dvi "xdvi")
          (output-html "xdg-open")
          (output-pdf "Okular")))
  (message "Output PDF is set now to Okular"))


(defun TeX-viewer-set-to-evince ()
  (interactive)
  "Small hack to set the PDF viewer to Evince"
  (setq TeX-view-program-selection
        '(((output-dvi style-pstricks)
           "dvips and gv")
          (output-dvi "xdvi")
          (output-html "xdg-open")
          (output-pdf "Evince")))
  (message "Output PDF is set now to Evince"))


(defun my-toggle-evince-or-okular ()
  "This function allows to switch between the PDF viewers `Evince'
and `Okular'."
  (interactive)
  (with-output-to-temp-buffer "TeX-viewer-list-buffer"
    (princ "List of functions\n")
    (princ "1: TeX-viewer-set-to-evince\n")
    (princ "2: TeX-viewer-set-to-okular\n"))
  (let  ((ch (string-to-char (read-string "Which choice: 1: 2: "))))
    (call-interactively (cond
                         ((eql ch ?1) #'TeX-viewer-set-to-evince)
                         ((eql ch ?2) #'TeX-viewer-set-to-okular)
                         (t (error 'args-out-of-range '(1 2  ch))))))
  (kill-buffer "TeX-viewer-list-buffer"))


> Bye,
> Ikumi Keita
> #StandWithUkraine #StopWarInUkraine

-- 
I strongly condem Putin's war of agression against the Ukraine.
I support to deliver weapons to Ukraine’s military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
https://how-to-help-ukraine-now.super.site/

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]