auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fontification of $ sign


From: Tassilo Horn
Subject: Re: Fontification of $ sign
Date: Sat, 16 Sep 2023 12:38:25 +0200
User-agent: mu4e 1.11.17; emacs 30.0.50

Jean Eid <jeid@wlu.ca> writes:

Hi Jean,

> Anyway to turn off the fontification of math within $ signs? I know I
> can change the color  to white but that is not what I want,  I would
> like to  turn it right off.

There is no simple option for it but this seems to work:

--8<---------------cut here---------------start------------->8---
(defun my/font-latex-disable-dollar-math ()
  (cl-flet ((f (lst)
              (seq-filter (lambda (e)
                            (not (eq (car e) #'font-latex-match-dollar-math)))
                          lst)))
    (setq font-latex-keywords-1 (funcall #'f font-latex-keywords-1))
    (setq font-latex-keywords-2 (funcall #'f font-latex-keywords-2))))

(advice-add
 #'font-latex-make-user-keywords
 :after
 #'my/font-latex-disable-dollar-math)
--8<---------------cut here---------------end--------------->8---

Note however, that this will also disable $$...$$.  And since
super/subscript fontification is only performed in regions which are
already identified to be math, that's also disabled.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]