我将 Emacs 与 AucTeX 结合使用(运行 Ubuntu 10.04,如果这很重要)。
有谁知道如果点在任何数学环境中(即在 $...$
、 $$...$$
、 begin{equation}...\end{equation}
等在)?
我想有一个相对简单的答案,因为语法突出显示使用相同的标准来着色数学内容,但我找不到任何东西。
最佳答案
如果 andre-r的回答不能满足你,这里有一些设置 `
的代码在文本模式下自插入并在数学模式下充当数学模式前缀。 LaTeX-math-mode
必须关闭。
(defun LaTeX-maybe-math ()
"If in math mode, act as a prefix key for `LaTeX-math-keymap'.
Otherwise act as `self-insert-command'."
(interactive)
(if (texmathp)
(let* ((events (let ((overriding-local-map LaTeX-math-keymap))
(read-key-sequence "math: ")))
(binding (lookup-key LaTeX-math-keymap events)))
(call-interactively binding))
(call-interactively 'self-insert-command)))
(define-key LaTeX-mode-map "`" 'LaTeX-maybe-math)
以下改进留作练习:
C-h
则显示帮助或 f1
. 关于Emacs/Auctex : Automatically enabling/disabling LaTeX-Math-mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3465190/