# [texworks] Color environment background

Stefan Löffler st.loeffler at gmail.com
Mon Jan 18 23:48:16 CET 2016

Hi Ignasi,

On 18.01.2016 06:10, Ignasi wrote:
> I know that TeXworks have some coloring rules for syntax highlighting
> but I'd like to apply coloring not to certain expressions but to text
> inside environments. Is it possible? how?
>
> As an example, if I have some \begin{mybox} .... \end{mybox} I'd
> like all text inside this begin-end shows certain background color.

Unfortunately, that is not possible at the moment. Right now, the syntax
highlighting is based on regular expressions evaluated separately on
each paragraph. That means that no multi-line highlighting is possible
ATM (also, it means nesting of brackets and similar things is currently
not possible).

Implementing this is definitely on the wish list, but it's not totally
straight forward (this environment could conceivably span the whole
(large) document, so the code would have to know at each position inside
the document which environments are everywhere around).

HTH
Stefan