Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One key Emacs LaTeX compilation?

Tags:

emacs

latex

Are there any Emacs gurus out there who can tell me how to bind C-B to Auctex's LaTeX compilation? This is, instead of C-c C-c RET. I'm on Ubuntu.

like image 705
Dervin Thunk Avatar asked Jul 31 '09 15:07

Dervin Thunk


2 Answers

C-c is a general prefix key which means it is hard to 'shorten' it.

You could alternatively bind you favorite function to one of the function keys. Hitting C-h k (for help on key) followed by C-c C-c reveals that the function bound to the key is TeX-command-master. So you could try something like

(global-set-key "^X9" 'TeX-command-master)

to bind this function to F9.

like image 175
Dirk Eddelbuettel Avatar answered Oct 26 '22 22:10

Dirk Eddelbuettel


Dirk's answer works, but you still need to type RET after you type the function key. I haven't figure out how to invocate, say, Latex command from TeX-command-master specifically. So my hack for now use keyboard macro:

(defun my-tex-mode-hook ()
(local-set-key (kbd "<f5>") (kbd "C-c C-c C-j")))

(add-hook 'TeX-mode-hook 'my-tex-mode-hook)

(You need to use local-set-key instead of global-set-key since C-c C-c C-j might do something unexpected in other modes!)

Then you have a truly one keypress solution.

like image 41
polyglot Avatar answered Oct 27 '22 00:10

polyglot