TransWikia.com

Section title above landscape tabular

TeX - LaTeX Asked on February 3, 2021

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.

One Answer

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}

Answered by leandriis on February 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP