auctex
[Top][All Lists]
Advanced

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

Re: Highlighting special characters in math environment


From: Kauê da Silva Sena
Subject: Re: Highlighting special characters in math environment
Date: Wed, 10 Nov 2021 21:00:26 -0300

Thank you, Andreas.
I believe I'll do as you suggest instead of trying to find a way to highlight them just in math environments since they do not generally appear outside them anyway. I just wondered if there were some "AUCTeXy" way of doing.  I thought also of trying to write some function which would match those characters only when between delimiters such as \( and \), but I have little knowledge of elisp and fear breaking AUCTeX's built in mechanism.

Em qua., 10 de nov. de 2021 às 20:30, Andreas Matthias <andreas.matthias@gmail.com> escreveu:
Kauê da Silva Sena wrote:

> In this section of the AUCTeX manual, it is described how one could customize the highlighting of commands started with a backslash. I'd like, however, to give special highlighting to certain unicode symbols when they are inside a math environment. For example, =,+,×,⊆, ⊂, ∩, ↦, →,≥,≤,≅,≃,∀,∃,∈,∑. I use those with XeLaTeX and have a method for directly inputting them.

Just adding keywords is not so difficult. However, I do not know how
to restrict keywords
to the math environment.

(defconst my-special-face
  '(:foreground "blue"
    :background "cornsilk"))

(font-lock-add-keywords
 'latex-mode
 '(("[≤≥×≅]" . font-lock-warning-face)
   ("[∑∩]" . my-special-face)))

Kind regards
Andreas


reply via email to

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