![并排放置多个表格](https://linux22.com/image/290983/%E5%B9%B6%E6%8E%92%E6%94%BE%E7%BD%AE%E5%A4%9A%E4%B8%AA%E8%A1%A8%E6%A0%BC.png)
我试图将 8 个表(其中 4 个放在一行,另外 4 个放在下面)放在一起,但是由于某种原因,结果并没有我想要的那样。
我想要按以下顺序排列表格
J3 J2 J1 J0 K3 K2 K1 K0
每张都附有标题
但我明白
J3 J3caption K3 K3caption J2 J2caption K2 K2caption ...
\begin{center}
\begin{table}[!htb]
\begin{minipage}{.24\linewidth}
\scalebox{0.5}{
\begin{tabular}{c|cccc}
%J3 table%
\end{tabular}
\selectfont\textit{Tabla J3}
\begin{tabular}{c|cccc}
%K3 table%
\end{tabular}
\selectfont\textit{Tabla K3}
\end{minipage}
\begin{minipage}{.24\linewidth}
\scalebox{0.5}{
\begin{tabular}{c|cccc}
%J2 table%
\end{tabular}
\selectfont\textit{Tabla J2}
\begin{tabular}{c|cccc}
%K2 table%
\end{tabular}
\selectfont\textit{Tabla K2}
}
\end{minipage}
\begin{minipage}{.24\linewidth}
\scalebox{0.5}{
\begin{tabular}{c|cccc}
%J1 table%
\end{tabular}
\selectfont\textit{Tabla J1}
\begin{tabular}{c|cccc}
%K1 table%
\end{tabular}
\selectfont\textit{Tabla K1}
}
\end{minipage}
\begin{minipage}{.24\linewidth}
\scalebox{0.5}{
\begin{tabular}{c|cccc}
%J0 table%
\end{tabular}
\selectfont\textit{Tabla J0}
\begin{tabular}{c|cccc}
%K0 table%
\end{tabular}
\selectfont\textit{Tabla K0}
}
\end{minipage}
\end{table}
\end{center}
我肯定遗漏了一些小细节。由于我是 LaTeX 新手,我不知道如何修复它。
答案1
空行表示段落中断,它必然会垂直堆叠内容(彼此叠放),而不是水平堆叠内容(彼此相邻)。以下是另一种视图,使用supcaption
包裹:
\documentclass{article}
\usepackage{subcaption}
\begin{document}
\begin{table}[!htb]
\subcaptionbox{J3}[.25\linewidth]{%
\begin{tabular}{|c|}
J3
\end{tabular}}%
\subcaptionbox{J2}[.25\linewidth]{%
\begin{tabular}{|c|}
J2
\end{tabular}}%
\subcaptionbox{J1}[.25\linewidth]{%
\begin{tabular}{|c|}
J1
\end{tabular}}%
\subcaptionbox{J0}[.25\linewidth]{%
\begin{tabular}{|c|}
J0
\end{tabular}}%
\bigskip
\subcaptionbox{K3}[.25\linewidth]{%
\begin{tabular}{|c|}
K3
\end{tabular}}%
\subcaptionbox{K2}[.25\linewidth]{%
\begin{tabular}{|c|}
K2
\end{tabular}}%
\subcaptionbox{K1}[.25\linewidth]{%
\begin{tabular}{|c|}
K1
\end{tabular}}%
\subcaptionbox{K0}[.25\linewidth]{%
\begin{tabular}{|c|}
K0
\end{tabular}}%
\caption{A set of 8 tables.}
\end{table}
\end{document}
界面\subcaptionbox{<sub-caption>}[<width>]{<stuff>}
(最小化)设置了<stuff>
一个宽度为 的框<width>
,其中有一个带编号的子标题<sup-caption>
。如果您不想要带编号的子标题,请使用\subcaptionbox*
。