0

I followed this topic and similar pages in order to customize the color of text and background of TeXworks. I can change the background color

QTextEdit {
  background-color: #000000;
  color: white;            /* sets the main text color */
}

However, the keywords which are dark blue are shown good in the in the black background. How can I change the colors of keywords, numbers, strings and ...?

2

The Syntax colours are held in a file

syntax-patterns.txt

which is deep in a subfolder in your user AppData path

In my case it is C:\Users\MyName\AppData\Local\MiKTeX\2.9\TeXworks\0.6\configuration

As TeXnician has pointed out in his linked answer above on Linux this may be located at ~/.TeXworks/configuration/syntax-patterns.txt

for some hints see https://www.texdev.net/2009/11/13/background-colouring-in-texworks/
and TeXnicians answer at How to change background colour in texworks (upvotes welcome)

If syntax colouring is not behaving as expected there may be related answers here

Texworks syntax highlighting not working on windows 8 and 8.1
package for making the script in MiKTeX colorful
https://latex.org/forum/viewtopic.php?f=56&t=6921

The latest manual source is here and also check out Help with custom syntax highlighting for TeXworks For regex help the above links to https://www.regular-expressions.info/lookaround.html

  • Maybe to add: On Windows it's AppData, Linux and other operating systems have some configuration directory in the home folder. – TeXnician Nov 25 '18 at 13:06
  • @TeXnician Thanks after answering I saw your main comment where a Linux path was shown but will add that to my answer. – user170109 Nov 25 '18 at 13:09
  • Thanks, it's more complete that way. Although I wonder if we have some extensive answer on configuring TeXworks syntax highlighting… – TeXnician Nov 25 '18 at 13:20
  • @TeXnician Thanks for constructive comments, feel free to edit as you see fit. – user170109 Nov 25 '18 at 14:26
  • 1
    No, that was really more a comment than anything else as I do not have any post in mind that would fit the description but I would not exclude the possibility that we have some post on the site that shows how to do syntax highlighting adjustments in TeXworks. – TeXnician Nov 25 '18 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.