3

Hi can someone please help me to fit the footnote for this table, here the attached code and my output table:

 \documentclass{article}
 \usepackage[margin=2cm,a4paper]{geometry} % set page parameters suitably
 \usepackage{booktabs} % For better looking tables
 \usepackage{tabularx}
\setlength{\parindent}{0pt}
\newcommand{\sym}[1]{#1}
\newcommand{\fignote}[1]{\figtext{\emph{Note:~}~#1}}
\newcommand{\figsource}[1]{\figtext{\emph{Source:~}~#1}}
\usepackage{siunitx} % centering in tables
 \sisetup{
detect-mode,
tight-spacing  = true,
group-digits = false ,

 input-open-uncertainty  = ,
 input-close-uncertainty = ,
 table-align-text-post   = false
 }
 \usepackage{ragged2e}
 \usepackage[para,flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textsf}

 \usepackage{enumitem}
 \newlist{myitemize}{itemize}{1}
 \setlist[myitemize]{noitemsep,left=0pt,label=--}

  \usepackage[colorlinks,allcolors=black]{hyperref} 

 \newcolumntype{P}{>{\RaggedRight\hspace{0pt}}p{\hsize}}
  \newcommand\mytab[1]{\smash{%
\begin{tabular}[t]{@{} P @{}} #1 \end{tabular}}}
 \newcommand{\ZScore}{\mathop{\textnormal{\slshape Z\_Score}}\nolimits}
  \newcommand{\NPLs}{\mathop{\textnormal{\slshape NPLs}}\nolimits}  
\begin{document}

   \begin{table}[h!]
   \caption{Descriptive statistics}
   \label{tab1}
    \centering
        \begin{tabular}{@{}*{2}{>{$}l<{$} cccccccc r@{\ }l}}
       \toprule
     Variables & \multicolumn{4}{c}{Domestic BANKS} & \multicolumn{4}{c}{Foreign BANKS} \\ 
     \cmidrule(l){2-5} \cmidrule(l){6-9}
    & \mc{Mean} & \mc{Max} & \mc{Min} & \mc{SD}&\mc{Mean} & \mc{Max} & \mc{Min} & \mc{SD}\\ 
  \midrule
  \multicolumn{9}{@{}l}{\textbf{Panel A} : Risk measures}\\ 
  \addlinespace
  \NPLs            & 3.83  & 14   & 0.18 & 2.01 & 3.14  & 9.64 & 0.17 & 1.84\\
  \ZScore          & 13.1  & 14.2 & 1.77 & 5.35 & 13.12 & 14.2 & 2.28 & 3.38 \\
  \midrule
  \multicolumn{9}{@{}l}{\textbf{Panel B} : Political Connections}\\
  \addlinespace 
  CEO\_{PC}       & 0.68  & 1  & 0  & 2.4  & 0.38  & 1   & 0   & 0.66\\
  Board\_{ind}       & 0.28  & 14 & 0  & 6.4  & 0.41  & 13  & 0   & 0.25\\
  \midrule
  \multicolumn{9}{@{}l}{\textbf{Panel C} : Bank Level Variables}\\ 
  \addlinespace              
   LnTA\tnote{a}    & 10.9&12.3&9.63&0.59&11.2& 13.4&8.63&0.68\\
   LTQ \tnote{b}  & 37.4&364.1&9.64&41.5&31.9&508.3&11.2&   32.2 \\
   PRF\tnote{c}    & 3.93&  4.13&   1.02&   2.02&   4.13&   5.83&   2.12&   2.53\\
    EFF\tnote{d}   & 36.2&  56.4&   16.2&   23.2&   25.5&   68.2&   17.9&   19.8\\
   LEV\tnote{e}   & 81.7&   86.2&   74.5&   2.04&   82.4&   110.2&74.64 &3.32\\
   LG\tnote{f}    & 0.21&   58.2&   -1.44&1.25& 0.14&   35.2&   -1.2&   1.32\\
  AG\tnote{g}    & 165  &700&   0   &157&   164 &513&   0   &146\\
  DIV\tnote{h}  & 21.2& 25.6&   14.3&   11.7&   17.4&   19.54&  15.8&   16.4\\
  \midrule
  \multicolumn{9}{@{}l}{\textbf{Panel D}: Ownership variables}\\
  \addlinespace
 MAS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
 ACS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
 \bottomrule
   \end{tabular}
        \medskip
   \begin{tablenotes}
   \footnotesize
   \item[a] Size
  \item[b] Liquidity  
  \item[c] Profitability 
  \item[d] Efficiency
  \item[e] Leverage
  \item[f] Loan\_growth
  \item[g] Asset\_growth
  \item[h] Diversification
  \end{tablenotes}
  \end{table}
  \end{document}

enter image description here

5
  • 2
    Why do you declare 12 columns? Your table only seems to need 9 of them.
    – leandriis
    Commented Aug 14, 2020 at 18:31
  • "Variables" is typeset in math-mode, and if you fix the number of columns this should produce a centred table caption.
    – oliversm
    Commented Aug 14, 2020 at 18:33
  • 2
    You didn't use the threeparttable environment (with para option)!
    – Bernard
    Commented Aug 14, 2020 at 18:33
  • Also, what are the \mc, \NPLs and \Zscore commands?
    – Bernard
    Commented Aug 14, 2020 at 18:53
  • @bernard I have edited the code, you can see how I defined these two commands
    – haithem
    Commented Aug 14, 2020 at 19:04

2 Answers 2

2

Edit: A wee bit improved code and table design

Like this?

enter image description here

  • you forgot to enclose your table into threeparttable environment
  • from your preamble i delete all not relevant stuff
  • for definitions of shortness for \multicolumn is added the xparse and defined it with \NewExpandableDocumentCommand
  • for columns with numbers are used S column types
\documentclass{article}
\usepackage[margin=2cm,a4paper]{geometry} % set page parameters suitably
\setlength{\parindent}{0pt}

\usepackage{booktabs, tabularx}
\usepackage[para,flushleft]{threeparttable}

\usepackage{xparse}  %new
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{c}{#2}}
\NewExpandableDocumentCommand\mcl{O{9}m}
    {\multicolumn{#1}{@{}l}{#2}}

\usepackage{siunitx} % centering in tables

\usepackage[colorlinks,allcolors=black]{hyperref}

\begin{document}
   \begin{table}[h!]
    \centering
\begin{threeparttable}
   \caption{Descriptive statistics}
   \label{tab1}
%
    \begin{tabular}{@{} >{\itshape}l
                       *{8}{S[table-format=3.2]}
                        }
    \toprule
\multirow{2.4}{*}{Variables} 
    & \mcc[4]{Domestic BANKS} & \mcc[4]{Foreign BANKS}   \\
     \cmidrule(l){2-5} \cmidrule(l){6-9}
    & \mcc{Mean} & \mcc{Max} & \mcc{Min} & \mcc{SD}
    & \mcc{Mean} & \mcc{Max} & \mcc{Min} & \mcc{SD}                 \\
    \midrule
\mcl{\textbf{Panel A} : Risk measures}                              \\
    \addlinespace
NPLs            & 3.83  & 14   & 0.18 & 2.01 & 3.14  & 9.64 & 0.17 & 1.84   \\
Z\_Score        & 13.1  & 14.2 & 1.77 & 5.35 & 13.12 & 14.2 & 2.28 & 3.38   \\
    \midrule
\mcl{\textbf{Panel B} : Political Connections}                      \\
  \addlinespace
CEO\_{PC}       & 0.68  & 1  & 0  & 2.4  & 0.38  & 1   & 0   & 0.66 \\
Board\_{ind}    & 0.28  & 14 & 0  & 6.4  & 0.41  & 13  & 0   & 0.25 \\
  \midrule
\mcl{\textbf{Panel C} : Bank Level Variables}                       \\
  \addlinespace
LnTA\tnote{a}   & 10.9  &  12.3     &  9.63     &  0.59 & 11.2  &  13.4 &  8.63 &  0.68 \\
LTQ \tnote{b}   & 37.4  & 364.1     &  9.64     & 41.5  & 31.9  & 508.3 & 11.2  & 32.2  \\
PRF\tnote{c}    & 3.93  &   4.13    &   1.02    &  2.02 &  4.13 &   5.83&  2.12 &  2.53 \\
EFF\tnote{d}    & 36.2  &  56.4     &  16.2     &  23.2 & 25.5  &  68.2 & 17.9  & 19.8  \\
LEV\tnote{e}    & 81.7  &  86.2     &  74.5     &   2.04& 82.4  & 110.2 & 74.64 &  3.32 \\
LG\tnote{f}     & 0.21  &  58.2     &  -1.44    &   1.25&  0.14 &  35.2 &  -1.2 &  1.32 \\
AG\tnote{g}     & 165   & 700       &   0       & 157   & 164   & 513   &   0   & 146   \\
DIV\tnote{h}    & 21.2  & 25.6      &  14.3     &  11.7 &  17.4 &  19.54&  15.8 &  16.4 \\
    \midrule
\mcl{\textbf{Panel D}: Ownership variables}                     \\
  \addlinespace
 MAS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
 ACS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
 \bottomrule
   \end{tabular}
        \medskip
   \begin{tablenotes}
   \footnotesize
   \item[a] Size
  \item[b] Liquidity
  \item[c] Profitability
  \item[d] Efficiency
  \item[e] Leverage
  \item[f] Loan\_growth
  \item[g] Asset\_growth
  \item[h] Diversification
  \end{tablenotes}
\end{threeparttable}
  \end{table}
  \end{document}
4
  • THe \mcc command isn't really necessary in S columns – a simple pair of braces would do it.
    – Bernard
    Commented Aug 14, 2020 at 20:24
  • @zarko Perfect.. thanks for sharing
    – haithem
    Commented Aug 14, 2020 at 20:25
  • @zarko .. i have annother question if you don't mind .. is it possible to align the numbers of Panel C?
    – haithem
    Commented Aug 14, 2020 at 20:28
  • @haithem, all numbers in table are aligned at their decimal points.
    – Zarko
    Commented Aug 14, 2020 at 20:37
1

If you want, you can use {NiceTabular} of nicematrix with its built-in command \tabularnote.

 \documentclass{article}
 \usepackage[margin=2cm,a4paper]{geometry} % set page parameters suitably
 \usepackage{booktabs} % For better looking tables
 \usepackage{tabularx}
\setlength{\parindent}{0pt}
\newcommand{\sym}[1]{#1}
\newcommand{\fignote}[1]{\figtext{\emph{Note:~}~#1}}
\newcommand{\figsource}[1]{\figtext{\emph{Source:~}~#1}}
\usepackage{siunitx} % centering in tables
\sisetup{
detect-mode,
tight-spacing  = true,
group-digits = false ,
input-open-uncertainty  = ,
input-close-uncertainty = ,
table-align-text-post   = false
}
\usepackage{ragged2e}
\usepackage[para,flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textsf}

\usepackage{enumitem}
\newlist{myitemize}{itemize}{1}
\setlist[myitemize]{noitemsep,left=0pt,label=--}
\usepackage[colorlinks,allcolors=black]{hyperref} 

\newcolumntype{P}{>{\RaggedRight\hspace{0pt}}p{\hsize}}
\newcommand\mytab[1]{\smash{%
\begin{tabular}[t]{@{} P @{}} #1 \end{tabular}}}
\newcommand{\ZScore}{$\mathop{\textnormal{\slshape Z\_Score}}\nolimits$}
\newcommand{\NPLs}{$\mathop{\textnormal{\slshape NPLs}}\nolimits$}  

\usepackage{nicematrix}


\NiceMatrixOptions{notes = { para , style = \textit{\alph{#1} } } }


\begin{document}

\begin{table}[h!]
\caption{Descriptive statistics}
\label{tab1}
\centering
\begin{NiceTabular}{@{}>{\itshape}l*{8}{c}}%
\toprule
Variables & \multicolumn{4}{c}{Domestic BANKS} & \multicolumn{4}{c}{Foreign BANKS} \\ 
\cmidrule(l){2-5} \cmidrule(l){6-9}
& Mean & Max & Min & SD & Mean & Max & Min & SD \\ 
\midrule
\normalfont\rlap{\textbf{Panel A} : Risk measures}\\ 
\addlinespace
\NPLs            & 3.83  & 14   & 0.18 & 2.01 & 3.14  & 9.64 & 0.17 & 1.84\\
\ZScore          & 13.1  & 14.2 & 1.77 & 5.35 & 13.12 & 14.2 & 2.28 & 3.38 \\
\midrule
\normalfont\rlap{\textbf{Panel B} : Political Connections}\\
\addlinespace 
CEO\_{PC}       & 0.68  & 1  & 0  & 2.4  & 0.38  & 1   & 0   & 0.66\\
Board\_{ind}       & 0.28  & 14 & 0  & 6.4  & 0.41  & 13  & 0   & 0.25\\
\midrule
\normalfont\rlap{\textbf{Panel C} : Bank Level Variables}\\ 
\addlinespace              
LnTA\tabularnote{Size}    & 10.9&12.3&9.63&0.59&11.2& 13.4&8.63&0.68\\
LTQ\tabularnote{Liquidity}  & 37.4&364.1&9.64&41.5&31.9&508.3&11.2&   32.2 \\
PRF\tabularnote{Profitability}    & 3.93&  4.13&   1.02&   2.02&   4.13&   5.83&   2.12&   2.53\\
EFF\tabularnote{Efficiency}   & 36.2&  56.4&   16.2&   23.2&   25.5&   68.2&   17.9&   19.8\\
LEV\tabularnote{Leverage}   & 81.7&   86.2&   74.5&   2.04&   82.4&   110.2&74.64 &3.32\\
LG\tabularnote{Loan growth}    & 0.21&   58.2&   -1.44&1.25& 0.14&   35.2&   -1.2&   1.32\\
AG\tabularnote{Assset growth}    & 165  &700&   0   &157&   164 &513&   0   &146\\
DIV\tabularnote{Diversification}  & 21.2& 25.6&   14.3&   11.7&   17.4&   19.54&  15.8&   16.4\\
\midrule
\normalfont\rlap{\textbf{Panel D}: Ownership variables}\\
\addlinespace
MAS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
ACS                   & 4.83 & 1.07 & 4.67 & 0.79 & 0.2 & 0.73& 0.07& 0.07 \\
\bottomrule
\end{NiceTabular}
\end{table}
\end{document}

Ouput of the above code

2
  • thanks for the help but i could not compile your code !!
    – haithem
    Commented Aug 15, 2020 at 14:32
  • Maybe you should update your TeX installation. If you want, you can send me an email. I'm the author of the package nicematrix. You will find my mail on the documentation of nicematrix. Commented Aug 15, 2020 at 14:57

You must log in to answer this question.

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