Does anyone have a syntax pattern for TeXworks’s syntax-patterns.txt that will correctly highlight Expl3 code? I.e., something that will recognize that the entirety of \cs_new:Npn is a command sequence—although highlighting the :Npn suffix differently might not be a bad idea.
Tell me more
×
TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
|
|
I use a colour scheme based loosely on that from WinEdt's DTX submode (I used to use WinEdt). This is for editing
[LaTeX DTX]
# comments
red Y \^\^A.*
# Guards
orange N %<(?:[A-Za-z0-9!\|]+|.)>
limegreen N %<\*(?:[A-Za-z0-9!\|]+|.)>
crimson N %</(?:[A-Za-z0-9!\|]+|.)>
darkviolet N %<@@=(?:[A-Za-z]+|.)>
# 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
darkgreen N \\(?:begin|end)\s*\{[^}]*\}
# control sequences
blue N \\(?:[A-Za-z@:_]+|.)
The key line here is the last one, which does the highlighting request. Of course, this is just a case of getting the regular expression right (if only this were easy!). |
|||
|