1

I have landscape tables which span multiple pages and are laid out as three part tables with a notes section at the bottom. The landscape tables in the document are fine at the beginning of the document. But in the landscape tables which come in the text following a normal table, the notes section is narrower (matching the width of the notes section for the preceding non-landscape table.

Here is a working example:

\listfiles
\documentclass[12pt,a4paper,bibtotoc,liststotocnumbered,pointlessnumbers]{scrreprt}             

%---------------------------------------%
%       Layout          %
%---------------------------------------%
\usepackage[parfill]{parskip}           %use line breaks instead of
\usepackage[left=3.75cm, right=3.75cm, bottom=3.5cm]{geometry}

\usepackage{pdflscape}          %landscape single pages

%Sets up landscape pages for each landscape page.
\usepackage{pdfpages}           % http://ctan.org/pkg/pdfpages 

\usepackage[absolute]{textpos}
\usepackage{fancyhdr}

\fancypagestyle{lscape}{% 
\fancyhf{} % clear all header and footer fields 
\fancyfoot[LE]{%
\begin{textblock}{20}(1,5){\rotatebox{90}{\leftmark}}\end{textblock}}
\fancyfoot[LO] {%
\begin{textblock}{1}(14,7.5){\rotatebox{90}{\thepage}}\end{textblock}}
\renewcommand{\headrulewidth}{0pt} 
\renewcommand{\footrulewidth}{0pt}}

%---------------------------------------%
%   Tables & Figures        %
%---------------------------------------%
\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}}}

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

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

\usepackage{caption}
\captionsetup{font={sf,large},justification=justified, singlelinecheck=false}
\setkomafont{caption}{\sffamily}
\setkomafont{captionlabel}{\upshape\bfseries\sffamily}

\renewcommand{\topfraction}{0.9}% max fraction of floats at top
\renewcommand{\textfraction}{0.07}
\renewcommand{\bottomfraction}{0.9}% max fraction of floats at bottom

%Set table for to be smaller
\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{\small}
\AtBeginEnvironment{longtable}{\small}

% Package for including code in the document
\usepackage{listings}



\usepackage[english]{babel}
\usepackage{blindtext}\def\mytitle{Energy security under climate policies}
\def\myauthor{Jessica Jewell}
\begin{document}

\blindtext

\newgeometry{hmargin=3.5cm,vmargin=3.5cm}
\thispagestyle{lscape}
\pagestyle{lscape}

\begin{landscape}

\begin{ThreePartTable}
\begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}
\caption{\large{Previous studies}} \label{table1} 
\toprule
\ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
\head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\
 \midrule
 \endfirsthead

 \toprule
 \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
 \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} & \head{\centering{XXX}} \\
 \midrule
 \endhead

 \multicolumn{6}{r}{{\emph{continues on next page}}} \\
 \endfoot

 \bottomrule
 \endlastfoot

  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table \\
  XXX & 2010 & XXXXl && This is an example of a working table       \end{longtable}
  \begin{tablenotes}
  \item Notes: These are some long notes to show that on the first table the text runs all the way across the bottom of the page. See? Isn't it lovely how it just lays down at the bottom of the page.

  \end{tablenotes}
  \end{ThreePartTable}
  \end{landscape}
  \restoregeometry
  \pagestyle{plain}


  \blindtext


  \begin{table*} 
  \begin{threeparttable}
 \caption{GDP and emissions of major economies} \label{meconomies}
 \begin{tabular}{lcccccc}
 \toprule
 && \multicolumn{2}{c}{\head{XXXXXXX}} && \multicolumn{2}{c}{\head{XXXXXXXX}} \\
 && XX & XX && XX & XX \\
 \midrule
 \head{XXXXX} && XX & XX && XX) & XX \\
 \head{XXXXX} && XX & XX && XX) & XX \\
 \head{XXXXX} && XX & XX && XX) & XX \\
 \bottomrule
 \end{tabular}
 \begin{tablenotes}
 \item Notes: This is meaningless not explaining the meaningless table.
 \end{tablenotes}
 \end{threeparttable}    
 \end{table*}



 \newgeometry{hmargin=3.5cm,vmargin=3.5cm}
 \thispagestyle{lscape}
 \pagestyle{lscape}

 \begin{landscape}

 \begin{ThreePartTable}
 \begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}
 \caption{\large{Previous studies}} \label{table2} 
 \toprule
 \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
 \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\
 \midrule
 \endfirsthead

 \toprule
 \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
 \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &   \head{\centering{XXX}} \\
 \midrule
 \endhead

 \multicolumn{6}{r}{{\emph{continues on next page}}} \\
 \endfoot

 \bottomrule
 \endlastfoot

 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table      \end{longtable}
 \begin{tablenotes}
 \item Notes: These are some long notes. See how the margin of these notes is wrong? They match the text width of the preceding threeparttable.

 \end{tablenotes}
 \end{ThreePartTable}
 \end{landscape}
 \restoregeometry
 \pagestyle{plain}

\blindtext

\end{document}
2
  • 1
    ! Undefined control sequence. l.80 \singlespacing Commented May 22, 2013 at 12:41
  • The comment is edited now.
    – jjewell
    Commented May 23, 2013 at 12:32

1 Answer 1

1

I finally found the proper solution using the ThreePartTable package. The trick is that ThreePartTable (which works with longtable unlike threeparttable which doesn't) requires \TableNotes instead of \tablenotes. Also the way these are inserted into ThreePartTable are slightly different. See the package documentation (first example on Page 3). Also here is the code where i have corrected the minimal working example.

\listfiles
\documentclass[12pt,a4paper,bibtotoc,liststotocnumbered,pointlessnumbers]{scrreprt}             

%---------------------------------------%
%       Layout          %
%---------------------------------------%
\usepackage[parfill]{parskip}           %use line breaks instead of
\usepackage[left=3.75cm, right=3.75cm, bottom=3.5cm]{geometry}

 \usepackage{pdflscape}          %landscape single pages

 %Sets up landscape pages for each landscape page.
 \usepackage{pdfpages}           % http://ctan.org/pkg/pdfpages 

 \usepackage[absolute]{textpos}
 \usepackage{fancyhdr}

 \fancypagestyle{lscape}{% 
 \fancyhf{} % clear all header and footer fields 
 \fancyfoot[LE]{%
 \begin{textblock}{20}(1,5){\rotatebox{90}{\leftmark}}\end{textblock}}
 \fancyfoot[LO] {%
 \begin{textblock}{1}(14,7.5){\rotatebox{90}{\thepage}}\end{textblock}}
 \renewcommand{\headrulewidth}{0pt} 
 \renewcommand{\footrulewidth}{0pt}}

%---------------------------------------%
%   Tables & Figures        %
%---------------------------------------%
\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}}}

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

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

 \usepackage{caption}
 \captionsetup{font={sf,large},justification=justified, singlelinecheck=false}
 \setkomafont{caption}{\sffamily}
 \setkomafont{captionlabel}{\upshape\bfseries\sffamily}


% Package for including code in the document
\usepackage{listings}



 \usepackage[english]{babel}
 \usepackage{blindtext}\def\mytitle{Energy security under climate policies}
 \def\myauthor{Jessica Jewell}
 \begin{document}

 \blindtext

 \newgeometry{hmargin=3.5cm,vmargin=3.5cm}
 \thispagestyle{lscape}
 \pagestyle{lscape}

 \begin{landscape}

 \begin{ThreePartTable}
 \begin{TableNotes}
 \item Notes: These are some long notes to show that on the first table the text runs all the way across the bottom of the page. See? Isn't it lovely how it just lays down at the bottom of the page.

 \end{TableNotes}
 \end{ThreePartTable}

 \begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}
 \caption{\large{Previous studies}} \label{table1} 
 \toprule
 & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
\head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\
 \midrule
 \endfirsthead

 \toprule
 \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
 \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} & \head{\centering{XXX}} \\
 \midrule
 \endhead

 \multicolumn{6}{r}{{\emph{continues on next page}}} \\
 \endfoot

 \bottomrule
 \insertTableNotes\\
 \endlastfoot

 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table \\
 XXX & 2010 & XXXXl && This is an example of a working table     \end{longtable}

\end{landscape}
\restoregeometry
\pagestyle{plain}


\blindtext


\begin{table*} 
\begin{threeparttable}
\caption{GDP and emissions of major economies} \label{meconomies}
\begin{tabular}{lcccccc}
\toprule
 && \multicolumn{2}{c}{\head{XXXXXXX}} && \multicolumn{2}{c}{\head{XXXXXXXX}} \\
 && XX & XX && XX & XX \\
\midrule
\head{XXXXX} && XX & XX && XX) & XX \\
\head{XXXXX} && XX & XX && XX) & XX \\
\head{XXXXX} && XX & XX && XX) & XX \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item Notes: This is meaningless not explaining the meaningless table.
\end{tablenotes}
\end{threeparttable}    
\end{table*}



\newgeometry{hmargin=3.5cm,vmargin=3.5cm}
\thispagestyle{lscape}
\pagestyle{lscape}

\begin{landscape}

\begin{ThreePartTable}
\begin{TableNotes}
\item Notes: These are some long notes. See how the margin of these notes is wrong? They match the text width of the preceding threeparttable.
\end{TableNotes}

\begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}
\caption{\large{Previous studies}} \label{table2} 
\toprule
\ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
\head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\
\midrule
\endfirsthead

\toprule
 \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\
 \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &   \head{\centering{XXX}} \\
\midrule
\endhead

\multicolumn{6}{r}{{\emph{continues on next page}}} \\
\endfoot

\bottomrule
\insertTableNotes\\
\endlastfoot

XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table \\
XXX & 2010 & XXXXl && This is an example of a working table     \end{longtable}

\end{ThreePartTable}
\end{landscape}
\restoregeometry
\pagestyle{plain}

\blindtext

\end{document}

You must log in to answer this question.

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