2012-03-02 48 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)))) 

我不做家庭的事了,因爲我沒有時間去想出一個好辦法,以編程方式得到它的權利,它似乎並沒有問題,但可能會因人而異。另外,我沒有在「默認」字體上設置任何內容,因爲其他一些值是相對的,需要固定的參考點。