# Space between table and caption in Beamer

I am making a slide using Stockton beamer theme.

I have added a table to a frame, however as you can see in the screenshot, that space between caption and table is too much. I made some search and found these codes,

\usepackage{subfig}
\captionsetup[table]{belowskip=1pt,aboveskip=1pt}

\usepackage[font=small,skip=0pt]{caption}


However, they both are not working. How can I solve this problem? Table looks so bad in this slide.

\documentclass[xcolor=svgnames]{beamer}
\usetheme{Stockton}

\usepackage{epsfig} %for figures
\usepackage{xcolor} %for color

\definecolor{hughesblue}{rgb}{.9,.9,1} %A blue I like to use for highlighting, matches Hughes Hallet's book

\logo{\includegraphics[height=2cm]{Seal_Cream.pdf}} % comment out this line if you do not have the pacific-seal file}

\inserttotalframenumber]{~ \\ Long Title:  A Sample Using \\ Stockton Beamer Theme \\~}

\author[short author name or speaker]{ \\ Sarah Merz, The University of the Pacific }

\date{January, 2010}

\begin{document}

\begin{frame}
\maketitle
\end{frame}

\begin{frame}
\frametitle{INPUT SELECTION}
\begin{itemize}
\item The load is influenced by many factors.:
\end{itemize}
\begin{table}[!htbp]
\caption {Factors that may influence electricity demand}
\label{table:1}
\resizebox{\linewidth}{!}{%
\begin{tabular}{|l|p{15cm}|}\hline
Calendar data & hour of the day, day of the week, holidays, 'bridge days', daylight saving time, school holidays\\\hline
Meteorological data & temperature, humidity, cloud cover, luminosity, earth's position in the eclipse, sun's altitude, wind speed, solar radiation, climate change\\\hline
Economic data & GDP, per capita GDP, consumer price index, average salary earnings, production plans of companies, electricity price, industrial expansion\\\hline
Demographic data & number of households, population growth, local area development\\\hline
\end{tabular}}
\end{table}
\begin{itemize}
\item The importance of horizon:
\begin{itemize}
\item For very short-term forecast (up to 6 hours) $\longrightarrow$ inputs based on past load values
\end{itemize}
\item Engineering judgment or human experience as well as some statistical/graphical analysis
\end{itemize}
\end{frame}

\end{document}

-
It appears to be a problem of stockton, I commented the line out and the result had a smaller gap between caption and table. –  xfoo Jan 20 '13 at 9:11
In beamer presentations you don't need floats. Hence, you don't need to put your tabular inside a table environment because it's not a float. You don't even need to caption them because it's not a float. Subfig is not related to caption but caption offers a \captionof command for captioning objects that are not a float. And lastly you just have too much text on a slide. –  percusse Jan 20 '13 at 9:31
I take your code (without captionsetup) and get dl.getdropbox.com/u/1897885/space_table_caption.pdf. I think there aren't extra spaces between caption and table here. –  artscan Jan 20 '13 at 9:32
Using caption package and setting skip=0pt seem to do the work. It only looks like there is a big space between the caption and the table because the table text is smaller compared to the default font size. And, afaik, specifying !htbp does not work in beamer. And as percusse has mentioned, instead of the table environment, you might want to use the \captionof command instead. –  hpesoj626 Jan 20 '13 at 9:37
Since figure and table are no floating environments in beamer I don't see the point why not using them. –  Axel Sommerfeldt Jan 20 '13 at 9:40

belowskip=0pt of caption package seems to do the job. Also, the table environment is adding whitespace between text and the table. You can use \captionof command instead.

# Code

\documentclass[xcolor=svgnames]{beamer}
\usetheme{Stockton}

\usepackage{epsfig} %for figures
\usepackage{xcolor} %for color

\definecolor{hughesblue}{rgb}{.9,.9,1} %A blue I like to use for highlighting, matches Hughes Hallet's book

%\logo{\includegraphics[height=2cm]{Seal_Cream.pdf}} % comment out this line if you do not have the pacific-seal file}

\inserttotalframenumber]{~ \\ Long Title:  A Sample Using \\ Stockton Beamer Theme \\~}

\author[short author name or speaker]{Sarah Merz, The University of the Pacific }

\date{January, 2010}

\usepackage{caption}
\captionsetup{skip=0pt,belowskip=0pt}

\begin{document}

\begin{frame}
\maketitle
\end{frame}

\begin{frame}
\frametitle{INPUT SELECTION}
\begin{itemize}
\item The load is influenced by many factors.:
\end{itemize}
%\begin{table}[!htbp]
\captionof{table}{Factors that may influence electricity demand\label{table:1}}
%\captionof{table}{Factors that may influence electricity demand}
%\label{table:1}
\resizebox{\linewidth}{!}{%
\begin{tabular}{|l|p{15cm}|}\hline
Calendar data & hour of the day, day of the week, holidays, 'bridge days', daylight saving time, school holidays\\\hline
Meteorological data & temperature, humidity, cloud cover, luminosity, earth's position in the eclipse, sun's altitude, wind speed, solar radiation, climate change\\\hline
Economic data & GDP, per capita GDP, consumer price index, average salary earnings, production plans of companies, electricity price, industrial expansion\\\hline
Demographic data & number of households, population growth, local area development\\\hline
\end{tabular}}
%\end{table}
\begin{itemize}
\item The importance of horizon:
\begin{itemize}
\item For very short-term forecast (up to 6 hours) $\longrightarrow$ inputs based on past load values
\end{itemize}
\item Engineering judgment or human experience as well as some statistical/graphical analysis
\end{itemize}
\end{frame}

\end{document}


# Output

-
Much obliged, it works great! –  Oceansoul Jan 20 '13 at 19:04