在我的论文附录中,我使用了该longtable
包制作了两张长表格。单独使用时,它们工作正常,没有错误,但当我将它们放在一起时,会出现以下错误:
Extra alignment tab has been changed to \cr \end{longtable}
我在网上查看过,发现人们由于指定了错误数量的列或忘记了\\
某处而遇到类似的错误,但我在我的代码中找不到任何这些错误(也许我对我的代码视而不见,所以如果错误是由于这样一个愚蠢的错误造成的,我很抱歉:P)
我已将代码粘贴在下面,并在我的文档中添加了我使用的所有包,以防其中一个包导致错误。请原谅任何丑陋的代码,我最近才开始使用 latex ;P 如何轻松地将代码添加到这个问题中?我需要“永远”才能在每行开头插入所有这些空格 :P
\documentclass[pdftex,10pt,b5paper,twoside]{book}
\usepackage{bigfoot} %
\usepackage{chngcntr}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{arydshln}
\usepackage{colortbl}
\usepackage{diagbox}
\usepackage{lettrine}
\usepackage{marginnote}
\usepackage{picinpar}
\usepackage{sidecap}
\usepackage{booktabs}
\usepackage[utf8]{luainputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{color}
\usepackage[activate={true,nocompatibility},final]{microtype}
\usepackage[round]{natbib}
\bibpunct{(}{)}{,}{a}{}{;}
\usepackage{har2nat}
\setcounter{secnumdepth}{0}
\pagenumbering{arabic}
\usepackage{amsmath}
\usepackage{setspace}
\onehalfspacing
\usepackage[font=it, labelfont=bf,width=\textwidth ]{caption}
\usepackage[lmargin=25mm,rmargin=25mm,tmargin=27mm,bmargin=30mm]{geometry}
\usepackage{tabularx}
\usepackage{threeparttable}
\usepackage{wrapfig}
\setlength{\parindent}{0.0in}
\setlength{\parskip}{0.1in}
\usepackage{chngcntr}
\usepackage{float}
% Figures within a column.
\makeatletter
\newenvironment{tablehere}
{\def\@captype{table}}
{}
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}
\definecolor{midnightblue}{RGB}{35,35,132}
\hypersetup{
colorlinks=true,
linkcolor=midnightblue, %internal links
urlcolor=blue, %hyperlinks
citecolor=midnightblue %citations
}
\begin{document}
\begin{longtable}{cccccc}
\caption{95 \% HPD intevals on the monthly differences between reproductive statuses within movement strategies. If the interval overlaps with zero, the difference is non-significant. The value is the latter mentioned group compared to the former, i.e. for the first row male is more displaced than female 2.}\label{tab:HPDs}\\
\hline
Mov. strat. & Comparison & Month & \multicolumn{3}{c}{95 \% HPD} \\
& & & Lower & Upper & Mean \\
\hline
\endfirsthead
\multicolumn{6}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\
\hline
Mov. & Comparison & Month & \multicolumn{3}{c}{95 \% HPD} \\
strat. & & & Lower & Upper & Mean\\
\hline
\endhead
\hline \multicolumn{6}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
Resident & F 2 : M & Jan & -7541.749 & -535.60955 & -4038.6792 \\
Resident & F 2 : M & Feb & -6110.897 & 4303.20452 & -903.8463 \\
Resident & F 2 : M & Mar & -2859.167 & 7111.11899 & 2125.9758 \\
Resident & F 2 : M & Apr & -1880.914 & 7797.36517 & 2958.2258 \\
Resident & F 2 : M & May & -9997.666 & -35.55812 & -5016.6122 \\
Resident & F 2 : M & Jun & -1970.992 & 8078.87614 & 3053.9420 \\
Resident & F 2 : M & Jul & -3089.044 & 6792.68025 & 1851.8180 \\
Resident & F 2 : M & Aug & -1647.339 & 8478.60948 & 3415.6353 \\
Resident & F 2 : M & Sep & -7463.388 & 2883.24340 & -2290.0722 \\
Resident & F 2 : M & Oct & -7235.819 & 2898.49023 & -2168.6644 \\
Resident & F 2 : M & Nov & -12968.947 & -2374.20558 & -7671.5764 \\
Resident & F 2 : M & Dec & -8329.053 & 2230.49215 & -3049.2804 \\
Resident & F 1 : M & Jan & -6569.760 & 5487.1773 & -541.29153 \\
Resident & F 1 : M & Feb & -9251.295 & 4983.5124 & -2133.89130 \\
Resident & F 1 : M & Mar & -6903.880 & 7310.9649 & 203.54265 \\
Resident & F 1 : M & Apr & -5868.838 & 8064.0137 & 1097.58794 \\
Resident & F 1 : M & May & -13241.847 & 757.4838 & -6242.18168 \\
Resident & F 1 : M & Jun & -4513.502 & 9638.8357 & 2562.66689 \\
Resident & F 1 : M & Jul & -5248.751 & 8716.3877 & 1733.81830 \\
Resident & F 1 : M & Aug & -2557.091 & 11778.7149 & 4610.81199 \\
Resident & F 1 : M & Sep & -6989.497 & 7153.1526 & 81.82776 \\
Resident & F 1 : M & Oct & -5829.542 & 8399.1912 & 1284.82463 \\
Resident & F 1 : M & Nov & -11795.802 & 2764.9795 & -4515.41109 \\
Resident & F 1 : M & Dec & -5858.474 & 8529.5752 & 1335.55038 \\
Resident & F 2 : F 1 & Jan & -8916.293 & 2661.668 & -3127.3124 \\
Resident & F 2 : F 1 & Feb & -4215.102 & 7362.859 & 1573.8784 \\
Resident & F 2 : F 1 & Mar & -3887.763 & 7690.198 & 1901.2175 \\
Resident & F 2 : F 1 & Apr & -4052.231 & 7525.731 & 1736.7500 \\
Resident & F 2 : F 1 & May & -4541.265 & 7036.696 & 1247.7152 \\
Resident & F 2 : F 1 & Jun & -5209.674 & 6368.287 & 579.3067 \\
Resident & F 2 : F 1 & Jul & -5607.750 & 5970.211 & 181.2306 \\
Resident & F 2 : F 1 & Aug & -6980.015 & 4597.946 & -1191.0343 \\
Resident & F 2 : F 1 & Sep & -7588.128 & 3989.834 & -1799.1470 \\
Resident & F 2 : F 1 & Oct & -8954.595 & 2623.366 & -3165.6144 \\
Resident & F 2 : F 1 & Nov & -8777.256 & 2800.705 & -2988.2752 \\
Resident & F 2 : F 1 & Dec & -10236.879 & 1341.083 & -4447.8981 \\
Migratory & F 2 : M & Jan & -7541.749 & -535.6095 & -4038.6792 \\
Migratory & F 2 : M & Feb & -7464.934 & -458.7947 & -3961.8644 \\
Migratory & F 2 : M & Mar & -4996.693 & 2009.4460 & -1493.6237 \\
Migratory & F 2 : M & Apr & -1137.465 & 5868.6741 & 2365.6044 \\
Migratory & F 2 : M & May & -9658.010 & -2651.8702 & -6154.9399 \\
Migratory & F 2 : M & Jun & -4258.017 & 2748.1224 & -754.9473 \\
Migratory & F 2 : M & Jul & -5980.160 & 1025.9796 & -2477.0901 \\
Migratory & F 2 : M & Aug & -6261.208 & 744.9312 & -2758.1385 \\
Migratory & F 2 : M & Sep & -8371.023 & -1364.8839 & -4867.9536 \\
Migratory & F 2 : M & Oct & -8092.517 & -1086.3777 & -4589.4474 \\
Migratory & F 2 : M & Nov & -8286.493 & -1280.3540 & -4783.4237 \\
Migratory & F 2 : M & Dec & -7199.375 & -193.2352 & -3696.3049 \\
Migratory & F 1 : M & Jan & -6569.760 & 5487.1773 & -541.2915 \\
Migratory & F 1 : M & Feb & -11194.136 & 862.8013 & -5165.6675 \\
Migratory & F 1 : M & Mar & -9053.235 & 3003.7029 & -3024.7659 \\
Migratory & F 1 : M & Apr & -5029.539 & 7027.3985 & 998.9297 \\
Migratory & F 1 : M & May & -13061.049 & -1004.1110 & -7032.5799 \\
Migratory & F 1 : M & Jun & -6992.647 & 5064.2902 & -964.1786 \\
Migratory & F 1 : M & Jul & -8316.714 & 3740.2235 & -2288.2453 \\
Migratory & F 1 : M & Aug & -7225.498 & 4831.4399 & -1197.0289 \\
Migratory & F 1 : M & Sep & -8727.200 & 3329.7375 & -2698.7314 \\
Migratory & F 1 : M & Oct & -7082.227 & 4974.7112 & -1053.7577 \\
Migratory & F 1 : M & Nov & -7453.542 & 4603.3956 & -1425.0733 \\
Migratory & F 1 : M & Dec & -4906.800 & 7150.1373 & 1121.6685 Migratory & F 2 : F 1 & Jan & -8916.293 & 2661.668 & -3127.3124 \\
Migratory & F 2 : F 1 & Feb & -4215.102 & 7362.859 & 1573.8784 \\
Migratory & F 2 : F 1 & Mar & -3887.763 & 7690.198 & 1901.2175 \\
Migratory & F 2 : F 1 & Apr & -4052.231 & 7525.731 & 1736.7500 \\
Migratory & F 2 : F 1 & May & -4541.265 & 7036.696 & 1247.7152 \\
Migratory & F 2 : F 1 & Jun & -5209.674 & 6368.287 & 579.3067 \\
Migratory & F 2 : F 1 & Jul & -5607.750 & 5970.211 & 181.2306 \\
Migratory & F 2 : F 1 & Aug & -6980.015 & 4597.946 & -1191.0343 \\
Migratory & F 2 : F 1 & Sep & -7588.128 & 3989.834 & -1799.1470 \\
Migratory & F 2 : F 1 & Oct & -8954.595 & 2623.366 & -3165.6144 \\
Migratory & F 2 : F 1 & Nov & -8777.256 & 2800.705 & -2988.2752 \\
Migratory & F 2 : F 1 & Dec & -10236.879 & 1341.083 & -4447.8981 \\
\end{longtable}
\clearpage
\begin{longtable}{lrrrr}
\caption{Model estimates (SE) and 95 \% HPD interval describing annual variation in relative site fidelity (m) on monthly scale. All estimates are given in contrast to the intercept.}\label{tab:annualestimates}\\
\hline
Variable & Estimate (SE) & \multicolumn{3}{c}{95 \% HPD} \\
& & Lower & Upper & Mean \\
\hline
\endfirsthead
\multicolumn{5}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
Variable & Estimate (SE) & \multicolumn{3}{c}{95 \% HPD} \\
& & Lower & Upper & Mean \\
\hline
\endhead
\hline
\multicolumn{5}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
(Intercept) & 9806.016 (1556.862) & 9812.78 & 6806.08 & 12819.48 \\
F 1 & -768.514 (3149.245) & -550.57 & -6628.32 & 5527.18 \\
F 2 & -4053.925 (1831.782) & -3914.75 & -7468.49 & -361.01 \\
February & -2228.135 (1667.649) & -2231.54 & -5541.76 & 1078.68 \\
March & -3334.315 (1570.738) & -3345.38 & -6463.35 & -227.41 \\
April & -3241.632 (1511.672) & -3207.57 & -6187.97 & -227.17 \\
May & 455.817 (1515.323) & 483.24 & -2492.24 & 3458.72 \\
June & -5949.511 (1584.989) & -5890.10 & -9034.46 & -2745.73 \\
July & -5014.721 (1534.022) & -4999.94 & -8020.78 & -1979.11 \\
August & -6174.519 (1602.006) & -6169.19 & -9363.47 & -2974.91 \\
September & -1832.674 (1658.089) & -1783.49 & -5040.94 & 1473.95 \\
October & -2273.279 (1648.846) & -2184.94 & -5447.88 & 1078.01 \\
November & 3944.732 (1798.605) & 4011.84 & 423.98 & 7599.69 \\
December & -149.278 (1730.815) & -202.04 & -3644.26 & 3240.18 \\
Resident & -5235.626 (1734.428) & -5484.70 & -8802.11 & -2167.28 \\
F 1:February & -4624.376 (3504.09) & -4590.18 & -11536.34 & 2355.99 \\
F 2:February & 76.815 (1943.281) & 97.39 & -3735.27 & 3930.06 \\
F 1:March & -2483.474 (3179.528) & -2338.25 & -8529.83 & 3853.32 \\
F 2:March & 2545.056 (1848.627) & 2424.81 & -1249.08 & 6098.69 \\
F 1:April & 1540.221 (3040.248) & 1464.91 & -4571.65 & 7501.47 \\
F 2:April & 6404.284 (1759.22) & 6236.48 & 2764.61 & 9708.36 \\
F 1:May & -6491.288 (3042.934) & -6439.33 & -12506.71 & -371.95 \\
F 2:May & -2116.261 (1766.918) & -2096.42 & -5620.09 & 1427.26 \\
F 1:June & -422.887 (3191.366) & -468.31 & -6780.57 & 5843.94 \\
F 2:June & 3283.732 (1863.529) & 3249.60 & -458.04 & 6957.24 \\
F 1:July & -1746.954 (3119.257) & -1485.28 & -7644.04 & 4673.49 \\
F 2:July & 1561.589 (1795.252) & 1446.82 & -2110.81 & 5004.45 \\
F 1:August & -655.737 (3473.329) & -552.09 & -7412.98 & 6308.80 \\
F 2:August & 1280.541 (1878.105) & 1524.68 & -2238.70 & 5288.05 \\
F 1:September & -2157.44 (3499.55) & -2286.67 & -9131.44 & 4558.10 \\
F 2:September & -829.274 (1932.929) & -879.36 & -4719.97 & 2961.26 \\
F 1:October & -512.466 (3356.565) & -700.82 & -7349.51 & 5947.87 \\
F 2:October & -550.768 (1887.969) & -623.17 & -4349.89 & 3103.56 \\
F 1:November & -883.782 (3568.273) & -697.01 & -7812.49 & 6418.47 \\
F 2:November & -744.744 (2044.25) & -484.92 & -4596.20 & 3626.36 \\
F 1:December & 1662.96 (3437.784) & 1635.42 & -5219.25 & 8490.10 \\
F 2:December & 342.374 (1969.936) & 524.91 & -3373.75 & 4423.58 \\
February:Resident & 3071.722 (1971.677) & 2866.91 & -1056.93 & 6790.76 \\
March:Resident & 3721.583 (1837.282) & 3813.76 & 216.53 & 7410.98 \\
April:Resident & 399.018 (1748.478) & 351.73 & -3099.83 & 3803.30 \\
May:Resident & 1001.444 (1754.298) & 895.78 & -2553.84 & 4345.40 \\
June:Resident & 3481.517 (1850.373) & 3495.99 & -132.70 & 7124.69 \\
July:Resident & 4419.15 (1792.044) & 4456.97 & 925.83 & 7988.12 \\
August:Resident & 5977.879 (1903.629) & 5815.83 & 2082.02 & 9549.65 \\
September:Resident & 2615.86 (1944.834) & 2737.57 & -1116.26 & 6591.40 \\
October:Resident & 2411.506 (1887.149) & 2290.33 & -1429.23 & 6009.89 \\
November:Resident & -3040.899 (2033.56) & -3077.07 & -7159.88 & 1005.74 \\
December:Resident & 522.02 (1974.859) & 376.62 & -3503.35 & 4256.59 \\
\hline
\end{longtable}
\end{document}
答案1
最简单的解决方法似乎是将arydshln
包移到第一个位置。因此,您将获得以下部分顶部代码:
\documentclass[pdftex,10pt,b5paper,twoside]{book}
\usepackage{arydshln}
\usepackage{bigfoot} %
\usepackage{chngcntr}
\usepackage{hyperref}
虽然这是一种解决方法,但它似乎能给出你想要的结果。我不知道它是否会干扰文档的其他部分,你必须尝试一下。
感谢您egreg
注意到导致错误的包。