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.

shenflow
  • 173

1 Answers1

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}
leandriis
  • 62,593
  • 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 '20 at 07:36
  • Why do you want to reduce the font size that drastically and at the same time stretch the table? – leandriis Aug 20 '20 at 08: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 '20 at 08:50
  • \begin{sideways} \scriptsize \setlength{\tabcolsep}{10pt} \begin{threeparttable} should result in the desired output. – leandriis Aug 20 '20 at 10:57
  • That works, thanks. However, for some reason, one page is left blank prior to the table page now. – shenflow Aug 21 '20 at 06:30