Saturday, November 5, 2011

Minted: Highlighted source code in LATEX

Minted is a LaTeX package that facilitates expressive syntax highlighting using the powerful Pygments library. The package provides options to customize the highlighted source code output.
The example below shows how C code is highlighted,  and the output is shown at right:



int main()
  printf("hello, world");
  return 0;


Pygments also provides a command line interface pygmentize, among the possible output formats there are HTML, RTF, LaTeX and ANSI sequences.
For command line highlighting a solid alternative to Pygments is GNU Source-highlight.

A couple of on-line highlighters:

No comments:

Post a Comment