Problem with documentclass memoir + pgfplots from data file

I'm using the documentclass memoir and I want to make a plot from a file.dat of two rows, nothing special. But I keep getting that pgfplots could not open the file. The point is that if I make a new document (article) the plot is generated without problem.

This is the code that works with article but not with memoir:

\begin{tikzpicture}
\begin{axis} []
\end{axis}
\end{tikzpicture}


Can somebody explain me what is happening?

• Could you please provide a complete minimal working example? – SLx64 Jul 25 '14 at 5:15
• It says pdf.dat but you mentioned file.dat. A typo maybe? – percusse Jul 25 '14 at 8:10

I tried this MWE (that you have not provided) and it seems work fine:

% !TEX program = xelatex
% !TEX encoding = utf8

\begin{filecontents*}{pdf.dat}
0 1
1 2
\end{filecontents*}

\documentclass{memoir}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}

\end{document}