用箭头连接两张 tikz 图片

问题描述

我正在尝试绘制一个箭头来链接这两张图片并演示旋转。我可以用这个小创意来做到这一点,还是需要以不同的方式绘制它们?

Rotation function g

\begin{minipage}{0,5\textwidth}
\begin{center}
\begin{tikzpicture}
\draw (0,2)--(0,-2);
\draw (-2,0)--(2,0);
\newdimen\R
\R=1.5cm
   \draw (36:\R)
   \foreach \x in {36,108,180,252,324} {  -- (\x:\R) }
 -- cycle (36:\R) node[right] {4}
-- cycle (108:\R) node[above] {5}
 -- cycle (180:\R) node[below] {1}
-- cycle  (252:\R) node[below] {2}           -- cycle  (324:\R) node[right] {3};
\end{tikzpicture}
\end{center}
\end{minipage} 
\begin{minipage}{0,324} {  -- (\x:\R) }
 -- cycle (36:\R) node[right] {3}
-- cycle (108:\R) node[above] {4}
 -- cycle (180:\R) node[below] {5}
-- cycle  (252:\R) node[below] {1}           -- cycle  (324:\R) node[right] {2};
\end{tikzpicture}
\end{center}
\end{minipage}

解决方法

理论上您可以使用 tikzmark 库在两个小页面之间绘制箭头,但我认为将两个绘图放在一个 tikzpicture 中更容易:

\documentclass{article}

\usepackage{tikz}


\begin{document}

\begin{center}
\begin{tikzpicture}

\begin{scope}
  \draw (0,2)--(0,-2);
  \draw (-2,0)--(2,0);
  \newdimen\R
  \R=1.5cm
     \draw (36:\R)
     \foreach \x in {36,108,180,252,324} {  -- (\x:\R) }
   -- cycle (36:\R) node[right] {4}
  -- cycle (108:\R) node[above] {5}
   -- cycle (180:\R) node[below] {1}
  -- cycle  (252:\R) node[below] {2}           -- cycle  (324:\R) node[right] {3};
\end{scope}

\begin{scope}[xshift=6cm]
  \draw (0,324} {  -- (\x:\R) }
   -- cycle (36:\R) node[right] {3}
  -- cycle (108:\R) node[above] {4}
   -- cycle (180:\R) node[below] {5}
  -- cycle  (252:\R) node[below] {1}           -- cycle  (324:\R) node[right] {2};
\end{scope}

\draw[red,<->] (2.3,0) -- (3.8,0);

\end{tikzpicture}
\end{center}

\end{document}

enter image description here