0

The first C-c C-c by default suggests to run LaTeX command, and the second suggests View. The latter, in its turn suggest me a command to run the viewer, and I always have to change the editor to zathura. I’d want to make emacs stop asking and do LaTeX whenever I press C-c C-c and run View whenever I pass C-c C-v, since it doesn’t seem to do anything to me right now. Also I’d want to set up the default command for running the viewer, but I couldn’t find it. The LaTeX and the View commands are set in AUCTeX group under ‘Tex Command List’, and when we go down to the description of the View command we see

Name: View
        Command: %V

Oh wow.

The expansion of %V is defined below Tex Command List, under Tex Expand List, and here we see…

 Key: %V
            Expander: 
(lambda nil
  (TeX-source-correlate-start-server-maybe)
  (TeX-view-command-raw))

M-x describe-function RET TeX-view-command-raw says

TeX-view-command-raw is a compiled Lisp function in `tex.el'.
(TeX-view-command-raw)
Choose a viewer and return its unexpanded command string.

So I have to somehow replace it with the actual command I want, a-and… How do I actually do that? Excuse me, I am aware of that that’s being very silly of me trying to do something with Emacs without a firm grasp of elisp, but how do I do that? Why isn’t there a filed for a command like Latex Command has?

  • I cannot understand: do you want to set the default viewer to be opened with C-c C-v? If so, you have to customize the variable TeX-view-program-selection – giordano Mar 4 '15 at 11:08
  • @giordano, Ironically, I’ve found it in my init.el. I must note, that it’s impossible to alter from within emacs, since the viewer is to be chosen from a selection menu after M-x customize-variable. Also %V thing got replaced with a normal replaceable command once I restarted emacs daemon. I don’t know what changed it, I didn’t update the emacs package since the daemon start. – tijagi Mar 4 '15 at 11:29
  • If you want to add a viewer not already present in TeX-view-program-selection you have to add it to TeX-view-program-list (variable mentioned in the documentation of TeX-view-program-selection) – giordano Mar 4 '15 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.