Emacs AucTex Latex Syntax Prevents Monospace Font

My emacs (Aquamacs with AucTex) change the font size (e.g. LaTeX mode) to show the syntax - like this: enter image description here

Unfortunately, this destroys the point of a monospace font - for example. my comments do not match. How to solve this problem?

+4
source share
2 answers

For a specific example of sections, sections, etc. add the following to your .emacs :

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

Edit Here is the configuration that I usually use to configure AUCTeX formatting:

 ;; 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")) 
+5
source

If you find a solution to this, beer is on me. The best I've been able to come up with so far is to put the following in my .emacs somewhere and run the function after loading the mode that does this (in 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)))) 

I don't do family business anymore, because I didn’t have time to find a good way to programmatically get it right, and that doesn't seem to matter, but your mileage may change. In addition, I do not set anything in the default font, because some of the other values ​​are relative and need a fixed breakpoint.

+1
source

Source: https://habr.com/ru/post/1399391/


All Articles