TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to highlight text regions in my Emacs/AUCTeX/LaTeX document in a "textmarker style". Furthermore, the highlighting should save permanently. These features are provided by highlight.el and enriched-mode, which works fine with plain text file.

However, this doesn't work for LaTeX files *.tex, where I could not select text properties any more.

How can I combine text highlighting with AUCTeX?

share|improve this question

Using enriched-mode won't work since it actually saves the file in a different format—one that would prevent latex from working. Try M-xfind-file-literallyRETpath/to/enriched/mode/fileRET and you will see something like

Content-Type: text/enriched Text-Width: 70
<x-color><param>royalblue4</param>"Return the start and end of the
region as a list, smallest first.  If the region is empty or not
active, then bob and eob are used."</x-color>

If you want things highlighted systematically it can probably be done with font-lock-add-keywords, but if it's entirely arbitrary you would have to write a system that saves another file containing markers and then reads them in on file open and performs the highlighting. It's not impossible but as far as I know, noone has done it yet. See this stackoverflow question.

The question I think is really, what are you trying to accomplish. If it's drawing attention to an area that needs help for example then maybe adding a comment % TODO: description together with something like fic-mode (which I have never used) would be the best option. With a little more work you could even have it highlight the entire next sentence or something.

share|improve this answer
Thanks a lot for your suggestions! – Robinaut Apr 17 '12 at 16:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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