# Adding a rule to color text

I'd like to add a rule to supersede a tex mode. I'd like to colour text between two strings over multiple lines in a similar way that the character % is used as a comment character and so colours (greys out) everything following it on the same line, For example

\begin{comment}
coloured (greyed out) text in here
\end{comment}

normally coloured text by tex mode here

• I am the only person I know who uses the built-in tex-mode.el. Are you really using that too, or are you using the AUCTeX library? – lawlist Mar 22 '17 at 14:40
• With AUCTeX enabled and (setq TeX-parse-self t) in .emacs, it should work out of the box and the content should be fontified with font-lock-comment-face (\begin{comment} and \end{comment} must be in their own lines, though) – Arash Esbati Mar 22 '17 at 17:52

Sorry for answering here (my reputation is still to low to comment).

I know my answer isn't exactly what you are looking for, but it looks like you want to comment out some regions and, since I assume you are using emacs, to comment out some regions (in Latex) just type:

    C-c ;


This will comment out the region you selected, turning it to the standard comment colour (gray in your case). If you then want to uncomment the region, just select it and type

    C-c ;


again.

I hope I could help you even if my answer isn't exactly what you probably needed.

Best.