latex表格使用总结

news2025/2/3 12:11:58

参考博客
https://blog.csdn.net/TH_guan/article/details/124878398

测试了一下latex里面表格的用法

\documentclass{article}
\usepackage{booktabs} % 导入三线表需要的宏包
\usepackage{booktabs} % 导入三线表需要的宏包
\usepackage{longtable}% 导入跨页表格所需宏包
\usepackage{graphics}
\usepackage{threeparttable}
\usepackage[UTF8]{ctex} 
\usepackage{multirow}
\usepackage{array}
\usepackage{diagbox}
\usepackage{amsmath}
\begin{document}
	
%%%%%%%%%%% 1 %%%%%%%%%%%%%%
	\begin{tabular}{ccc}% 其中,tabular是表格内容的环境;c表示centering,即文本格式居中;c的个数代表列的个数
		\toprule %[2pt]设置线宽     
		a & b  &  c \\ %换行
		\midrule %[2pt]  
		1 & 2 & 3 \\
		4 & 5 & 6 \\
		7 & 8 & 9 \\
		\bottomrule %[2pt]     
	\end{tabular}
	
%%%%%%%%%%% 2 %%%%%%%%%%%%%%
\begin{longtable}{ccc}% 其中,tabular是表格内容的环境;c表示centering,即文本格式居中;c的个数代表列的个数
	\toprule %[2pt]设置线宽     
	a & b  &  c \\ %换行
	\midrule %[2pt]  
	1 & 2 & 3 \\
	4 & 5 & 6 \\
	7 & 8 & 9 \\
	\bottomrule %[2pt]     
\end{longtable}


%%%%%%%%%%% 3 %%%%%%%%%%%%%%
\begin{tabular}{|c|c|c|c|r|l|} \hline % 其中,|c|表示文本居中,文本两边有竖直表线。
	aaaaa & bbbbb & ccccc & ddddd & eeeee & fffff  \\ \hline
	1 & 2 & 3 & 4 & 5 & 6  \\ \hline
	7 &	8 &	9 &	10 & 11 & 12\\ \hline
	13 & 14 & 15 & 16 &	17 & 18\\ \hline
\end{tabular}

%%%%%%%%%%%4 %%%%%%%%%%%%%%
\begin{table}[!ht] % [!ht]表格在文本中放置的位置参数(努力放在当前位置,实在放不下,将放在下一页的顶部)
	\centering % 表格整体居中
	\caption{表格标题}
	\begin{tabular}{|c|c|c|c|r|l|} \hline % 其中,|c|表示文本居中,文本两边有竖直表线。
		aaaaa & bbbbb & ccccc & ddddd & eeeee & fffff  \\ \hline
		1 & 2 & 3 & 4 & 5 & 6  \\ \hline
		7 &	8 &	9 &	10 & 11 & 12\\ \hline
		13 & 14 & 15 & 16 &	17 & 18\\ \hline
	\end{tabular}
\end{table}


%%%%%%%%%%%5 %%%%%%%%%%%%%%
\begin{table}[!ht]
	
	\resizebox{\textwidth}{!}{ % 表格环境外部设置(头)
		\begin{tabular}{|c|c|c|c|r|l|} \hline % 其中,|c|表示文本居中,文本两边有竖直表线。
			aaaaa & bbbbb & ccccc & ddddd & eeeee & fffff  \\ \hline
			1 & 2 & 3 & 4 & 5 & 6  \\ \hline
			7 &	8 &	9 &	10 & 11 & 12\\ \hline
			13 & 14 & 15 & 16 &	17 & 18\\ \hline
		\end{tabular}
	}% 外部环境设置(尾)
	
\end{table}

%%%%%%%%%%%6 %%%%%%%%%%%%%%

\centering
\begin{threeparttable}
	\begin{tabular}{|c|c|c|c|c|c|} \hline
		
		班级层次&平均值	&个案数	&标准偏差	&最小值&最大值\\ \hline
		1&	53.74&	77	&29.819&	4	&96\\ \hline
		2	&57.60	&119&	28.971&	4	&100\\ \hline
		3	&58.94&	119&	29.930	&0&	100\\ \hline
		总计	&57.16	&315	&29.520&	0&	100\\ \hline
	\end{tabular}
	注: 1代表学习成绩低的同学;2代表学习层次居中的同学;3代表学习层次较好的同学。
\end{threeparttable}


%%%%%%%%%%%7 %%%%%%%%%%%%%%
\begin{tabular}{|p{6cm}<{\raggedleft}|p{4cm}<{\raggedright}|p{4cm}<{\centering}|} \hline
	
	汉字文本文本文本文本&汉字文本文本文本文本汉字文本文本文本文本&汉字文本文本文本文本汉字文本文本文本文本汉字文本文本文本文本\\ \hline
	汉字文本&汉字文本&汉字文本\\ \hline
	aaaaaaaaa&aaaaaaaaa&aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ \hline
	111111111&111111111&111111111111111111111111111111111111\\ \hline
	
\end{tabular}



%%%%%%%%%%8%%%%%%%%%%%%%%

\begin{table}[!ht]
	
	\center
	\begin{tabular}{|c|c|c|c|}\hline
		\multicolumn{1}{|c|}{\multirow{2}{*}{aaaa}} & \multicolumn{3}{c|}{bbbb}\\ \cline{2-4}
		& cccc  & dddd & eeee \\ \hline
		\multirow{2}{*}{aaaa}& 50 & 86 & 122  \\ \cline{2-4}
		\multirow{2}{*}{ }& 5 & 78  & 107   \\ \hline
		3& 25 & 48  & 101  \\ \hline
		4& 28 & 60 & 106  \\ \hline
	\end{tabular}
	
\end{table}


%%%%%%%%%%9%%%%%%%%%%%%%%
\centering
\begin{threeparttable}
	\begin{tabular}{|c|c|c|c|c|c|} \hline
		
		\diagbox{班级层次}{班级层次}&平均值	&个案数	&标准偏差	&最小值&最大值\\ \hline
		1&	53.74&	77	&29.819&	4	&96\\ \hline
		2	&57.60	&119&	28.971&	4	&100\\ \hline
		3	&58.94&	119&	29.930	&0&	100\\ \hline
		总计	&57.16	&315	&29.520&	0&	100\\ \hline
	\end{tabular}
	注: 1代表学习成绩低的同学;2代表学习层次居中的同学;3代表学习层次较好的同学。
\end{threeparttable}

	
%%%%%%%%%%%% 10 %%%%%%%%%%%%%%%%
\begin{table*}[!ht]
	%\usepackage{multirow}
	\center
	\caption{不同层次学生显著性分析}
	\begin{threeparttable}
		\resizebox{\linewidth}{!}{ 
			\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline
				
				
				\multirow{2}{*}{} &\multirow{2}{*}{(I) 班级层次} &\multirow{2}{*}{(J) 班级层次} &\multirow{2}{*}{平均值差值 (I-J)} &\multirow{2}{*}{标准 错误} &\multirow{2}{*}{显著性} &\multicolumn{2}{c|}{95\% 置信区间}\\ \cline{7-8}
				
				\multirow{2}{*}{}&\multirow{2}{*}{} &\multirow{2}{*}{} &\multirow{2}{*}{} &\multirow{2}{*}{} &\multirow{2}{*}{} &上限&下限   \\ \hline
				
				\multirow{6}{*}{塔姆黑尼}&\multirow{2}{*}{1} &2&	-3.856	&4.313	&.753&	-14.26&	6.55  \\ \cline{3-8}
				\multirow{6}{*}{}&\multirow{2}{*}{} & 3	&-5.201&4.368&	.553&	-15.74&	5.34 \\ \cline{2-8}
				
				\multirow{6}{*}{}&\multirow{2}{*}{2} &1&	3.856&	4.313&	.753&	-6.55&	14.26  \\ \cline{3-8}
				\multirow{6}{*}{}&\multirow{2}{*}{} &  3&	-1.345	&3.819&	.979	&-10.53&	7.84\\ \cline{2-8}
				
				\multirow{6}{*}{}&\multirow{2}{*}{3} &1&	5.201&	4.368&	.553	&-5.34&	15.74  \\ \cline{3-8}
				\multirow{6}{*}{}&\multirow{2}{*}{} & 2	&1.345&	3.819&	.979&	-7.84	&10.53 \\ \hline
				
				\multirow{2}{*}{邓尼特 t(双侧)} & 1&	3	&-5.201&4.321	&.384&	-14.83	&4.43 \\ \cline{2-8}
				\multirow{2}{*}{} & 2&	3&	-1.345	&3.830	&.917	&-9.88	&7.19\\ \hline
				
			\end{tabular}
		}	
		\begin{tablenotes}
			\item[1] 1代表学习成绩低的同学;2代表学习层次居中的同学;3代表学习层次较好的同学。
		\end{tablenotes}
	\end{threeparttable}
\end{table*}


%%%%%%%%%%%% 11 %%%%%%%%%%%%%%%%
$$
\begin{array}{|c|c|c|c|}
	\hline   \text { 序号 }& \text { 对比方法 } & \text { 方法版本 } & \text { 方法官方地址 } \\
	\hline  1& \text { FastMNN } & 1.10 .0 & \begin{array}{l}
		\text { https://bioconductor.org/packages/ } \\
		\text { release/bioc/html/batchelor.html }
	\end{array}  \\
	\hline 2 &\text { Harmony } & 0.1 .0 & \begin{array}{l}
		\text { https://github.com/immunogenomics/harmony } \\
	\end{array}  \\
	\hline 3 & \text { Seurat }3 & 4.1 .1 & \text { https://satijalab.org/seurat/ }  \\
	\hline 4 &\text { Liger } & 1.0 .0 & \text { https://github.com/welch-lab/liger }  \\
	\hline 5 &\text { INSCT } & 0.0 .2 & \text { https://github.com/lkmklsmn/insct } \\
	\hline 6 &\text { BERMUDA } & \text {无版本号 } & \begin{array}{l}
		\text { https://github.com/txWang/BERMUDA } \\
	\end{array}  \\
	\hline 7 &\text { BBKNN } & 1.5 .1 & \text { https://github.com/Teichlab/bbknn } \\
	\hline 8 & \text { Scanorama } & 1.7 .2 & \begin{array}{l}
		\text { https://github.com/brianhie/scanorama } \\
	\end{array}  \\
	\hline 9 &\mathrm{scVI} & 0.8 .1 & \begin{array}{l}
		\text { https://github.com/scverse/scvi-tools } \\
	\end{array}  \\
	\hline 10 & \text { carDEC } & 1.0 .3 & \begin{array}{l}
		\text { https://github.com/jlakkis/CarDEC } \\
	\end{array} \\
	\hline 11 & \text { scDML } & 0.0 .1 & \begin{array}{l}
		\text { https://github.com/eleozzr/scDML } \\
	\end{array} \\
	\hline
\end{array}
$$

%%%%%%%%%%%%%%% 12%%%%%%%%%%%%%%%%%%%%%%%%%%%

{
	\renewcommand{\arraystretch}{1.2}
	\begin{table}
		\caption{测试表格
			\label{Table:测试}}
		$\begin{array}{|c|c|c|c|}
			\hline   \text { 序号 }& \text { 对比方法 } & \text { 方法版本 } & \text { 方法官方地址 } \\
			\hline  1& \text { FastMNN } & 1.10 .0 & \begin{array}{l}
				\text { https://bioconductor.org/packages/ } \\
				\text { release/bioc/html/batchelor.html }
			\end{array}  \\
			\hline 2 &\text { Harmony } & 0.1 .0 & \begin{array}{l}
				\text { https://github.com/immunogenomics/harmony } \\
			\end{array}  \\
			\hline 3 & \text { Seurat }3 & 4.1 .1 & \text { https://satijalab.org/seurat/ }  \\
			\hline 4 &\text { Liger } & 1.0 .0 & \text { https://github.com/welch-lab/liger }  \\
			\hline 5 &\text { INSCT } & 0.0 .2 & \text { https://github.com/lkmklsmn/insct } \\
			\hline 6 &\text { BERMUDA } & \text {无版本号 } & \begin{array}{l}
				\text { https://github.com/txWang/BERMUDA } \\
			\end{array}  \\
			\hline 7 &\text { BBKNN } & 1.5 .1 & \text { https://github.com/Teichlab/bbknn } \\
			\hline 8 & \text { Scanorama } & 1.7 .2 & \begin{array}{l}
				\text { https://github.com/brianhie/scanorama } \\
			\end{array}  \\
			\hline 9 &\mathrm{scVI} & 0.8 .1 & \begin{array}{l}
				\text { https://github.com/scverse/scvi-tools } \\
			\end{array}  \\
			\hline 10 & \text { carDEC } & 1.0 .3 & \begin{array}{l}
				\text { https://github.com/jlakkis/CarDEC } \\
			\end{array} \\
			\hline 11 & \text { scDML } & 0.0 .1 & \begin{array}{l}
				\text { https://github.com/eleozzr/scDML } \\
			\end{array} \\
			\hline
		\end{array}$
	\end{table}
}




\end{document}

结果如下
在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

注意最后两个例子,其实我用latex识别公式识别出的内容

\begin{array)
*****
\end{array}

这其中的部分,使用

$$
\begin{array)
*****
\end{array}
$$

还是

\begin{table}
\begin{array)
*****
\end{array}
\end{table}

把这部分内容包起来看自己需要,我目前发现前者没有办法给表加标题和引用,所以使用后者会更好一点

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1427533.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【打赏】完美运营的最新视频打赏系统

完美运营的最新视频打赏系统优于市面上95%的打赏系统&#xff0c;与其他打赏系统相比&#xff0c;功能更加强大&#xff0c;完美运营且无bug。支付会调、短链接生成、代理后台、价格设置和试看功能等均没有问题。 以上为原简介&#xff0c;经测试验证。成功搭建并可以正常进入…

【GitHub项目推荐--大语言模型课程】【转载】

Large Language Model Course Large Language Model Course&#xff08;大型语言模型课程&#xff09;是一个开源项目&#xff0c;该课程分为三个部分&#xff1a; LLM 基础&#xff1a;涵盖了数学、Python 和神经网络的基础知识。 LLM 科学家&#xff1a;专注于学习如何使用…

DBeaver连接ClickHouse,时间少了8小时

文章目录 业务场景问题描述解决办法 业务场景 表字段time&#xff0c;类型为Datetime&#xff0c;插入时间格式为“yyyy-MM-dd HH:mm:ss” 问题描述 插入表中的时间比正常给的时间少了8小时。如&#xff0c;给定时间为&#xff1a; 2024-01-30 14:52:08 在表中显示的时间为&…

生物素-PEG4-酪胺,Biotin-PEG4-TSA,应用于酶联免疫吸附实验

您好&#xff0c;欢迎来到新研之家 文章关键词&#xff1a;生物素-PEG4-酪胺&#xff0c;Biotin-PEG4-Tyramide&#xff0c;Biotin-PEG4-TSA 一、基本信息 产品简介&#xff1a;Biotin PEG4 Tyramine is a reagent used for tyramine signal amplification (TSA) through ca…

前端通过nginx,访问一个文件夹里面的全部数据,nginx 咋配置

目录 1 问题2 实现 1 问题 前端通过nginx,访问一个文件夹里面的全部数据&#xff0c;nginx 咋配置 2 实现 location /logs {alias /mnt/www/logs/;autoindex on; }

【Git】03 图形化工具

文章目录 一、右击菜单二、打开仓库三、可视化所有分支历史四、总结 一、右击菜单 二、打开仓库 三、可视化所有分支历史 四、总结 图形化工具了解一下&#xff0c;要懂得在哪里能找到。

echarts条形图添加滚动条

效果展示: 测试数据: taskList:[{majorDeptName:测试,finishCount:54,notFinishCount:21}, {majorDeptName:测试,finishCount:54,notFinishCount:21}, {majorDeptName:测试,finishCount:54,notFinishCount:21}, {majorDeptName:测试,finishCount:54,notFinishCount:21}, {maj…

帅气的性能监控平台Grafana(Windows下使用Grafana监控系统指标与GPU指标)

帅气的性能监控平台Grafana&#xff08;Windows下使用Grafana监控系统指标与GPU指标&#xff09; 前情提要 系统环境准备 windows_exporter下载 nvidia_gpu_exporter下载 prometheus下载 Grafana下载 安装指导 windows_exporter安装与nvidia_gpu_exporter安装 promethe…

leetcode热题100.二叉树中的最大路径和

Problem: 124. 二叉树中的最大路径和 文章目录 题目解题方法复杂度Code 题目 二叉树中的 路径 被定义为一条节点序列&#xff0c;序列中每对相邻节点之间都存在一条边。同一个节点在一条路径序列中 至多出现一次 。该路径 至少包含一个 节点&#xff0c;且不一定经过根节点。 …

项目安全问题及解决方法------使用合适的算法

Spring Security 已经废弃了 MessageDigestPasswordEncoder&#xff0c;推荐使用 BCryptPasswordEncoder private static BCryptPasswordEncoder passwordEncoder new BCryptPasswordEncoder(); GetMapping("performance")public void performance() {StopWatch st…

抖音短视频矩阵营销系统源头独立开发搭建

开发背景 抖音短视频矩阵系统源码开发采用模块化设计&#xff0c;包括账号分析、营销活动、数据监控、自动化管理等功能。通过综合分析账号数据&#xff0c;快速发现账号的优势和不足&#xff0c;并提供全面的营销方案&#xff0c;以提高账号曝光率和粉丝数量。同时&#xff0c…

Axure 动态面板初使用-实现简单的tab切换页面效果

使用工具版本 Axure 9 实现的效果 步骤过程 1、打开Axure 9&#xff0c;默认进入一个空白页&#xff0c;首先从元件库拉一个动态面板到页面中&#xff0c;位置肯定是C位咯~ 2、将面板尺寸调整一下&#xff0c;设置成你喜欢的数字&#xff0c;比如我就喜欢800600 3、然后…

MySQL原理(五)事务

一、介绍&#xff1a; 1、介绍&#xff1a; 在计算机术语中&#xff0c;事务(Transaction)是访问并可能更新数据库中各种数据项的一个程序执行单元(unit)。事务是恢复和并发控制的基本单位。 2、事务的4大特性 原子性、一致性、隔离性、持久性。这四个属性通常称为ACID特性…

2023年09月CCF-GESP编程能力等级认证Python编程五级真题解析

Python等级认证GESP(1~6级)全部真题・点这里 一、单选题(共15题,共30分) 第1题 近年来,线上授课变得普遍,很多有助于改善教学效果的设备也逐渐流行,其中包括比较常用的手写板,那么它属于哪类设备?( ) A:输入 B:输出 C:控制 D:记录 答案:A 第2题 以下关于…

【Git】04 .git目录

文章目录 一、.git目录二、切换分支三、仓库配置信息四、引用五、对象六、总结 一、.git目录 ls -a .git/./ COMMIT_EDITMSG description hooks/ info/ objects/ ../ config HEAD index logs/ refs/二、切换分支 cat .git/HEAD #…

Leetcode—31. 下一个排列【中等】

2024每日刷题&#xff08;一零九&#xff09; Leetcode—31. 下一个排列 算法思想 实现代码 class Solution { public:void reverse(vector<int>& nums, int l, int r) {while(l < r) {swap(nums[l], nums[r--]);}}void nextPermutation(vector<int>&…

NLP入门系列—Attention 机制

NLP入门系列—Attention 机制 Attention 正在被越来越广泛的得到应用。尤其是 [BERT]火爆了之后。 Attention 到底有什么特别之处&#xff1f;他的原理和本质是什么&#xff1f;Attention都有哪些类型&#xff1f;本文将详细讲解Attention的方方面面。 Attention 的本质是什…

2024美赛C题保姆级分析完整思路代码数据教学

2024美国大学生数学建模竞赛C题保姆级分析完整思路代码数据教学 C题 Momentum in Tennis 网球中的动量 在2023年温布尔登男单决赛中&#xff0c;20岁的西班牙新星卡洛斯阿尔卡拉兹击败了36岁的诺瓦克德约科维奇。这是德约科维奇自2013年以来在温布尔登的首次失利&#xff0c;也…

element-ui button 仿写 demo

基于上篇 button 源码分享写了一个简单 demo&#xff0c;在写 demo 的过程中&#xff0c;又发现了一个小细节&#xff0c;分享一下&#xff1a; 1、组件部分&#xff1a; <template><buttonclass"yss-button"click"handleClick":class"[ty…