【发布时间】:2012-03-02 13:38:22
【问题描述】:
我的 emacs(带有 AucTex 的 Aquamacs)改变字体大小(例如在 LaTeX 模式下)以显示语法 - 像这样:
不幸的是,这破坏了等宽字体的要点 - 例如我的 cmets 不对齐。我该如何解决这个问题?
【问题讨论】:
标签: emacs syntax-highlighting auctex
我的 emacs(带有 AucTex 的 Aquamacs)改变字体大小(例如在 LaTeX 模式下)以显示语法 - 像这样:
不幸的是,这破坏了等宽字体的要点 - 例如我的 cmets 不对齐。我该如何解决这个问题?
【问题讨论】:
标签: emacs syntax-highlighting auctex
对于章节、章节等的具体示例,请将以下内容添加到您的.emacs:
(setq font-latex-fontify-sectioning 'color)
编辑 这是我通常用来自定义 AUCTeX 格式的配置:
;; Only change sectioning colour
(setq font-latex-fontify-sectioning 'color)
;; super-/sub-script on baseline
(setq font-latex-script-display (quote (nil)))
;; Do not change super-/sub-script font
(custom-set-faces
'(font-latex-subscript-face ((t nil)))
'(font-latex-superscript-face ((t nil)))
)
;; Exclude bold/italic from keywords
(setq font-latex-deactivated-keyword-classes
'("italic-command" "bold-command" "italic-declaration" "bold-declaration"))
【讨论】:
font-latex-script-display、font-latex-subscript-face 设置为nil,然后将italic-command / bold-command 等添加到font-latex-deactivated-keyword-classes - 我从来不需要做更多的事情(=.
.emacs 中有效,但我无法在 emacs 中使用M-x 调用它吗?
如果你能找到解决办法,啤酒就交给我了。到目前为止,我能想到的最好的方法是将以下内容放在我的 .emacs 中某处,并在加载执行此操作的模式后运行该函数(org-mode 也执行此操作)。
(defun fix-fonts ()
(interactive)
(mapc
(lambda (face)
(set-face-attribute face nil
;; :family (if (string= system-type "darwin")
;; "Menlo"
;; "Inconsolata")
:width 'normal
:height 1.0
:weight 'normal
:underline nil
:slant 'normal))
(remove 'default (face-list))))
我不再做家庭的事情了,因为我没有时间想出一个以编程方式正确处理它的好方法,这似乎并不重要,但你的里程可能会有所不同。另外,我没有在“默认”字体上设置任何东西,因为其他一些值是相对的,需要那个固定的参考点。
【讨论】: