gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 17:09:38 33 4
gpt4 key购买 nike

如何重新绑定(bind)双引号键以在启用 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 有助于重新定义引号键以插入 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绑定(bind)为:

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

或者,如果您想在大部分时间使用智能引号但偶尔插入文字双引号,只需执行 C-q " .

关于emacs - 使用 AUCTeX 在 LaTeX 模式下插入常规双引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24835536/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com