定义两个图形之间的节点

定义两个图形之间的节点

我想要两个图形之间的一个箭头,我知道我可以使用 Tikz 来实现,但是我如何定义图形之间中间点的坐标。

  \documentclass{beamer}
   \usepackage{tikz}
 \begin{document}
\begin{frame}{Advantages Vs. a Word processor}
 \underline{How dose it look like?} \\ \vspace{1em}

            \begin{columns}[T,onlytextwidth]
            \begin{column}{.4\textwidth}
            {\tikz\node[coordinate](start1){};}
            \includegraphics[scale=0.17]{Lat001.png}
            
            
\end{column}
  
 \documentclass{beamer}
 \begin{column}{.4\textwidth}
{\tikz\node[coordinate](end1){};}
     \includegraphics[width=15cm,
  height=5cm,
  keepaspectratio]{Lat002.png}       
            \end{column}
            \end{columns}
            
           % \begin{tikzpicture}[overlay, remember picture, -latex, color=blue!15!red, 
% yshift=1ex, shorten >=1pt, shorten <=1pt, line width=0.1cm]
  % \path[->] (start1) edge [out=150, in=240] (end1);
%\end{tikzpicture}
\end{frame}
 \end{document}

答案1

当然,这取决于你想在这张幻灯片上放什么,但我不会columns为图像使用环境。相反,我会把两幅图像放在一个tizpicture环境中。这样做很容易在它们之间画一个箭头:

\begin{tikzpicture}
  \node (start1) at (0,0) {\includegraphics[scale=0.17]{example-image-a}};
  \node (end1) at   (10,0) {
    \includegraphics[width=15cm, height=5cm, 
        keepaspectratio=0.17]{example-image-b}
  };
  \draw[thick, ->](start1.east)--(end1.west);
\end{tikzpicture}

如果你确实需要将图像放在columns环境中,那么你可以使用蒂克兹马克

\begin{columns}[T,onlytextwidth]
  \begin{column}{.4\textwidth}
     \tikzmarknode{start2}{
       \includegraphics[scale=0.17]{example-image-a}
     }
  \end{column}
  \begin{column}{.4\textwidth}
    \tikzmarknode{end2}{
      \includegraphics[width=15cm, height=5cm, 
          keepaspectratio=0.17]{example-image-b}
    }
    \tikz[remember picture,overlay]{
       \draw[thick, ->](start2.east)--(end2.west);
    }
  \end{column}
\end{columns}

这两种方法的结果是:

在此处输入图片描述

当然,你需要使用真实图像来微调图像的位置和大小。这里我使用了姆韦包。以下是完整代码:

\documentclass{beamer}
\usepackage{tikz}
\usepackage{mwe}
\usetikzlibrary{tikzmark}

\begin{document}

  \begin{frame}{Advantages Vs. a Word processor}
    \underline{How does it look like?} \\ \vspace{1em}

   \begin{tikzpicture}
     \node (start1) at (0,0) {
       \includegraphics[scale=0.17]{example-image-a}
     };
     \node (end1) at   (10,0) {
        \includegraphics[width=15cm, height=5cm, 
            keepaspectratio=0.17]{example-image-b}
     };
     \draw[thick, ->](start1.east)--(end1.west);
   \end{tikzpicture}

  \end{frame}

  \begin{frame}[fragile]{Advantages Vs. a Word processor}
    \underline{How does it look like?} \\ \vspace{1em}

    \begin{columns}[T,onlytextwidth]
      \begin{column}{.4\textwidth}
         \tikzmarknode{start2}{
            \includegraphics[scale=0.17]{example-image-a}
         }
      \end{column}
      \begin{column}{.4\textwidth}
        \tikzmarknode{end2}{
          \includegraphics[width=15cm, height=5cm,
                  keepaspectratio=0.17]{example-image-b}
        }
        \tikz[remember picture,overlay]{ 
           \draw[thick, ->](start2.east)--(end2.west); 
        }
      \end{column}
    \end{columns}

  \end{frame}

 \end{document}

相关内容