I am trying to set a dark theme in TeXworks on Mac OS. I found the following link

How can I set a dark theme in TeXworks?

showing how we can do in Windows.

But I am not sure we can do the same in Mac, can we? Could anyone tell me how to do it?

  • Which version of MacOS is installed on your system? – Mico Nov 11 '18 at 20:04
  • TeXworks should use the same Qt configuration options on Mac OS. Did you try to use the information given? – TeXnician Nov 11 '18 at 20:05
  • @Mico : My MacOS is Mojave 10.14.1 . – DB225681 Nov 11 '18 at 20:22
  • @TeXnician : The problem is I do not know how to process in MacOS. – DB225681 Nov 11 '18 at 20:23

Regarding the how-to instructions you found in an earlier query, the only thing that's meaningfully different for TeXworks under MacOS compared TeXworks under Windows is the location of the executable program. If your system has MacTeX, if TeXworks was installed along with MacTeX, and if you chose the default folder names throughout, the executable program should be at


The white-on-black instructions should otherwise be exactly the same as in the earlier posting:

  • Create a file called mystyle.css (using, say, TeXworks as the editor) with the following contents:

    QTextEdit {
        background-color: black;  
        color: white;            /* sets the main text color */

    Save this file in the directory where you keep most (or at least some of) your tex files. E.g., I've saved the file to ~/documents/tex. (tex is a directory I created.)

  • Open a command prompt window and type

    /Applications/TeX/TeXworks.app/Contents/MacOS/TeXworks -stylesheet ~/documents/tex/mystyle.css

    It may take a few seconds, but then the TeXworks program should start. At first the interior of the window will be all black because, after all, that's what the css file tells it to show. Once you start typing, the material will show up as white on black.

Happy TeXworking!

  • I use windows not macs but isn't an Alias similar to Shortcut a useful means to avoid repeating the command line typing – user170109 Nov 11 '18 at 20:43
  • 1
    @KJO - The OP indicated that he/she was not very familiar with MacOS. If I embellished my answer with jargon phrases about aliases and the like, I suspect I might create more confusion than illumination. My goal is quite modest: Get the OP off to a good start without creating pointless confusion. Let's see if the OP wants to ask a follow-up question on how one might simplify starting up TeXworks in white-on-black mode. – Mico Nov 11 '18 at 20:49
  • @Mico I am grateful that you answered the questions with such details. I am able to follow it easily and it works. I would like to learn more about what KJO said. How can we simplify the starting up so that I don't have to run the command every time. I looked up on the Internet but I have not found anything useful. – DB225681 Nov 11 '18 at 21:24
  • @DB225681 - I’m delighted my answer was helpful. The topic of writing so-called shell scripts to automate and simplify the running of frequently-used commands under MacOS is not all that closely linked to TeX and friends, though, and I’d therefore off-topic for this site. I would thus like to suggest that you post a new query to stackoverflow, about creating a shell script file under MacOS. – Mico Nov 11 '18 at 21:35
  • 1
    Thanks, Mico. I will try to search using the keywords and if I won't have any luck, I will post in stackoverflow. – DB225681 Nov 11 '18 at 22:04

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.