I tried to find something as identical as possible to this question but did not find it. If so, please let me know.
I want to connect two nodes that are in different tikzpicture environments through circle connection bar. By default the connection bar code should be close to the tikzpicture environment of the last declared node or isolated to a single tikzpicture but never to the tikzpicture environment of the first declared node, see case 1 and 2. Everything seems (optical illusion?) To work well, but in both cases the nodes do not remain in their original position at either end of the circle connection bar edge, and that is the main issue. Also, if there was a solution it would work for case 3 when using \newpage
?
Case 1:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,quotes}
\begin{document}
\begin{tikzpicture}
\node (energy1) at (30:10cm){motorcycle.1};
\end{tikzpicture}
\begin{tikzpicture}
\node (energy2) at (90:10cm) {motorcycle.2};
\draw[circle connection bar]
(energy1)
edge["USA" {orange ,sloped,above=.5cm,align=center,text width=8cm}]
(energy2)
;
\end{tikzpicture}
\end{document}
Case 2:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,quotes}
\begin{document}
\begin{tikzpicture}
\node (energy1) at (30:10cm){motorcycle.1};
\end{tikzpicture}
\begin{tikzpicture}
\node (energy2) at (90:10cm) {motorcycle.2};
\end{tikzpicture}
\begin{tikzpicture}
\draw[circle connection bar]
(energy1)
edge["USA" {orange ,sloped,above=.5cm,align=center,text width=8cm}]
(energy2)
;
\end{tikzpicture}
\end{document}
Case 3 (with \newpage
):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,quotes}
\begin{document}
\begin{tikzpicture}
\node (energy1) at (30:10cm){motorcycle.1};
\end{tikzpicture}
\newpage
\begin{tikzpicture}
\node (energy2) at (90:10cm) {motorcycle.2};
\end{tikzpicture}
\newpage
\begin{tikzpicture}
\draw[circle connection bar]
(energy1)
edge["USA" {orange ,sloped,above=.5cm,align=center,text width=8cm}]
(energy2)
;
\end{tikzpicture}
\end{document}
As pointed out by @Henri Menke, I present an attempt to use remember picture
and overlay
. I'm not sure exactly how to use these arguments, but after all, I couldn't keep the nodes at either end of it either edges from the circle connection bar
. Am I doing something incorrectly when using these arguments?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,quotes}
\begin{document}
\begin{tikzpicture}
\node [remember picture,overlay]
(energy1) at (30:10cm){motorcycle.1};
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\node (energy2) at (90:10cm) {motorcycle.2};
\end{tikzpicture}
\begin{tikzpicture}
\draw[circle connection bar]
(energy1)
edge["USA" {orange ,sloped,above=.5cm,align=center,text width=8cm}]
(energy2)
;
\end{tikzpicture}
\end{document}
Following @Henrique Menke's note about the above attempt, I have been able to place the nodes at the end circle connection bar
but have not been able to maintain their initial positions, although I have tried to change the coordinates of both nodes to be further and further apart. to check if it was really working or was an "optical illusion".
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,quotes}
\begin{document}
\begin{tikzpicture}[remember picture]
\node [remember picture] (energy1) at (30:30cm){motorcycle.1};
\end{tikzpicture}
\begin{tikzpicture}[remember picture]
\node [remember picture] (energy2) at (90:10cm) {motorcycle.2};
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\draw[circle connection bar,remember picture, overlay]
(energy1)
edge["USA" {orange ,sloped,above=.5cm,align=center,text width=8cm}]
(energy2)
;
\end{tikzpicture}
\end{document}
remember picture
for position-tracking.overlay
tikzpicture
containing(energy1)
and(energy2)
needremember picture
, thetikzpicture
with the connection bar needsremember picture, overlay
.