今天简单的问题 - 我希望答案同样简单。
From TextMate我习惯使用键盘快捷键将当前环境或命令更改为其加星标的版本。 Emacs / AUCTeX中有类似的东西吗?
答案 0 :(得分:2)
如上所述by Kilian Foth,您可以编写一个函数来以这种方式修改环境:
(defun LaTeX-star-environment ()
"Convert the current environment to its starred version."
(interactive)
;; Add a star to the current environment.
(LaTeX-modify-environment (concat (LaTeX-current-environment) "*")))
如果重复命令,此函数将继续将星(*
)添加到当前环境。
如果您想要一个函数为当前环境加注星标(如果它尚未加星标),并且如果它已经加星标则取消它,则可以使用以下函数:
(defun LaTeX-star-environment-dwim ()
"Convert between the starred and the not starred version of the current environment."
(interactive)
;; If the current environment is starred.
(if (string-match "\*$" (LaTeX-current-environment))
;; Remove the star from the current environment.
(LaTeX-modify-environment (substring (LaTeX-current-environment) 0 -1))
;; Else add a star to the current environment.
(LaTeX-modify-environment (concat (LaTeX-current-environment) "*"))))
您可以将任一功能包括在.emacs中,然后分别执行 M-x LaTeX-star-environment
或LaTeX-star-environment-dwim
,或将功能绑定到密钥。
答案 1 :(得分:1)
显然不是,但使用LaTeX-current-environment
和LaTeX-modify-environment
编写一个很小的功能很容易。 (我现在没有电子邮件,对不起。)