Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

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".

share|improve this answer

Your Answer

 
discard

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.