
2 つの図形の間に矢印を付けたいのですが、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
画像に環境は使いません。代わりに、両方の画像を 1 つの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}
これら 2 つのアプローチにより、次のようになります。
もちろん、実際の画像を使用して画像の配置とサイズを微調整する必要があります。ここでは、ムウェパッケージ。完全なコードは次のとおりです。
\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}