# Tikz Externalize: How to remove PDF filename from figure

I have coded graphics in a LaTeX report using TikZ and have externalized them. When the generated PDF files for the graphics are included in the PDF of the report, the filename of each figure is included in each graphic. How can I ensure that the filename does not appear?

I am have included the TikZ externalize library using \usetikzlibrary{external} and am wrapping each TikZ picture using \beginpgfgraphicnamed{filename} and \endpgfgraphicnamed{filename}, where filename is the name of the graphic file created. For example:

\begin{figure}[!h]
\centering
\beginpgfgraphicnamed{causaldiagram}
\begin{tikzpicture}

... tikz code here

\end{tikzpicture}
\endpgfgraphicnamed{causaldiagram}
\caption{Causal diagram example.}
\label{fig:causal_diagram_example}
\end{figure}

-

The correct syntax is (from the pgf manual, §80.2 p. 651-652 for version 2.10)

\beginpgfgraphicnamed{graphic-of-flat-world}
\begin{tikzpicture}
\fill (0,0) circle (1cm);
\end{tikzpicture}
\endpgfgraphicnamed


You should replace \endpgfgraphicnamed{causaldiagram} with \endpgfgraphicnamed.

The reason why the filename appears in your document is that the command \endpgfgraphicnamed does not accept arguments, so it is executed and then latex encounters {causaldiagram} which is a perfectly valid chunk of latex which gives the text "causaldiagram".

-