Yesterday I found my old thesis and found out that there is a new version of minted (2.0+) which somehow don't want to work with my old thesis since all the listings were not highlighted.
Unfortunately there is in my opinion a problem which depends on the location of the \tikzexternalize
command. If this command is located before \usepackage{minted}
my listings won't get highlighted at all. Putting \usepackage{minted}
before the \tikzexternalize
works though. Using the old \usepackage{minted1}
also works fine. So it seems to be a problem with minted 2.0+ only.
Here is a MWE for the problem (see commented lines):
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{pgf,tikz}
\usetikzlibrary{external}
\tikzset{external/system call={pdflatex --shell-escape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}
% Loading minted here and everything is fine
%\usepackage{minted}
\tikzexternalize
% Loading minted here will result in no highlighting
\usepackage{minted}
\begin{document}
\begin{tikzpicture}
\draw (0,0) --(1,2) -- (2,3) -- (1,0);
\end{tikzpicture}
\begin{minted}[frame=none,fontsize=\small,linenos=true]{c}
int main(int argc, char*argv[])
{
(void) printf("Hello World\n");
return EXIT_SUCCESS;
}
\end{minted}
\end{document}
So my question: Is this behaviour normal or intended?
Some information about the setup I am using:
MikTeX version: miktex-2.9.5721
Minted version: 2015/09/09 v2.1 Yet another Pygments shim for LaTeX
Python version: Python 3.5.0
Pygments version: Pygments version 2.0.2, (c) 2006-2014 by Georg Brandl.
And for building my thesis I use (under windows 8)
pdflatex --shell-escape --enable-write18 mwe
\tikzexternalrealjob
is probably set directly after\tikzexternalize
and not only when the figures are externalized?\tikzexternalrealjob
is defined but also look into its content. But I wasn't successful yet. I think at least it is good that this problem can be found by using google now very easy. Unfortunately it took me one to two hours to find the cause for the non-highlighting problem in my two year old thesis template.