Latex并排摆放两张表格

本文详细介绍了一种在Latex中实现并排摆放两张表格的方法,特别适用于需要在同一行展示两个相关数据集的情况。通过使用minipage环境,可以有效地控制表格的宽度,并确保标题位于表格下方。

Latex并排摆放两张表格

这里自己记录一下Latex并排摆放两张表格的方法,标题在表格的下方。

\begin{minipage}{\textwidth}

\begin{minipage}[t]{0.48\textwidth}
\makeatletter\def\@captype{table}
\begin{tabular}{ccc}
    \toprule
    Name     & Description     & Size ($\mu$m) \\
    \midrule
    Dendrite & Input terminal  & $\sim$100     \\
    Axon     & Output terminal & $\sim$10      \\
    Soma     & Cell body       & up to $10^6$  \\
    \bottomrule
\end{tabular}
\caption{Sample table title}
\label{sample-table}
\end{minipage}
\begin{minipage}[t]{0.48\textwidth}
\makeatletter\def\@captype{table}
\begin{tabular}{ccc}
    \toprule
    Name     & Description     & Size ($\mu$m) \\
    \midrule
    Dendrite & Input terminal  & $\sim$100     \\
    Axon     & Output terminal & $\sim$10      \\
    Soma     & Cell body       & up to $10^6$  \\
    \bottomrule
\end{tabular}
\caption{Sample table title}
\label{sample-table}
\end{minipage}
\end{minipage}

在这里插入图片描述

参考

https://blog.youkuaiyun.com/jogue/article/details/78646397

LaTeX并排插入两张图片可以通过多种方式实现,以下是几种常见的方法。 ### 使用 `minipage` 环境 `minipage` 环境允许在同一行上放置两个独立的图片环境。这种方法不需要额外的宏包,适用于大多数 LaTeX 发行版。 ```latex \begin{figure}[htbp] \centering \begin{minipage}{0.49\linewidth} \centering \includegraphics[width=0.9\linewidth]{Figure/chutian.JPG} \caption{chutian1} \label{chutian1} \end{minipage} \hfill \begin{minipage}{0.49\linewidth} \centering \includegraphics[width=0.9\linewidth]{Figure/chutian.JPG} \caption{chutian2} \label{chutian2} \end{minipage} \end{figure} ``` ### 使用 `subfigure` 宏包 `subfigure` 宏包提供了更灵活的方式来组织图片,允许为每张图片添加子标题,并且可以更容易地控制图片的布局[^4]。 ```latex \usepackage{subfigure} % 在导言区加入此行 \begin{figure*}[htbp] \centering \subfigure[xxx] % (a)小标题 { \begin{minipage}[t]{0.70\linewidth} % 左图分配70% \centering \includegraphics[width=5.0in, height=1.85in]{./img/SOTAv2.pdf} \end{minipage}% }% \subfigure[xxx] % (b)小标题 { \begin{minipage}[t]{0.3\linewidth} % 右图分配30% \centering \includegraphics[width=1.8in, height=1.85in]{./img/PRv1.pdf} \end{minipage}% }% \caption{xxx} % 标题 \label{xx} % 标签 \end{figure*} ``` ### 自定义宽度 如果希望两张图片具有相同的宽度并且占据整个文本宽度,可以使用如下代码: ```latex \begin{figure}[htbp] \begin{minipage}[t]{0.5\linewidth} \centering \includegraphics[width=\textwidth]{Fig3a.png} \centerline{(a) AA} \end{minipage}% \begin{minipage}[t]{0.5\linewidth} \centering \includegraphics[width=\textwidth]{Fig3b.png} \centerline{(b) BB} \end{minipage} \caption{AABB} \end{figure} ``` 这些方法都可以有效地帮助您在 LaTeX 文档中并排插入两张图片。
评论 7
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值