1

I use the resize box command, but the table is so small. I want to manage the table to be readbale. this is the code for table

\begin{sidewaystable}
    \centering
    \caption{Description des données}
    \label{Desc.données}
    \resizebox{\linewidth}{!}{%
        \begin{tabular}{lccccccccccccccc} 
            \hline
            \textbf{Panel A :} Fréquence Mensuelle &  \phantom{abc}   & \multicolumn{4}{l}{ \textbf{Mesure directes}}  &\phantom{abc}& \multicolumn{2}{l}{ \textbf{Mesures du marché}} & \phantom{abc} & \multicolumn{2}{l}{ \textbf{Mesures textuelles}} &\phantom{abc}  & \multicolumn{3}{l}{ \textbf{Mesures composites}}                        \\ 
            \cline{3-6}\cline{8-9}\cline{11-12}\cline{14-16}
            & \textbf{\textit{S\&P500EW}} & \textit{\textbf{UMCI}} & \textit{CCI} & \textit{\textbf{AAII}} & \textit{\textbf{II}} &  & \textit{\textbf{VIX}} & \textit{\textbf{PCR}}   &  & \textit{\textbf{FEARS}} & \textit{\textbf{MS}}   &  & \textit{\textbf{BW}} & \textit{\textbf{HJTZ}} & \textit{\textbf{Lutz}}  \\ 
            \hline
            Début de Période                       & 1965:07                     & 1978:01                & 1967:07      & 1965:02                & 1965:07              &  & 1990:01               & 1965:07                 &  & 2004:07                 & 2004:07                &  & 1965:07              & 1965:07                & 1965:07                 \\
            Fin de Période                         & 2018:12                     & 2018:12                & 2018:12      & 2018:12                & 2018:12              &  & 2018:12               & 2018:12                 &  & 2011:12                 & 2014:12                &  & 2016:12              & 2016:12                & 2009:12                 \\
            \hline
            \textbf{Panel B:} Fréquence Journalière &                             & \multicolumn{2}{l}{\textbf{Mesures d'enquêtes}} &                        & \multicolumn{7}{l}{ \textbf{Mesure du marché} }                                                                                      &  &                      &                        &                         \\ 
            \cline{3-4}\cline{6-12}
            & \textbf{S\&P500EW}          & $AAII$               & $II$                 &                        & $Pull/Call_{Equity}$ &  & $Pull/Call_{Equity}$ & $Pull/Call_{Equity}$ &  & $VIX$                 & $ISSE$               &  &                      &                        &                         \\ 
            \hline
            Début de Période                       & 1965:07                     & 1978:01                & 1967:07                &                        & 1965:07                 &  & 1965:07                 & 1965:07                 &  & 1990:01                 & 1965:07                &  &                      &                        &                         \\
            Fin de Période                         & 2018:12                     & 2018:12                & 2018:12                &                        & 2018:12                 &  & 2018:12                 & 2018:12                 &  & 2018:12                 & 2018:12                &  &                      &                        &                         \\
            \hline
            \end{tabular}
        [1]\ Footnote 1: Variable~1 is calculated as\ldots \endgraf
        [2]\ Correlations are Pearson.
            }
    \end{sidewaystable}

. Thanks in advance

  • Please tell us a lot more about the document this table is embedded in. E.g., which document class do you employ, what's the main font size, and wide and tall is the textblock? Incidentally, should Pull/Call possibly be Put/Call? – Mico Aug 1 '19 at 9:40
2

You haven't provided much information about document parameters such as the class, the main font size, the paper size, of the margin widths. I've thus had to make quite a few guesses; do advise if they turn out to be incorrect.

Your tabular environment contains several empty columns, which take up quite a bit of space without providing much clarity. I recommend getting rid of these columns. I would also recommend not using bold-facing or italics or bold italics for the header cells. A well-designed table doesn't require such visual crutches. I would, though, recommend, loading the booktabs package and using its macros \toprule, \bottomrule, \midrule, \cmidrule, and `\addlinespace to give the table a much more open "look". Using line breaks for some of the longish headers in the first columns is also advisable.

In the following solution, I employed a tabular* environment instead of a tabular environment, to help assure that the table fits inside the available space.

enter image description here

\documentclass[10pt]{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters suitably
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[flushleft]{threeparttable}
\usepackage{rotating,booktabs,amsmath,array}

\newlength\mylen
\settowidth\mylen{Fréquence Journalière}
\newcommand\mytab[1]{\smash[b]{%
   \begin{tabular}[t]{@{}>{\raggedright\arraybackslash}p{\mylen}@{}} 
   #1 \end{tabular}}}

\begin{document}
\begin{sidewaystable}
\setlength\tabcolsep{0pt} % make LaTeX figure out intercol. whitespae

\begin{threeparttable}
\caption{Description des données}\label{Desc.données}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{12}{c} @{}} 
\toprule
\mytab{Panel A\,: Fréquence Mensuelle} &  
& \multicolumn{4}{c}{Mesures directes}  
& \multicolumn{2}{c}{Mesures du marché}
& \multicolumn{2}{c}{Mesures textuelles}   
& \multicolumn{3}{c}{Mesures composites} \\ 
\cmidrule{3-6} \cmidrule{7-8} \cmidrule{9-10} \cmidrule{11-13}
& S\&P500EW & UMCI & CCI & AAII & II & VIX & PCR & FEARS & MS & BW & HJTZ & Lutz \\ 
\midrule

Début de Période & 1965:07 & 1978:01 & 1967:07 & 1965:02 & 1965:07 & 1990:01 & 1965:07 & 2004:07 & 2004:07 & 1965:07 & 1965:07 & 1965:07 \\
Fin de Période   & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2011:12 & 2014:12 & 2016:12 & 2016:12 & 2009:12 \\
\bottomrule

\addlinespace
\mytab{Panel B\,: Fréquence Journalière} &
& \multicolumn{2}{c}{Mesures d'enquêtes} & 
& \multicolumn{4}{c}{Mesures du marché} \\ 
\cmidrule{3-4}\cmidrule{6-9}
& S\&P500EW & AAII & II & Put/Call\textsubscript{Eq.} & Put/Call\textsubscript{Eq.} & Put/Call\textsubscript{Eq.} & VIX & ISSE \\ 
\midrule

Début de Période & 1965:07 & 1978:01 & 1967:07 & 1965:07 & 1965:07 & 1965:07 & 1990:01 & 1965:07 & & & \\
Fin de Période   & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & & & \\
\bottomrule
\end{tabular*}

\begin{tablenotes}
\footnotesize
\smallskip
\item[1]Variable~1 is calculated as \ldots 
\item[2]Correlations are Pearson.
\end{tablenotes}

\end{threeparttable}
\end{sidewaystable}
\end{document}
| improve this answer | |
  • Thanks Mico for your answer, i use a book class (\documentclass[a4paper,12pt,oneside,french]{book}), with margin width(\usepackage[top=2.5cm,bottom=2.5cm,headsep=1cm,right=2cm,vscale=0.75]{geometry} \titleformat{\chapter}[block]{}{\eqmakebox[chap]{\Large\MakeUppercase{\sffamily\lsstyle\chaptername} % \raisebox{-0.6\height}{\fontsize{50pt}{50pt}\selectfont\thechapter}\quad}}% {0pt}{\huge\bfseries\raisebox{1ex}{\parbox[t]{\dimexpr\textwidth-\eqboxwidth{chap}\relax}{\titlerule[2pt]\vspace{1.25ex}#1}}} \titlespacing*{\chapter}{0pt}{-32pt}{48pt}%). – nino Aug 1 '19 at 12:54
  • with the specification that i used the table don't fit the page. – nino Aug 1 '19 at 13:14
  • 1
    @nino - I had assumed, in my answer, that the document font size was 10pt; since you use 12pt, which is about 20% larger, you need to insert the instruction \footnotesize after \begin{sidewaystable} to revert to 10pt. – Mico Aug 1 '19 at 14:59
2

I propose playing with \tabcolsep, setting the font size to \footnotesize and replacing the empty columns with the (lr) argument of \cmidrule to help visualise the different groups of columns:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array, multirow, makecell}
\usepackage{threeparttable, booktabs, caption}
\usepackage{rotating}
\usepackage[showframe]{geometry}
\renewcommand{\theadfont}{\bfseries}

\begin{document}

\begin{sidewaystable}
    \centering\footnotesize
\setlength{\tabcolsep}{4.7pt}
\begin{threeparttable}
    \caption{Description des données}
    \label{Desc.données}
        \begin{tabular}{@{}l*{12}{c}@{}}
            \toprule
           \multicolumn{2}{@{}l}{\textbf{Panel A :} Fréquence Mensuelle} & \multicolumn{4}{l}{ \textbf{Mesure directes}} & \multicolumn{2}{l}{ \thead[l]{Mesures\\ du marché}} & \multicolumn{2}{l}{ \thead[l]{Mesures\\ textuelles}} & \multicolumn{3}{l}{ \textbf{Mesures composites}} \\
            \cmidrule(lr{1.3em}){3-6}\cmidrule(lr){7-8}\cmidrule(lr{0.5em}){9-10}\cmidrule(l){11-13}
            & \makebox[0pt]{\textbf{\textit{S\&P500EW}}} & \textit{\textbf{UMCI}} & \textit{CCI} & \textit{\textbf{AAII}}%
             & \textit{\textbf{II}} & \textit{\textbf{VIX}} & \textit{\textbf{PCR}} & \textit{\textbf{FEARS}} & \textit{\textbf{MS}} & \textit{\textbf{BW}} & \textit{\textbf{HJTZ}} & \textit{\textbf{Lutz}} \\
            \midrule
            Début de Période & 1965:07 & 1978:01 & 1967:07 & 1965:02 & 1965:07 & 990:01 & 1965:07 & 2004:07 & 2004:07 & 1965:07 & 1965:07 & 1965:07 \\
            Fin de Période & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2011:12 & 2014:12 & 2016:12 & 2016:12 & 2009:12 \\
            \midrule\addlinespace[2ex]
            \multicolumn{2}{@{}l}{\textbf{Panel B:} \rlap{Fréquence Journalière}} & \multicolumn{2}{l}{\textbf{Mesures d'enquêtes}} & \multicolumn{7}{l}{ \textbf{Mesure du marché} } \\
            \cmidrule(lr){3-4}\cmidrule(lr){5-9}
            & \makebox[0pt]{\textbf{S\&P500EW}} & $AAII$ & $II$ & \makecell{$Pull/$\\$Call_{Equity}$} & \makecell{$Pull/$\\$Call_{Equity}$} & \makecell{$Pull/$\\$Call_{Equity}$} & $VIX$ & $ISSE$ \\
            \midrule
            Début de Période & 1965:07 & 1978:01 & 1967:07 & 1965:07 & 1965:07 & 1965:07 & 1990:01 & 1965:07 \\
            Fin de Période & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 & 2018:12 \\
            \bottomrule
            \end{tabular}
\begin{tablenotes}[online]\smallskip
\item[{[1]}]\ Footnote 1: Variable~1 is calculated as \ldots %\endgraf
\item [{[2]}]\ Correlations are Pearson.
 \end{tablenotes}
 \end{threeparttable}
\end{sidewaystable}

\end{document} 

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.