Thursday, January 9, 2014

Colored code in org-mode export (Minted way)

In the emacs configuration file, add

(setq org-latex-listings 'minted)

And in the org file, add

#+LATEX_HEADER: \usepackage{minted}
#+LATEX_HEADER: \usepackage{color}

Then minted should work (in principle).

Fixes:

(1) I have to replace the pdflatex command to pdflatex --shell-escape to make it work (as I can read from the org code, seems org tries to add --shell-escape automatically. But on my machine it doesn't work out of the box.)

(2) Add support for Mathematica: Here is the plugin:

https://github.com/benjamin-hodgson/pygments-mathematica

It almost works. But there are a few special operators missing: $, `, !. I added them here and made a pull request.

https://github.com/tririver/pygments-mathematica

The looking is considerably better than Listings way:


No comments:

Post a Comment