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.

I have a table for my thesis which needs to be landscape breaking across pages and preferably with threeparttable. I found that threeparttablex works with longtable so I switched to that. I have two problems with the current code:

(1) When I use landscape (from pdflscape) the margins get all messed up for the that page. (2) The longtable doesn't break across pages.

\documentclass{article}             % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{a4paper}                              % ... or a4paper or a5paper or ... 
%\geometry{landscape}                       % Activate for for rotated page geometry
\usepackage[parfill]{parskip}           % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}               % Use pdf, png, jpg, or epsß with pdflatex; use eps in DVI mode
                                % TeX will automatically convert eps --> pdf in pdflatex    

\usepackage{booktabs}
\usepackage{multirow}               % Allows rows in tables to be combined.
\usepackage{threeparttable}         % Allows for three part tables with a specified notes section.
\usepackage{threeparttablex}            % Lets threeparttable work with longtable
\usepackage{longtable}              % Allows tables to break across pages
\newcommand{\head}[1]{\textsf{\textbf{#1}}}
\renewcommand{\arraystretch}{1.3}

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}

\usepackage{tabulary}

\usepackage{rotate}
\usepackage{rotating}
\usepackage{pdflscape}          %landscape single pages
%\usepackage{lscape}


\usepackage{fontspec,microtype}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}

\setmainfont[SmallCapsFeatures={LetterSpace=6}, Numbers={Proportional,OldStyle}]{Palatino}
\setsansfont[LetterSpace=3, Numbers={Proportional,OldStyle}]{Myriad Pro}

\usepackage{floatrow}
\floatsetup[table]{capposition = top, font = sf}    % Sets table to sans serif font and puts the caption on the top

\usepackage{caption}
\captionsetup[table] {font=sf,justification=justified, singlelinecheck=false}

\usepackage{amssymb}


\title{Dissertation}
\author{Test}
%\date{}                            % Activate to display a given date or no date

\begin{document}
\maketitle
%\section{}
%\subsection{}

This is a test and I really hope I can get Tex to work for me.
For diversity, I use the Shannon-Weiner diversity index (SWDI) which is calculated as: \[SWDI = - \Sigma p_i *\!  \ln(p_i)\] \label{SWDI} where $p_i = $ the share of the primary energy source $i$ in the TPES.



\begin{landscape}
\begin{table*}
  \begin{ThreePartTable}
    \caption{Indicators of energy security in long-term energy transformation scenarios}
         \begin{longtable}{p{2.2cm} p{2.5cm} p{1cm} p{2.5cm} p{3.7cm} p{2cm} p{3cm} p{2cm}}
          \toprule  
        \head{Test} & \centering{\head{Concern(s)}} &\centering{ \head{Unit}} & \centering{\head{Definition}} & \centering{\head{Formula}} & \centering{\head{Geography}} & \centering{\head{Sector}} & \head{References}\\
       \midrule
       \multicolumn{8}{c}{\head{\centering Sovereignty Indicators}} \\
       \midrule
           \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
           \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
                   \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
                   \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
                       \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\         
               \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
               \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 
        \raggedright{\head{Test}} & \raggedright{Test} & \centering Test & \raggedright{Test Test Test Test Test Test} & $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test & \centering{Test} & \raggedright{\head{Test Test Test Test Test Test Test}, Test Test Test Test} & \cite{Test}\\ 

         \bottomrule
    \end{longtable}
     \begin{tablenotes}
       \small
       \item Notes: \item[a] This thesis uses the Shannon Wiener diversity index (see the equation for the \ref{SWDI}) for all diversity calculations. 
            \item[b] Neff \cite{*Neff:1997tk} and Lefevre \cite{*Lefevre:2007wg} use the Herfindahl-Hirschmann index. Costantini \cite{*Costantini:2007hx} use both the SWDI and HHI. Figures in italics show the ratios of the projected extraction volumes to the last column: Reserves and Resources estimates from the Global Energy Assessment \cite{Rogner:2012uq}. These estimates exclude gas hydrates and additional occurrences which are highly uncertain technologically and economically. Models have their own resource availability and cost curves which are not reported in this article but which are discussed in \cite{McCollum:wi}.
     \end{tablenotes}
   \end{ThreePartTable}
\end{table*}
\end{landscape}

\end{document}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

A table or table* environment is not breakable so it's the culprit.

Here's a working version, correcting some of the glitches in your input.

\documentclass{article}             % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{a4paper}                              % ... or a4paper or a5paper or ... 
%\geometry{landscape}                       % Activate for for rotated page geometry
\usepackage[parfill]{parskip}           % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}               % Use pdf, png, jpg, or epsß with pdflatex; use eps in DVI mode
                                % TeX will automatically convert eps --> pdf in pdflatex    

\usepackage{booktabs}
\usepackage{multirow}               % Allows rows in tables to be combined.
\usepackage{threeparttable}         % Allows for three part tables with a specified notes section.
\usepackage{threeparttablex}            % Lets threeparttable work with longtable
\usepackage{longtable}              % Allows tables to break across pages
\newcommand{\head}[1]{\textsf{\textbf{#1}}}
\renewcommand{\arraystretch}{1.3}

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\usepackage{tabulary}

\usepackage{rotate}
\usepackage{rotating}
\usepackage{pdflscape}          %landscape single pages

\usepackage{fontspec,microtype}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}

\setmainfont[SmallCapsFeatures={LetterSpace=6}, Numbers={Proportional,OldStyle}]{Palatino}
\setsansfont[LetterSpace=3, Numbers={Proportional,OldStyle}]{Myriad Pro}

\usepackage{floatrow}
\floatsetup[table]{capposition = top, font = sf}    % Sets table to sans serif font and puts the caption on the top

\usepackage{caption}
\captionsetup[table] {font=sf,justification=justified, singlelinecheck=false}

\usepackage{amssymb}


\title{Dissertation}
\author{Test}
%\date{}                            % Activate to display a given date or no date

\begin{document}
\maketitle
%\section{}
%\subsection{}

This is a test and I really hope I can get Tex to work for me. For diversity, I use the Shannon-Weiner diversity 
index (SWDI) which is calculated as: \[SWDI = - \Sigma p_i *\!  \ln(p_i)\] \label{SWDI} where $p_i = $ the share 
of the primary energy source $i$ in the TPES.



\begin{landscape}
\begin{ThreePartTable}
\begin{longtable}{P{2.2cm} P{2.5cm} C{1cm} P{2.5cm} p{3.7cm} C{2cm} p{3cm} p{2cm}}
\caption{Indicators of energy security in long-term energy transformation scenarios}\\

\toprule  
\head{Test} & \centering\head{Concern(s)} &\centering\head{Unit} &
 \centering\head{Definition} & \centering\head{Formula} &
 \centering\head{Geography} & \centering\head{Sector} & \head{References}\\
\midrule
\multicolumn{8}{c}{\head{Sovereignty Indicators}} \\
\midrule
\endfirsthead

\toprule
\head{Test} & \centering\head{Concern(s)} &\centering\head{Unit} &
 \centering\head{Definition} & \centering\head{Formula} &
 \centering\head{Geography} & \centering\head{Sector} & \head{References}\\
\midrule
\multicolumn{8}{c}{\head{Sovereignty Indicators}} \\
\midrule
\endhead

\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\head{Test} & Test & Test & Test Test Test Test Test Test & 
  $Trade_i = \Sigma s_i$ where $s_i $ Test Test Test Test Test Test Test Test Test Test Test Test &
  Test & \head{Test Test Test Test Test Test Test}, Test Test Test Test & Test \\ 
\bottomrule
\end{longtable}
\begin{tablenotes}
\small
\item Notes: 

\item[a] This thesis uses the Shannon Wiener diversity index (see the equation for the \ref{SWDI}) for all 
  diversity calculations.

\item[b] Neff \cite{*Neff:1997tk} and Lefevre \cite{*Lefevre:2007wg} use the Herfindahl-Hirschmann index. 
  Costantini \cite{*Costantini:2007hx} use both the SWDI and HHI. Figures in italics show the ratios of the 
  projected extraction volumes to the last column: Reserves and Resources estimates from the Global Energy 
  Assessment \cite{Rogner:2012uq}. These estimates exclude gas hydrates and additional occurrences which are 
  highly uncertain technologically and economically. Models have their own resource availability and cost curves 
  which are not reported in this article but which are discussed in \cite{McCollum:wi}.

\end{tablenotes}
\end{ThreePartTable}
\end{landscape}

\end{document}
share|improve this answer
    
That is wonderful. Thank you very much egreg! I don't have enough reputation to vote up yet but as soon I do I will. –  jjewell Mar 11 '13 at 11:00

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.