[OS X TeX] Syntax & Index coloring in TeXShop

Herbert Schulz herbs at wideopenwest.com
Wed Aug 28 21:51:55 CEST 2013


Howdy,

Searching for `syntax coloring' (without the quotes) in TeXShop's Help Panel gives the following:

********
When syntax coloring turned on in the source window, comments will be colored red, commands will be colored blue, and the symbols $, {, and } will be colored dark green. A few users may wish to change these colors. Each color is determined by setting its red, green, and blue components; these components are real numbers between 0.0 and 1.0. Suppose we wish to change the color of $, {, and } to bright green, a color with components (r, g, b) = (0.0, 1.0, 0.0). To do so, open the Terminal window and type the following commands

defaults write TeXShop markerred 0.0
defaults write TeXShop markergreen 1.0
defaults write TeXShop markerblue 0.0

The corresponding preference items for comments are commentred, commentgreen, commentblue; the items for commands are commandred, commandgreen, commandblue.
********

So you can customize the colors for syntax colors. It turns out you can do a similar thing with the color of the `\index{text}' command when the IndexColor checkbox is installed on the Source toolbar and checked. The variables are indexred, indexgreen and indexblue.

As an example I'll use the colorizing I prefer since I find the default colors a bit too bright and jarring to my eyes. I enclose a screen shot with examples from my color set. 



Notice that I prefer a light gray for comments since it makes them recede into the background a bit and deeper colors for commands and delimiters. Finally, I've used an even lighter gray for \index commands, when ColorIndex is turned on, to make it recede even further into the background and is still readable.

And here are my settings:

For commands:
commandblue    0.8
commandgreen   0.0
commandred     0.0

For comments:
commentblue    0.5
commentgreen   0.5
commentred     0.5

For delimiters:
markerblue     0.13
markergreen    0.53
markerred      0.02

For colored index commands:
indexblue      0.8
indexgreen     0.8
indexred       0.8

Before applying these close TeXShop and save your original TeXShop.plist file, which contains TeXShop's Preferences, so you can return to your previous settings if things go wrong. That file is in ~/Library/Preferences. NOTE: ~/Library is the Library folder in your HOME folder --- NOT the /Library folder at the root of your Hard Drive. NOTE2: under OS X 10.7 and 10.8 (and I assume 10.9 too) ~/Library is hidden by default in Finder; to open ~/Library hold the Opt key down while you clock on the Go menu in Finder and an new item to open ~/Library will appear.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20130828/96c53bb8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyColors.png
Type: image/png
Size: 16650 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20130828/96c53bb8/attachment.png>


More information about the macostex-archives mailing list