Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I bind shifted keys to LaTeX-math-mode?

Tags:

emacs

auctex

With AUCTeX I can add

(setq LaTeX-math-list '(
    (?c "cong " nil)))

to my .emacs to make the minor mode LaTeX-math-mode spit out \cong when it's triggered and I enter c.

I want it to be invoked with C-c instead of c but changing the code to

(setq LaTeX-math-list '(
    (?C-c "cong " nil)))

gives me "Invalid read syntax: ?" when loading emacs. How do I make this work with C-c (or any other shifted binding such as M-c or C-M-c)?

like image 599
N.N. Avatar asked Nov 05 '22 12:11

N.N.


1 Answers

The ?c atom is Emacs way of indicating the single character c. To use this syntax for control characters, you need to use ?\C-c. Note that C-c is a standard prefix key in Emacs, so using this particular key in LaTeX-math-list may cause some conflicts. To use meta instead, you can use ?\M-c

Details are in the Elisp manual.

You can also use v as a prefix key, if you define your shortcut as "v c" for vc, for example.

like image 59
Tyler Avatar answered Nov 09 '22 09:11

Tyler