1

I have the following slide:

enter image description here

With the following code:

\documentclass{beamer}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{G}{@{}>{\begin{lrbox}{\mybox}}l<{\end{lrbox}}@{}}
\usepackage{multirow}
\usepackage{ragged2e}
\newcolumntype{L}{ >{\RaggedRight}X }
\usepackage{siunitx}
\usepackage{makecell}
\renewcommand\theadfont{\normalfont\bfseries}
\setlength\parindent{0pt}
\newcolumntype{Y}{ >{\Centering}X}
\usepackage[justification=centering]{caption}
\setlength\parindent{0pt}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\renewcommand\theadfont{\normalfont\bfseries}
\newcommand\mc[1]{\multicolumn{2}{c}{#1}}
\setlength\parindent{0pt}
\usepackage[round,sort,comma]{natbib}
\usepackage{indentfirst}
\usetheme{Warsaw}
\usepackage{pgfpages}
\usepackage{stmaryrd}
\usepackage{multicol}
\usepackage[english]{babel}
\usepackage{units}
\usepackage{tikz}
\usepackage{bmpsize}
\usepackage{adjustbox}
\begin{document}
\begin{frame}[shrink=40]{Summary Statistics}     \vspace*{2em}     \begin{tabularx}{\textwidth}{@{} lYYYYYY @{}}   
    \toprule   
\thead[lc]{Category }& \thead{Strategies}& {\thead{Annualized \\ Mean}} & {\thead{Volatility}} & {\thead{Skew}} & {\thead{kurtosis}} & {\thead{Sharpe \\ Ratio}} \\
    \midrule   
    \multirow{2}{*}{ Momentum } & TSMOM(1,1) & 3.18 &  3.84 & -0.26 & 20.06 & 0.00  \\                                    &                                     TSMOM(3,3) & 11.85 &  7.76 & -1.96 & 24.72 & 0.00  \\ \addlinespace       
\multirow{5}{*}{ Size } & Top Decile & 12.70 & 9.26 & 1.44 & 15.80 & 0.00 \\     
& 9\textsuperscript{th} Decile & 0.11 & 8.49 & 0.49 & 12.73 & 0.00\\     
& Bottom Decile & 8.96 & 5.07 & -0.57 & -9.38 & 0.00 \\     
& 2\textsuperscript{nd} Decile & 10.13 & 5.19 & -0.44 & 10.87 & 0.00\\
& Top minus Bottom & 3.75 & 6.54 & 2.45 & 18.54 & 0.00\\ \addlinespace

\multirow{7}{*}{ Value } & Top Decile & 11.76 & 8.73 & 0.1915 & 14.62 & 0.00\\     
& Bottom Decile & 8.38 & 5.76 & -0.59 & 8.74 & 0.00 \\     
& Top Minus Lowest (Decile) & 3.38 & 5.94 & 0.68 & 11.03 & 0.00 \\     
& Top 30\textsuperscript{th} Percentile & 11.79 & 8.73 & 0.19 & 14.62 & 0.00 \\     
& Mid 40\textsuperscript{th} Percentile & 10.04 & 5.64 & 0.03 & 13.76 & 0.00 \\     
& Bottom 30\textsuperscript{th} Percentile & 9.04 & 5.43 & -0.73 & 8.80 & 0.00 \\     
& Highest Minus Lowest 30\textsuperscript{th} & 2.72 & 5.60 & 0.82 & 12.79 & 0.00 \\   

\bottomrule 
\end{tabularx} 
\end{frame}
\end{document}

As can be seen, the slide texts feels quite squished for the 2nd column. Also, the last row has some text that is being cut off. Is there anyways to fix this ?

Thank you

1
  • 3
    Too much information for a single slide. I would suggest 5 slides with the mean through the ratio each on a separate slide. – R. Schumacher Mar 4 '16 at 19:31
1

If you will use my answer on similar your question ( here) and play little bit with [shrink=<amount>], you will able to achieve the following:

enter image description here

\documentclass{beamer}
    \usepackage{booktabs,makecell,multirow,tabularx}
    \usepackage{ragged2e}
\renewcommand\theadfont{\normalfont\bfseries}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\newcommand\mc[1]{\multicolumn{2}{c}{#1}}

\setlength\parindent{0pt}
%\usepackage[justification=centering]{caption}
\usepackage{siunitx}
\usepackage{tikz}

\usepackage{adjustbox}

\begin{document}

\begin{frame}[shrink=30]{Summary Statistics}     
    \vspace*{2em}     
    \setlength{\tabcolsep}{4pt}
\begin{tabularx}{\textwidth}{@{} l L *{5}{S[table-format=3.3]} @{}}
    \toprule
\thead[b]{Category}
    &   {\thead[b]{Strategies}}
        &   {\thead[b]{Annualized \\ Mean}}
            &   {\thead[b]{Annualized \\ Volatility}}
                &   {\thead[b]{Skew}}
                    &   {\thead[b]{Kurtosis}}
                        &   {\thead[b]{Sharpe \\ Ratio}}   \\
\midrule
    \multirow{2}{*}{ Momentum } & TSMOM(1,1) & 3.18 &  3.84 & -0.26 & 20.06 & 0.00  \\
                                & TSMOM(3,3) & 11.85 &  7.76 & -1.96 & 24.72 & 0.00  \\ \addlinespace
    \multirow{5}{*}{ Size } & Top Decile & 12.70 & 9.26 & 1.44 & 1.44 & 15.80  \\
    & 9\textsuperscript{th} Decile & 0.11 & 8.49 & 0.49 & 12.73 & 0.00\\
    & Bottom Decile & 0 & 1.00 & 1.00 \\
    & 2\textsuperscript{nd} Decile & 0 & 0.23 & 1.00\\
    & Top minus Bottom & 0 & 1.00 & 1.00\\
\addlinespace
    \multirow{7}{*}{ Value } & Top Decile & 0 & 1.00 & 1.00\\
    & Bottom Decile & 0 & 1.00 & 1.00 \\
    & Top Minus Lowest (Decile) & 0 & 1.00 & 1.00 \\
    & Top 30\textsuperscript{th} Percentile & 0 & 1.00 & 1.00 \\
    & Mid 40\textsuperscript{th} Percentile & 0 & 0.29 & 1.00 \\
    & Bottom 30\textsuperscript{th} Percentile & 0 & 1.00 & 1.00 \\
    & Highest Minus Lowest 30\textsuperscript{th} & 0 & 1.00 & 1.00 \\
\bottomrule
    \end{tabularx}
\end{frame}
\end{document}
3
  • Thank you ! I ran into this trouble but didnt want to bother you for asking too much but it looks like you ran into it again. Once again, thank you very much – PutsandCalls Mar 4 '16 at 23:53
  • Its OK, however, if you already receive an answer, close to your needs, than for some new requirements use it for starting point. With this you will (i) learn more about (table) typesetting in LaTeX and probably find solutions yourself, (ii) make people here his their help easier. Happy TeX-ing! – Zarko Mar 5 '16 at 6:01
  • Thanks for the tip, I will keep that in mind for next time – PutsandCalls Mar 5 '16 at 6:06
5

My advice (as the author of the package) is never use tabularx for data tables. It s designed to affect linebreaking widths in columns, but you have no linebreaking here. the numeric columns would look better if the y were aligned on the decimal point using a D column from dcolumn or an S column from siunitx. And don't take two lines for your row headings, it introduces ugly gaps. So something like this

enter image description here

Although as there is some vertical space left I'd probably add more space between the groups.

\documentclass{beamer}

\usepackage{booktabs}
\usepackage{array}
\newcolumntype{G}{@{}>{\begin{lrbox}{\mybox}}l<{\end{lrbox}}@{}}

\newcolumntype{L}{ >{\RaggedRight}X }
\usepackage{siunitx}


\setlength\parindent{0pt}

\usepackage[justification=centering]{caption}
\setlength\parindent{0pt}


\newcommand\mc[1]{\multicolumn{2}{c}{#1}}
\setlength\parindent{0pt}
\usepackage[round,sort,comma]{natbib}
\newcommand\thead[1]{\textbf{\begin{tabular}{@{}c@{}}#1\end{tabular}}}
\usetheme{Warsaw}
\usepackage{pgfpages}
\usepackage{stmaryrd}


\begin{document}
\begin{frame}[shrink=40]{Summary Statistics}  
\centering
\vspace*{2em}     
\begin{tabular}{@{} ll
*{5}{S} @{}}   
    \toprule   
\thead{Category }& \thead{Strategies}& {\thead{Annualized \\ Mean}} & {\thead{Volatility}} & {\thead{Skew}} & {\thead{kurtosis}} & {\thead{Sharpe \\ Ratio}} \\
    \midrule   
Momentum  & TSMOM(1,1) & 3.18 &  3.84 & -0.26 & 20.06 & 0.00  \\                                    &                                     TSMOM(3,3) & 11.85 &  7.76 & -1.96 & 24.72 & 0.00  \\ \addlinespace       
Size  & Top Decile & 12.70 & 9.26 & 1.44 & 15.80 & 0.00 \\     
& 9\textsuperscript{th} Decile & 0.11 & 8.49 & 0.49 & 12.73 & 0.00\\     
& Bottom Decile & 8.96 & 5.07 & -0.57 & -9.38 & 0.00 \\     
& 2\textsuperscript{nd} Decile & 10.13 & 5.19 & -0.44 & 10.87 & 0.00\\
& Top minus Bottom & 3.75 & 6.54 & 2.45 & 18.54 & 0.00\\ \addlinespace

Value  & Top Decile & 11.76 & 8.73 & 0.1915 & 14.62 & 0.00\\     
& Bottom Decile & 8.38 & 5.76 & -0.59 & 8.74 & 0.00 \\     
& Top Minus Lowest (Decile) & 3.38 & 5.94 & 0.68 & 11.03 & 0.00 \\     
& Top 30\textsuperscript{th} Percentile & 11.79 & 8.73 & 0.19 & 14.62 & 0.00 \\     
& Mid 40\textsuperscript{th} Percentile & 10.04 & 5.64 & 0.03 & 13.76 & 0.00 \\     
& Bottom 30\textsuperscript{th} Percentile & 9.04 & 5.43 & -0.73 & 8.80 & 0.00 \\     
& Highest Minus Lowest 30\textsuperscript{th} & 2.72 & 5.60 & 0.82 & 12.79 & 0.00 \\   

\bottomrule 
\end{tabular} 
\end{frame}
\end{document}

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.