I'm somewhat familiar with all the common packages that use Pygments. As part of writing my
pythontex package, I researched what had been done previously.
texments is pretty basic. It doesn't provide access to much of Pygments or
minted provides much more complete access to Pygments and
fancyvrb, and adds additional functionality like background colors.
verbments is more recent than
minted, which probably explains why it is apparently less popular. The
verbments documentation says that "the
minted package cannot split the highlighted source code over pages." Technically,
minted can do that fine--the problem is with the
listing float that
minted provides. (Edit: There are also page break issues when a background color is used, but those can be overcome by not using the package's
bgcolor option and using
mdframed or a similar package instead.) The
verbments solution is to allow listing numbering and captions--but without providing a real float (which would have to solve the page break problem).
verbments also provides individual highlighting styles (you can use different Pygments styles for each environment) and a few additional options that
pygmentex is yet another Pygments package (2012-02-12). It includes custom patches for Pygments to allow escaping to LaTeX anywhere. That is nice, but may also make maintenance difficult as Pygments continues to develop. (That feature has been requested in Pygments since early 2010, and is still open.)
pygmentex provides an inline command. And it caches output.
And finally, there's my
pythontex package. (First release 2012/04/27, but in development for the previous year.) Its main purpose is to allow Python code to be included in a LaTeX document, with a means to execute the code and bring back the output. Adding Pygments highlighting was actually something of an afterthought.
pythontex provides most of
minted's functionality, except for a few things like background colors (since these can be so easily added with packages like
mdframed). It caches all highlighted content, using the mechanism I'd already created for caching the output of executed code. It also provides an inline command, allows automatic line number continuation between environments of the same language, and allows
fancyvrb settings on a per-language basis. Unicode is supported with the pdfTeX engine.
So this leaves us with many options for Pygments highlighting. Caching is really important for performance, but the downside is that both my approach and the
pygmentex approach require compiling (which saves code to an auxiliary file), running a Python script (which uses Pygments to do the highlighting, then saves the output), and compiling a second time (which brings back the highlighted output). One of the really nice things about the
\write18 approach used by the other packages is that the highlighting is always up-to-date and only requires a single compile. It probably wouldn't be hard to cache and keep everything up-to-date using LuaTeX. Otherwise, I would think about
\pdfmdfivesum (possibly with temp files), except that I don't believe XeTeX has an equivalent. There may not be a good cross-engine alternative to the three-step process.
pythontex is under active development and should continue to provide Pygments highlighting for the foreseable future. While the focus is access to Python, I'm in the midst of a major refactoring that should allow the package to be extended for arbitrary languages, with only a few dozen lines of code needed per extension. The disadvantage of all this is that
pythontex isn't quite as nimble as a highlighting-only package.
Edit: After corresponding with Konrad Rudolph, I have decided to maintain
minted. Development will be at https://github.com/gpoore/minted.