I use xdvi and auctex with

;;; 1
(setq tex-dvi-view-command "xdvi -editor 'emacsclient -a emacs --no-wait +%l %f'")

All works fine. Now I want xdvi to use the options -s 6 -geometry 917X736. First I tried

;;; 2
(setq tex-dvi-view-command "xdvi -s 6 -geometry 917X736 -editor 'emacsclient -a emacs --no-wait +%l %f'")

That doesn't work. Next I tried

;;; 3
(setq xdvi-program "xdvi -s 6 -geometry 917X736")

which also doesn't work. What does work is to remove 1 and use

;;; 4
(setq TeX-view-program-selection
  '((output-dvi "DVI Viewer")))
(setq TeX-view-program-list
  '(("DVI Viewer" "xdvi -geometry 917X736 -s 6 %o")))

which unfortunately looses the search forward via emacsclient. Does anyone know how to set the xdvi zoom and geometry options in 1, or to set the emacsclient in 4? I would be happy to use either solution. I'm using emacs-24.4 and AUCTeX 11.88. Thanks.

  • tex-dvi-dview-command is not part of AUCTeX, but of the vanilla TeX mode of Emacs. For AUCTeX, try adding " -sourceposition \"%n %b\" -editor \"%cS\"" without quotes in your DVI Viewer specification.
    – giordano
    Mar 18, 2015 at 15:40
  • Thanks. "DVI Viewer" "xdvi -sourceposition \"%n %b\" -editor \"%cS\" -geometry 917X736 -s 6 %o" is what I want. Also works with emacs- if anyone is using the devel version.
    – m43cap
    Mar 18, 2015 at 17:01

1 Answer 1


AUCTeX supports by default forward/inverse search with xdvi, you can see the options used for that in the value of the variable TeX-view-program-list-builtin. This variable is not customizable, but you have (at least) two options:

  1. setq the variable in your init file copying the default value and add there the flags -geometry 917X736 -s 6

  2. define a new viewer in TeX-view-program-list, as you suggested in your question, and add there the options to enable forward/inverse search: -sourceposition \"%n %b\" -editor \"%cS\"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.