# width and long table with tabularx and longtable

So here it is I am new with tables in latex. I have follow the example in here How to set the width of column in longtable method? in order to use longtableand tabularx functionalities.

I want to get a table that needs both to fit on width page and to continue in the next page. The table that continues in the second page should contain the caption "continue" and the head of the table.

My driver file looks like this:

\documentclass[a4paper,twoside,11pt, times, numbered]{report}
\usepackage{longtable} %%For tables, that exceed one page
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{ltxtable}
\usepackage{pdflscape}
\usepackage{ragged2e}

\newcolumntype{L}{>{\RaggedRight\arraybackslash}X} % flush-left, while allowing hyphenation
\newcolumntype{C}{>{\Centering\arraybackslash}X}   % centered,   while allowing hyphenation

\begin{document}
% Here is where my table begins
\begingroup % restrict scope of reset of \textwidth parameter
\setlength\textwidth\textheight
\begin{landscape}
\setlength\tabcolsep{2pt}
\tiny
\LTXtable{\textwidth}{macroinvertebratesIdx.tex} % name of file that contains my table
\end{landscape}
\endgroup

\end{document}


And the file macroinvertebratesIdx.tex looks like this

\begin{longtable}{LLLLLL}

\caption{My caption}\\
\label{my-label}
\hline
\multicolumn{2}{l}{Metric} & Taxonomic resolution & Definition & Expected response to increasing perturbation & Reference \\
\hline
\multirow{5}{*}{Measures of richness} & Number of total taxa & \multirow{2}{*}{Family} & All different taxa at a site. & \multirow{11}{*}{Decrease} & \multirow{16}{*}{Resh \& Jackson, 1993; Barbour et al., 1999} \\
& Number of EPT taxa &  & Total number of taxa of the orders Ephemeroptera (mayflies), Plecoptera (stoneflies) and Trichoptera (caddisflies). &  &  \\
& Number of Ephemeroptera taxa & \multirow{3}{*}{Genus or Species} & Total number of taxa of the order Ephemeroptera (mayflies). &  &  \\
& Number of Plecoptera taxa &  & Total number of taxa of the order Plecoptera (stoneflies). &  &  \\
& Number of Trichoptera taxa &  & Total number of taxa of the order of Trichoptera (caddisflies). &  &  \\
\multirow{11}{*}{Enumerations} & Number of families in common & \multirow{9}{*}{Family} & Number of families in common between 2 samples. &  &  \\
& \%EPT &  & Ratio of EPT abundance. &  &  \\
& \%Ephemeroptera &  & Ratio of mayflies to total number of individuals. &  &  \\
& \%Plecoptera &  & Ratio of stoneflies to total number of individuals. &  &  \\
& \%Trichoptera &  & Ratio of caddisflies to total number of individuals. &  &  \\
& \%Coleoptera &  & Ratio of individuals of the order of Coleoptera to total number of individuals. &  &  \\
& \%Diptera &  & Ratio of individuals of the order of Diptera to total number of individuals. & \multirow{2}{*}{Increase} &  \\
& \%Chironomidae &  & Ratio of chironomidae individuals to total number of individuals. &  &  \\
& EPT / Chironomidae &  & Ratio of EPT abundance to chironomidae abundance. & Decrease &  \\
& \% of most dominant genus & Genus & Ratio of individuals in numerically dominant genus to total numbers of individuals. & \multirow{2}{*}{Increase} &  \\
& \% of dominant taxa & \multirow{4}{*}{Family} & Ratio of individuals in numerically dominant taxa to total number of individuals. &  &  \\
\multirow{6}{*}{Diversity and Similarity indices} & Shannon's Index &  & Description of community structure (Diversity). & Decrease & Shannon, 1948 \\
& Simpson's Index &  & Diversity index commonly used in Ecology and Biology. & Increase & Simpson, 1949 \\
& Margalef Index &  & Diversity index, where the number of species in the sample and the total number of organisms in the sampling are considered. & \multirow{7}{*}{Decrease} & Margalef, 1951 \\
& Sequential Comparison Index (SCI) & Order or Family & Description of stream quality method, based upon distinguishing the number of different types of organisms and the number of « runs ». &  & Cairns et al., 1968 \\
& Jaccard's Coefficient & \multirow{2}{*}{Family} & Description of the similarity between two samples. &  & Jaccard, 1901 \\
& Sørensen Coefficient &  & Description of the similarity between two samples. &  & Sørensen, 1948 \\
\multirow{7}{*}{Biotic indices} & Trent Biotic Index (TBI) & Family (genus for Plecoptera and Ephemeroptera nymphs and species-level for Annelida, Mollusca, Crustacea and Megaloptera) & Description of the pollution level of streams, according to the sensitivity of key groups to pollution. &  & Woodiwiss, 1964; Metcalfe 1989 \\
& Extended Biotic Index (EBI) & Family or Genus & Description of the pollution level of streams, according to the sensitivity of key groups to pollution. Aquatic ecosystems are described using « quality classes ». &  & Ghetti, 1997 \\
& Beck Biotic Index (BI) & Genus & Classification of streams according to their organic pollution. Organisms are classed according to their tolerance to organic pollution. &  & Beck, 1955 \\
& Family Biotic Index (FBI) & \multirow{10}{*}{Family} & Uses tolerance values to weight abundance in an estimate of overall pollution. Originally designed to evaluate organic pollution. & Increase & Hilsenhoff, 1982, 1988 ; Plafkin, 1989 \\
& Biological Monitoring Working Party (BMWP) &  & Score system using benthic macroinvertebrate classed according to their pollution tolerance for Britain rivers. & \multirow{3}{*}{Decrease} & ISO, 1979 ; National Water Council, 1981 \\
& Biological Monitoring Working Party – Costa Rica (BMWP/CR) &  & Score system based on the BMWP modified to include macroinvertebrate communities of Costa Rica &  & Gutiérrez-Fonseca and Lorion, 2014 \\
& Biological Monitoring Working Party- Average Score per Taxon (BMWP- ASPT) &  & Average Score Per Taxon, added to the BMWP Score System. &  & Armitage et al., 1983 \\
\multirow{5}{*}{Functional Feeding measures} & \%Filterer collectors &  & Percent of the macrobenthos that filter fine organic material. & Increase & \multirow{5}{*}{Merrit \& Cummins, 2008} \\
& \% Scrapers &  & Percent of the macrobenthos that feed on epiphytes. & \multirow{3}{*}{Decrease} &  \\
& \%Shredder &  & Percent of the macrobenthos that feed on leaf litter. &  &  \\
& \%Predators &  & Percent of the predator functional feeding group. They are carnivores-scavangers, engulf or pierce prey. &  &  \\
& \% gathering collectors &  & Percent of the macrobenthos that collect fine deposited organic material. & Variable &  \\
Multimetric approach & IBI-west central Mexico &  & Computation of multimetric approaches which is summarized in a single value. & Decrease & Weigel et al., 2002

\end{longtable}


I just can't find what I am doing wrong. Please, any hint to make this work will be deeply appreciated.

• \begin{longtable}{L}} you have not defined L but it appears to be defining a one-column table when your data has 6 columns, and it has a spurious unmatched } – David Carlisle Aug 2 '16 at 19:51
• Besides the comment of @DavidCarlisle, you also need a \\ or tabularnewline after \caption, otherwise you get an error. – Arash Esbati Aug 2 '16 at 20:01
• @Stefan it isn't clearly a good idea to fix problems by editing the question it just makes the comments and answers harder to understand when read later. – David Carlisle Aug 2 '16 at 22:09

Your column specification was completely missing, also you have some non-ascii utf8 characters but not declared inputenc You alos had \multirow commands without loading the multirow package but i removed them as they appeared mis-placed.

\documentclass[a4paper,twoside,11pt, times, numbered]{report}
\usepackage{longtable} %%For tables, that exceed one page
\usepackage{booktabs}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{ragged2e}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\begin{landscape}
\begin{longtable}{
>{\RaggedRight\hspace*{0pt}}p{1.5cm}
>{\RaggedRight}p{3cm}
>{\RaggedRight}p{3cm}
>{\RaggedRight}p{4cm}
>{\RaggedRight}p{3cm}
>{\RaggedRight\arraybackslash}p{3cm}
}

\caption{My caption\label{my-label}}\\
\hline
\multicolumn{2}{l}{Metric} & Taxonomic resolution & Definition & Expected response to increasing perturbation & Reference \\
\hline
\caption{My caption (continued}\\
\hline
\multicolumn{2}{l}{Metric} & Taxonomic resolution & Definition & Expected response to increasing perturbation & Reference \\
\hline
Measures of richness & Number of total taxa & Family & All different taxa at a site. & Decrease & Resh \& Jackson, 1993; Barbour et al., 1999 \\
& Number of EPT taxa &  & Total number of taxa of the orders Ephemeroptera (mayflies), Plecoptera (stoneflies) and Trichoptera (caddisflies). &  &  \\
& Number of Ephemeroptera taxa & Genus or Species & Total number of taxa of the order Ephemeroptera (mayflies). &  &  \\
& Number of Plecoptera taxa &  & Total number of taxa of the order Plecoptera (stoneflies). &  &  \\
& Number of Trichoptera taxa &  & Total number of taxa of the order of Trichoptera (caddisflies). &  &  \\
Enumerations & Number of families in common & Family & Number of families in common between 2 samples. &  &  \\
& \%EPT &  & Ratio of EPT abundance. &  &  \\
& \%Ephemeroptera &  & Ratio of mayflies to total number of individuals. &  &  \\
& \%Plecoptera &  & Ratio of stoneflies to total number of individuals. &  &  \\
& \%Trichoptera &  & Ratio of caddisflies to total number of individuals. &  &  \\
& \%Coleoptera &  & Ratio of individuals of the order of Coleoptera to total number of individuals. &  &  \\
& \%Diptera &  & Ratio of individuals of the order of Diptera to total number of individuals. & Increase &  \\
& \%Chironomidae &  & Ratio of chironomidae individuals to total number of individuals. &  &  \\
& EPT / Chironomidae &  & Ratio of EPT abundance to chironomidae abundance. & Decrease &  \\
& \% of most dominant genus & Genus & Ratio of individuals in numerically dominant genus to total numbers of individuals. & Increase &  \\
& \% of dominant taxa & Family & Ratio of individuals in numerically dominant taxa to total number of individuals. &  &  \\
Diversity and Similarity indices & Shannon's Index &  & Description of community structure (Diversity). & Decrease & Shannon, 1948 \\
& Simpson's Index &  & Diversity index commonly used in Ecology and Biology. & Increase & Simpson, 1949 \\
& Margalef Index &  & Diversity index, where the number of species in the sample and the total number of organisms in the sampling are considered. & Decrease & Margalef, 1951 \\
& Sequential Comparison Index (SCI) & Order or Family & Description of stream quality method, based upon distinguishing the number of different types of organisms and the number of « runs ». &  & Cairns et al., 1968 \\
& Jaccard's Coefficient & Family & Description of the similarity between two samples. &  & Jaccard, 1901 \\
& Sørensen Coefficient &  & Description of the similarity between two samples. &  & Sørensen, 1948 \\
Biotic indices & Trent Biotic Index (TBI) & Family (genus for Plecoptera and Ephemeroptera nymphs and species-level for Annelida, Mollusca, Crustacea and Megaloptera) & Description of the pollution level of streams, according to the sensitivity of key groups to pollution. &  & Woodiwiss, 1964; Metcalfe 1989 \\
& Extended Biotic Index (EBI) & Family or Genus & Description of the pollution level of streams, according to the sensitivity of key groups to pollution. Aquatic ecosystems are described using « quality classes ». &  & Ghetti, 1997 \\
& Beck Biotic Index (BI) & Genus & Classification of streams according to their organic pollution. Organisms are classed according to their tolerance to organic pollution. &  & Beck, 1955 \\
& Family Biotic Index (FBI) & Family & Uses tolerance values to weight abundance in an estimate of overall pollution. Originally designed to evaluate organic pollution. & Increase & Hilsenhoff, 1982, 1988 ; Plafkin, 1989 \\
& Biological Monitoring Working Party (BMWP) &  & Score system using benthic macroinvertebrate classed according to their pollution tolerance for Britain rivers. & Decrease & ISO, 1979 ; National Water Council, 1981 \\
& Biological Monitoring Working Party – Costa Rica (BMWP/CR) &  & Score system based on the BMWP modified to include macroinvertebrate communities of Costa Rica &  & Gutiérrez-Fonseca and Lorion, 2014 \\
& Biological Monitoring Working Party- Average Score per Taxon (BMWP- ASPT) &  & Average Score Per Taxon, added to the BMWP Score System. &  & Armitage et al., 1983 \\
Functional Feeding measures & \%Filterer collectors &  & Percent of the macrobenthos that filter fine organic material. & Increase & Merrit \& Cummins, 2008 \\
& \% Scrapers &  & Percent of the macrobenthos that feed on epiphytes. & Decrease &  \\
& \%Shredder &  & Percent of the macrobenthos that feed on leaf litter. &  &  \\
& \%Predators &  & Percent of the predator functional feeding group. They are carnivores-scavangers, engulf or pierce prey. &  &  \\
& \% gathering collectors &  & Percent of the macrobenthos that collect fine deposited organic material. & Variable &  \\
Multimetric approach & IBI-west central Mexico &  & Computation of multimetric approaches which is summarized in a single value. & Decrease & Weigel et al., 2002

\end{longtable}
\end{landscape}

\end{document}