I am trying to create a document containing:
- A cover page image (see 1 below this post) set as background using the package
eso-pic
. - Several tikz pictures that I externalize using
\tikzexternalize[up to date check={md5}]
.
Problem: a part of the cover page image is included in the background of the tikz picture.
How can I solve this problem while keeping the externalization?
Following Tom's answer: In my complete document, I use \AddToShipoutPictureBG
inside a macro so I had to set \tikzset{external/optimize command away=\mymacro}
after the macro definition instead of in the \tikzexternalize
command.
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[up to date check={md5}]
\usepackage{eso-pic}
\usepackage{graphicx}
\begin{document}
% Add title image across the complete page
\AddToShipoutPictureBG*{\AtPageLowerLeft{%
\includegraphics[width=\paperwidth,height=\paperheight]{my_picture.jpg}}}
\newpage\null\newpage
\tikzsetnextfilename{tikz_picture}
\begin{tikzpicture}
\draw[red, thick] (-1,2) -- (2,-4);
\draw[red, thick] (-1,-1) -- (2,2);
\filldraw[red] (0,0) circle (2pt) node[anchor=west]{A tikz picture};
\end{tikzpicture}
\end{document}