[texworks] syntax pattern for inmath

Stefan Löffler st.loeffler at gmail.com
Wed Feb 3 18:53:24 CET 2010


Hi

2010/2/3 kap4lin <kap4lin at gmail.com>

> On Wed, Feb 3, 2010 at 9:42 AM, Stefan Löffler <st.loeffler at gmail.com>
> wrote:
> > Am 2010-02-03 14:19, schrieb Herbert Schulz:
> >> For curiosities sake... what happens if you use $$...$$ for displayed
> math equations? I see this quite a bit even with LaTeX.
> >>
> >
> > With "\$[^\$]+\$", I'd assume that everything between an including the
> > inner $ signs would be colored, but not the outer $ signs. But you could
> > easily adjust the regexp to work for both cases by simply saying
> > "\$+[^\$]+\$+" (which will actually match one or arbitrarly more $
> signs).
>
> So in $e=mc^2$ is it possible to have "e=mc^2" in limegreen but the
> left and right "$"s in red?
>

No, not at the moment. It may be possible to have "$e=mc^2" in limegreen,
though (using lookahead assertions). This could be enabled by implementing
the "highlight only the first captured group" idea I mentioned earlier.

My approach was just to consistently highlight "$$e=mc^2$$", i.e. highlight
the complete expression, not just the inner "$e=mc^2$" (in fact, my latest
regexp would also highlight the complete expression "$$$$$e=mc^2$$$$$",
though this probably is nothing you'd actually write ;)).


> Regards,
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20100203/65e33986/attachment.html>


More information about the texworks mailing list