My favorites | Sign in
Project Home Downloads Issues Source
Project Information
Members
Featured
Downloads
Links

minted – highlighted source code for LaTeX

minted is a package that facilitates expressive syntax highlighting in LaTeX using the powerful Pygments library. The package also provides options to customize the highlighted source code output using fancyvrb.

For instance, this code:

\begin{minted}[mathescape,
               linenos,
               numbersep=5pt,
               gobble=2,
               frame=lines,
               framesep=2mm]{csharp}
  string title = "This is a Unicode π in the sky"
  /*
  Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
  of an $n$-sided regular polygon circumscribing a
  circle of diameter $d$.
  */
  const double pi = 3.1415926535
\end{minted}

will produce the following rendering:

See the documentation for examples and instructions of installation and usage.

Availability

minted is distributed with both TeX Live and MikTeX. It is also available from CTAN (see below). In any case, Pygments needs to be installed separately. The documentation contains information on how to do that.

Powered by Google Project Hosting