0

Could someone help me to figure out what the template to add a new symbol to LaTeX-math-list is?

I am trying to extend the available list with two sequences, not exactly symbols; I am not sure if this is possible. So far, I ended up with the following line in .emacs

(setq LaTeX-math-list '((?\C-w (lambda () "\\Wec\{\}") "" nil)
                        (?\C-v (lambda () "\\Bec\{\}") "" nil)))

After enabling math mode, the additional keybindings are visible (with lambda at each item) but when I try to run any of them I get the following error:

Wrong type argument: commandp, (lambda nil "\\Wec{}")

I am currently learning Lisp so this is as far as I could get. Hope this is solvable. Thanks.

1 Answer 1

1

A command is a function containing an interactive form and this is, apparently, at LaTeX-math-list expects. So

(setq LaTeX-math-list '((?\C-w (lambda () (interactive) "\\Wec\{\}") "" nil)
                        (?\C-v (lambda () (interactive) "\\Bec\{\}") "" nil)))

should do the job (but I haven't tested it).

2
  • Hi. Thanks for the clue. It's no longer generating error but also doesn't show anything when I press the combination of the keys. Emacs shows it's accepted the keys, though. I don't know if I should ask a new question or edit this one?
    – Celdor
    Commented Aug 28, 2022 at 18:38
  • I think a new one is in order. Commented Aug 28, 2022 at 20:03

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.