A friend of mine asked me the other day how ‘pretty printed’ source code can be inserted into wordpress posts. Here’s how:
If you have a self-hosted wordpress server, get the plugin ‘SyntaxHighlighter Evolved’. Defaults work fine. If you have a wordpress.com account, the plugin is already. For LaTeX, you need the ‘WP-Latex’ plugin. After that, you can insert the source code using the syntax
… code here (there is no space after the [ in the lines above and below).
You can get a list of supported languages here. Latex code can be inserted using the syntax:
$ latex 2^x $
Again, no space after the $ in the above code. There you go!