Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}

enter image description here

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}

\title[Short Title \hspace{4em}\insertframenumber/
\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}
share|improve this question
1  
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
4  
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
1  
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
show 2 more comments

1 Answer 1

up vote 4 down vote accepted

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}

\title[Short Title \hspace{4em}\insertframenumber/
\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

enter image description here

share|improve this answer
    
Much obliged, it works great! –  Murat Arat Jan 20 '13 at 19:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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