Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Emacs 使用AUCTeX在LaTeX模式下插入常规双引号_Emacs_Elisp_Auctex - Fatal编程技术网

Emacs 使用AUCTeX在LaTeX模式下插入常规双引号

Emacs 使用AUCTeX在LaTeX模式下插入常规双引号,emacs,elisp,auctex,Emacs,Elisp,Auctex,如何重新绑定双引号键,以便在启用AUCTex的LaTeX缓冲区中插入双引号 我试图重新定义TeX开放式和封闭式报价,但这似乎不起作用 (add-hook 'LaTeX-mode-hook '(progn (setq-default TeX-close-quote "\"") (setq-default tex-close-quote "\"") (setq-default TeX-open-quot

如何重新绑定双引号键,以便在启用AUCTex的LaTeX缓冲区中插入双引号

我试图重新定义TeX开放式和封闭式报价,但这似乎不起作用

(add-hook 'LaTeX-mode-hook
          '(progn
             (setq-default TeX-close-quote "\"")
             (setq-default tex-close-quote "\"")
             (setq-default TeX-open-quote "\"")
             (setq-default tex-open-quote "\"")
             (setq-default TeX-quote-after-quote t)))
更新

上面的代码和接受的答案本可以工作,但我启用了
smartparens
。Smartparens有助于重新定义quote键以插入LaTeX引号。使用普通引号的代码如下所示:

(eval-after-load 'latex
  '(progn
     (require 'smartparens-latex)
     ;; removes the double quote trigger binding. Now smartparens will 
     ;; insert a regular double quote
     (sp-local-pair 'latex-mode "``" "''" :trigger "\"" :actions :rem)))

您可以通过以下方式取消设置
auctex
绑定:

(defun my-hook ()
  (local-unset-key "\""))
(add-hook 'LaTeX-mode-hook 'my-hook)

或者,如果您想在大多数时间使用智能引号,但偶尔会插入一个文字双引号,只需执行
C-q“

如何?:
(添加hook'LaTeX mode hook(lambda()(setq TeX close quote“\”)(setq TeX open quote“\”)
只是好奇而已。
C-q
命令的作用是什么?