Latex并排两张表格 分别加入表格说明的方法
\begin{table}[]
\vspace{-1.0cm}
\begin{minipage}[t]{0.45\textwidth}
\centering
\begin{tabular}{l}
\hline
\textbf{ Algorithm 1} SETCOPYRIGHT\\ \hline
\textbf{Input:}ID, copyrigtNum, name, creator, royalty,\\ \hspace*{0.9cm} publisher, buyerAddress, date, supplement\\
1.\textbf{if}(\textit{SetterisCopyrightOwner}) \textbf{then}\\
%省略
11.\textbf{else}\\
12. \hspace*{0.3cm} \textit{alert permission incorrect}\\
13.\textbf{end if}=0\\\hline
\end{tabular}
\caption{Copyright Creation Algorithm }
\label{tab1}
\end{minipage}
\begin{minipage}[t]{0.45\textwidth}
\centering
\begin{tabular}{l}
\hline
\textbf{ Algorithm 2} SEARCHCOPYRIGHT\\ \hline
\textbf{Input:}musicID, CopyrigtNum \\
1.\textbf{if}(\textit{musicIDandCopyrigtNumExists}) \textbf{then}\\
2. \textbf{ Output:} \\
%省略
4.\hspace*{0.5cm} \textit{alert not exists}\\
5.\textbf{end if}=0\\\hline
\end{tabular}
\caption{Copyright Search Algorithm }
\label{tab2}
% \caption{Copyright Search Algorithm }
\end{minipage}
\end{table}
29. 图形与表格的平行排列
通过在一个 figure 环境中使用多个 \caption 命令来得到并列的多个图形。同样地,在一个 table 环境中使用多个 \caption 命令可将多个表格平行排列。 若想使表格和图形平行排列在一起,可使用第 20 章中定义 的命令 \figcaption 和 \tabcaption。 例如下面的命令:
\begin{figure}[htb]
\begin{minipage}[b]{0.5\textwidth}
\centering
\includegraphics[width=0.8\textwidth]{graphic.eps}
\caption{This is a Figure by a Table}
\label{fig:by:table}
\end{minipage}%
\begin{minipage}[b]{0.5\textwidth}
\centering
\begin{tabular}{|c|c|} \hline
Day & Data \\ \hline\hline
Monday & 14.6 \\
Tuesday & 14.3 \\
Wednesday & 14.2 \\
Thursday & 14.5 \\
Friday & 14.9 \\ \hline
\end{tabular}
\tabcaption{This is a Table by a Figure}
\label{table:by:fig}
\end{minipage}
\end{figure}
因为 LATEX 允许图形的浮动不必考虑其前后表格的顺序,所以在 figure 环境中使用命令 \tabcaption 可能会将表格 放置到尚未处理的浮动图形前面。同理,在 table 环境中 使用命令 \figcaption 可能会将图形放置到尚未处理的浮动图形前面。 这种情况下,可以在图形环境前使用 \FloatBarrier 命令来清除 其前面尚未处理的浮动图形。