auctex
[Top][All Lists]
Advanced

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

[AUCTeX] fontifying contents of an environment


From: Non Aggie
Subject: [AUCTeX] fontifying contents of an environment
Date: Sat, 28 Aug 2010 12:01:35 -0400

Hello,

I am trying to syntax highlight the contents of certain environments.
Following the suggestion of a long-ago post on this list
(http://article.gmane.org/gmane.emacs.auctex.general/2875/match=font+lock+environment),
I tried the following to highlight the contents of an environment
called problem:

(add-hook 'LaTeX-mode-hook
          (lambda ()
            (font-lock-add-keywords
             'latex-mode
             '(("\\\\begin{problem}\\(\\(.\\|\n\\)+?\\)\\\\end{problem}" 1
                'font-latex-sectioning-5-face)
               ))
            ))

This works fine most of the time, but if the text inside the problem
environment contains % or $, then none of the text in the environment
is highlighted.  How do I fix this?

Thanks,
Janet



reply via email to

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