Please see my comment for the motivation.
Here is what I am doing:
\begin{tikzpicture}
\node (a) at (0,0)
{
\input{Diagrams/model1.tex}
};
\node (b) at (a) [anchor=west,xshift=50ex]
{
\input{Diagrams/model2.tex}
};
% connect nodes from these two separate plots that happen to have the same name
\draw [<->] (a.outlier)--(b.outlier);
\end{tikzpicture}
Here is the MWE that simulates this case:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{shapes,positioning,arrows}
\begin{tikzpicture}[node distance=10ex]
\node (a) at (0,0)
{
% please see comment, this picture is actually being imported from a separate .tex file but MWE implements differently because I can't load files in a post:
\begin{tikzpicture}
\node (aSub1) {aSub1};
\node (aSub2) [below of=aSub1] {aSub2};
\node (outlier1) [below of=aSub2] {outlier};
\draw [->] (aSub1) -- (aSub2);
\end{tikzpicture}
};
\node (b) at (a) [anchor=west,xshift=50ex]
{
% please see comment, this picture is actually being imported from a separate .tex file but MWE implements differently because I can't load files in a post:
\begin{tikzpicture}
\node (bSub1) {bSub1};
\node (bSub2) [below of=bSub1] {bSub2};
\node (outlier2) [below of=bSub2] {outlier2};
\draw [->] (bSub1) -- (bSub2);
\end{tikzpicture}
};
\draw [<->] (a)--(b);
% now draw a line between sub-nodes of the two nested pictures where the scope of the two "outlier" nodes is local to the sub-picture
\draw [<->] (outlier1) -- (outlier2); % this doesn't work
\end{tikzpicture}
\end{document}
Output:
What I want:




tikzpictureinside anothertikzpicture. – Sigur Apr 17 '20 at 23:32tikzpictures is not good. – Sigur Apr 17 '20 at 23:37tikzpictureis in a file that you input in a node, it is still a nestedtikzpicture, and thus no good. You can get what you want withpics very easily. (And in principle you can make the stuff above work with somename prefixorname suffix, but it is really bad practice.) – Apr 17 '20 at 23:48