LaTeX forum ⇒ Graphics, Figures & Tables\end{longtabu} not compiling

Information and discussion about graphics, figures & tables in LaTeX documents.
KatarinaD
Posts: 10
Joined: Mon Mar 30, 2015 9:39 am

\end{longtabu} not compiling

Postby KatarinaD » Tue Mar 31, 2015 10:48 am

Cross posted (sorry - beginner's mistake): http://tex.stackexchange.com/questions/ ... 664_236134

I have copy-pasted the codes and usepackages from a colleague to help me set up a long table landscape style. When I try to compile the copied code in a fresh document the compiling stops at the \end{longtabu} and I can not figure out why.

This is what I have in my document:
  1. \documentclass[a4paper, 12pt]{article}
  2.  
  3. \usepackage{tabularx}
  4. \usepackage[english]{babel}
  5. %\usepackage[round,sort&compress]{natbib} % Natbib for better citations %longnamesfirst
  6. \usepackage{pdflscape} % landscape env
  7. \usepackage[bottom]{footmisc}% places footnotes at page bottom
  8. \usepackage{rotating}
  9. \usepackage{longtable}
  10. \usepackage{tabu}
  11. \usepackage{tablefootnote}
  12. \usepackage{lipsum}
  13. \usepackage{blindtext}
  14. %\usepackage{fancyref}
  15. %\renewcommand{\fancyrefdefaultformat}{plain}
  16. \usepackage[round,colon]{natbib}
  17.  
  18.  
  19. \title{xxx}
  20. \author{yyy}
  21. \begin{document}
  22.  
  23. \tabcolsep=3pt % Half the width of the horizontal space between columns
  24. \extrarowsep=3pt
  25. \begin{landscape}
  26. \scriptsize
  27. \begin{longtabu} to \linewidth {
  28. p{14em} % paper col aligned left
  29. c % levels
  30. p{5em} % criterion
  31. X[2.5,l] % state var
  32. X[1,l] % stage length
  33. p{4em} % decisions
  34. l % application
  35. X[2.5,l] % misc
  36. }
  37. \caption{Overview over literature using MDPs for modeling within cattle farming.}\label{tab:cattle}\\
  38. \toprule
  39. Paper\footnotemk{a} & Levels\footnotemk{b} & Criterion\footnotemk{c} & State variables\footnotemk{d} & Stage Length\footnotemk{e} & Decisions\footnotemk{f} & Application\footnotemk{g} & Misc\\
  40. \midrule
  41. \endfirsthead
  42. \caption{Overview over literature using MDPs for modeling (cattle farming - table continued).}\\
  43. \toprule
  44. Paper\footnotemk{a} & Levels\footnotemk{b} & Criterion\footnotemk{c} & State variables\footnotemk{d} & Stage Length\footnotemk{e} & Decisions\footnotemk{f} & Application\footnotemk{g} & Misc\\
  45. \midrule
  46. \endhead
  47. %\midrule
  48. (\emph{Continued on next page}) & \\
  49. \bottomrule
  50. \endfoot
  51. \bottomrule
  52. \endlastfoot
  53. % table content
  54. %\cite{Giordano12} & ? & ? (?) & ? & ? & ? & ? & Study impact of reproductive programs. As I can read they do not use MDP?? \\
  55. %\cite{Cabrera12} & ? & ? (?) & ? & ? & ? & ? & Again they use Markov chain (so we do not include it?)\\
  56. \cite{Kalantari12} & 1 & $DR$ (VI) & lactation (9), days in preganacy (282), DIM (750), milk yield (5) & day ($\infty$) & K, R & dairy (US) & Study the effect of reproductive performance.\\
  57. \cite{Heikkila12} & 1 & $DR$ (PI) & month (78), culling reason (3), mastitis cases (5) & month ($\infty$) & K, R & dairy (FIN) & Focus on clinical mastitis \\
  58. \cite{Langford12} & 1 & $DR$ (VI) & parity (12), milk yield level (15) & parity (20) & K, R & dairy (UK) & Extension of \cite{Stott94} which study the effect on welfare \\
  59. \cite{Cha11} & 3 & $DR$ (HPI) & permanent milk yield level (5); dummy (1); temporary milk yield level (5), pregnancy state (9), clinical mastitis state (13) & cow life ($\infty$); parity (8); month (20) & I, K, R & dairy (US)& Lactation number and stage of lactation known from stage number. Extension of the work by \citet{Bar08a} and \citet{Cha10}. \\
  60. \cite{Demeter11} & 4 & $DR$ (HPI) & permanent milk yield potential (PMYP) estimated at first calving(13); PMYP estimated at the beginning of lactation (13), months open previous lactation (8); PMYP estimated this month (13), temporary milk yield capacity (13), pregnancy state (2); PMYP estimated this month (13), temporary milk yield capacity (13) & cow life ($\infty$); parity (12); month/gestation period (18); month (9) & I, K, R & dairy (NL) & Used to assess herd level implication of genetic selection strategies. Lactation number, stage of lactation and month of pregnancy known from stage numbers. \\
  61. \cite{Cabrera10} & 1 & R/T (LP) & parity (15), month in lactation (24), pregnancy status (10) & month ($\infty$) & K, R & dairy (US) & Consider different diets and nitrogen excretion \\
  62. \cite{Cha10} & 3 & $DR$ (HPI) & permanent milk yield level (5); dummy (1); temporary milk yield level (5), pregnancy state (9), lameness state (13) & cow life ($\infty$); parity (8); month (20) & I, K, R & dairy (US)& Lactation number and stage of lactation known from stage number. Extension of the work by \citet{Bar08a} with focus on lameness. \\
  63. \cite{Kalantari10} & 1 & DR (VI) & lactation (12), month after calving (24), milk production class (15), pregnancy status (10) & lactation (180) & K, R & dairy (IR) & A modification of \cite{VanArendonk85a} applied to Iran conditions. \\
  64. \cite{Nielsen10} & 3 & $DR$ (HPI) & dummy (1); milk yield potential (MYP) estimated at the beginning of lactation (13); combination of MYP estimated until present day and temporary milk yield level (45 combinations), drying off week (32) & cow life ($\infty$); parity (10); day (483) & K, R & dairy (DK) & Lactation number and stage of lactation known from stage number. Focus on management. Bayesian updating used.\\
  65. %\cite{Stygar10} & ? & ? (?) & ? & ? & ? & ? & A review of models applied to Beef prod\\
  66. \cite{Bar08,Bar08a} & 3 & $DR$ (HPI) & permanent milk yield level (5); mastitis in previous lactation (2); temporary milk yield level (5), pregnancy state (9), mastitis state in present lactation (13) & cow life ($\infty$); parity (8); month (20) & I, K, R & dairy (US)& Lactation number and stage of lactation known from stage number. Focus on cost of clinical mastitis. \\
  67. \cite{Heikkila08} & 1 & $DR$ (PI) & lactation (10), milk yield (3), health status (3) & lactation ($\infty$) & K, R & dairy (FIN) & Focus on diseases and milk yield. \\
  68. \cite{Nielsen07, Nielsen04} & 4 & $R/T$ (HPI), $R/Q$ (HPI) & birth month (12); live weight (up to 26) previous winter feeding level (2), weigh gain (5); weight gain at fattening (3) & steer life ($\infty$); seasons (summer/winter) (6); month (up to 6); month (4)& G, Fe, Fa, R & steer (DK) & \cite{Nielsen04} consider average reward per steer while in \cite{Nielsen07} the average reward per time unit is maximized \\
  69. \cite{Vries06} & 1 & $DR$ (VI) & lactation (12), days open (10), month of lactation (24), milk yield (15) & month ($\infty$) & K, R & dairy (US) & Extension of model by \cite{Vries04}.\\
  70. %\cite{Groenendaal05} & ? & ? (?) & ? & ? & ? & Not MDP: Delete \\
  71. \cite{Stott05} & 1 & $DR$ (VI) & lactation (12), milk yield (15) & lactation (20) & K, R & dairy (UK) & Studies financial incentive to control paratuberculosis. Extension of model by \cite{Stott94}.\\
  72. %\cite{Vries05} & ? & ? (?) & ? & ? & ? & ?& I don't think this is MDP: Delete \\
  73. %\cite{Groenendaal04} & ? & ? (?) & ? & ? & ? & Not MDP: Delete \\
  74. \cite{Vries04} & 1 & $DR$ (VI) & lactation (12), days open (10), month of lactation (24), milk yield (15), month of calving (12) & month ($\infty$) & K, R & dairy (US) & Studies the effect of delayed replacement with seasonal cow performance.\\
  75. \cite{Grohn03} & 1 & $DR$ (VI) & lactation (12), days open (10), month of lactation (20), milk yield (5), month of calving (12), disease state (240) & month (60) & I, K, R & dairy (US) & Extension of models by \cite{Delorenzo92} and \cite{Mccullough96}. \\
  76. \cite{Stott02} & 1 & $DR$ (VI) & lactation (12), milk yield (15), somatic cell count (11) & lactation (20) & K, R & dairy (UK) & Extension of model by \cite{Stott94}. \\
  77. \cite{Pihamaa02} & 1 & $DR$ (VI) & live weight (507) & week (326) & Fe, K, R & beef (FIN) & Study the effect of agricultural policy reforms in Finland. \\
  78. \cite{Rajala-Schultz01} & 1 & \emph{DR} (VI) & lactation (12), production level (5), month of calving (12), month of lactation (19), days open (10) & month (60) & I, K, R & dairy (FIN) & Compares optimal decisions with farmer decisions. Use of model by \cite{Mccullough96}.\\
  79. \cite{Vargas01} & 1 & \emph{DR} (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15) & month (180) & I, K, R & dairy (CR) & Based on model by \cite{VanArendonk85a}.\\
  80. \cite{Rajala-Schultz00, Rajala-Schultz00a} & 1 & $DR$ (VI) & parity (12), days open (10), stage of lactation (19), production level (3, 5, 7), month of calving (12) & month (48-120) & I, K, R & dairy (FIN) & Use of model by \cite{Mccullough96}. \\
  81. \cite{Yalcin00} & 1 & $DR$ (VI) & lactation (12), milk yield (15), somatic cell count (11) & lactation (20) & K, R & dairy (UK) & Extension of work by \cite{Stott94}\\
  82. %\cite{Makulska99} & ? & ? (?) & ? & ? & ? & ? & Model never built: Delete \\
  83. %\cite{Allore99} & ? & ? (?) & ? & ? & ? & ? & Only MC: Delete \\
  84. \cite{Cardoso99, Cardoso99a} & 1 & $DR$ (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15) & month (240) & I, K, R & dairy (BR) & Use of model by \cite{VanArendonk85a}. \\
  85. \cite{Mourits99, Mourits99a} & 2 & $DR$ (HPI) & month of birth (12); body weight (173), reproductive state (32), prepubertal growth rate (3) & rearing period ($\infty$); month (30) & Fe, I, K, R & heifers (NL) & Age of heifer known from stage number. The keep and inseminate decisions can be done under different growth strategies \\
  86. %\cite{Mourits99a} & ? & ? (?) & ? & ? & ? & ? \\
  87. %\cite{Polimeno99} & 1 & $R$ (VI) & body weight & 4 weeks (11) & Fe & dairy & Deterministic model \\
  88. %\cite{Allore98} & ? & ? (?) & ? & ? & ? & ? & Only MC: Delete \\
  89. %\cite{Lehenbauer98} & ? & ? (?) & ? & ? & ? & ? & Review paper - no model built: Delete \\
  90. %\cite{Noordegraaf98} & ? & ? (?) & ? & ? & ? & ? & Only MC: Delete \\
  91. \cite{Yates98} & 1 & $DR$ (LP) & lactation (12), genetic level (4) & year (10) & K, R & dairy (UK) & The keep decision has 2 options: produce calf for replacement or for beef. \\
  92. \cite{Dekkers98} & 1 & $DR$ (VI) & lactation $l$ (12), month in lactation (16), milk yield $l$ (15), calving intervals (6) & month (180) & I, K, R & dairy (CDN) & Quantify the impact of persistency of lactation. Adaptation of the work in \cite{VanArendonk85a} \\
  93. \cite{Haran97} & 2 & $DR$ (HPI) & month of first calving (12); current month (12), milk production level (15), time of conception (5) & cow life ($\infty$); lactation stage (72) & I, K, R & dairy (IRL) & Lactation number and stage of lactation known from stage number. \\
  94. %\cite{Mourits97} & ? & ? (?) & ? & ? & ? & heifer & No model given. Talk about a model by Galligan96 (proc) \\
  95. %\cite{Hardie96} & ? & ? (?) & ? & ? & ? & ? & PHD WITH NO ACCESS\\
  96. \cite{Mccullough96,Mccullough96a} & 1 & \emph{DR} (VI) & lactation (12), production level (15), month of calving (12), month of lactation (19), days open (10) & month (60) & I, K, R & dairy (US) & Focus: levels of state variables, milk price and management inputs. Model based on \cite{Delorenzo92} \\
  97. %\cite{Yates96,Yates96a} & ? & ? (?) & ? & ? & ? & ? & SEEMS TO BE A MC \\
  98. \cite{Houben94} & 2 & \emph{R/T} (HPI) & dummy (1); milk production $l$ (15), $l-1$ (15), calving interval (18), mastitis current month (2), mastitis cases $l$ (4), $l+1$ (4) & life span of a cow ($\infty$); month (204) & I, K, R & dairy (NL) & Focus on mastitis \\
  99. \cite{Stott94} & 1 & \emph{DR} (VI) & lactation (12), yield class (15) & lactation ($\infty$) & K, R & dairy (UK) & Uses bayesian updating for milk yield \\
  100. %\cite{Jalvingh93, Jalvingh93a, Jalvingh94} & 1 & \emph{DR} (VI) & lactation $l$ (10), stage in lactation (11), milk yield $l$ (15), time of conception (7), month of calving (12) & month (180) & I, K, R & dairy (NL) & Focus: calving patterns. MDP based on \cite{VanArendonk86}. ONLY MC\\
  101. \cite{Kennedy93} & 1 & \emph{DR} (VI) & lactation $l$ (12), yield class (5), mastitis status $l-1$ (2) & lactation ($\infty$) & K, R & dairy (UK) & Focus: model and bayesian updating\\
  102. \cite{Stott93} & 1 & $DR$ (VI) & lactation number (12), mastitis state (2) & lactation ($\infty$) & K, R & dairy (UK) & Focus on clinical mastitis. \\
  103. \cite{Delorenzo92} & 1 & \emph{DR} (VI) & lactation (12), production level (15), month of calving (12), month of lactation (16), days open (7) & month (240) & I, K, R & dairy (US) & Model based on \cite{VanArendonk86} \\
  104. %\cite{Kristensen92} & ? & ? (?) & ? & ? & ? & & Considers how to solve the multi-component system. The model is applied to the MDP in \cite{Kristensen89}. \\
  105. %\cite{Kristensen91b} & ? & ? (?) & ? & ? & ? & ? & Theoretical study - no model developed: Delete? \\
  106. \cite{Dekkers91} & 1 & $DR$ (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15), time of conception (6) & month (180) & I, K, R & dairy (CDN) & Studies economic values for breeding goals. Adaptation of the work in \cite{VanArendonk85a} \\
  107. \cite{Boichard90} & 1 & \emph{DR} (VI) & lactation $l$ (6), lactation stage (22), stage of conception (7), calving date (18), milk yield in $l$ (9), $l-1$ (9) & 20 days (200) & I, K, R & dairy (F) & Focus: economic value of conception \\
  108. \cite{Harris90} & 1 & \emph{DR} (VI) & lactation (10), best linear prediction of future milkfat production, milk volume production, milk protein production, breed, calving date (6) & year (20) & K, R & dairy (NZ) & It is not clear from the description whether an optimization is performed or the model is only used for simulation. \\
  109. \cite{Kristensen89, Kristensen91, Kristensen91a} & 2 & $R/Q$ (HPI) & estimated genetic class at first calving (5); milk yield of present lactation (15), milk yield of previous lactation (15), length of calving interval (8) & cow life ($\infty$); 4 week period (108) & K, R & dairy (DK) & Lactation number and stage of lactation known from stage number. Average reward per kg milk is maximized. Extension of work by \cite{Kristensen87}. The model is later applied by \cite{Kristensen91a,
  110. Kristensen91} \\ %\cite{Kristensen92} considers how to solve the multi-component system. \\
  111. \cite{Rogers1988a, Rogers1988b} & 1 & $DR$ (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15), time of conception (6) & month (180) & I, K, R & dairy (US) & Adaptation of the work in \cite{VanArendonk85a} \\
  112. \cite{Kristensen87} & 2 & $DR$ (HPI) & estimated genetic class at first calving (5); milk yield of present lactation (15), milk yield of previous lactation (15), length of calving interval (8) & cow life ($\infty$); lactation stage (24) & K, R & dairy (DK) & Lactation number and stage of lactation known from stage number. \\
  113. \cite{VanArendonk86} & 1 & \emph{DR} (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), time of conception (6), month of calving (12) & month (180) & I, K, R & dairy (NL) & Extension of the work in \cite{VanArendonk85} \\
  114. \cite{VanArendonk85a, VanArendonk88} & 1 & \emph{DR} (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15), time of conception (6) & month (180) & I, K, R & dairy (NL) & Extension of the work in \cite{VanArendonk85} \\
  115. \cite{VanArendonk85,VanArendonk85b} & 1 & \emph{DR} (VI) & lactation $l$ (12), stage in lactation (11), milk yield $l$ (15), $l-1$ (15) & month (240) & I, K, R & dairy (NL) & The model has had a huge impact on later models.\\
  116. \cite{Ben-Ari83, Ben-Ari86} & 1 & DR (VI) & lactation, milk yield, body weight & lactation ($\infty$) & K, R & dairy (IL) & \citet{Ben-Ari86} consider how to solve the multi-component system. \\
  117. \cite{Killen78} & 1 & $R$ (VI) & lactation number (9) & lactation (20) & R, K & dairy (IRL) & Very small model.\\
  118. \cite{Stewart77,Stewart78} & 1 & \emph{DR} (VI) & lactation (7), body weight (5), 305d milk yield (11), milk fat pct (7) & lactation (10) & R, K & dairy (CDN) & \cite{Stewart77} describe the model and \cite{Stewart78} consider different breeds. Culling decisions were assumed to occur at 60 days postcalving \\
  119. \cite{McArthur73} & 1 & $R$ (VI) & lactation number (7), milk production level (80) & lactation (15) & K, R & dairy (NZ) & Milk yield represented as average over lactations. \\
  120. \cite{Smith73,Smith71} & 1 & \emph{DR} (VI) & lactation $l$ (6), yield in $l$ (29), $l-1$ (29), calving interval (3) & lactation (15) & R, K & dairy (US) & Far more detailed model than the one by \cite{Giaever66}.\\
  121. \cite{Giaever66} & 1 & $DR$ (VI) & lactation number (5), calving interval (3), milk yield (7) & & & dairy (US) & Alternative optimization methods described. Important considerations about Markov property.\\
  122. \end{longtabu}
  123.  
  124. \footnotetxt{a}{Papers have been ordered in reverse order of year.}
  125. \footnotetxt{b}{Number of levels in the MDP. If 1 then the MDP is an ordinary MDP.}
  126. \footnotetxt{c}{$DR$ = expected discounted reward, $R$ = expected reward, $R/T$ = average reward per time unit, $R/Q$ average reward per quantity unit. Algorithm used is given in parentheses (VI = value iteration, PI = policy iteration, HPI = hierarchical policy iteration, LP = Linear programming).}
  127. \footnotetxt{d}{State variables for each level in the process (separated with semicolon). The number of levels/classes of each state variable is given in parentheses.}
  128. \footnotetxt{e}{Stage length at each level in the process (separated with semicolon). Maximum number of stages given in parentheses.}
  129. \footnotetxt{f}{R = replace, K = keep, I = Inseminate, G = Grazing, Fe = Feeding intensity, Fa = Fattening.}
  130. \footnotetxt{g}{Animal group applied to. The country from which the parameters has been estimated is given in parentheses.}
  131. \end{landscape}
  132.  
  133.  
  134.  
  135. % section MDP models applied to cattle farming (end)
  136.  
  137.  
  138.  
  139. \bibliographystyle{plainnat}
  140. %\bibliographystyle{elsarticle-harv}
  141. %\bibliographystyle{spbasic}
  142. \bibliography{Refbib}
  143.  
  144. \end{document}
Last edited by KatarinaD on Tue Mar 31, 2015 3:12 pm, edited 1 time in total.

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3795
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Mar 31, 2015 2:13 pm

Getting code from some other dude is almost always a quite bad idea, no matter how nice he is or how high his academic degree is.

Very very often, code that gets inherited like this is often old and obsolete, or simple faulty. So please be careful.


In the example above, package booktabs is missing. Furthermore, your colleague seems to have made own and a bit shorter commands, \footnotemk instead of \footnotemark
and \footnotetxt instead of \footnotetext. Maybe a package i don't know actually provides thos commands, but right now, this is impossible for me to tell.

As you can see, the benefit is minimal, but it is very very hard for a beginner to find the cause and once you send some article to a publisher, it will drive their copy editor simply mad. Some user-defined commands are usefull, but they should be defined in the document ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

KatarinaD
Posts: 10
Joined: Mon Mar 30, 2015 9:39 am

Postby KatarinaD » Tue Mar 31, 2015 3:17 pm

Thank you very much for your answer (and again: sorry for the cross posting). I can see what you mean about my colleague making his own definitions.

I will begin defining the table from scratch - and actually trying to find the solution to my problem has provided me with a lot of useful information on how to build tables - which packages exist (at least some of them) and what they do.

Thanks again :mrgreen:


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests