我正在尝试绘制一个表格,但缺少一些字段。表格字段不在页面中。我正在使用以下软件包。
\documentclass{Dissertate}
\begin{document}
\usepackage{longtable} % for 'longtable' environment
\usepackage{rotating}
\usepackage{lscape}
\begin{landscape}
\begin{longtable}[c]{p{5cm}c c c c c c c c c c c c c c c }
\hline
Parameter & Device & Table & Variable & night\_lowlimit & night\_upperlimit & day\_lowlimit & day\_upperlimit & sensor\_definition\\\hline
Global\_radiations & DAR & EMB1.DAR & PYR.R.SWDR.Avg &0 & 0 & 0 & 10 & EB1.PYR.R.SWDR.001.AVG \\
Reflected\_irradiance & DAR & EMB1.DAR & PYR.R.SWUR.Avg & 0 &0& 0& 10 & EB1.PYR.R.SWUR.001.AVG \\
\end{longtable}
\end{landscape}
\end{document}
我正在尝试在一页上完整绘制表格。如果有人能帮助我解决这个问题。我将不胜感激
答案1
- 我没有
Dissertate
文档类,所以我使用book
宽度geometry
包定义边距为 25 毫米 - 我还假设,该表可以放在一页中
- 由于表格在环境中列标题太宽,比文本宽度更宽
landscape
,我建议重新设计列标题并使用\tnotes
来threeparttable
描述列标题的含义
\documentclass{book}%{Dissertate}
\usepackage[margin=25mm]{geometry}
\usepackage{pdflscape}
\usepackage{booktabs, threeparttable}
\usepackage{rotating}
\usepackage{siunitx}
\begin{document}
\begin{landscape}
\begin{threeparttable}
\begin{tabular}{p{5cm} ccc *{4}{S[table-format=2.0,
table-column-width=9mm]}c}
\toprule
\multicolumn{4}{c}{}
& \multicolumn{2}{c}{night limit}
& \multicolumn{2}{c}{day limit} \\
\cmidrule(lr){5-6}\cmidrule(lr){7-8}
Parameter & Device & Table & Variable
& {low\tnote{a}} & {upper\tnote{b}}
& {low\tnote{c}} & {upper\tnote{d}} & sensor\_definition \\
\midrule
Global\_radiations & DAR & EMB1.DAR & PYR.R.SWDR.Avg &0 & 0 & 0 & 10 & EB1.PYR.R.SWDR.001.AVG \\
Reflected\_irradiance & DAR & EMB1.DAR & PYR.R.SWUR.Avg & 0 &0& 0& 10 & EB1.PYR.R.SWUR.001.AVG \\
\bottomrule
\end{tabular}
\begin{tablenotes}[para, flushleft]\footnotesize
\item[a] night\_lowlimit
\item[b] night\_upperlimit
\item[c] day\_lowlimit
\item[d] day\_upperlimit
\end{tablenotes}
\end{threeparttable}
\end{landscape}
\end{document}
答案2
解决方案是将数字列的头部逆时针旋转 90°,并使用sidewaystable
环境代替landscape
。此外,规则周围booktabs
有一些垂直填充:
\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{array, booktabs, caption}
\usepackage{rotating}
\usepackage{lscape}
\begin{document}
\begin{sidewaystable}
\setlength{\extrarowheight}{2pt}
\caption{A sideways table}\label{table:swtab}
\begin{tabular}[c]{l*{8}{c}}
\toprule
Parameter & Device & Table & Variable & \rotatebox{90}{night\_lowlimit} & \rotatebox{90}{night\_upperlimit} & \rotatebox{90}{day\_lowlimit} & \rotatebox{90}{day\_upperlimit} & sensor\_definition \\
\midrule
Global\_radiations & DAR & EMB1.DAR & PYR.R.SWDR.Avg & 0 & 0 & 0 & 10 & EB1.PYR.R.SWDR.001.AVG \\
Reflected\_irradiance & DAR & EMB1.DAR & PYR.R.SWUR.Avg & 0 & 0 & 0 & 10 & EB1.PYR.R.SWUR.001.AVG \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}