TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use WinShell with PDFLatex on Windows 7. I managed to install Pygmentize and compile the minimum example without errors:




inline: \mint{python}|import this|

int main() {
    printf("hello, world");
    return 0;


However, the output is strange. It shows tex code in the document, which is nicely formatted as if it was Python code:


Any idea how this could happen? Please comment, if more information is needed.


I compile via WinShell, my PDFLatex command line looks like this:

"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" -shell-escape -aux-directory=./.aux -interaction=nonstopmode -synctex=-1 "%s.tex"
share|improve this question
I'm afraid minted is not very well behaving on Windows. – egreg Mar 13 '13 at 16:31
Welcome to TeX.sx! – Peter Jansson Mar 13 '13 at 16:32
This document works fine under Windows--I just compiled it. How are you compiling the document? It looks like the Pygments output is somehow being included in your document verbatim. – G. Poore Mar 13 '13 at 16:46
I added the command line – fschmengler Mar 13 '13 at 17:08
Related:tex.stackexchange.com/questions/112953/… – rowman May 17 '13 at 10:48
up vote 5 down vote accepted

The problem is that MiKTeX's -aux-directory option doesn't work with minted's use of pygmentize. Apparently, this option causes problems with packages that use external programs. See https://code.google.com/p/minted/issues/detail?id=37.

share|improve this answer
Removing the -aux-directory option solved the problem. Thanks a lot! – fschmengler Mar 14 '13 at 7:49
As far as I’m concerned this is a bug in MikTeX: packages have simply no way of getting the path to the aux directory so Pygments is working on the wrong directory. – Konrad Rudolph Mar 17 '13 at 19:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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