Document ClassesFitting Tables in Presentation Slides

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
lucataschini
Posts: 5
Joined: Tue Jun 10, 2008 4:22 pm

Fitting Tables in Presentation Slides

Post by lucataschini »

Hi all,

I have a table that does not fit in the slides I'm preparing with the beamer class.

Code: Select all

\begin{table}[!ht]
  \centering
  \begin{tabular}{|c||c|c|c||c|c|c||c|c|c|} \hline
    $\sigma$ & \multicolumn{3}{c}{$\sigma$=.05} & \multicolumn{3}{c}{$\sigma$=.20} & \multicolumn{3}{c}{$\sigma$=.40} \\ \hline
    d & 0      & 0.5    & 1      & 0      & 0.5    & 1      & 0      & 0.5    & 1      \\ \hline
    0 & 2.8291 & 2.8291 & 2.8291 & 3.5735 & 3.5735 & 3.5734 & 5.3185 & 5.3113 & 5.3080 \\
    3 & 2.3221 & 2.3221 & 2.3221 & 2.1571 & 2.1571 & 2.1570 & 2.0858 & 2.0823 & 2.0807 \\
    5 & 2.0973 & 2.0973 & 2.0973 & 1.8080 & 1.8079 & 1.8079 & 1.5447 & 1.5417 & 1.5403 \\ \hline
    \end{tabular}
\end{table}
Any idea how to solve this size issue?

Thank you for your help, and have a great day from the sunny Zurich!


Luca

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Fitting Tables in Presentation Slides

Post by Stefan Kottwitz »

:? Hi Luca,

you don't need the table environment, I guess that table is not intended to float. You could choose a smaller font size and you could reduce \tabcolsep, like in this example.

Code: Select all

\usepackage{caption}
...
\frame{%
  \begin{center}
    \captionof{table}{Test}
    \label{table:second}
    \setlength{\tabcolsep}{2pt}
    \small
    \begin{tabular}{|c||c|c|c||c|c|c||c|c|c|} \hline
      $\sigma$ & \multicolumn{3}{c}{$\sigma$=.05} & \multicolumn{3}{c}{$\sigma$=.20} & \multicolumn{3}{c|}{$\sigma$=.40} \\ \hline
      d & 0 & 0.5 & 1 & 0 & 0.5 & 1 & 0 & 0.5 & 1 \\ \hline
      0 & 2.8291 & 2.8291 & 2.8291 & 3.5735 & 3.5735 & 3.5734 & 5.3185 & 5.3113 & 5.3080 \\
      3 & 2.3221 & 2.3221 & 2.3221 & 2.1571 & 2.1571 & 2.1570 & 2.0858 & 2.0823 & 2.0807 \\
      5 & 2.0973 & 2.0973 & 2.0973 & 1.8080 & 1.8079 & 1.8079 & 1.5447 & 1.5417 & 1.5403 \\ \hline
    \end{tabular}
  \end{center}%
}
But don't make the font too small in a presentation.

Stefan
LaTeX.org admin
lucataschini
Posts: 5
Joined: Tue Jun 10, 2008 4:22 pm

Re: Fitting Tables in Presentation Slides

Post by lucataschini »

Thank you very much!
ejspeiro
Posts: 2
Joined: Wed May 23, 2012 6:30 am

Fitting Tables in Presentation Slides

Post by ejspeiro »

What about having this table inside a block? Can I do that?

Thanks!
Eduardo J. Sanchez Peiro
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Fitting Tables in Presentation Slides

Post by Stefan Kottwitz »

Hi Eduardo,

sure, did you try it? If you tried and got an error or an undesired result, you could post the error message here or the code which you tried.

Stefan
LaTeX.org admin
Post Reply