13

I have a table like this:

\begin{table}
\centering
\begin{center}
\begin{tabular}{c|c|c|c}
Data set & Image size & Hole size (pix) & Total time\\
\hline
Mailbox & 459 $\times$ 489 & 30171 & 1m5s \\
Electric boxes & 688 $\times$ 478 & 45434 & 2m19s\\
Trashcan & 572 $\times$ 517 & 42734 & 1m59s\\
Air conditioners & 400 $\times$ 496 & 13709 & 23s
\end{tabular}
\end{center}
\caption{A summary of the data sets shown throughout this paper.}
\label{tab:Timing}
\end{table}

Table image

The problem is that the caption is only about 1 word wide (and centered), so it takes up about 10 lines. Why would this caption not behave like a normal figure caption and simply occur page-width?

Here is a minimal working example (you need this style: daviddoria.com/Uploads/acmtog.cls):

\documentclass{acmtog}
\pdfminorversion=5
\begin{document}

\begin{table}
\centering
\begin{center}
\begin{tabular}{c|c|c|c}
Data set & Image size & Hole size (pix) & Total time\\
\hline
Mailbox & 459 $\times$ 489 & 30171 & 1m5s \\
Electric boxes & 688 $\times$ 478 & 45434 & 2m19s\\
Trashcan & 572 $\times$ 517 & 42734 & 1m59s\\
Air conditioners & 400 $\times$ 496 & 13709 & 23s
\end{tabular}
\end{center}
\caption{A summary of the data sets shown throughout this paper.}
\label{tab:Timing}
\end{table}

\end{document}
David Carlisle
  • 757,742
  • 1
    You need to turn this into a complete minimal document. Simply pasting your code into an article document, for example, does not reproduce the behaviour. – Jake Apr 24 '12 at 15:49
  • @Jake Ok, I modified the original question to include a minimal document and the document class file necessary. – David Doria Apr 24 '12 at 15:59
  • 3
    \centering inside floats like figure and table is sufficient -- don't use the center environment in addition (or instead). See http://tex.stackexchange.com/questions/2651/should-i-use-center-or-centering-for-figures for details. – lockstep Apr 24 '12 at 16:02
  • Would you mind changing the title of your question to something like "Table caption very skinny when using ACM ToG documentclass"? That will make it easier for others with the same problem to find the question. – Jake Apr 24 '12 at 16:15

1 Answers1

19

In ACM document classes, I think you create tables via the \tbl macro.

\begin{table}
\tbl{caption}{%                                          
\begin{tabular}
...
\end{tabular}}
\end{table}

See section 4.2 of the documentation for acmsmall for example.

Change the table to:

\begin{table}
\tbl{A summary of the data sets shown throughout this paper.}{
\begin{tabular}{c|c|c|c}
Data set & Image size & Hole size (pix) & Total time\\
\hline
Mailbox & 459 $\times$ 489 & 30171 & 1m5s \\
Electric boxes & 688 $\times$ 478 & 45434 & 2m19s\\
Trashcan & 572 $\times$ 517 & 42734 & 1m59s\\
Air conditioners & 400 $\times$ 496 & 13709 & 23s
\end{tabular}}
\label{tab:Timing}
\end{table}
David Carlisle
  • 757,742
Ian Thompson
  • 43,767
  • Thanks Ian! I added the correct syntax for my table to your answer - once it is peer reviewed it should appear. – David Doria Apr 24 '12 at 16:12