csv - 来自 CSV 文件的乳胶表
问题描述
以下用于从 csv 文件创建 Latex 表的代码在表顶部缺少水平线。
\documentclass{article}
\usepackage{csvsimple}
% Make csv in question
\begin{filecontents*}{check.csv}
labels,names,A,C,V,tools
a,example,838,663,683,
b,otter,353,215,192,
d,\textbf{broccoli},79,79,117,
e,fibredensityandcrosssection,1086,849,868,
ad,hcp-prefree:exec-centos7.freebuild-centos4-latest,70,76,157,
ar,shots47s\_fmriprep-1.2.3,,,,453
\end{filecontents*}
\begin{table*}[!ht]
\csvreader[%
tabular={|c|c|c|c|c|c|},
table head = \textbf{Labels} &\textbf{{names}} & \textbf{A} & \textbf{C} & \textbf{V} & \textbf{T}\\\hline,
late after line= \\,
late after last line=\\\hline %
]{check.csv}{labels=\labels,names=\names,A=\A,C=\C,V=\V,tools=\tools}%
{\labels & \names & \A & \C & \V & \tools}
\centering
\caption{\label{table1}Number by category}
\end{table*}
\end{document}
我们如何在表格顶部添加顶部水平线?
解决方案
请注意,构建这样的数据监狱是不好的风格。看看http://betterposters.blogspot.de/2012/08/the-data-prison.html,https://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables。 pdf 或 https://wiert.me/2014/04/03/andre-vatter-google-wie-tabellen-eigentlich-aussehen-sollten-%EF%BB%BF/获取一些关于漂亮桌子的指南。
\documentclass{article}
\usepackage{csvsimple}
% Make csv in question
\begin{filecontents*}{check.csv}
labels,names,A,C,V,tools
a,example,838,663,683,
b,otter,353,215,192,
d,\textbf{broccoli},79,79,117,
e,fibredensityandcrosssection,1086,849,868,
ad,hcp-prefree:exec-centos7.freebuild-centos4-latest,70,76,157,
ar,shots47s\_fmriprep-1.2.3,,,,453
\end{filecontents*}
\begin{document}
\begin{table*}[!ht]
\csvreader[%
tabular={|c|c|c|c|c|c|},
table head = \hline\textbf{Labels} &\textbf{{names}} & \textbf{A} & \textbf{C} & \textbf{V} & \textbf{T}\\\hline,
late after line= \\,
late after last line=\\\hline %
]{check.csv}{labels=\labels,names=\names,A=\A,C=\C,V=\V,tools=\tools}%
{\labels & \names & \A & \C & \V & \tools}
\centering
\caption{\label{table1}Number by category}
\end{table*}
\end{document}
推荐阅读
- angular - 在 mat-select angular 中禁用时如何隐藏下划线
- javascript - 无法加载类型为“模块”的脚本
- powershell - 使用 PowerShell 将电子邮件从一个文件夹移动到另一个文件夹
- javascript - Codeigniter 验证可防止显示引导模式。我该如何解决?
- html - 如何在 VSTS 中发布 html 报告
- python - 使用 http.server 从 python 脚本显示动态网页
- javascript - 调整窗口大小后如何使图像重新定位?
- swift - 在 Swift 中将可选绑定转换为错误处理的过程是什么?
- android - 将图像从 imageview 上传到 Firebase Android
- c# - 将 webApi 控制器的令牌身份验证添加到现有的 asp.net MVC 5 应用程序