[texworks] Regex for DTX mode

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Sep 26 17:06:07 CEST 2008


Jonathan Kew wrote:
>>
>> Yes, background is more of an issue for me too.  I'm thinking that this
>> allows combinations of properties, which I like the idea of.
> 
> So something like "green,bold,bg:yellow"?
> 
> I don't want to go too far with this... different fonts, etc... but
> maybe something more than just text color would be possible.
> 
> Note that the current implementation, at least, applies the first match
> it finds and then skips to the end of the matched text; do you feel
> there's a need to layer multiple styles on top of each other, rather
> than this "exclusive" model?

How about simply controlling background separately? So

[foreground]

<specs>

[background]

<specs>

with the current skipping unchanged.  I'm thinking that the two are (at
least for me) useful for very different things.

>>> But that still matches four tabs. Why can't I write ( ){4} or (\ ){4} or
>>> even [\s^\t]{4} to match four spaces only?
>>
>> As it was, it took me ages to get what I have.  The really obvious
>> (typing four spaces) seems to fail too!
> 
> It would, because it's using whitespace to separate the fields in the
> configuration file!
> 
> I suppose I should change that, if you're wanting to be able to put
> explicit spaces (as opposed to general whitespace, \s) into patterns. I
> was trying to do something rather minimalist.... perhaps too much so!
> 
> How about requiring <TAB>s to separate the fields? Then space would be
> allowed in patterns, and you can still use the \t escape sequence if you
> need an actual tab there. (That's actually what I did first, then I
> switched to using any whitespace as the separator; apparently a bad move.)

How about Will's suggestion of "\ " as an escaped space.  This is
obvious on screen, whereas I think you have it right that any general
whitespace should separate the input.
-- 
Joseph Wright


More information about the texworks mailing list