latex - 如何修复longtable LATEX的宽度
问题描述
我想设置我的宽度,longtable
使其适合页面而不是裁剪。我有 206 列和 17 行。
我使用 tablesgenerator.com 来获取我的longtable
,但是“将表格缩放到文本宽度”选项不适用于longtable
,可以使用一些帮助。(这里是乳胶初学者)。
\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\begin{longtable}{@{}lllllllllllllllll@{}}
\toprule
\textbf{SN} & \textbf{zhelio} & \textbf{zhelio\_un} & \textbf{zCMB} &
\textbf{zCMB\_un} & \textbf{Peak\_MJD} & \textbf{Peak\_MJD\_un} & \textbf{x1}
& \textbf{x1\_un} & \textbf{c} & \textbf{c\_un} & \textbf{mB} &
\textbf{mB\_un} & \textbf{t} & \textbf{t\_un} & \textbf{Host\_logmass} &
\textbf{Host\_logmass\_un} \\* \midrule
\endhead
%table stuff here...
\caption{}
\label{tab:my-table}\\
\end{longtable}
\end{document}
这就是它的样子
解决方案
假设您的意思是 206 行而不是列,那么您可以尝试以下策略:
将表格放在横向页面上
使用较小的字体
减少文档的边距以腾出更多空间
减少列之间的空间
\documentclass{article}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[vmargin=2cm]{geometry}
\usepackage{lscape}
\begin{document}
\begin{landscape}
\small
\setlength{\tabcolsep}{2pt}
\begin{longtable}{@{}lllllllllllllllll@{}}
\toprule
\textbf{SN} & \textbf{zhelio} & \textbf{zhelio\_un} & \textbf{zCMB} &
\textbf{zCMB\_un} & \textbf{Peak\_MJD} & \textbf{Peak\_MJD\_un} & \textbf{x1}
& \textbf{x1\_un} & \textbf{c} & \textbf{c\_un} & \textbf{mB} &
\textbf{mB\_un} & \textbf{t} & \textbf{t\_un} & \textbf{Host\_logmass} &
\textbf{Host\_logmass\_un} \\* \midrule
\endhead
%table stuff here...
\caption{}
\label{tab:my-table}\\
\end{longtable}
\end{landscape}
\end{document}
推荐阅读
- r - 寓言中的预测功能是否提供一步预测?
- c++ - 一个简单的 OOP 代码在 DEV-C++ 编译器中运行,但不在 VS 2019 中,为什么?
- python - google.cloud.vision_v1.types.image_annotator.AnnotateImageResponse 到 python 中的 Json
- android - 通过 ACTION_WIFI_ADD_NETWORKS 意图添加 WiFi 网络
- python - 如何更改 matplotlib(缩放)十字准线的颜色?
- android - 使用 Viewpager2 和 Kotlin 在片段之间滑动
- python - Windows 上的 os.path.exists 有时会成功,有时会在映射的网络驱动器上失败
- css - 将图标定位在“动态”div 的边框上
- google-app-engine - 如何在谷歌云项目中停用 IAP?
- neo4j - Neo4J - 如何将备份(或转储)从以前的版本(3.0.3)恢复到实际的 4.1.3 社区