# How do I get tikzpictures to overlap on the same page?

I have two complex TikZ drawings that need to overlap (appear on the same page). I can't put them into one tikzpicture, because different scale parameters need to be applied to them. Minimal example:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}
\begin{document}
\begin{tikzpicture}[inner sep=0pt, outer sep=0pt, scale=2]
\node (image) {\includegraphics{example-image}};
\fill [white]
\end{tikzpicture}
\begin{tikzpicture}[overlay, remember picture, scale=1]
\fill [red]
\end{tikzpicture}
\end{document}


This is what I get:

This is what I actually need:

The overlay option doesn't seem to work as expected. Using (current page.center) in the second tikzpicture doesn't work either. What am I doing wrong?

• Do you really need to use a second tikzpicture? Oct 9 '18 at 16:07
• Yes. :( As I explained, I need to use a different scale for each figure. Oct 9 '18 at 16:08
• You can use a single one and use \begin{scope}[scale=2] \end{scope} instead of duplicate the scale in the whole figure. Oct 9 '18 at 16:10
• Sounds good! Care to make that an answer? Oct 9 '18 at 16:11

You can superpose two different tikzpicures if you have some reference from the first one. In this case, as you already have a image node in your first picture, just adding remember picture option to it, this image node will be available outside of it. Therefore, you can use it as reference inside the second tikzpicture.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}
\begin{document}
\begin{tikzpicture}[inner sep=0pt, outer sep=0pt, scale=2, remember picture]
\node (image) {\includegraphics{example-image}};
\fill [white]
\end{tikzpicture}
\begin{tikzpicture}[overlay, remember picture, scale=1]
\fill [red]
\end{tikzpicture}
\end{document}


• This answers the exact question in the title, although @Sigur has the better approach to my specific problem. Oct 9 '18 at 18:44

You can use a single tikzpicture and put everything you want to scale inside a scope environment.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}
\begin{document}
\begin{tikzpicture}[inner sep=0pt, outer sep=0pt]
\begin{scope}[scale=2]
\node (image) {\includegraphics{example-image}};