227
reputation
1
13

Camford Oxbridge

Texworks を起動

ヘルプ > 設定の管理 > データの格納先 > syntax-patterns を変更

TeXworks: Patterns for syntax coloring

Each entry consists of three whitespace-separated fields:

<spell?>

is a combination of color and style flags

Valid syntax:

/

;

;

/;

The color fields and are either:

*) a color name from the list defined in the SVG standard;

see https://www.w3.org/TR/SVG11/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 field is a combination of the letters

B (bold)

I (italic)

U (underlined)

is a flag controlling whether this style is subject to spell-checking;

"Y" or "y" for yes, "N" (or anything else, actually) for no.

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

yellow N [$#^_{}&]

LaTeX environments

red;I N \(?:begin|end)\s*{[^}]*}

LaTeX packages

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

control sequences

yellow;B N \(?:[\p{L}@]+|.)

comments

red B %.*

[ConTeXt]

special characters

darkred N [$#{}&]

'other' special characters

darkyellow N [=[]]

mathematical operations

green N [-+/^_]

start/stop

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

control sequences

yellow;I \(?:[\p{L}@]+|.)

comments

red B %.*

[BibTeX]

entries

darkgreen N @[^{]+

comments

darkgray Y %.*

keys

yellow N [a-zA-Z]+(?=\s*=)

[LaTeX DTX]

comments

red B ^^A.*

Guards

darkviolet N ^%<@@=[^>]> limegreen N ^%<*[^>]> crimson N ^%</[^>]> brown N ^%<< orange N ^%<[^>]>

special characters

darkred N ^^^^^[0-9a-z]{5} darkred N ^^^^[0-9a-z]{4} darkred N ^^^[0-9a-z]{3} darkred N ^^[0-9a-z]{2} darkred N [$#^_{}&] gray N ^%%.* gray N ^%

Macrocode

green N \(?:begin|end){macrocode}

LaTeX environments

yellow N \(?:begin|end)\s*{[^}]*}

control sequences

yellow N \(?:[\p{L}@:_]+|.)

[Lua]

Comments (single line only)

darkgray Y --.*

Strings

yellow N (?:"(?:[^"\]|\[\s\S])(?:"|$)|'(?:[^'\]|\[\s\S])(?:'|$)) yellow N [(=)[[\s\S](?:]\1]|$)

Keywords

yellow;B N
\b(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b

Numbers

yellow N [+-]?(?:0x[\da-f]+|(?:(?:.\d+|\d+(?:.\d*)?)(?:e[+-]?\d+)?))

other possibilities to be added....

[Metapost]

etc

1
answer
13
questions
~10k
people reached
  • adgag
  • Member for 2 years, 5 months
  • 32 profile views
  • Last seen Mar 26 at 7:28

Top tags (15)

Score 0
Posts 3
Posts % 21
Score 0
Posts 2
Score 0
Posts 2
Score 0
Posts 2
Score 0
Posts 1
Score 0
Posts 1

Top posts (14)

View all questions and answers

Badges (14)

Gold

Silver

1

Rarest

Bronze

13

Rarest