CV论文Ablation Study表格Latex实用工具


基于自己经验,在CV论文Ablation Study Quantitative Comparison中常用到一下Latex的一些功能,特整理如下。

Latex插入表格

latex插入表格可通过以下代码实现

\begin{table}[htbp]
	\centering
	\caption{Ablation Study}
	\label{ablation}
	\begin{tabular}{|c|c|c|c|c|c|c|}
		\hline
		Model Name & Component 1 & Component 2 &  Component 3  &  Component 4 &  Component 5 &  Component 6 \\
		\hline
		blah blah & blah blah & blah blah & blah blah  & blah blah  & blah blah  & blah blah\\
		\hline
	\end{tabular}
\end{table}

在这里插入图片描述

自动缩放表格使表格不超出页面范围

上面示例可以看到,因为表格较长的缘故,表格已经超出了页面范围,甚至出现了显示不全的情况。遇到这种情况,可以通过添加\resizebox来解决。

\begin{table}[htbp]
	\centering
	\caption{Ablation Study}
	\label{ablation}
	\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|c|c|c|c|c|}
		\hline
		Model Name & Component 1 & Component 2 &  Component 3  &  Component 4 &  Component 5 &  Component 6 \\
		\hline
		blah blah & blah blah & blah blah & blah blah  & blah blah  & blah blah  & blah blah\\
		\hline
	\end{tabular}}
\end{table}

可以看到,表格实现了自动缩放,不再超出页面范围且与段落同款。
在这里插入图片描述

表格单元换行的实现

想要实现表格单元格内的换行,可以在在文档开始处,添加以下句:

\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}

在表格欲实现单元格内换行处,通过以下方式实现换行

\tabincell{c}{component\\1}

完整示例如下所示:

\begin{table}[htbp]
	\centering
	\caption{Ablation Study}
	\label{ablation}
	\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|c|c|c|c|c|}
		\hline
		 \tabincell{c}{Model\\Name} & Component 1 & Component 2 &  Component 3  &  Component 4 &  Component 5 &  Component 6 \\
		\hline
		blah blah & blah blah & blah blah & blah blah  & blah blah  & blah blah  & blah blah\\
		\hline
	\end{tabular}}
\end{table}

在这里插入图片描述

在单元格中插入打勾和打叉

要插入好看的打勾和打叉,需要使用到一个包bbding。在文档开始处,添加以下句:

\usepackage{bbding}

bbding可查入各种特殊符号,这边仅以打勾和打叉为示例。

\Checkmark 

\CheckmarkBold

\XSolid

\XSolidBrush

对应效果入如下:
在这里插入图片描述

设置文字颜色

首先,在文档开始处,添加以下句:

\usepackage{color}

使用方法:

{\color{green}\CheckmarkBold}

{\color{red}\XSolidBrush}

在这里插入图片描述

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值