0

I have the following table:

\documentclass[a4paper, bibtotocnumbered,liststotoc,12pt]{scrartcl}
\usepackage[paper=a4paper,left=40mm,right=20mm,top=20mm,bottom=20mm]{geometry} 
\usepackage{caption}
\captionsetup{labelfont=bf}
\captionsetup[figure]{aboveskip=10pt} 
\captionsetup{justification=justified,singlelinecheck=false,font=small}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{booktabs}

\begin{document}
\begin{landscape}
{\captionof{table}{Regression Results H1 - Panel A (Weighted)}
\begin{scriptsize} 
\begin{tabular*}{\columnwidth}{@{\extracolsep{\stretch{1}}}*{14}{r}@{}}
  \toprule
  & $PER I$ & $PER II$ & $PRED$ & $SM I$ & $SM II$ &$AQ I$ &$AQ II$ &$DACC I$ &$DACC II$ &$TL$&$CC$&$UC$&$VR$\\
  \midrule
  Estimate & 0.0020 & 12.6092 & 0.0008 & -0.0291 & 0.0021 & -0.0014 & -0.0099 & -0.0081 & 0.0091 &  0.2199 & 0.0062 & 0.0072 \\
  StdErr   & 0.0088 & 12.2425 & 0.0006 & 0.0070  & 0.0017 & 0.0011  & 0.0085  & 0.0079  & 0.0047 & 0.1849 & 0.0076 & 0.0058 \\
   \\
   \\
   Observations & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482 & 1,482\\
   $R^2$  \\
   \bottomrule                             
 \end{tabular*}
 \small
 \caption*{\textit{Notes}: xx}
 \end{scriptsize}}
 \end{landscape}
 \end{document}

I want to add a section title, but when I do, it creates a new page for the section title. The other solutions proposed on SE do not work in my case.

5
  • 1
    \begin{landscape} always starts a new page.
    – leandriis
    Aug 19, 2020 at 12:05
  • 1
    See also: Section title above table in landscape mode and Text and sidewaystable on same page for related questions.
    – leandriis
    Aug 19, 2020 at 12:09
  • Yes I have seen those. But when I do \begin{sideways} \end{sideways} instead of landscape as suggested in those questions, I get errors using the abovementioned MWE.
    – shenflow
    Aug 19, 2020 at 12:25
  • Since you're setting the width of the tabular* environment to the full width of the rotated text block, where is the section title supposed to go?
    – Mico
    Aug 19, 2020 at 12:55
  • It is supposed to go to the top of the page.
    – shenflow
    Aug 19, 2020 at 13:01

1 Answer 1

1

Here is my suggestion using a combination of sideways from the rotating package and threeparttable. I have also replaced deprecated class options with their up-to-date counterparts. (Red lines indicate margins):

enter image description here

\documentclass[a4paper, bibliography=totocnumbered,listof=totoc,12pt]{scrartcl}
\usepackage[paper=a4paper,left=40mm,right=20mm,top=20mm,bottom=20mm]{geometry} 
\usepackage{caption}
\captionsetup{labelfont=bf} 
\captionsetup{justification=justified,singlelinecheck=false,font=small}
\usepackage{rotating}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{booktabs}
\begin{document}
\section{my section title}
\begin{sideways}
\setlength{\tabcolsep}{5.5pt}
  \begin{threeparttable}
    \caption{Regression Results H1 - Panel A (Weighted)}
    \begin{tabular}{r*{13}{>{$}r<{$}}@{}}
      \toprule
                   & PER I  & PER II  & PRED   & SM I    & SM II  & AQ I    & AQ II   & DACC I  & DACC II & TL     & CC     & UC & VR \\
      \midrule
      Estimate     & 0.0020 & 12.6092 & 0.0008 & -0.0291 & 0.0021 & -0.0014 & -0.0099 & -0.0081 & 0.0091  & 0.2199 & 0.0062 & 0.0072  \\
      StdErr       & 0.0088 & 12.2425 & 0.0006 & 0.0070  & 0.0017 & 0.0011  & 0.0085  & 0.0079  & 0.0047  & 0.1849 & 0.0076 & 0.0058  \\
      \addlinespace
      Observations & 1,482  & 1,482   & 1,482  & 1,482   & 1,482  & 1,482   & 1,482   & 1,482   & 1,482  & 1,482   & 1,482  & 1,482   \\
      $R^2$  \\
      \bottomrule                             
    \end{tabular}
    \begin{tablenotes}[flushleft]
      \item{}\textit{Notes:}
    \end{tablenotes}
   \end{threeparttable}
\end{sideways}
\end{document}
5
  • Thank you for the reply. I added \begin{scriptize} and \end{scriptsize to it, to adjust the fontsize. However, now the table only fills around half the page. Is there a way to "stretch" it horizontally, similar to what the landscape command does?
    – shenflow
    Aug 20, 2020 at 7:36
  • Why do you want to reduce the font size that drastically and at the same time stretch the table?
    – leandriis
    Aug 20, 2020 at 8:42
  • Because I consistently use this font size throughout the document and I personally like the look of the stretched table (as in landscape) more.
    – shenflow
    Aug 20, 2020 at 8:50
  • \begin{sideways} \scriptsize \setlength{\tabcolsep}{10pt} \begin{threeparttable} should result in the desired output.
    – leandriis
    Aug 20, 2020 at 10:57
  • That works, thanks. However, for some reason, one page is left blank prior to the table page now.
    – shenflow
    Aug 21, 2020 at 6:30

You must log in to answer this question.

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