Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

in the appendices of my thesis I have two long tables for which I use the longtable package. Separately they work fine, no errors, but when I have after each other I get errors such as:

Extra alignment tab has been changed to \cr \end{longtable}

I have looked around on the web and found people getting similar error due to mispecified number of columns or forgotten \\ somewhere, but I can't find any of that in my code (perhaps I've gotten blind on my code, so sorry if the error is due to such a dumb mistake :P )

I have pasted the code beneath and added all the packages I use otherwise in my document in case it is one of these causing the error. Pardon any ugly code, I have only recently started with latex ;P How does one add the code easily to this question? I takes "forever" to insert all those spaces at the beginning of each line :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}
share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. –  Peter Jansson Mar 5 '13 at 10:35
    
The error seems to disappear if I remove the call to the arydshln package. –  egreg Mar 5 '13 at 11:04
    
This is not a minimal example. First, you can simply remove the first longtable without removing the error. Second, the tables are so long it takes a long time to move from start to end of file. As @egreg notices the error goes away if you remove some packages. (I noticed the same.) I suggest you resubmit a minimal version of the input that still exhibits the problems. I doubt if many people are willing to do this kind of preprocessing for you. –  Marc van Dongen Mar 5 '13 at 11:14
    
Actually for me, the example works if I remove the second table. The error remains if i remove the first table. –  Mythio Mar 5 '13 at 11:21
    
@Mythio I didn't try removing the second table. All I tried was removing the first. It's just to show, the example isn't minimal. –  Marc van Dongen Mar 5 '13 at 12:39

1 Answer 1

up vote 0 down vote accepted

The easiest fix seems to be to move the arydshln package to the first spot. So you would get this as partial top code:

\documentclass[pdftex,10pt,b5paper,twoside]{book}
\usepackage{arydshln}
\usepackage{bigfoot}        %
\usepackage{chngcntr}
\usepackage{hyperref}

Its a workaround though, but it seems to give the result you want. I don't know if it messes with other parts of your document, you'll have to try that out.

Thanks to egreg for noticing the package causing the error.

share|improve this answer
    
Thank you everyone! Changing the order of the packages worked! I can't see why, but :P egreg should have gotten the accepted answer anyhow... –  Endre Grüner Ofstad Mar 5 '13 at 12:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.