2012-03-02 38 views

回答

5

对于部分,章节等的具体例子,以下内容添加到您的.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")) 
+0

你知道一种说法,“不要改变关于颜色以外的任何表情吗?”的一般说法吗?理想情况下,我想告诉Emacs忽略粗体,斜体,超级和下标,尺寸变化等等,只是使用颜色,但我从来没有找到一个通用的方式来做到这一点。我在下面的答案中发布的代码片段在事实之后撤消了这些更改,但如果可能,直接表达我的意图会更清晰。 – deong 2012-03-03 00:39:24

+1

@deong恐怕我没有;我将'font-latex-script-display','font-latex-subscript-face'设置为'nil',然后将'italic-command' /'bold-command'等添加到'font-latex-deactivated-关键字类“ - 我从来不需要做更多的事情(=。 – 2012-03-03 09:13:21

+0

@SébastienLeCallonnec:这真的太棒了,我可以请你编辑你的答案,包括你评论中的所有内容吗? - 为了将来的参考,我的elisp技巧是在复制和粘贴的层面上:o) – hpekristiansen 2012-03-03 10:59:11

1

如果你找到了解决方案,啤酒就在我身上。迄今为止我所能想到的最好的方法是将以下内容放在我的.emacs某处,并在加载完成此模式(组织模式)后运行该功能。

(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)))) 

我不做家庭的事了,因为我没有时间去想出一个好办法,以编程方式得到它的权利,它似乎并没有问题,但可能会因人而异。另外,我没有在“默认”字体上设置任何内容,因为其他一些值是相对的,需要固定的参考点。