我正在使用 overleaf latex 网站撰写论文。我想在表格上方写一个标题;我试过不同的方法,但我不知道该怎么做。你能帮帮我吗!
\documentclass[12pt]{uthesis-v12} %---> DO NOT ALTER THIS COMMAND
\usepackage{graphicx} %---> %---> %---> DO NOT ALTER THIS COMMAND
\usepackage{eurosym}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{color}
\usepackage{graphicx}
\usepackage{float}
\usepackage{placeins}
\usepackage{subfigure}
\usepackage{indentfirst}
\usepackage{bm}
\usepackage{tabularx}
\usepackage[space]{grffile}
\usepackage{etoolbox}
\usepackage{booktab}
\usepackage{arydshln}
\usepackage{array}
\usepackage{tabu}
\usepackage{rotating}
\usepackage{afterpage}
\usepackage[outdir=./]{epstopdf}
\usepackage{epstopdf}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage{subcaption}
\usepackage{capt-of}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb}
\usepackage{float}
\usepackage{perpage}
\usepackage{adjustbox}
\usepackage{blindtext}
\usepackage{mwe}
\usepackage{rotating}% http://ctan.org/pkg/rotating
\begin{document}
\begin{center}
\begin{adjustbox}{width=1.4\textwidth, rotate=90,center}
\begin{tabular}{c| c| c| c| c| c| c| c| c| c|c| c| c| c| c| c| c| c| c| c| c| c c| }
\hline
\multirow{}{Sample size}
& \multicolumn{6}{|c|}{ Step 1 } & \multicolumn{10}{|c|}{ Step 2} & \multicolumn{5}{|c}{ Relative Frequency} \\
\cline{2-22}
& \multicolumn{2}{|c|}{ ${\hat{\beta_{0}}}$}
& \multicolumn{2}{|c|}{ ${\hat{\beta_{1}}}$}
& \multicolumn{2}{|c}{ ${\hat{\beta_{2}}}$}
& \multicolumn{2}{|c|}{ ${\hat{\phi}_{AIC}}$}
& \multicolumn{2}{|c|}{ ${\hat{\phi}_{AICc}}$}
& \multicolumn{2}{|c|}{ ${\hat{\phi}_{BIC}}$}
& \multicolumn{2}{|c|}{ ${\hat{\phi}_{LASSO}}$}
& \multicolumn{2}{|c}{ ${\hat{\phi}_{AdLASSO}}$}
& \multicolumn{3}{|c|}{ Information Criteria }
& \multicolumn{2}{|c}{ Regularization Methods }\\
\cline{2-22}
& Mean & SD & Mean & SD & Mean & SD
& Mean & SD & Mean & SD & Mean & SD & Mean & SD & Mean & SD
& AIC & AICc & BIC & LASSO & AdLASSO \\
\hline
${N=200}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=400}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=600}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=800}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=1000}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=1200}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=1400}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=1600}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=1800}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${0}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
${N=2000}$
%beta0
& ${}$ & ${}$
%beta1
& ${}$ & ${}$
%beta2
& ${}$ & ${}$
%phi1
& ${}$ & ${}$
%phi2
& ${}$ & ${}$
%phi3
& ${}$ & ${}$
%phi4
& ${}$ & ${}$
%phi5
& ${}$ & ${}$
%aic
& ${}$
%aicc
& ${}$
%bic
& ${}$
%lasso
& ${}$
%adlasso
& ${}$\\
\hline
\end{tabular}
\end{adjustbox}
\end{center}
\end{document}
答案1
Overleaf 没有带标题的内容。它只是(远程)编辑器...
我会按照以下方式编写您的表格:
- 用于旋转表的使用
sidewaystable
定义在rotating
包中而不是adjustbox
- 对于表格标题,请使用标准标题
\caption
- 删除
\begin{center}
...`\end{center} - 使用较小的字体:
\footnotesize
- 而不是
tabular
使用tabular*
- 左计算
\tabcolsep
(单元格内容与其边框之间的距离)到宏@{\extracolsep{\fill}}
考虑到上述情况并仅使用与您的问题相关的包,MWE 是:
\documentclass[12pt]{article}%{uthesis-v12} % i do not have your document class
\usepackage{amsmath}
\usepackage{makecell, multirow}
\usepackage{rotating}% http://ctan.org/pkg/rotating
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{sidewaystable}
\caption{My very wide rotated table}
\footnotesize
\setlength\tabcolsep{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
*{21}{>{$}c<{$}|} >{$}c<{$}}
\hline
\multirow{3}{3em}{\centering Sample size}
& \multicolumn{6}{c|}{ Step 1 }
& \multicolumn{10}{c|}{ Step 2}
& \multicolumn{5}{c}{ Relative Frequency} \\
\cline{2-22}
& \multicolumn{2}{c|}{ ${\hat{\beta_{0}}}$}
& \multicolumn{2}{c|}{ ${\hat{\beta_{1}}}$}
& \multicolumn{2}{c|}{ ${\hat{\beta_{2}}}$}
& \multicolumn{2}{c|}{ ${\hat{\phi}_{AIC}}$}
& \multicolumn{2}{c|}{ ${\hat{\phi}_{AICc}}$}
& \multicolumn{2}{c|}{ ${\hat{\phi}_{BIC}}$}
& \multicolumn{2}{c|}{ ${\hat{\phi}_{LASSO}}$}
& \multicolumn{2}{c|}{ ${\hat{\phi}_{AdLASSO}}$}
& \multicolumn{3}{c|}{\makecell{Information\\ Criteria}}
& \multicolumn{2}{c}{\makecell{Regularization\\ Methods}} \\
\cline{2-22}
& \text{Mean} & \text{SD} & \text{Mean} & \text{SD} & \text{Mean} & \text{SD}
& \text{Mean} & \text{SD} & \text{Mean} & \text{SD} & \text{Mean} & \text{SD}
& \text{Mean} & \text{SD} & \text{Mean} & \text{SD}
& \text{AIC} & \text{AICc} & \text{BIC} & \text{LASSO} & \text{AdLASSO} \\
\hline
N=200 & & & & & & & & & & & & & & & & & & & & & \\
\hline
N=400 & & & & & & & & & & & & & & & & & & & & & \\
\hline
N=600 & & & & & & & & & & & & & & & & & & & & & \\
\hline
\end{tabular*}
\end{sidewaystable}
\end{document}
(红线表示页面布局)