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?

5
  • 2
    See perhaps tex.stackexchange.com/questions/28528/…
    – Joseph Wright
    Jan 4, 2012 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. Jan 4, 2012 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 5, 2012 at 2:02
  • Closed as a 'reverse dupe': we've now got a proper answer for the general case.
    – Joseph Wright
    Sep 18, 2012 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, 2012 at 7:10

1 Answer 1

16

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
3
  • In addition to @jon 's comment it did the trick.
    – f4lco
    Jan 5, 2012 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 5, 2012 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! Mar 25, 2019 at 15:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.