webjunkie - 2 months ago 38
LaTeX Question

# Make LaTeX table caption same width as table?

It looks bad in my paper if a caption is wider than the table underneath it. How can I make them both align?

Right now my code looks like:

\begin{table}[th!]
\caption{Reference temperature blah blah}
\centering
\begin{tabular}{llll}
...
\end{tabular}
\end{table}


Answer

Put your table plus caption inside a minipage. The caption will wrap. This is also a great way to have proper footnotes for tables.