[Tex/LaTex] How to use minted under MikTeX and Windows 7


According to minted documentation:

Windows support is sketchy / untested at the moment. There are two
complications: installation and usage…….

This question seeks a step by step elaboration of

How to setup minted for use with MikTeX under Windows?

Best Answer

minted uses Python pygments library, so you need to:

  • Install Python, choose any version you like: x64 or x86, it better to choose 2.7.5 version.
  • Add Python to PATH:
    • Hold Win and press Pause.
    • Click Advanced System Settings.
    • Click Environment Variables.
    • Append ;C:\Python27 to the PATH variable.
  • Install python-pip.
  • Add ;C:\Python27\Scripts to the PATH variable.
  • pip install pygments to install Pygments (in case you have Perl installed, the full path to pip should be specified, because Perl also has a binary with the same name).

  • Сompile with -shell-escape option enabled:

          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

The result should look like: