I followed the instruction from this link: http://tug.ctan.org/tex-archive/macros/latex/contrib/minted/
Firstly, I install Python 2.7, then create a folder named Scripts
in the directory:
C:\Python27
So I got C:\Python27\Scripts
Then I create a file named pygmentize.cmd
with the content:
@echo offset PYTHONPATH=C:\Python27%PYTHONPATH%\python.exe %PYTHONPATH%Scripts\pygmentize %*
At this point, I already set the path
environment variable to C:\Python27
and C:\Python27\Scripts
.
Next I installed setuptools-0.6c11.win32-py2.7.exe (md5)
from http://pypi.python.org/pypi/setuptoolsAnd install Pygments
with the following command
easy_install Pygments
Next I include the line \usepackage{minted}
to let TexMaker do the installation.
Inside TexMaker, I also change the PdfLaTex
option to:pdflatex -shell-escape -interaction=nonstopmode %.tex
Then I tried out a simple example:
\documentclass[12pt,letterpaper]{article}\usepackage[latin1]{inputenc}\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry} \usepackage{amsmath}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{minted}\begin{document} \begin{minted}{python} def boring(args = None): pass \end{minted}\end{document}
And the compiler generated these error:
!Emergency stop.<read 2> \TestAppExists{pygmentize}!==> Fatal error occured, no output PDF file produced!
I guessed the pygmentize
was not installed properly so TexMaker wasn't able to run it. I read the instruction over, and couldn't figure out what could cause these errors? Has anyone done it before could share me some lights?
Thank you,