0

using a recent suggestion from @mico, i am encountering a problem with my long table, it exceeds maring using \documentclass[12pt,notitlepage]{article} and \topmargin=-1.0cm \textheight=23.8cm \oddsidemargin=-0.3cm \evensidemargin=-0.0cm \textwidth=17.1cm

here my code and output:


\documentclass[12pt,notitlepage]{article}

%------------------------------------
% PACKAGES
%-------------------------------------
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{blindtext}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{mathtools, cuted}
\usepackage{cuted}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{newpxtext}
\usepackage[font={large,bf}]{caption} 
\usepackage{setspace}
\usepackage{threeparttable}  
\usepackage{tabulary}
\usepackage{booktabs}
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{rotating}
\usepackage[titletoc,title]{appendix}
\usepackage{array,multirow}
\usepackage[round]{natbib}


%%%%%% asterisk in Table %%%%%%%%%%%%%%%%%%
\usepackage{xcolor}
\newcommand\tc[1]{\textcolor{blue}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\bibpunct{(}{)}{;}{a}{,}{;}
\setcounter{MaxMatrixCols}{10}

\topmargin=-1.0cm \textheight=23.8cm \oddsidemargin=-0.3cm
\evensidemargin=-0.0cm \textwidth=17.1cm

%% new:
\usepackage{collcell}
\makeatletter
%% 'g' for 'gobble':
\newcolumntype{g}{>{\collectcell\@gobble}c<{\endcollectcell}}
\makeatother








\begin{document}
\begin{landscape}
%\texttt{}\begin{sidewaystable}[!ht]
\small
\centering
\begin{threeparttable}
\caption{Main effects of sanctions on Global sectoral indices}
    \label{tab:table_1}

 \begin{tabular}{@{} l *{2}{wc{2.5cm}}g *{2}{*{2}{wc{2cm}}g} @{}}
\toprule
  & \multicolumn{2}{c}{\textbf{Episodes sanctions \#2011}}& 
  & \multicolumn{2}{c}{\textbf{Episodes sanctions \#2019}}     &
  & \multicolumn{2}{c}{\textbf{Episodes sanctions \#2022}}\\
  & \multicolumn{2}{c}{SPX vs. SHC} &
  & \multicolumn{2}{c}{SPX vs. SHC }  &
  & \multicolumn{2}{c}{SPX vs. MOEX}\\
  \cmidrule(lr){2-3} \cmidrule(lr){5-6} \cmidrule(l){8-10}
  &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&
  &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&
  &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\\
  \cmidrule[\lightrulewidth](l){2-10}
  ARMA-GARCH. & & & \\ 
  \hspace{5mm}{1991--1997}& & & & & & & & & \\
  \addlinespace 
   
    \textbf{Constant for mean equation: $\alpha$} &0.000 & 0.000&    &        -0.000   &      -0.000 &          & -0.008\tc{***}  & -0.001   & \\
                                               & (0.001)& (0.001)& &     (0.001)   &     (0.001)   &        &(0.002)& (0.002)   & \\                                     
                                                                        $\phi_{1}$   &    &   &               &              &  &   &  -0.166\tc{***}&  -0.147 & \\
                                               &    &  &                &              &    &   & (0.051)&(0.408) & \\
                                      
                                                                            
                                                                            $\phi_{2}$ &    &   &                &     0.009           &  0.772\tc{**}  &   & & & \\
                                               &    &  &                &     (0.033)             &  (0.352)  &   & & & \\
                                      
                                      $\theta_{1}$ &      &  &                &                &   &      &0.563\tc{***} & 0.336 & \\
                                               &     &      &                 &                 &    &  &(0.016)&(0.363)  & \\
                                      
                                                                            $\theta_{2}$ &  0.012      &   0.024  &                &                &  -0.736\tc{*}  &    & & & \\
                                               &  (0.076)   & (0.078)     &                 &                 & (0.376)    &  && & \\

  \addlinespace 
  \textbf{Constant for the variance equation: $\omega$} &    0.000\tc{***}   &    -9.305\tc{***}  & 0.000\tc{***}   &0.000\tc{***} & -10.686\tc{***}  & &  0.001\tc{***}& -7.040\tc{***} & \\
                                                        &    (0.000)          &   (0.128)          & (0.000)    &  (0.000)&(0.467)  & &(0.000) & (0.202) & \\
                                              
                                                                                            $\Phi_{1}$ &   &    &    &         &          &             &    1.998\tc{***}     &  0.322\tc{***}    &    \\
                                                       & &  &   &         &          &             &    (0.253)      & (0.036)    &        \\ 
                                   
                                                                                            $\Phi_{16}$ &   &  0.006   &    &         &          &             &        &    &    \\
                                                       & & (0.062) &   &         &          &             &          &    &      \\
                                              
                                                                                            $\Phi_{22}$ &    &   0.016    &    &  &      0.151\tc{***}    &            &     &     &     \\
                                                         &     &    (0.046)  &   &  &    (0.048)    &     &           &   &     \\
                                                                                                                
                                                                                            $\Theta_{1}$ &&    &  &          &   0.591\tc{***}  &   &  0.582\tc{***}      &0.593\tc{***} & \\
                                                        &&   & &          &   (0.149)  &     &  (0.048)  &(0.058)  & \\
  \addlinespace 
  \textbf{Sanction}           &   &  -0.659\tc{***}    &   & &0.206\tc{**} & & &  1.382\tc{***} &  \\\
                              &   &  (0.215)   &   & & (0.175)& & &(0.116) & \\
      
            Currency Sanctions =   $11jul \_2011$ til $18 oct \_2011$ &  &0.183   & &     &        &         & & 1.519\tc{***} & \\
                                                     &   & (0.507)& &  &        &       & &(0.124)  & \\
     
        Black Monday = $01 aug \_2011$ til $15 aug \_2011$ & &    & & & 0.151  & &  &     -1.896\tc{***}&      \\
                                                     & &  &  & &(0.219)   & &     &  (0.157)   &     \\
     
        Debt Debate= $13 may \_2011$ til $01 aug \_2011$ & &    0.211& & &  -0.181 & &   &  &      \\
                                                     & &(0.203) & & &(0.273)  & &     &     &     \\
 \addlinespace 
  \textbf{L-L elast. (emp. shares)}& &  &  &   &        &        &        &        &        \\
    N        &              258&  258&       &        511&        511&        &         466 &         466 &       \\
   AIC         & -1681.149 & -1680.206  &       &     -3231.076  &        -3259.866 &       &        -1739.233 &       -1825.872 &       \\
    BIC        & -1670.490  & -1651.782   &        &      -3218.367 &      -3221.739  &        &      -1718.512 &       -1788.574 &        \\
  \addlinespace 
  \textbf{ Ljung-Box Q-Statistics}& & & &      &       &       &      &       &      \\
     $Q(40)$         &        30.922&       33.7&       &       30.922&        33.7&        &        30.922&        33.7&        \\
   $ Q(40)^2 $       & 21.3&34.46&      &       21.3&       34.46&      &       21.3&        34.46&      \\
\bottomrule
\end{tabular}

\footnotesize\smallskip
Source: Standard errors in parenthese $\tc{*}$ $\(p<.10\)$, $\tc{**}$ $\(p<.05\)$, $\tc{***}$ $\(p<.01\)$. The $\phi$ are AR coefficients, the $\theta$ are MA coefficients, the $\Phi$ are ARCH coefficients, and $\Theta$ the are GARCH coefficients. $\alpha$ is the constant for mean equation and $\omega$ is the constant for the variance equation. The Ljung-Box Q-Statistics for the $40$ lags of the standardized residuals $(Q(40))$ and the squared standardized residuals $(Q(40)^2)$ are presented in the bottom panel. 

\end{threeparttable}
%\end{sidewaystable}
\end{landscape}
\end{document}



enter image description here

5
  • Your MWE contain errors: missing $ .... Also please make Your document e4xample minimal. Remove all what is not related to this table.
    – Zarko
    Oct 29, 2022 at 17:58
  • The \sym macro isn't defined. Various math-greek letters need to be in math mode. Please fix so that your document becomes minimally compilable.
    – Mico
    Oct 29, 2022 at 18:01
  • There seems to be a lot of code that doesn't have to do anything with the question -- you can remove it. Also, it is not compilable. Regarding your problem -- use tabularx and make your left column X, this might help Oct 29, 2022 at 18:04
  • @zarko Dear friend, code edited
    – HAITHEM
    Oct 29, 2022 at 18:22
  • @mico. Code edited but i did not get your point about /sym macro
    – HAITHEM
    Oct 29, 2022 at 22:40

1 Answer 1

1
  • You need some sort of longtable, which can span several pages
  • Among them I would select longtblr package of tabularray package
  • You define 10 columns from which three are empty. Remove them!
  • For numbers I would use `siunitx package
  • In your preamble some packages are load twice (with different options!).
  • Please, in future provide MWE (Minimal Working Example). In it in preamble load packages and have definitions for new macros/commands which are relevant to your problem. I commented all not needed packages and command definitions
  • In table writing I found helping, if already in editor try to mimic table format.

So, MWE with your table can be:

\documentclass[12pt,notitlepage]{article}
\usepackage[a4paper,
            hmargin=2cm, vmargin=3cm]{geometry}
%\topmargin=-1.0cm \textheight=23.8cm \oddsidemargin=-0.3cm
%\evensidemargin=-0.0cm \textwidth=17.1cm
\usepackage{blindtext}

%------------------------------------
% PACKAGES
%-------------------------------------
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{newpxtext}
%\usepackage{amsmath, amssymb, amsthm}  % amsmath is loaded by mathtools
%\usepackage{mathtools}
%\setcounter{MaxMatrixCols}{10}

\usepackage{pdflscape}
%\usepackage{array, multirow}
%\usepackage{tabularx}
%\usepackage{tabulary}
%\usepackage{longtable}
%\usepackage{threeparttable}
\usepackage{tabularray}     %   NEW
\UseTblrLibrary{booktabs,   %   NEW, load package booktabs
                siunitx,    %   NEW, load siunitx package
                }
\sisetup{
    table-align-text-after = false, % <---
    table-align-text-before= false, % <---
    input-open-uncertainty =,
    input-close-uncertainty=,
         }

%                varwidth}   %   NEW, tabularray specific
%\usepackage[font={large,bf}]{caption}
%\usepackage{setspace}
%\usepackage{float}
%\usepackage{cuted}
%\usepackage{caption}   & surplus, loaded second time
%\usepackage{subcaption}
%\usepackage{rotating}
%\usepackage[titletoc,title]{appendix}
%\usepackage[round]{natbib}
%\bibpunct{(}{)}{;}{a}{,}{;}

%%%%%% asterisk in Table %%%%%%%%%%%%%%%%%%
\usepackage{xcolor}
\newcommand\tc[1]{\textcolor{blue}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% new:
%\usepackage{collcell}
%\makeatletter
%% 'g' for 'gobble':
%\newcolumntype{g}{>{\collectcell\@gobble}c<{\endcollectcell}}
%\makeatother

\begin{document}
    \begin{landscape}
%\small
%\centering
    \begin{longtblr}[
caption = {Main effects of sanctions on Global sectoral indices},
  label = {tab:table_1},
remark{Source} ={Standard errors in parentheses 
    \tc{*}: \(p<.10\),\quad \tc{**}: \(p<.05\),\quad \tc{***}: \(p<.01\). 
The $\phi$ are AR coefficients, the $\theta$ are MA coefficients, the $\Phi$ are ARCH coefficients, and $\Theta$ the are GARCH coefficients. $\alpha$ is the constant for mean equation and $\omega$ is the constant for the variance equation. The Ljung-Box Q-Statistics for the $40$ lags of the standardized residuals $(Q(40))$ and the squared standardized residuals $(Q(40)^2)$ are presented in the bottom panel.}
                ]{colsep=3pt,
                 colspec = {X[l] *{6}{Q[c, si={table-format=-4.3{***}}]}},
                 row{1} = {font=\bfseries, c, guard},
                 row{2,3} = {guard},
                 rowhead=3
                 }
    \toprule
    &   \SetCell[c=2]{c}    Episodes sanctions\#2011
        &   &   \SetCell[c=2]{c}    Episodes sanctions \#2019
                &   & \SetCell[c=2]{c}  Episodes sanctions \#2022
                        &                                                       \\
    &   \SetCell[c=2]{c}    PX vs. SHC
        &   &   \SetCell[c=2]{c}    SPX vs. SHC
                &   &   \SetCell[c=2]{c}    SPX vs. MOEX
                        &                                                       \\
% table body
    \cmidrule[r]{2-3} \cmidrule[lr]{4-5} \cmidrule[l]{6-7}
    & (1)   & (2)   & (1)   & (2)   & (1)   & (2)                               \\
    \midrule[\lightrulewidth]
ARMA-GARCH. {1991--1997}
    &           &           &           &           &           &               \\
  \addlinespace
\textbf{Constant for mean equation:} $\alpha$
    & 0.000     & 0.000     & -0.000    & -0.000    & -0.008\tc{***}    
                                                                & -0.001        \\
    & (0.001)   & (0.001)   & (0.001)   & (0.001)   & (0.002)   & (0.002)       \\
$\phi_{1}$   
    &           &           & -0.166\tc{***}    
                                        &  -0.147   &           &               \\
    &           &           & (0.051)   & (0.408)   &           &               \\
$\phi_{2}$ 
    &           &           & 0.009     & 0.772\tc{**}      &   &               \\
    &           &           & (0.033)   &  (0.352)  &           &               \\
$\theta_{1}$ 
    &           &           &           &           & 0.563\tc{***} 
                                                                & 0.336         \\
    &           &           &           &           & (0.016)   &(0.363)        \\
$\theta_{2}$ 
    &  0.012    &   0.024   &           & -0.736\tc{*}      &   &               \\
    &  (0.076   & (0.078)   &           & (0.376)   &           &               \\
    \addlinespace
\textbf{Constant for the variance equation:} $\omega$ 
    & 0.000\tc{***} 
                & -9.305\tc{***}  
                            & 0.000\tc{***}   
                                        & -10.686\tc{***}  
                                                    &  0.001\tc{***}    
                                                                & -7.040\tc{***}\\
    & (0.000)   & (0.128)   & (0.000)   & (0.467)   &(0.000)    & (0.202)       \\
$\Phi_{1}$ 
    &           &           &           &           & 1.998\tc{***}     
                                                                & 0.322\tc{***} \\
    &           &           &           &           & (0.253)   & (0.036)       \\
$\Phi_{16}$ 
    &           & 0.006     &           &           &           &               \\
    &           & (0.062)   &           &           &           &               \\
$\Phi_{22}$ 
    &           & 0.016     &           & 0.151\tc{***} &       &               \\
    &           & (0.046)   &           & (0.048)   &           &               \\
$\Theta_{1}$ 
    &           &           &           & 0.591\tc{***}  
                                                    & 0.582\tc{***}
                                                                & 0.593\tc{***} \\
    &           &           &           & (0.149)   & (0.048)   & (0.058)       \\
  \addlinespace
\textbf{Sanction}           
    &           & -0.659\tc{***}
                            &           & 0.206\tc{**}  &       & 1.382\tc{***} \\
    &           & (0.215)   &           & (0.175)   &           & (0.116)       \\
Currency Sanctions:  11 jul 2011 til 18 oct 2011
    &           & 0.183     &           &           &           & 1.519\tc{***} \\
    &           & (0.507)   &           &           &           & (0.124)       \\
Black Monday: 01 aug 2011 til 15 aug 2011
    &           &           &           & 0.151     &           & -1.896\tc{***}\\
    &           &           &           & (0.219)   &           &  (0.157)      \\
Debt Debate: 13 may 2011 til 01 aug 2011
    &       & 0.211         &           &  -0.181   &           &               \\
    &       & (0.203)       &           & (0.273)   &           &               \\
    \addlinespace
\textbf{L-L elast. (emp. shares)}
   &        &           &           &           &               &               \\
 N        
    & 258   & 258       & 511       & 511       & 466           & 466           \\
 AIC         
    & -1681.149 
            & -1680.206 & -3231.076 & -3259.866 & -1739.233     & -1825.872     \\
 BIC        
    & -1670.490
            & -1651.782 & -3218.367 & -3221.739 & -1718.512     & -1788.574     \\
    \addlinespace
\textbf{Ljung-Box Q-Statistics}
    &       &           &           &           &               &               \\
$Q(40)$
    & 30.922& 33.7      & 30.922    & 33.7      & 30.922        & 33.7          \\
$Q(40)^2$       
    & 21.3  &34.46      & 21.3      & 34.46     & 21.3          & 34.46         \\
    \bottomrule
\end{longtblr}
    \end{landscape}
\end{document}

\end{longtblr}
    \end{landscape}
\end{document}

enter image description here

Addendum: You may liked grouping of data rows with standard errors and columns PS vs. SHC (for better readable). Beside this you may consider to redesign column headers. I suggest to remove repetition of text "Episodes sanctions" and "PX vs. SHC".

\documentclass[12pt,notitlepage]{article}
\usepackage[a4paper,
            hmargin=2cm, vmargin=3cm]{geometry}
%---------------------------------------------------------------%
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{newpxtext}

\usepackage{pdflscape}
\usepackage{xcolor}
\newcommand\tc[1]{\textcolor{blue}{#1}}
\usepackage{tabularray}     %   NEW
\UseTblrLibrary{booktabs,   %   NEW, load package booktabs
                siunitx,    %   NEW, load siunitx package
                }
\sisetup{
    table-align-text-before= false, 
    input-open-uncertainty =,
    input-close-uncertainty=,
         }


\begin{document}
    \begin{landscape}
%\small
\SetTblrStyle{caption}{font=\large\bfseries}
\SetTblrStyle{conthead}{font=\large\bfseries}
    \begin{longtblr}[
caption = {Main effects of sanctions on Global sectoral indices},
  label = {tab:table_1},
remark{Source} ={Standard errors in parentheses
    \tc{*}: \(p<.10\),\quad \tc{**}: \(p<.05\),\quad \tc{***}: \(p<.01\).
The $\phi$ are AR coefficients, the $\theta$ are MA coefficients, the $\Phi$ are ARCH coefficients, and $\Theta$ the are GARCH coefficients. $\alpha$ is the constant for mean equation and $\omega$ is the constant for the variance equation. The Ljung-Box Q-Statistics for the $40$ lags of the standardized residuals $(Q(40))$ and the squared standardized residuals $(Q(40)^2)$ are presented in the bottom panel.}
                ]{column{2-Y}= {colsep=-3pt},
                 column{3,5} = {rightsep=18pt},
                 colspec = {@{} X[l] *{6}{Q[c, si={table-format=-4.3{$^{***}$}}]} @{}},
                 row{1} = {font=\bfseries, c, guard},
                 row{2,3} = {guard},
                 row{4-Y} = {rowsep = 0pt},
                 row{even[5-Z]} = {belowsep=5pt},
                 rowhead=3
                 }
    \toprule
    &   \SetCell[c=6]{c}    {Episodes sanctions: PX vs. SHC}
        &   &   &   &   &                                                       \\
    &   \SetCell[c=2]{c}    \# 2011
        &   &   \SetCell[c=2]{c}    \# 2019
                &   &   \SetCell[c=2]{c}    \# 2022
                        &                                                       \\
% table body
    \cmidrule[r]{2-3} \cmidrule[lr]{4-5} \cmidrule[l]{6-7}
    & (1)   & (2)   & (1)   & (2)   & (1)   & (2)                               \\
    \midrule[\lightrulewidth]
ARMA-GARCH. {1991--1997}
    &           &           &           &           &           &               \\
\textbf{Constant for mean equation:} $\alpha$
    & 0.000     & 0.000     & -0.000    & -0.000    & -0.008\tc{***}
                                                                & -0.001        \\
    & (0.001)   & (0.001)   & (0.001)   & (0.001)   & (0.002)   & (0.002)       \\
$\phi_{1}$
    &           &           & -0.166\tc{***}
                                        &  -0.147   &           &               \\
    &           &           & (0.051)   & (0.408)   &           &               \\
$\phi_{2}$
    &           &           & 0.009     & 0.772\tc{**}      &   &               \\
    &           &           & (0.033)   &  (0.352)  &           &               \\
$\theta_{1}$
    &           &           &           &           & 0.563\tc{***}
                                                                & 0.336         \\
    &           &           &           &           & (0.016)   &(0.363)        \\
$\theta_{2}$
    &  0.012    &   0.024   &           & -0.736\tc{*}      &   &               \\
    &  (0.076   & (0.078)   &           & (0.376)   &           &               \\
\textbf{Constant for the variance equation:} $\omega$
    & 0.000\tc{***}
                & -9.305\tc{***}
                            & 0.000\tc{***}
                                        & -10.686\tc{***}
                                                    &  0.001\tc{***}
                                                                & -7.040\tc{***}\\
    & (0.000)   & (0.128)   & (0.000)   & (0.467)   &(0.000)    & (0.202)       \\
$\Phi_{1}$
    &           &           &           &           & 1.998\tc{***}
                                                                & 0.322\tc{***} \\
    &           &           &           &           & (0.253)   & (0.036)       \\
$\Phi_{16}$
    &           & 0.006     &           &           &           &               \\
    &           & (0.062)   &           &           &           &               \\
$\Phi_{22}$
    &           & 0.016     &           & 0.151\tc{***} &       &               \\
    &           & (0.046)   &           & (0.048)   &           &               \\
$\Theta_{1}$
    &           &           &           & 0.591\tc{***}
                                                    & 0.582\tc{***}
                                                                & 0.593\tc{***} \\
    &           &           &           & (0.149)   & (0.048)   & (0.058)       \\
\textbf{Sanction}
    &           & -0.659\tc{***}
                            &           & 0.206\tc{**}  &       & 1.382\tc{***} \\
    &           & (0.215)   &           & (0.175)   &           & (0.116)       \\
Currency Sanctions:  11 jul 2011 til 18 oct 2011
    &           & 0.183     &           &           &           & 1.519\tc{***} \\
    &           & (0.507)   &           &           &           & (0.124)       \\
Black Monday: 01 aug 2011 til 15 aug 2011
    &           &           &           & 0.151     &           & -1.896\tc{***}\\
    &           &           &           & (0.219)   &           &  (0.157)      \\
Debt Debate: 13 may 2011 til 01 aug 2011
    &       & 0.211         &           &  -0.181   &           &               \\
    &       & (0.203)       &           & (0.273)   &           &               \\
\textbf{L-L elast. (emp. shares)}
    &        &           &           &           &               &               \\
\SetRow{guard}
 N
    & 258   & 258       & 511       & 511       & 466           & 466           \\
AIC
    & -1681.149
            & -1680.206 & -3231.076 & -3259.866 & -1739.233     & -1825.872     \\
  \addlinespace
BIC
    & -1670.490
            & -1651.782 & -3218.367 & -3221.739 & -1718.512     & -1788.574     \\
\textbf{Ljung-Box Q-Statistics}
    &       &           &           &           &               &               \\
$Q(40)$
    & 30.922& 33.7      & 30.922    & 33.7      & 30.922        & 33.7          \\
$Q(40)^2$
    & 21.3  &34.46      & 21.3      & 34.46     & 21.3          & 34.46         \\
    \bottomrule
\end{longtblr}
    \end{landscape}
\end{document}

enter image description here

3
  • Many thanks for your help, very professional my friend.
    – HAITHEM
    Oct 29, 2022 at 23:51
  • @Haithem, see addendum to answer.
    – Zarko
    Oct 30, 2022 at 10:19
  • thank you so much this is also very useful since i have several tables to present in my paper .. many thanks again for your guidance
    – HAITHEM
    Oct 30, 2022 at 10:38

You must log in to answer this question.

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