[Tex/LaTex] I can’t get minted package to work under Ubuntu (pygments error)

mintedtexliveUbuntu

I'm currently using ubuntu13.10, TeXlive and Texmaker editor, and I found out that minted package is the best way to get source code highlighting on LaTeX.

So I installed python-pygments via terminal (sudo apt-get install python-pygments), it actually installed correctly, but when I start Texmaker and type \usepackage{minted} the log displays:

! Package minted Error: You must invoke LaTeX with the -shell-escape
flag.

! Package minted Error: You must have `pygmentize' installed to use
this packag e.

and it gives me this error as well:

LaTeX Error: File `mytexts.pyg' not found.

I'd appreciate some help on that, I'm learning C atm and minted would be really helpful.

EDIT:

Mmm, I chek out tm settings>fast comp. and I have selected latex + dvips + ps2pdf + see pdf option, so I should add the -shell-escape line to dvips at settings>commands or to ps2pdf or both of them?

That's what I'm not really getting, where I should add the shell escape lines…

(python-pigments + texlive are already installed)

thanks

Best Answer

with running apt-cache search pygments you'll get the needed packages:

voss@ubuntu:~$ apt-cache search pygments
python-pygments - syntax highlighting package written in Python
python-sphinx - documentation generator for Python projects (implemented in Python 2)
python3-pygments - syntax highlighting package written in Python 3
python3-sphinx - documentation generator for Python projects (implemented in Python 3)
texlive-latex-extra - TeX Live: LaTeX additional packages
python-django-debug-toolbar - Embedded debugging toolbar for Django projects
ruby-albino - Ruby wrapper for pygmentize
trac-wikiprint - Make Trac wiki pages printable, exporting to PDF or printable HTML

Install the package(s) with

voss@ubuntu:~$ sudo apt-get install python-pygments

and maybe that you also need to install the texlive package. Anf when everything is installed you need the pdflatex --shell-escape <file> command

Related Question