Background colouring in TeXworks
The current experimental builds of TeXworks now include the ability to alter the background colour of text, as well as the foreground. At the moment, you can’t do this in an additive fashion (varying the two independently). However, it does make it easy to have something a bit nicer than the default bright red for comments. I’ve altered my syntax-patterns.txt file for LaTeX to read
[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
black/lightgrey Y %.*
You’ll see that the last line includes two colours, so I get black on light grey for comments.
Hi, thanks for the post that’s very helpful.
But there is one thing I don’t understand. What do the Letters N or Y mean? Couldn’t find anything in the wiki.
david
13 Nov 09 at 12:22 pm
Hi, thanks for the post that’s very helpful.
But there is one thing I don’t understand. What do the Letters N or Y mean? Couldn’t find anything in the wiki. I am asking because I would like to add something for “TODO” or “FIXME”.
david
13 Nov 09 at 12:24 pm
Hello David,
This is a flag for spell-checking. So it’s turned on for comments (which will mainly be text), but off for command names and so on.
Joseph
Joseph Wright
13 Nov 09 at 12:30 pm
At your hint, I made an extension of this file for emphasizing tasks. Perhaps it helps.
Just add two lines before the comments line:
# tasks
red Y %TODO:.*
Mathias
13 Nov 09 at 4:31 pm