latex中表格怎么加标题_Latex中表格添加注释的方法

latex中表格添加注释,网上方法较多,然而很多注释添加之后并不美观,最好的注释肯定是,注释和表格同宽,注释左对齐。要做到这点,有一组代码可以实现,如何操作需要在这里详细说明。

就像上图的注释。

step 1. 在文档最开始,在\begin{document}上面,添加\usepackage{threeparttable},建立环境。

step 2. 转到表格处,在表格代码\begin{tabular}上面,添加一行\begin{threeparttable}。

step 3. 在表格\label{xxx}下,\end{table}上,这之间的部分添加注释。

step 4. 注释的代码为:

\begin{tablenotes}

\footnotesize

\item This is note content.

\end{tablenotes}

\end{threeparttable}

全部表格代码如下:

\documentclass[11pt,a4paper,english]{article}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage{babel}

\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\usepackage{booktabs}

\usepackage{threeparttable} %这行要添加

\begin{document}

\begin{table}[!ht]

\caption{A table with notes}\label{tab:tablenotes}

\centering

\begin{threeparttable} %这行要添加

\begin{tabular}{*4{c}}\toprule

Table head\tnote{1} & Table head\tnote{1} & Table head\tnote{2} & Table head\tnote{2} \\ \midrule

Some values & Some values & Some values & Some values \\

Some values & Some values & Some values & Some values \\

Some values & Some values & Some values & Some values \\

Some values & Some values & Some values & Some values \\ \bottomrule

\end{tabular}

\begin{tablenotes} %这行要添加, 从这开始

\footnotesize %这行要添加

\item[1] The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. %这行要添加

\item[2] The quick brown fox jumps over the lazy dog. %这行要添加

\end{tablenotes} %这行要添加

\end{threeparttable} %这行要添加,到这里结束

\end{table}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值