Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limited flixibility in style definitions for syntax patterns #276

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

The current style definitions for syntax patterns as listed in
configurations/syntax-patterns.txt is limited to:
(1) applying regex one line at a time (like sed). Thus multi-line text
cannot be handled.
(2) usage of regex which can not handle nested delimiters. Thus if the
specified regex searches for [^}] and the _text_ itself has a closing
brace, }, then the intended style is lost.

Example:
Add the following definition in syntax-patterns.txt:
red         Y \\textcolor\s*\{red\}\s*\{[^}]*\}

Then this works as expected:
\textcolor{red}{This is in red}

But the following two don't:
(1)
\textcolor{red}{This should have been (line break here)
in red}

(2)
\textcolor{red}{This also should have been in red: $\{a,b\}$}

This issue is seen with svn r545 version of Tw on RedHat 5.4, but is
generic to any version of Tw till date and any OS.

See the entire thread initiated by this message:
http://tug.org/pipermail/texworks/2010q1/002130.html

Original issue reported on code.google.com by [email protected] on 20 Jan 2010 at 5:26

@GoogleCodeExporter
Copy link
Author

Original comment by st.loeffler on 31 Jan 2010 at 10:08

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Hello,
I would like to propose extension to this and Issue 533: highlighting or 
emphasizing entire \begin{}-\end{} block, e.g.
\begin{equation}
\exp^{\imath\phi}=\cos\phi+\imath\sin\phi
\end{equation}
What I expect: the entire block would have background different from other text 
around.

Original comment by [email protected] on 21 Mar 2012 at 1:12

@GoogleCodeExporter
Copy link
Author

(2) can actually be fixed to use
 red   Y    \\textcolor\s*\{red\}\s*\{(\\\}|[^}])*\}
instead of
red         Y \\textcolor\s*\{red\}\s*\{[^}]*\}
i.e., symbol "}" will not be treated at the end of expression only when it 
follows immediately after "\"

Original comment by [email protected] on 15 May 2012 at 4:41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants