17

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?

f4lco
  • 273
  • 2
    See perhaps http://tex.stackexchange.com/questions/28528/best-way-to-install-packages-for-texlive-in-ubuntu – Joseph Wright Jan 04 '12 at 22:01
  • Did you notice the documentation file? It contains a fairly detailed installation instruction. If you’ve got stuck at a particular command, we can certainly help. – Konrad Rudolph Jan 04 '12 at 23:31
  • 2
    If you installed LaTeX from the repositories (e.g., using apt-get), then it is quite likely that you could copy the file to /usr/share/texmf-texlive/tex/latex/ and then run the command sudo texhash in a terminal. (Note that I've neither installed nor used minted.) I recommend you look at the FAQ for better/fuller advice. – jon Jan 05 '12 at 02:02
  • Closed as a 'reverse dupe': we've now got a proper answer for the general case. – Joseph Wright Sep 18 '12 at 14:34
  • 2
    more hints. minted is inside package "texlive-latex-extra" in Ubuntu version - Quantal (12.10), while it doesn't exist in previous ubuntu release. Which you need install .sty directly – larrycai Oct 20 '12 at 07:10

1 Answers1

17

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
cmhughes
  • 100,947
  • In addition to @jon 's comment it did the trick. – f4lco Jan 05 '12 at 13:29
  • @phineas Glad it worked :) The TeXLive in the repositories is out of date- best to go with the instructions in the linked question. – cmhughes Jan 05 '12 at 16:47
  • After I did what @cmhughes suggested my pdflatex stop working. Here is the error message: ktexpk: `mf-nowin -progname=mf \mode:=ljfour; mag:=1+37/600; nonstopmode; input tcit0800' failed. kpathsea: Appending font creation commands to missfont.log. (see the transcript file for additional information) !pdfTeX error: pdflatex (file tcit0800): Font tcit0800 at 637 not found ==> Fatal error occurred, no output PDF file produced! – Herman Jaramillo Mar 25 '19 at 15:56