[Tex/LaTex] How to install minted in Ubuntu


Possible Duplicate:
How do I install an individual package on a Linux system?

I'm very new to Latex and have understood basic concepts. Now I would like to get syntax highlighting. minted seems to be best choice according to Google but I you don't find detailed instructions on how to install it on a Ubuntu machine (and it is not included in any package).
I'm a bit stuck after generating the minted.sty file. What steps to take next?

Best Answer

Update for Ubuntu 20.04: see I can't get minted package to work under Ubuntu (pygments error)

old answer (not recommended, see above link)

  • In Ubuntu minted is included in texlive-latex-extra package

      sudo apt-get install texlive-latex-extra 
  • Or you can install minted manually, as mentioned in the comments.

Best way to install packages for TeXLive in Ubuntu?

Once you have minted installed (which comes by default with TeXLive), you'll need python-pygments

sudo apt-get install python-pygments

If you want to run your file with pdflatex, then you need to so with shell-escape

pdflatex -shell-escape myfile.tex

The documentation has this, and more information.

texdoc minted