Quantcast
Channel: How to install syntax highlight package minted on Windows 7? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 7

How to install syntax highlight package minted on Windows 7?

$
0
0

I followed the instruction from this link: http://tug.ctan.org/tex-archive/macros/latex/contrib/minted/

enter image description here

Firstly, I install Python 2.7, then create a folder named Scripts in the directory:

C:\Python27

So I got C:\Python27\ScriptsThen 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,


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>