On a new install, I noticed that Emacs systematically lowers or raises what it identifies as subscripts or superscripts (sometimes correctly, sometimes incorrectly...) due to the presence of _ or ^ in latex-mode. Syntax highlighting is enough for me, and I do not want Emacs to do any WYSIWYG mess, so I need to deactivate this.

I found several old notes that addressed other causes of this, and tried them all, but it seems my issue is a different one.

I have GNU emacs-25.2.1 (under Linux gentoo). I am not using any of the "advanced modes" (yatex, auctex) as they do even more visual things that I do not like. I am just using the stock latex-mode, which used to be fine for my purpose.


You're looking for tex-fontify-script, which you can customize, or just set manually via:

(setq tex-fontify-script nil)
  • 1
    +1 - though you need to set it to nil instead of t to get rid of the funky subscripts and superscripts. – Stephen May 18 '18 at 12:49
  • 2
    In addition to set tex-fontify-script to nil, I also had to change font-latex-fontify-script and set it to nil. – Olivier Oct 2 '18 at 7:31
  • @Olivier: that's only if you're using font-latex (which comes with AUCTeX, IIUC) instead of the "builtin" font-lock rules. In your case, I'd guess that setting tex-fontify-script doesn't actually have any effect. – Stefan Oct 2 '18 at 12:42
  • @Stefan. This worked for me. Thanks! Additional question: How does one get latexmode to stop highlighting the carat and underscore characters with a different color? – Chris Judge Oct 31 '20 at 20:09

With 26.1 on macOS Mojave, I found that the following two lines in custom-set-variables did the trick (I actually found them via the customisation browser):

 '(tex-font-script-display (quote (-0.0 0.0)))
 '(tex-suscript-height-ratio 1.0)

The first defines the amount by which the sub/superscript is lowered/raised. The second defines how tall the super/subscript characters are with respect to the default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.