With these lines in my init.el I can synchronize the Emacs LaTeX buffer with Sumatra:
(setq TeX-source-correlate-mode t) (setq TeX-source-correlate-method 'synctex) (setq TeX-view-program-list '(("Sumatra PDF" ("\"C:/bin86/SumatraPDF/SumatraPDF.exe\" -reuse-instance" (mode-io-correlate " -forward-search %b %n ") " %o")))) (setq TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and start") (output-dvi "Yap") (output-pdf "Sumatra PDF") (output-html "start")))
In order to double-click on the PDF to bring me to the corresponding LaTeX code, I also set the Sumatra Set inverse search command line parameters:
"c:\bin86\GNU Emacs 24.2\bin\emacsclient.exe" --no-wait +%l "%f"
Despite working with synchronization, Id loves to code it differently.
If I did not set the last expression, (setq TeX-view-program-selection... , I would get the default values ββthat are the same as above, except for the value for the PDF output, which will be: (output-pdf "start") . Id would like to change this to" Sumatra PDF "and leave the other default values, that is, Id would like to ask Emacs the default values ββfor viewers and change only the PDF value.
This is basically an ELisp question regarding the manipulation of the variable TeX-view-program-selection . Thanks for the help.
PS Please tell me if this question is best suited for tex.stackexchange
Update based on comments and answers by lunaryorn
To update TeX-view-program-selection , I could use:
(assq-delete-all 'output-pdf TeX-view-program-selection) (add-to-list 'TeX-view-program-selection '(output-pdf "Sumatra PDF"))
The first line is optional, but it makes the list "clean."
In both cases (with or without assq-delete-all ) I now need to paste the code into the correct hook, since TeX-view-program-selection not valid in init.el