【发布时间】:2013-05-02 12:47:44
【问题描述】:
我最近开始使用优秀的包xargs
提供\newcommandx。它共享类似于默认\newcommand 的语法。
我希望font-lock 反映这一点。
我做了
(custom-set-variables
'(font-latex-user-keyword-classes
(quote (("cx" ("newcommandx" "*|{\\[[{")
(:family "font-lock-type-face") command)))))
但这只是字体化命令名称本身,而不是它的主体
(\newcommand 用'font-lock-function-name-face 字体化正文,
在我的情况下是粗体)。我希望\newcommandx 用'font-lock-function-name-face 字体化它的主体。
总结问题:如何使\newcommandx 的字体化与\newcommand 完全相同(即在我的情况下为粗体)?
【问题讨论】:
-
我已经更新了答案以专门解决您的问题,并且我已经在 OSX Mountain Lion 上使用 Emacs / Aquamacs 的夜间版本对其进行了测试。在此示例中,
\newcommandx{cmd}[args]{def}现在的行为类似于\newcommand{cmd}[args]{def}。参见auctex--11.86内font-latex.el的第301 行。
标签: emacs latex syntax-highlighting auctex