Graphics, Figures & TablesColumn titles, tablefootnotes, longtable, and landscape

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

Column titles, tablefootnotes, longtable, and landscape

Post by KatarinaD »

Im having troulbe with my tables in the review paper I'm writing. This is my first LaTeX document.

I have searched the forum, the LaTeX user's guide by L. Lamport and a Danish online manual by L. Madsen - but I still can't get it right.

The answer might be where I looked - but I just don't get it.

I would like my tables to:
- be rotated 90 degrees (landscape)
- continue on the next page if one is too long for a single page
- start the columns on the next page with the same titles as on the first page
- have tablefootnotes at the bottom of the table

I have read that 'sidewaystable' (where the column-titles ARE transfered to the next page if I get it rigth?) is a float but that since 'longtable' is NOT a float I have to use 'lscape' which don't transfer the column-titles?

About the tablefootnotes... I'm not sure where to put them in the TeX-document? After which command/environment - or before which?

Any help would be appriciated. Thank you.

Code: Select all

        \documentclass[a4paper, 12pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{latexsym}
%\usepackage{kpfonts}
\usepackage[english]{babel}
%\usepackage[round,sort&compress]{natbib}   % Natbib for better citations %longnamesfirst
\usepackage{lscape}	% landscape env
\usepackage[bottom]{footmisc}% places footnotes at page bottom
\usepackage{rotating}
\usepackage{longtable}
%\usepackage{tabu}
\usepackage{tablefootnote}
\usepackage{lipsum}
%\usepackage{blindtext}
%\usepackage{fancyref}
%\renewcommand{\fancyrefdefaultformat}{plain}
\usepackage[authoryear,round,colon]{natbib}


\begin{document}
\begin{landscape}
\scriptsize
\centering
\begin{longtable}{p{1,9cm}p{1,2cm}p{1,9cm}p{1,9cm}p{2cm}p{2,6cm}p{2,6cm}p{2,7cm}p{4,5cm}}
 \caption{Improved Detection Models}
  \label{tab:5}
  \\
  \toprule
  \multicolumn{9}{c}{Dairy cows}
    \\
  \midrule
   Paper&Focus&Method&Improvement&Sensor&Variables&Performance&Performance method&Misc
   \\
  \toprule

\citet{Ref166}&CM\newline Oestrus\newline Other diseases&Time series\newline Kalman filter&Cow-specific information: \newline DIM\newline Calved\newline In oestrus\newline Inseminated\newline In calf\newline Days since last oestrus observation&AMS-like sensors but in milking parlour&Milk yield\newline Temperature\newline EC\newline Activity\newline Concentrate intake&HSE (oestrus) 93 (SP 94)\newline HSP (CM) 99,6 (SE 8)&HSE (oestrus) confidence interval 95\newline HSP (CM) confidence interval 99,9&Model tested in four commercial farms (field condition)\\
\citet{Ref12}&CM&Multivariate model&Fuzzy logic&AMS sensors\newline SCC weekly from pooled samples&Milk yield\newline Milk flow rate\newline Time between milkings\newline Milk production rate\newline EC\newline SCC&HSE 92,9 (SP 93,9)\newline HSP 94,0 (SE 81,1)&HSE error rate of 95,5\%\newline HSP error rate of 96,1\% &Sensitivity set to be minimum 80\%\newline Three thresholds for definition of CM\\
%should EC be denotated quarter or udder? Performance method might need reformulation
\citet{Ref46}&CM&Univariate model (ISCC as threshold)\newline Univariate model (AMS-measured EC as threshold)\newline Multivariate model (combination of ISCC and EC)&Fuzzy logic&AMS-sensors\newline Inline SCC (ISCC)\newline Monthly laboratorial determination of SCC (FSCC)&ISCC\newline EC\newline FSCC\newline Visual observation&Highest Success Rate (HSR) 32\% (False alert rate (FAR) 1,2\%)\newline Lowest FAR 1,2\% (Success Rate 32\%)&HSR Combined model, largest time window\newline Lowest FAR Combined model, largest time window&Alert threshold adjustet to set sensitivity closest possible to 80\newline Four different time windows used\\
\citet{Ref297}&Mastitis\newline Lameness&Wavelet filtering\newline Vector autoregressive model (VAR)&Multivariate cumultative sum (MCUSUM)&Milk meter\newline Feeding troughs with sensors\newline Pedometer&EC\newline Milk Yield\newline Feeding pattern\newline Activity&Mastitis:\newline HSE 78,9 (SP 80,4)\newline HSP 80,4 (SE 78,9)\newline Lameness:\newline HSE 74,3 (SP 75,7)\newline HSP 81,0 (SE 74,2)&Mastitis:\newline HSE+HSP VAR+MCUSUM\newline Lameness: HSE VAR+MCUSUM\newline HSP Wavelet filtering+MCUSUM &Diseases defined as disease blocks\newline TP (cows/day) and FP (cows/day) registered\\
\citet{Ref288}&Lameness&StepMetrix (a logistic regression model that relates clinical lameness diagnosis to limb movement and calculates the probability of a cow being lame on one of it's hind limbs)&B-spline transformation of limb movement variables (LMV)&Force\newline Load cells&All variables at both limb- and cow level:\newline Peak ground reaction force\newline Average ground reaction force\newline Stance time of a limb\newline Forund reaction force integral&Hind limb:\newline HSE 99 (SP 97,0)\newline HSP 97,1 (SE 95,0)\newline Cow:\newline HSE 99,5 (SP 100)\newline HSE 100 (SE 99,5)&Spline-transformed (LMV)\newline Hind limb:\newline HSE 15 knots\newline HSP 13 knots\newline Cow:\newline HSE 15 knots\newline HSP 15 knots&No difference in accuracy related to three degrees of freedom\\
 \citet{Ref244}&Lameness&Partial least squares discriminant analysis (PLS-DA)&Cross-validation\newline Logistic regression\newline Backward variable selection of originally 320 variables&AMS\newline Activity tag\newline Manual gait score&Parity 1: 17\newline Parity 2 28\newline (variables not specified)&Parity 1:\newline SE 79 SP 77\newline Parity 2:\newline SE 79 SP 83&Cross-validation (leave-one-cow-out)&Almost 50\% of observations (gait score 2) excluded\\
 \citet{Ref264}&Disease onset&Mixed models\newline Autroregressive model&Health monitoring shemes\newline CUSUM\newline Shewhart control chart&Milk meter&25 health events\newline Parity\newline Number of calves\newline Calving difficulty&Target SP of 98,99 and 99,5\% used\newline SE estimated for four health event groups\newline Not reported in paper&-& Cows milked in parlour\\%not sure this should be included in review...
 \citet{Ref265}&CM\newline Oestrus\newline Other diseases&Time series&Kalman filter\newline Cow information&Pedometer\newline &QMC\newline Milk yield\newline Milk temperature\newline Activity level\newline General cow information from MIS&Oestrus:\newline HSE 96,9 (SP 86,5)\newline CM:\newline HSE 90 (SP 98,2)\newline Other diseases (HSE 94,5) SP 93,5&Multivariate distribution of parameters\newline Cow level&Reference data partly from bacteriological culturing\newline Sensors for milk variables not described\newline Algorithm and threshold values developed in a pilot study\\
\midrule
\\
\hline
\end{longtable}
\end{landscape}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Re: Column titles, tablefootnotes, longtable, and landscape

Post by KatarinaD »

Do I have too many questions in one post?

Or is it maybe not fully clear what my problem is?

I would like to explain or rephrase if needed. I really need help ;)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Column titles, tablefootnotes, longtable, and landscape

Post by Johannes_B »

Hi, quite a lot of questions, but all stemming from the same problem. I am a bit busy and tired these days, so i haven't looked into the matter and hoped somebody else would jump in. Unfortunately, we are a bit short on helpers right now.

Lamports work was the starting point for something very successful, leading to thousands of packages. I don't know the document written by Lars, but i think it will be of very good quality.

Back to topic, please have a look at packages supertabular and ltablex, maybe even tablefootnotes.

I might have some spare time over the weekend and look into this again. But no promises :-(
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

Re: Column titles, tablefootnotes, longtable, and landscape

Post by KatarinaD »

Thank you very much Johannes_B

I will look into the packages you suggest.

And no stress.. I can really use the help - but for now I have found a way to at least get the tables to be on multiple pages when I print instead of just going out of the paper-range. This makes me able to write the discussion and analysis although the tables do not look even close to a usable endproduct.

This sums up to: Don't stress about answering my questions - I will be happy to get an answer when you (or someone else) have time.

Lars' book is this one (in Danish): http://data.math.au.dk/system/latex/bog ... -20-10.pdf

It is of very high quality (in my poor judgement) and might be of help to other Danish LaTeX-users :)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Column titles, tablefootnotes, longtable, and landscape

Post by Johannes_B »

All i could come up with is the follwing. The table is still too wide and too large for a simple A4 sheet. It is common in some areas, to have a few larger sheets of paper, simply folded within the document. The reader can unfold the page and have quite a bunch of information available.

Code: Select all

\documentclass[a4paper, 12pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{threeparttable}
\usepackage[english]{babel}
\usepackage{pdflscape}     % landscape env
\usepackage{rotating}
\usepackage{longtable}
\usepackage[authoryear,round,colon]{natbib}

\newcolumntype{L}[1]{>{\raggedright\arraybackslash\hbox{}}p{#1}}

\begin{document}
\begin{landscape}
	\scriptsize
	\renewcommand{\arraystretch}{2}
	\centering
	\begin{longtable}{p{1,9cm}L{1,2cm}L{1,9cm}L{1,9cm}L{2cm}L{2,6cm}L{2,6cm}L{2,7cm}L{4,5cm}}
		\caption{Improved Detection Models} \label{tab:5} \endfirsthead
		\toprule
		\multicolumn{9}{c}{Dairy cows} \\
		\midrule
		Paper&Focus&Method&Improvement&Sensor&Variables&Performance&Performance method&Misc \endhead
		\toprule

		\citet{Ref166}&CM\newline
 Oestrus\newline
 Other diseases&Time series\newline
 Kalman filter&Cow-specific information: \newline
 DIM\newline
 Calved\newline
 In oestrus\newline
 Inseminated\newline
 In calf\newline
 Days since last oestrus observation&AMS-like sensors but in milking parlour&Milk yield\newline
 Temperature\newline
 EC\newline
 Activity\newline
 Concentrate intake&HSE (oestrus) 93 (SP 94)\newline
 HSP (CM) 99,6 (SE 8)&HSE (oestrus) confidence interval 95\newline
 HSP (CM) confidence interval 99,9&Model tested in four commercial farms (field condition)\\
 \citet{Ref12}&CM&Multivariate model&Fuzzy logic\tnote{ katarina }&AMS sensors\newline
 SCC weekly from pooled samples&Milk yield\newline
 Milk flow rate\newline
 Time between milkings\newline
 Milk production rate\newline
 EC\newline
 SCC&HSE 92,9 (SP 93,9)\newline
 HSP 94,0 (SE 81,1)&HSE error rate of 95,5\%\newline
 HSP error rate of 96,1\% &Sensitivity set to be minimum 80\%\newline
 Three thresholds for definition of CM\\
																				       %should EC be denotated quarter or udder? Performance method might need reformulation
		\citet{Ref46}&CM&Univariate model (ISCC as threshold)\newline
 Univariate model (AMS-measured EC as threshold)\newline
 Multivariate model (combination of ISCC and EC)&Fuzzy logic&AMS-sensors\newline
 Inline SCC (ISCC)\newline
 Monthly laboratorial determination of SCC (FSCC)&ISCC\newline
 EC\newline
 FSCC\newline
 Visual observation&Highest Success Rate (HSR) 32\% (False alert rate (FAR) 1,2\%)\newline
 Lowest FAR 1,2\% (Success Rate 32\%)&HSR Combined model, largest time window\newline
 Lowest FAR Combined model, largest time window&Alert threshold adjustet to set sensitivity closest possible to 80\newline
 Four different time windows used\\
		\citet{Ref297}&Mastitis\newline
 Lameness&Wavelet filtering\newline
 Vector autoregressive model (VAR)&Multivariate cumultative sum (MCUSUM)&Milk meter\newline
 Feeding troughs with sensors\newline
 Pedometer&EC\newline
 Milk Yield\newline
 Feeding pattern\newline
 Activity&Mastitis:\newline
 HSE 78,9 (SP 80,4)\newline
 HSP 80,4 (SE 78,9)\newline
 Lameness:\newline
 HSE 74,3 (SP 75,7)\newline
 HSP 81,0 (SE 74,2)&Mastitis:\newline
 HSE+HSP VAR+MCUSUM\newline
 Lameness: HSE VAR+MCUSUM\newline
 HSP Wavelet filtering+MCUSUM &Diseases defined as disease blocks\newline
 TP (cows/day) and FP (cows/day) registered\\
		\citet{Ref288}&Lameness&StepMetrix (a logistic regression model that relates clinical lameness diagnosis to limb movement and calculates the probability of a cow being lame on one of it's hind limbs)&B-spline transformation of limb movement variables (LMV)&Force\newline
 Load cells&All variables at both limb- and cow level:\newline
 Peak ground reaction force\newline
 Average ground reaction force\newline
 Stance time of a limb\newline
 Forund reaction force integral&Hind limb:\newline
 HSE 99 (SP 97,0)\newline
 HSP 97,1 (SE 95,0)\newline
 Cow:\newline
 HSE 99,5 (SP 100)\newline
 HSE 100 (SE 99,5)&Spline-transformed (LMV)\newline
 Hind limb:\newline
 HSE 15 knots\newline
 HSP 13 knots\newline
 Cow:\newline
 HSE 15 knots\newline
 HSP 15 knots&No difference in accuracy related to three degrees of freedom\\
		\citet{Ref244}&Lameness&Partial least squares discriminant analysis (PLS-DA)&Cross-validation\newline
 Logistic regression\newline
 Backward variable selection of originally 320 variables&AMS\newline
 Activity tag\newline
 Manual gait score&Parity 1: 17\newline
 Parity 2 28\newline
 (variables not specified)&Parity 1:\newline
 SE 79 SP 77\newline
 Parity 2:\newline
 SE 79 SP 83&Cross-validation (leave-one-cow-out)&Almost 50\% of observations (gait score 2) excluded\\
		\citet{Ref264}&Disease onset&Mixed models\newline
 Autroregressive model&Health monitoring shemes\newline
 CUSUM\newline
 Shewhart control chart&Milk meter&25 health events\newline
 Parity\newline
 Number of calves\newline
 Calving difficulty&Target SP of 98,99 and 99,5\% used\newline
 SE estimated for four health event groups\newline
 Not reported in paper&-& Cows milked in parlour\\%not sure this should be included in review...
		\citet{Ref265}&CM\newline
 Oestrus\newline
 Other diseases&Time series&Kalman filter\newline
 Cow information&Pedometer\newline
 &QMC\newline
 Milk yield\newline
 Milk temperature\newline
 Activity level\newline
 General cow information from MIS&Oestrus:\newline
 HSE 96,9 (SP 86,5)\newline
 CM:\newline
 HSE 90 (SP 98,2)\newline
 Other diseases (HSE 94,5) SP 93,5&Multivariate distribution of parameters\newline
 Cow level&Reference data partly from bacteriological culturing\newline
 Sensors for milk variables not described\newline
 Algorithm and threshold values developed in a pilot
 study\footnotemark\\
		\midrule
		\\
		\hline
		\footnotetext{This is the text of the footnote}
	\end{longtable}
\end{landscape}

\end{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

Re: Column titles, tablefootnotes, longtable, and landscape

Post by KatarinaD »

Thank you very much :)

This solution will work. Thanks a lot.
Post Reply