簡體   English   中英

如何禁用 auctex 字體化,而不會丟失顏色突出顯示?

[英]How to disable auctex fontification, without losing color highlighting?

我喜歡 AucTeX 的最大語法高亮,但我不喜歡 AucTeX 搞亂 fonts。 例如,如果我使用斜體,它會在我的 emacs 緩沖區中顯示斜體字母,並以小寫字母(略高於或低於行)顯示下標和上標。 無論我所處的 latex 環境如何,我都更喜歡使用固定寬度的字體。

我嘗試更改變量 font-latex-deactivated-keyword-classes 的設置,但隨后語法着色也消失了。

有人可以提出解決此問題的方法嗎?

謝謝。

來自http://www.gnu.org/software/auctex/manual/auctex/Faces.html#Faces

如果要更改 font-latex 使用的 colors 和 fonts 請參考上面解釋中提到的面,並使用Mx customize-face RET <face> RET 由 font-latex 定義的所有面都可以通過自定義組通過鍵入來訪問

Mx customize-group RET 字體-latex-highlighting-faces RET。


上面的命令打開設置緩沖區,您可以在其中設置適當的字體。 保存更改后,您的 .emacs 文件將包含類似於以下內容的行:

'(font-latex-sectioning-5-face ((((class color) (背景光)) (:inherit variable-pitch:foreground "blue4":weight normal:foundry "outline":family "Century Gothic")

在您的示例中,您可以根據您的規格自定義Font Latex Italic Face Your.emacs 應包含

'(字體-乳膠-斜體-臉...)

到任何你設置它。 您可以類似地自定義上標、下標和其他所有字體。

在 AUCTeX 的最新版本中:

(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning 'color)

在 Emacs 24.3 上測試。 將以下內容放入您的 ~/.emacs 文件中:

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(font-latex-bold-face ((t nil)))
 '(font-latex-doctex-documentation-face ((t nil)))
 '(font-latex-doctex-preprocessor-face ((t nil)))
 '(font-latex-italic-face ((t nil)))
 '(font-latex-math-face ((t nil)))
 '(font-latex-sectioning-0-face ((t nil)))
 '(font-latex-sectioning-1-face ((t nil)))
 '(font-latex-sectioning-2-face ((t nil)))
 '(font-latex-sectioning-3-face ((t nil)))
 '(font-latex-sectioning-4-face ((t nil)))
 '(font-latex-sectioning-5-face ((t nil)))
 '(font-latex-sedate-face ((t nil)))
 '(font-latex-slide-title-face ((t nil)))
 '(font-latex-string-face ((t nil)))
 '(font-latex-subscript-face ((t nil)))
 '(font-latex-superscript-face ((t nil)))
 '(font-latex-verbatim-face ((t nil)))
 '(font-latex-warning-face ((t nil))))

請參閱手冊中的此頁面Deactivating defaults of built-in keyword classes部分。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM