Latex brush for Syntax Highlighter Plus Wordpress plugin
I post source code snippets quite often and I use this plugin for syntax highlighting. It works great but it doesn’t support every programming language. For example it lacks Latex support. On the other hand you can define coloring rules for unsupported languages by creating new “brushes”.
Taking advantage of this feature, I’ve defined an extremely simple Latex brush which highlights:
- Latex comments beginning with a percent symbol ‘%’.
- Latex commands beginning with a backslash “\”.
- Some keywords such as ‘if’, ‘else’, etc.
You can download the brush from here.
If you want to see Latex coloring in action, you can take a look at the Latex section of my blog.
Note: I also had to add this line:
'Latex' => array('latex', 'tex'),
…to the SetVariables() function in syntaxhighlighter.php for the new brush to work.
Related posts:






Get Jorge Martinez de Salinas delivered by email
Finally! Great! Took me a while to find this one, probably because I searched for TeX and not for LaTeX. Others commented on the forums that work was done, by never found the completed work.
Anyway, I added your LaTeX highlighter to my list of “all” brushes (bundled and non-bundled alike), hope you don’t mind, of course with due credits: http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/