3

within my thesis I want to have a page break within tables that are very long, and which are created with tabularx and booktabs packages. Surprisingly I could not find any applicable solution for my problem so far, that works fine.

Here is a MWE of the table I would like to be broken over two pages:

\documentclass[10pt,a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{eurosym}
\begin{document}



\begin{table}[h!]
\caption{Overview of Key Variables}
\begin{tabularx}{\textwidth}{p{4cm}Xp{1.5cm}}
\toprule
Variable & Question& Scale\\ 
\midrule
\textit{Value of sporting success}\\
{WTP\_PR} & How much would you be willing to pay in total for fan bonds in the promotion scenario? (in \EUR) & Metric\\
{WTP\_PR\_log} & Log of WTP\_PR & Metric\\
{WTP\_PR\_bin} & Binary variable of WTP\_PR (0=no WTP, 1=positive WTP) & Dummy\\
{WTP\_RE} & How much would you be willing to pay in total for fan bonds in the relegation scenario? (in \EUR) & Metric\\
{WTP\_RE\_log} & Log of WTP\_RE & Metric\\
{WTP\_RE\_bin} & Binary variable of WTP\_RE (0=no WTP, 1=positive WTP) & Dummy\\
\textit{Sport related consumption capital}&&\\
SPORT& I regularly participate in sport (at least once per week) (0=fully disagree, 5=fully agree)& Ordinal\\
SPINT & I am generally interested in sport (0=fully disagree, 5=fully agree) & Ordinal\\

\textit{Football-specific consumption capital}& & \\
FOOTP & I regularly play football (at least once per week) (0=fully disagree, 5=fully agree) & Ordinal\\
FOOTINT & I am interested in football (0=fully disagree, 5=fully agree) & Ordinal\\
GAMESHOME & How many home games of club XY do you attend per season? (open question)& Metric\\
GAMESAWAY & How many away games of club XY do you attend per season? (open question)& Metric \\
ATTEND & Sum of GAMESHOME and GAMESAWAY& Metric\\
TV & How many games of club XY do you watch on TV per season? (open question)& Metric\\
TALK & How many days a week do you talk about club XY? (open question)& Metric\\
EXPMERCH & How much money do you spend on merchandise articles of club XY per season? (0=less than \EUR50, 1=more than \EUR50) & Dummy\\
WEARMERCH & How often do you wear merchandising articles of club XY? (0=less often, 1=at least once per month)& Dummy\\


\textit{Intangible factors}&&\\
IDC & I identify myself with club XY (0=fully disagree, 5=fully agree) & Ordinal\\
FAN & I am a fan of club XY (0=fully disagree, 5=fully agree)& Ordinal \\
REPUT & It is important for the reputation of city XY that club XY does well (0=fully disagree, 5=fully agree)& Ordinal\\
HERO & The players of club XY have a role model function (0=fully disagree, 5=fully agree) & Ordinal\\
HAPPY & It makes me happy if club XY wins (0=fully disagree, 5=fully agree) & Ordinal\\
SAD & It makes me sad if club XY looses (0=fully disagree, 5=fully agree) & Ordinal\\
INTANGIBLE & Index of IDC, FAN, REPUT, HERO, HAPPY, and SAD& Ordinal\\

\textit{Socio-economic factors}  & &\\
SEX    & What is your gender? (0=male, 1=female)& Dummy\\
AGE   & How old are you? (open question)& Metric\\
YEARSLIV & For how many years have you been living in your city? (open question) & Metric \\
EDU & What is your highest educational attainment? (0=below A-levels, 1=at least A-levels)& Dummy\\
INC & What is your monthly net income? (1=up to \EUR500, 9=over \EUR4000)& Ordinal\\
\textit{Regional factors}&&\\
DISTANCE & How many km away from the stadium do you live? (0=less than 100km, 1=more than 100km)& Dummy \\
\bottomrule
\end{tabularx}
\label{tab:variables}
\end{table}


\end{document}

Many thanks in advance for helpful hints!

Yours, Magnus

2
  • a table is a box so can not break (and you should never use [!h] it usually generates a warning from latex). longtable allows breakable tables, see ltxtable for a way to keep tabularx functionality with longtable although in this case i would just use longtable X is not needed as the column width does not depend on the table content. Commented Nov 21, 2014 at 13:59
  • Thank you for the answer. I already read some entries about these packages, but could not make out an appropriate solution that compiles. Probably due to lack of skills and knowledge. I also read about longtabu. Would this make any sense in this case as well? It's the flood of choices that kills me... Commented Nov 21, 2014 at 14:28

2 Answers 2

2
\documentclass[10pt,a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{eurosym}
\begin{document}



\begin{longtable}{@{}p{4cm}p{\dimexpr\textwidth-5.5cm-4\tabcolsep}p{1.5cm}@{}}
\caption{Overview of Key Variables\label{tab:variables}}\\
\toprule
Variable & Question& Scale\\ 
\midrule
\endfirsthead
\caption[]{Overview of Key Variables (continued)}\\
\toprule
Variable & Question& Scale\\ 
\midrule
\endhead
\textit{Value of sporting success}\\
{WTP\_PR} & How much would you be willing to pay in total for fan bonds in the promotion scenario? (in \EUR) & Metric\\
{WTP\_PR\_log} & Log of WTP\_PR & Metric\\
{WTP\_PR\_bin} & Binary variable of WTP\_PR (0=no WTP, 1=positive WTP) & Dummy\\
{WTP\_RE} & How much would you be willing to pay in total for fan bonds in the relegation scenario? (in \EUR) & Metric\\
{WTP\_RE\_log} & Log of WTP\_RE & Metric\\
{WTP\_RE\_bin} & Binary variable of WTP\_RE (0=no WTP, 1=positive WTP) & Dummy\\
\textit{Sport related consumption capital}&&\\
SPORT& I regularly participate in sport (at least once per week) (0=fully disagree, 5=fully agree)& Ordinal\\
SPINT & I am generally interested in sport (0=fully disagree, 5=fully agree) & Ordinal\\

\textit{Football-specific consumption capital}& & \\
FOOTP & I regularly play football (at least once per week) (0=fully disagree, 5=fully agree) & Ordinal\\
FOOTINT & I am interested in football (0=fully disagree, 5=fully agree) & Ordinal\\
GAMESHOME & How many home games of club XY do you attend per season? (open question)& Metric\\
GAMESAWAY & How many away games of club XY do you attend per season? (open question)& Metric \\
ATTEND & Sum of GAMESHOME and GAMESAWAY& Metric\\
TV & How many games of club XY do you watch on TV per season? (open question)& Metric\\
TALK & How many days a week do you talk about club XY? (open question)& Metric\\
EXPMERCH & How much money do you spend on merchandise articles of club XY per season? (0=less than \EUR50, 1=more than \EUR50) & Dummy\\
WEARMERCH & How often do you wear merchandising articles of club XY? (0=less often, 1=at least once per month)& Dummy\\


\textit{Intangible factors}&&\\
IDC & I identify myself with club XY (0=fully disagree, 5=fully agree) & Ordinal\\
FAN & I am a fan of club XY (0=fully disagree, 5=fully agree)& Ordinal \\
REPUT & It is important for the reputation of city XY that club XY does well (0=fully disagree, 5=fully agree)& Ordinal\\
HERO & The players of club XY have a role model function (0=fully disagree, 5=fully agree) & Ordinal\\
HAPPY & It makes me happy if club XY wins (0=fully disagree, 5=fully agree) & Ordinal\\
SAD & It makes me sad if club XY looses (0=fully disagree, 5=fully agree) & Ordinal\\
INTANGIBLE & Index of IDC, FAN, REPUT, HERO, HAPPY, and SAD& Ordinal\\

\textit{Socio-economic factors}  & &\\
SEX    & What is your gender? (0=male, 1=female)& Dummy\\
AGE   & How old are you? (open question)& Metric\\
YEARSLIV & For how many years have you been living in your city? (open question) & Metric \\
EDU & What is your highest educational attainment? (0=below A-levels, 1=at least A-levels)& Dummy\\
INC & What is your monthly net income? (1=up to \EUR500, 9=over \EUR4000)& Ordinal\\
\textit{Regional factors}&&\\
DISTANCE & How many km away from the stadium do you live? (0=less than 100km, 1=more than 100km)& Dummy \\
\bottomrule
\end{longtable}




\end{document}
0

Thank you for your answer David Carlisle. In the end I used the longtabu environment. Here is the code:

\begin{longtabu} to \textwidth{p{4cm}Xp{1.5cm}}
\caption{Overview of Key Variables\label{tab:variables}}\\
\toprule
Variable & Question& Scale\\ 
\midrule
\endfirsthead
\caption[]{Overview of Key Variables (continued)}\\
\toprule
Variable & Question& Scale\\ 
\midrule
\endhead

\textit{Value of sporting success}\\
{WTP\_PR} & How much would you be willing to pay in total for fan bonds in the promotion scenario? (in \EUR) & Metric\\
{WTP\_PR\_log} & Log of WTP\_PR & Metric\\
{WTP\_PR\_bin} & Binary variable of WTP\_PR (0=no WTP, 1=positive WTP) & Dummy\\
{WTP\_RE} & How much would you be willing to pay in total for fan bonds in the relegation scenario? (in \EUR) & Metric\\
{WTP\_RE\_log} & Log of WTP\_RE & Metric\\
{WTP\_RE\_bin} & Binary variable of WTP\_RE (0=no WTP, 1=positive WTP) & Dummy\\
\textit{Sport related consumption capital}&&\\
SPORT& I regularly participate in sport (at least once per week) (0=fully disagree, 5=fully agree)& Ordinal\\
SPINT & I am generally interested in sport (0=fully disagree, 5=fully agree) & Ordinal\\

\bottomrule
\end{longtabu}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .