我有一张很长的表(大约 6 页),所以我正在尝试使用 longtable 包。但是,有没有办法在不实际开始新表的情况下修改表的条目。现在我有两个国家的数据(大约 3 页),之后我想更改国家的名称并继续使用原表。我设法插入数据,但是,我无法更改表中的条目。我希望它清楚我想要什么。我真的很感激任何帮助,这已经花了我几个小时,但我仍然找不到正确的方法。我尝试插入我的代码,也许它更清楚。Lina
\documentclass [a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{array}
\usepackage{graphicx}
\usepackage{apacite}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{caption} \captionsetup[table]{skip=10pt}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
\renewcommand*{\arraystretch}{0.8}
\begin{document}
\begin{landscape}
\begin{center}
\begin{longtable}{|l|ccc|ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\caption{Multinomial Logit Model} \\
\hline
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{Denmark}} & \multicolumn{12}{c|}{\textbf{Sweden}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\ \hline
\endfirsthead
\caption{(Continued)} \\
\hline
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{Denmark}} & \multicolumn{12}{c|}{\textbf{Sweden}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\
\hline
\endhead
\hline \multicolumn{25}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
\textit{Coexceedances = 1} & & & & & & & & & & & & & & & & & & & & & & & & \\
Constant & & -1.86*** & & & & & & -1.90*** & & & & & & -2.61*** & & & & & & -2.72*** & & & & \\
Coex. Lagged & & 0.27*** & & & & & & 0.25*** & & & & & & 0.43*** & & & & & & 0.41*** & & & & \\
Systemic Risk & & 0.28*** & & & & & & 0.20* & & & & & & 0.30*** & & & & & & 0.20* & & & & \\
Yield Curve & & -0.34 & & & & & & -0.35 & & & & & & -0.80 & & & & & & -0.78 & & & & \\
Volatility Own & & 0.26 & & & & & & 0.05 & & & & & & 1.13*** & & & & & & 0.96*** & & & & \\
Volatility US & & 0.85 & & & & & & 0.88 & & & & & & 0.65 & & & & & & 0.62 & & & & \\
Contagion DK & & - & & & - & & & - & & & & & & - & & & - & & & 0.21* & & & & \\
Contagion SE & & - & & & - & & & 0.23** & & & & & & - & & & - & & & & & & & \\
Contagion NO & & - & & & - & & & 0.22 & & & & & & - & & & - & & & 0.44*** & & & & \\
Contagion FI & & - & & & - & & & 0.04 & & & & & & - & & & - & & & 0.40** & & & & \\
\end{longtable}
\end{center}
\end{landscape}
\end{document}
答案1
不要center
在长表格周围使用(它不会使表格居中,只会增加虚假的垂直空间)。您可以使用两个表格,但它们之间不留任何空间。此外,如果您需要强制列的宽度相同,那么您可以使用\kill
行来告诉一个表格另一个表格中的宽条目,尽管这里不需要这样做。无关,但我使用了\extrarowheight
数组包中的方法来使水平线远离文本。
\documentclass [a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{array}
\usepackage{graphicx}
\usepackage{apacite}
\usepackage{booktabs}
\usepackage{longtable,array}
\usepackage{caption} \captionsetup[table]{skip=10pt}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
\renewcommand*{\arraystretch}{0.8}
\begin{document}
\begin{landscape}
\setlength\LTpre{0pt}
\setlength\LTpost{0pt}
\setlength\extrarowheight{2pt}
\begin{longtable}{|l|ccc|ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\caption{Multinomial Logit Model} \\
\hline
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{Denmark}} & \multicolumn{12}{c|}{\textbf{Sweden}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\ \hline
\endfirsthead
\caption{(Continued)} \\
\hline
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{Denmark}} & \multicolumn{12}{c|}{\textbf{Sweden}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 1}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 2}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\
\hline
\endhead
\hline \multicolumn{25}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
\textit{Coexceedances = 1} & & & & & & & & & & & & & & & & & & & & & & & & \\
Constant & & -1.86*** & & & & & & -1.90*** & & & & & & -2.61*** & & & & & & -2.72*** & & & & \\
Coex. Lagged & & 0.27*** & & & & & & 0.25*** & & & & & & 0.43*** & & & & & & 0.41*** & & & & \\
Systemic Risk & & 0.28*** & & & & & & 0.20* & & & & & & 0.30*** & & & & & & 0.20* & & & & \\
Yield Curve & & -0.34 & & & & & & -0.35 & & & & & & -0.80 & & & & & & -0.78 & & & & \\
Volatility Own & & 0.26 & & & & & & 0.05 & & & & & & 1.13*** & & & & & & 0.96*** & & & & \\
Volatility US & & 0.85 & & & & & & 0.88 & & & & & & 0.65 & & & & & & 0.62 & & & & \\
Contagion DK & & - & & & - & & & - & & & & & & - & & & - & & & 0.21* & & & & \\
Contagion SE & & - & & & - & & & 0.23** & & & & & & - & & & - & & & & & & & \\
Contagion NO & & - & & & - & & & 0.22 & & & & & & - & & & - & & & 0.44*** & & & & \\
Contagion FI & & - & & & - & & & 0.04 & & & & & & - & & & - & & & 0.40** & & & & \\
\end{longtable}
\begin{longtable}{|l|ccc|ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{France}} & \multicolumn{12}{c|}{\textbf{UK}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 3}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 4}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 3}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 4}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\ \hline
\endfirsthead
\hline
\multirow{3}{*}{} & \multicolumn{12}{c|}{\textbf{France}} & \multicolumn{12}{c|}{\textbf{UK}} \\
\cline{2-25}
& \multicolumn{6}{c|}{\textit{\textbf{Model 3}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 4}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 3}}} & \multicolumn{6}{c|}{\textit{\textbf{Model 4}}} \\ \cline{2-25}
& \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} & \multicolumn{3}{c|}{\textit{\textbf{Coeff.}}} & \multicolumn{3}{c|}{\textit{\textbf{Prob.}}} \\
\hline
\endhead
\hline \multicolumn{25}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline
\endlastfoot
\textit{Coexceedances = 1} & & & & & & & & & & & & & & & & & & & & & & & & \\
Constant & & -1.86*** & & & & & & -1.90*** & & & & & & -2.61*** & & & & & & -2.72*** & & & & \\
Coex. Lagged & & 0.27*** & & & & & & 0.25*** & & & & & & 0.43*** & & & & & & 0.41*** & & & & \\
Systemic Risk & & 0.28*** & & & & & & 0.20* & & & & & & 0.30*** & & & & & & 0.20* & & & & \\
Yield Curve & & -0.34 & & & & & & -0.35 & & & & & & -0.80 & & & & & & -0.78 & & & & \\
Volatility Own & & 0.26 & & & & & & 0.05 & & & & & & 1.13*** & & & & & & 0.96*** & & & & \\
Volatility US & & 0.85 & & & & & & 0.88 & & & & & & 0.65 & & & & & & 0.62 & & & & \\
Contagion DK & & - & & & - & & & - & & & & & & - & & & - & & & 0.21* & & & & \\
Contagion SE & & - & & & - & & & 0.23** & & & & & & - & & & - & & & & & & & \\
Contagion NO & & - & & & - & & & 0.22 & & & & & & - & & & - & & & 0.44*** & & & & \\
Contagion FI & & - & & & - & & & 0.04 & & & & & & - & & & - & & & 0.40** & & & & \\
\end{longtable}
\end{landscape}
\end{document}