My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# TeXworks: Patterns for syntax coloring

# Each entry consists of three whitespace-separated fields:
# <style> <spell?> <regex>

# <style> is a combination of color and style flags
# Valid syntax:
# <fgcolor>
# <fgcolor>/<bgcolor>
# ;<fontflags>
# <fgcolor>;<fontflags>
# <fgcolor>/<bgcolor>;<fontflags>
#
# The color fields <fgcolor> and <bgcolor> are either:
# *) a color name from the list defined in the SVG standard;
# see http://www.w3.org/TR/SVG/types.html#ColorKeywords
# *) a hexadecimal color value of the form #rrggbb; note that if this is used at
# the beginning of a line, a space " " must be added in front of it so the
# line is not interpreted as a comment (e.g., " #aabbcc" instead of "#aabbcc")
#
# The <fontflags> field is a combination of the letters
# B (bold)
# I (italic)
# U (underlined)

# <spell> is a flag controlling whether this style is subject to spell-checking;
# "Y" or "y" for yes, "N" (or anything else, actually) for no.

# <regex> is the regular expression to match.

# Note that order of rules may be important if several rules could match at the same position;
# this is why the generic "control sequence" rule comes AFTER the specific \begin/\end one.

[LaTeX]
# special characters
darkred N [$#^_{}&]

# LaTeX environments
darkgreen N \\(?:begin|end)\s*\{[^}]*\}

# LaTeX packages
darkblue N \\usepackage\s*(?:\[[^]]*\]\s*)?\{[^}]*\}

# control sequences
blue N \\(?:[A-Za-z@]+|.)

# comments
red Y %.*

[ConTeXt]
# special characters
darkred N [$#^_{}&]

# start/stop
darkgreen N \\(?:start|stop)[A-Za-z]+

# control sequences
blue N \\(?:[A-Za-z@]+|.)

# comments
red Y %.*

# other possibilities to be added....
# [BibTeX]
# [Metapost]
# etc

Change log

r682 by st.loeffler on Nov 17, 2010   Diff
Document peculiarity for hex-colors in
syntax-patterns.txt -  issue 433 
Go to: 
Sign in to write a code review

Older revisions

r488 by jonat...@jfkew.plus.com on Nov 21, 2009   Diff
support font styles in syntax rules,
based on Stefan's patch (issue 164)
r167 by jonat...@jfkew.plus.com on Sep 24, 2008   Diff
added auto-indent mode; this and
syntax coloring now configurable
r166 by jonat...@jfkew.plus.com on Sep 18, 2008   Diff
configuration files for syntax
coloring and tag recognition
All revisions of this file

File info

Size: 1704 bytes, 66 lines
Powered by Google Project Hosting