如何在两个表之间添加箭头?
\documentclass[english]{IEEEtran}
\usepackage{booktabs}
\begin{document}
\begin{table*}[!htb]
\large\setlength{\tabcolsep}{0.1pt}
\begin{minipage}{0.5\linewidth}
\centering
\caption{First Table}
\label{tab:first_table}
\medskip
\begin{tabular}{ccc}
\toprule
\textbf{Start} & \textbf{Interval Time} & \textbf{Destination} \\
\midrule
Zone 1 & $483$ & Zone 2 \\
Zone 1 & $848$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
\bottomrule
\end{tabular}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
\centering
\caption{Second Table}
\label{tab:second_table}
\medskip
\begin{tabular}{ccc}
\toprule
\textbf{Start} & \textbf{Interval Time} & \textbf{Destination} \\
\midrule
Zone 1 & $483$ & Zone 2 \\
Zone 1 & $848$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
Zone 1 & $121$ & Zone 4 \\
Zone 2 & $13$ & Zone 3 \\
\bottomrule
\end{tabular}
\end{minipage}\hfill
\end{table*}
\end{document}
答案1
这很简单,你需要在第一个表格后添加一个 \Rightarrow。因为我有时间做这件事,所以它如下:
\begin{minipage}{0.5\linewidth} \centering \caption{First Table} \label{tab:first_table} \medskip \begin{tabular}{ccc} \toprule \textbf{Start} & \textbf{Interval Time} & \textbf{Destination} \\ \midrule Zone 1 & $483$ & Zone 2 \\ Zone 1 & $848$ & Zone 3 \\ Zone 1 & $121$ & Zone 4 \\ Zone 2 & $13$ & Zone 3 \\ Zone 1 & $121$ & Zone 4 \\ Zone 2 & $13$ & Zone 3 \\ Zone 1 & $121$ & Zone 4 \\ Zone 2 & $13$ & Zone 3 \\ \bottomrule \end{tabular} \end{minipage} $\Rightarrow$
答案2
使用tikzmark
,编译两次。
箭头位于表格(垂直)中间,包括标题。如果您希望垂直对齐方式仅位于表格内容的中间(不包括标题),则可以更改垂直对齐方式。
我还对表格布局做了一些改进(但我认为>{$}c<{$}
根本不需要数字)。
\documentclass[english]{IEEEtran}
\usepackage{array}
\renewcommand{\arraystretch}{1.2}
\newcolumntype{C}{>{$}c<{$}}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{tikz}
\usetikzlibrary{tikzmark, shapes.arrows}
\usepackage{caption}
\begin{document}
\begin{table*}
\large
\begin{minipage}{0.5\linewidth}
\centering
\caption{First Table}
\label{tab:first_table}
\tikzmarknode{A}{%contents
\begin{tabular}{cCc}
\toprule
\textbf{Start} & \makecell{\textbf{Interval}\\ \textbf{Time}}
& \textbf{Destination}
\\
\midrule
Zone 1 & 483 & Zone 2 \\
Zone 1 & 848 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
\bottomrule
\end{tabular}}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
\centering
\caption{Second Table}
\label{tab:second_table}
\tikzmarknode{B}{%contents
\begin{tabular}{ccc}
\toprule
\textbf{Start} & \makecell{\textbf{Interval}\\ \textbf{Time}}
& \textbf{Destination}
\\
\midrule
Zone 1 & 483 & Zone 2 \\
Zone 1 & 848 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
\bottomrule
\end{tabular}}
\end{minipage}
\begin{tikzpicture}[remember picture, overlay]
\path (A) -- node[draw, text width=3em, single arrow, thick, red]{} (B);
\end{tikzpicture}
\end{table*}
\end{document}
编辑:先前的解决方案需要 2018/10/18 起的 v1.6 tikzmark
(或最新版本)。
对于使用旧版本的用户,这里有一个纯 TikZ 解决方案:
\documentclass[english]{IEEEtran}
\usepackage{array}
\renewcommand{\arraystretch}{1.2}
\newcolumntype{C}{>{$}c<{$}}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{table*}
\large
\begin{minipage}{0.5\linewidth}
\centering
\caption{First Table}
\label{tab:first_table}
\tikz[remember picture]{\node[inner sep=0pt, outer sep=0pt](A){%contents
\begin{tabular}{cCc}
\toprule
\textbf{Start} & \makecell{\textbf{Interval}\\ \textbf{Time}}
& \textbf{Destination}
\\
\midrule
Zone 1 & 483 & Zone 2 \\
Zone 1 & 848 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
\bottomrule
\end{tabular}}}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
\centering
\caption{Second Table}
\label{tab:second_table}
\tikz[remember picture]{\node[inner sep=0pt, outer sep=0pt](B){%contents
\begin{tabular}{ccc}
\toprule
\textbf{Start} & \makecell{\textbf{Interval}\\ \textbf{Time}}
& \textbf{Destination}
\\
\midrule
Zone 1 & 483 & Zone 2 \\
Zone 1 & 848 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
Zone 1 & 121 & Zone 4 \\
Zone 2 & 13 & Zone 3 \\
\bottomrule
\end{tabular}}}
\end{minipage}
\begin{tikzpicture}[remember picture, overlay]
\path (A) -- node[draw, text width=3em, single arrow, thick, red]{} (B);
\end{tikzpicture}
\end{table*}
\end{document}