Monday, September 19, 2011

TexShop coloring

From version 3.06 (Lion) it is possible to have different background and foreground colors in TexShop.

You can select the background colors from Preference dialog box. However, other colors must be
specified at command line.

defaults write foreground_R 1
default write foreground_B 1
default write foreground_G 1
will make the font color to white.

The background color can be changed from TexShop Preferences window.

defaults write TexShop commandblue 1
defaults write TexShop commandred 0
defaults write TexShop commandgreen 1
will make the command color to cyan.

To change the cursor color to white do
defaults write TexShop insertionpoint_R 1
defaults write TexShop insertionpoint_G 1
defaults write TexShop insertionpoint_B 1

defaults write TexShop commentred 0
defaults write TexShop commentblue 0
defaults write TexShop commentgreen 1
will make the comment color to lime green.

These are RGB decimal color codes. To obtain those values divide RGB colors from 255.
Here is a list of RGB colors.

TexShop documentation where these color preferences are mentioned can be seen here.

Thursday, September 1, 2011

pygmentize

Install pygmentize by

sudo easy_install Pygments

quick start (copied from the official Web site)



You can use Pygments from the command line, using the pygmentize script:
$ pygmentize test.py
will highlight the Python file test.py using ANSI escape sequences (a.k.a. terminal colors) and print the result to standard output.
To output HTML, use the -f option:
$ pygmentize -f html -o test.html test.py
to write an HTML-highlighted version of test.py to the file test.html. Note that it will only be a snippet of HTML, if you want a full HTML document, use the "full" option:
$ pygmentize -f html -O full -o test.html test.py
This will produce a full HTML document with included stylesheet.
A style can be selected with -O style=.
If you need a stylesheet for an existing HTML file using Pygments CSS classes, it can be created with:
$ pygmentize -S default -f html > style.css

Continuously monitor GPU usage

 For nvidia GPUs do the follwing: nvidia-smi -l 1