Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer

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>grey45</param>(</x-color><x-color><param>red4</param>defun</x-color>
<x-color><param>red4</param>hlt-region-or-buffer-limits</x-color>
<x-color><param>grey45</param>()</x-color>
<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>
<x-color><param>grey45</param>(</x-color><x-color><param>red4</param>if</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
add comment

Your Answer

 
discard

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.