Ali
Ali

Reputation: 177

How to change the default compilation command/shortcut in GNU Emacs-AUCTeX?

In GNU Emacs with AUCTeX enabled, C-C C-C is the default shortcut for running latex over the active buffer. How can I change this to also run dvips after the dvi output is generated by latex? Can I define a new shortcut, say C-C C-D, and assign it to the foregoing operation?

Upvotes: 2

Views: 1284

Answers (1)

Yike Lu
Yike Lu

Reputation: 1035

M-x describe-key <RET> C-c C-c
C-h k C-c C-c

will each give you the function name that is called for compile. Then you can rebind as follows in your .emacs:

(global-set-key (kbd "C-c C-d") '<function name>)

This isn't fully general, as I'm not fully familiar with the innards of AUCTeX. Typically there is some type of mode hook to run (keeps you from rebinding a global).

Here's an example adapted from http://emacswiki.org/emacs/AUCTeX

 (add-hook 'LaTeX-mode-hook
              '(lambda ()
                 (local-set-key "<key>" '<function name>)))

As to your question about running dvips, you would define your own function and do a keybinding. in a similar manner as above.

Upvotes: 1

Related Questions