1

I have this very large table which I cannot fit in one single sheet. The idea would be or to use landscape (but still it goes into another sheet) or to put it vertically (best solution).

Would you know how to do it?

    \documentclass{article}
    \usepackage{longtable}

    \begin{document}


    \begin{longtable}[l]{lccccccccc}
        \caption{VAR Estimation Results}
        \label{my-label}\\
        \toprule
        \multicolumn{1}{l}{\textbf{Dependent Variables}} & \multicolumn{1}{c}{\textbf{$rtb_t$}} & \multicolumn{1}{c}{\textbf{$xIG_t$}} & \multicolumn{1}{c}{\textbf{ $xHY_t$}} &\multicolumn{1}{c}{\textbf{$xEM_t$}} & \multicolumn{1}{c}{\textbf{$xConv_t$}} & \multicolumn{1}{c}{\textbf{$y_t$}}  & \multicolumn{1}{c}{\textbf{$DefRate_t$}} & \multicolumn{1}{c}{\textbf{$spr_t$}}& \multicolumn{1}{c}{\textbf{$R^2$}}\\
        \endfirsthead
        %
        \endhead
        %
        \toprule
        ~~$rtb_{t+1}$ & 0.9038  & 0.0872  & -0.0239  & -0.0279 &   0.0004 &  -0.2039  & -0.0172  &   0.1384 &\\
         & (2.1620)  &  (2.5739) & (-0.7706)  & (-0.9658)  &  (0.0330)  & (-1.1606)  & (-1.1140) &  (3.2121) &\\
        ~~$xIG_{t+1}$ & 0.1275  &  0.3683  & -0.0481  & -0.2046  &  0.0453  &  0.8365  &  0.0629  &  0.1911&\\
        & (0.7783) &  (2.2406)  & (-0.5394)  & (-1.9506)  &  (1.0510)  &  (1.4690)  &  (1.5138)  &  (1.0819) &\\
        ~~$xHY_{t+1}$  & 0.3392  & 0.4406  & -0.0890  &  0.1170  &  0.1419 &  -0.1556 &  -0.0070   & 0.3028& \\
        & (1.3632)  &  (1.3334)  & (-0.6600)  &  (0.6035)  &  (1.6819) &  (-0.1464) & (-0.0900)  &  (0.9893)& \\
        ~~$xEM_{t+1}$  & 0.4025  &  0.7190 &  -0.0523  & -0.3276  &  0.1349  & 1.9086 &  0.0128 &   0.2404&\\
        & (1.5669)  &  (1.9427)  & (-0.6229)  & (-1.6961) &   (1.7558)  &  (1.7899)   & (0.2595)   & (0.9980) &\\
        ~~$xConv_{t+1}$  & 0.7229 &  0.3615  & -0.0278  &  0.0637  &  0.1026  &  0.6163 &  -0.0360 &  -0.0710& \\
        & (2.3238)   &  (1.0195) & (-0.1533)  &  (0.2868)  &  (0.8016) &   (0.3322)  & (-0.3836)  & (-0.2200)& \\
        ~~$y_{t+1}$ & -0.0087  & -0.0215 &   0.0006  &  0.0140  & -0.0049  &  0.8962  &  0.0018 &  -0.0089 &\\
        & (-1.0722) &  (-1.9254)  &  (0.2111)  &  (2.3309)  & (-2.0655)  & (9.1198)  &  (0.8533) &  (-1.1866)&\\
        ~~$DefRate_{t+1}$ & 0.0662 &  -0.0655  &-0.0094 &   0.0486 &  -0.0153   & 0.5947  &  0.9504  &  0.2086& \\ 
        & (2.7102)  & (-2.1225) & (-0.6587)  &  (2.4579)  & (-1.7263)  &  (4.7462) &  (8.2119)  &  (6.4868)& \\ 
        ~~$spr_{t+1}$ & -0.0196  &  0.0289  & -0.0636 &  -0.0349  & -0.0061  &  0.0552  & -0.0073  &  1.0028&\\     
        & (-2.0809)   &  (1.5845)  &  (-7.7777)   & (-2.0494) &  (-1.1787)  &  (0.9975) &  (-1.2758)  & (5.4443)& \\ 
        \toprule  
        \multicolumn{1}{c}{Cross-Correlation Of Residuals} \\ 
        & \multicolumn{1}{c}{\textbf{$rtb_t$}} & \multicolumn{1}{c}{\textbf{$xIG_t$}} & \multicolumn{1}{c}{\textbf{ $xHY_t$}} &\multicolumn{1}{c}{\textbf{ $xEM_t$}} & \multicolumn{1}{c}{\textbf{$(xConv_t$}} & \multicolumn{1}{c}{\textbf{$y_t$}} & \multicolumn{1}{c}{\textbf{$DefRate_t$}} & \multicolumn{1}{c}{\textbf{$spr_t$}}   \\
        ~~$rtb_{t+1}$ & - & 0.1140 &  0.0502 &  0.0207  &   0.1135  &   0.2269  &   0.1019  &   0.0339 \\
        ~~$xIG_{t+1}$ & - & - & 0.5636  &   0.7684  &   0.3342  &  -0.0310 &   -0.0992  &  -0.0556  \\
        ~~$xHY_{t+1}$  & - & - & - & 0.7265  &   0.7244  &  -0.0856  &  -0.1109   &  0.1040 \\
        ~~$xEM_{t+1}$ & - & - & - & - &   0.5508  &  -0.2182  &  -0.1723  &  -0.0318 \\
        ~~$xConv_{t+1}$ & - & - & - & - & - & 0.0071 &   -0.0735 &   -0.0327\\
        ~~$y_{t+1}$ & - & - & - & - & - & - & 0.1840  &  0.0032 \\ 
        ~~$DefRate_{t+1}$ & - & - & - & - & - &  - & - &-0.0796 \\ 
        ~~$spr_{t+1}$ & - & - & - & - & - & -  & - & - \\ 
        \bottomrule             

    \end{longtable}

    \end{landscape}

    \end{document}
10
  • Welcome to TeX SX! The last column seem to be unused.
    – Bernard
    Commented Jul 1, 2018 at 19:49
  • @Bernard Hi, I simply forgot to add the values for the R squared!
    – madrac
    Commented Jul 1, 2018 at 19:50
  • OK. It can fit in portrait orientation slightly redesigning the layout, and reducing the value of \tabcolsep and the font size.
    – Bernard
    Commented Jul 1, 2018 at 19:54
  • Just one question: rtb, xConv, xIG , &c., are function names?
    – Bernard
    Commented Jul 1, 2018 at 20:04
  • @Bernard I would not like to reduce the font size ...it has to fit on a paper and it would not look great if the font size is different. Those are simply descriptions of variables I am testing.
    – madrac
    Commented Jul 1, 2018 at 20:08

2 Answers 2

1

I propose this layout in portrait orientation, with S columns for the alignment of numbers on the decimal dot. Actually, in the present state, you don't need longtable really.

    \documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\rtb}{rtb}
\DeclareMathOperator{\spr}{spr}
\DeclareMathOperator{\IG}{IG}
\DeclareMathOperator{\HY}{HY}
\DeclareMathOperator{\EM}{EM}
\DeclareMathOperator{\Conv}{Conv}
\DeclareMathOperator{\DefRate}{DefRate}
\usepackage{longtable}
\usepackage{booktabs, makecell}
\renewcommand{\theadfont}{\bfseries\boldmath}
\usepackage{siunitx}
\usepackage{lscape}
\usepackage[showframe]{geometry}

    \begin{document}

\setlength{\tabcolsep}{2pt}
\sisetup{table-format=-1.4, table-number-alignment=center, table-space-text-pre={(}, table-align-text-pre=false, table-space-text-post={)}}
\small
    \begin{longtable}[l]{@{}l@{}*9{S}}
        \caption{VAR Estimation Results}
        \label{my-label}\\
        \toprule
        \multicolumn{10}{l}{\bfseries Dependent Variables}\\
        & {\thead{$\rtb_t$}} & {\thead{$x\IG_t$}} & {\thead{$x\HY_t$}} & {\thead{$x\EM_t$}} &{\thead{$x\Conv_t$}} & {\thead{$y_t$}} & {\thead{$\DefRate_t$}} & {\thead{$\spr_t$}}&{\thead{$R^2$}}\\
        \endfirsthead
        %
        \endhead
        %
        \toprule
        ~~$\rtb_{t+1}$ & 0.9038 & 0.0872 & -0.0239 & -0.0279 & 0.0004 & -0.2039 & -0.0172 & 0.1384 &\\
  & {(}2.1620{)} & {(}2.5739{)} & {(}-0.7706{)} & {(}-0.9658{)} & {(}0.0330{)} & {(}-1.1606{)} & {(}-1.1140{)} & {(}3.2121{)} & \\
\addlinespace
        ~~$x\IG_{t+1}$ & 0.1275 & 0.3683 & -0.0481 & -0.2046 & 0.0453 & 0.8365 & 0.0629 & 0.1911&\\
    & {(}0.7783{)} & {(}2.2406{)} & {(}-0.5394{)} & {(}-1.9506{)} & {(}1.0510{)} & {(}1.4690{)} & {(}1.5138{)} & {(}1.0819{)} & \\
\addlinespace
        ~~$x\HY_{t+1}$ & 0.3392 & 0.4406 & -0.0890 & 0.1170 & 0.1419 & -0.1556 & -0.0070 & 0.3028& \\
    & {(}1.3632{)} & {(}1.3334{)} & {(}-0.6600{)} & {(}0.6035{)} & {(}1.6819{)} & {(}-0.1464{)} & {(}-0.0900{)} & {(}0.9893{)}& \\
\addlinespace
        ~~$x\EM_{t+1}$ & 0.4025 & 0.7190 & -0.0523 & -0.3276 & 0.1349 & 1.9086 & 0.0128 & 0.2404&\\
   & {(}1.5669{)} & {(}1.9427{)} & {(}-0.6229{)} & {(}-1.6961{)} & {(}1.7558{)} & {(}1.7899{)} & {(}0.2595{)} & {(}0.9980{)} & \\
\addlinespace
        ~~$x\Conv_{t+1}$ & 0.7229 & 0.3615 & -0.0278 & 0.0637 & 0.1026 & 0.6163 & -0.0360 & -0.0710& \\
   & {(}2.3238{)} & {(}1.0195{)} & {(}-0.1533{)} & {(}0.2868{)} & {(}0.8016{)} & {(}0.3322{)} & {(}-0.3836{)} & {(}-0.2200{)}& \\
\addlinespace
        ~~$y_{t+1}$ & -0.0087 & -0.0215 & 0.0006 & 0.0140 & -0.0049 & 0.8962 & 0.0018 & -0.0089 &\\
  & {(}-1.0722{)} & {(}-1.9254{)} & {(}0.2111{)} & {(}2.3309{)} & {(}-2.0655{)} & {(}9.1198{)} & {(}0.8533{)} & {(}-1.1866{)}& \\
\addlinespace
        ~~$\DefRate_{t+1}$ & 0.0662 & -0.0655 &-0.0094 & 0.0486 & -0.0153 & 0.5947 & 0.9504 & 0.2086& \\
   & {(}2.7102{)} & {(}-2.1225{)} & {(}-0.6587{)} & {(}2.4579{)} & {(}-1.7263{)} & {(}4.7462{)} & {(}8.2119{)} & {(}6.4868{)}& \\
\addlinespace
        ~~$\spr_{t+1}$ & -0.0196 & 0.0289 & -0.0636 & -0.0349 & -0.0061 & 0.0552 & -0.0073 & 1.0028&\\
  & {(}-2.0809{)} & {(}1.5845{)} & {(}-7.7777{)} & {(}-2.0494{)} & {(}-1.1787{)} & {(}0.9975{)} & {(}-1.2758{)} & {(}5.4443{)}& \\
  \midrule[\heavyrulewidth]
 \multicolumn{10}{l}{\bfseries Cross-Correlation of Residuals} \\
& {\thead{$\rtb_t$}} &{\thead{$x\IG_t$}} & {\thead{$x\HY_t$}} & {\thead{$x\EM_t$}} &{\thead{$x\Conv_t$}} & {\thead{$y_t$}} & {\thead{$\DefRate_t$}} & {\thead{$\spr_t$}} \\
 ~~$\rtb_{t+1}$ & {$-$} & 0.1140 & 0.0502 & 0.0207 & 0.1135 & 0.2269 & 0.1019 & 0.0339 \\
 ~~$x\IG_{t+1}$ & {$-$} & {$-$} & 0.5636 & 0.7684 & 0.3342 & -0.0310 & -0.0992 & -0.0556 \\
 ~~$x\HY_{t+1}$ & {$-$} & {$-$} & {$-$} & 0.7265 & 0.7244 & -0.0856 & -0.1109 & 0.1040 \\
 ~~$x\EM_{t+1}$ & {$-$} & {$-$} & {$-$} & {$-$} & 0.5508 & -0.2182 & -0.1723 & -0.0318 \\
 ~~$x\Conv_{t+1}$ & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & 0.0071 & -0.0735 & -0.0327\\
 ~~$y_{t+1}$ & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & 0.1840 & 0.0032 \\
 ~~$\DefRate_{t+1}$ & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} &-0.0796 \\
 ~~$\spr_{t+1}$ & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} & {$-$} \\
        \bottomrule
    \end{longtable}

    \end{document}

enter image description here

Here is the version in landscape, formal font size and the default \tabcolsep:

enter image description here

2
  • Many thanks! This definitely helps. Would be possible to also see the one with landscape without \small?
    – madrac
    Commented Jul 1, 2018 at 21:10
  • @madrac: I've added a screenshot of the landscape version.
    – Bernard
    Commented Jul 1, 2018 at 21:19
0

An answer similar to @Bernard's, but without resorting to bold-facing. (There's no need for this visual equivalent of shouting at your readers.) And, since page-breaking is neither desirable nor necessary, I've replaced longtable with table and tabular.

enter image description here

\documentclass{article}
%\usepackage[margin=2.5cm,a4paper]{geometry}  % load if necessary
\usepackage[skip=0.3333\baselineskip]{caption}
\usepackage{amsmath,booktabs,pdflscape,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\newcommand\vn[1]{\mathrm{#1}} % "variable name"

\begin{document}
\begin{landscape}

\begin{table}
\caption{VAR Estimation Results}
\label{my-label}
\centering
\begin{tabular}{@{} l *{8}{d{2.5}} c @{}}
\toprule
Dependent Variables & 
\mc{$\vn{rtb}_t$}   & \mc{$\vn{xIG}_t$}& \mc{$\vn{xHY}_t$} & \mc{$\vn{xEM}_t$} & 
\mc{$\vn{xConv}_t$} & \mc{$y_t$}   & \mc{$\vn{DefRate}_t$} & \mc{$\vn{spr}_t$} & $R^2$ \\
\midrule
$\vn{rtb}_{t+1}$ & 0.9038  & 0.0872  & -0.0239  & -0.0279 &   0.0004 &  -0.2039  & -0.0172  &   0.1384 &\\
 & (2.1620)  &  (2.5739) & (-0.7706)  & (-0.9658)  &  (0.0330)  & (-1.1606)  & (-1.1140) &  (3.2121) &\\
$\vn{xIG}_{t+1}$ & 0.1275  &  0.3683  & -0.0481  & -0.2046  &  0.0453  &  0.8365  &  0.0629  &  0.1911&\\
& (0.7783) &  (2.2406)  & (-0.5394)  & (-1.9506)  &  (1.0510)  &  (1.4690)  &  (1.5138)  &  (1.0819) &\\
$\vn{xHY}_{t+1}$  & 0.3392  & 0.4406  & -0.0890  &  0.1170  &  0.1419 &  -0.1556 &  -0.0070   & 0.3028& \\
& (1.3632)  &  (1.3334)  & (-0.6600)  &  (0.6035)  &  (1.6819) &  (-0.1464) & (-0.0900)  &  (0.9893)& \\
$\vn{xEM}_{t+1}$  & 0.4025  &  0.7190 &  -0.0523  & -0.3276  &  0.1349  & 1.9086 &  0.0128 &   0.2404&\\
& (1.5669)  &  (1.9427)  & (-0.6229)  & (-1.6961) &   (1.7558)  &  (1.7899)   & (0.2595)   & (0.9980) &\\
$\vn{xConv}_{t+1}$  & 0.7229 &  0.3615  & -0.0278  &  0.0637  &  0.1026  &  0.6163 &  -0.0360 &  -0.0710& \\
& (2.3238)   &  (1.0195) & (-0.1533)  &  (0.2868)  &  (0.8016) &   (0.3322)  & (-0.3836)  & (-0.2200)& \\
$y_{t+1}$ & -0.0087  & -0.0215 &   0.0006  &  0.0140  & -0.0049  &  0.8962  &  0.0018 &  -0.0089 &\\
& (-1.0722) &  (-1.9254)  &  (0.2111)  &  (2.3309)  & (-2.0655)  & (9.1198)  &  (0.8533) &  (-1.1866)&\\
$\vn{DefRate}_{t+1}$ & 0.0662 &  -0.0655  &-0.0094 &   0.0486 &  -0.0153   & 0.5947  &  0.9504  &  0.2086& \\ 
& (2.7102)  & (-2.1225) & (-0.6587)  &  (2.4579)  & (-1.7263)  &  (4.7462) &  (8.2119)  &  (6.4868)& \\ 
$\vn{spr}_{t+1}$ & -0.0196  &  0.0289  & -0.0636 &  -0.0349  & -0.0061  &  0.0552  & -0.0073  &  1.0028&\\ 
& (-2.0809)   &  (1.5845)  &  (-7.7777)   & (-2.0494) &  (-1.1787)  &  (0.9975) &  (-1.2758)  & (5.4443)& \\ 
\addlinespace
\midrule  
\addlinespace
\multicolumn{5}{@{}l}{Cross-Correlations of Residuals} \\ 
& \mc{$\vn{rtb}_t$}   & \mc{$\vn{xIG}_t$} & \mc{$\vn{xHY}_t$}     & \mc{$\vn{xEM}_t$} 
& \mc{$\vn{xConv}_t$} & \mc{$y_t$}        & \mc{$\vn{DefRate}_t$} & \mc{$\vn{spr}_t$} &   \\
$\vn{rtb}_{t+1}$ & \mc{\text{--}}& 0.1140 &  0.0502 &  0.0207  &   0.1135  &   0.2269  &   0.1019  &   0.0339 \\
$\vn{xIG}_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& 0.5636  &   0.7684  &   0.3342  &  -0.0310 &   -0.0992  &  -0.0556  \\
$\vn{xHY}_{t+1}$  & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& 0.7265  &   0.7244  &  -0.0856  &  -0.1109   &  0.1040 \\
$\vn{xEM}_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}&   0.5508  &  -0.2182  &  -0.1723  &  -0.0318 \\
$\vn{xConv}_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& 0.0071 &   -0.0735 &   -0.0327\\
$y_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& 0.1840  &  0.0032 \\ 
$\vn{DefRate}_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}&  \mc{\text{--}}& \mc{\text{--}}&-0.0796 \\ 
$\vn{spr}_{t+1}$ & \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}}& \mc{\text{--}} & \mc{\text{--}}& \mc{\text{--}}\\ 
\bottomrule 

\end{tabular}
\end{table}
\end{landscape}
\end{document}

You must log in to answer this question.

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