TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to add a line break in a centered table caption with beamer. I can't seem to figure it out. Here is sample code:

\usepackage{amsmath,amsthm, amssymb, latexsym}


      \begin{tabular}{|c c|}\hline
      a & b  \\
      1 & 2 \\
      \caption{I would like to put a break \newline here in the caption.}


This does not work (unless the caption stretches the whole page, in which case it becomes left aligned, which is not what I want). \\ produces an error.

If I tried to load the caption package I receive this error

! LaTeX Error: \@makecaption undefined.

This occurs even if I remove the beamer caption templates.

share|improve this question
The beamer document class is supported by the caption package since v3.1 (2007/09/01). So it seems that your TeX distribution is quite old. – Axel Sommerfeldt Feb 11 '12 at 12:49
I'm using the Tex distribution currently on Fedora: pdfTeXk, Version 3.141592-1.40.3 – Glen Feb 11 '12 at 14:59
This is TeXlive 2007 which is now over 4 years old. See also: tex.stackexchange.com/questions/24762/… – Axel Sommerfeldt Feb 11 '12 at 16:04
up vote 5 down vote accepted

I would use a [t]op-aligned \parbox of fixed width. For example, using

\caption{\parbox[t]{4cm}{I would like to put a break here in the caption.}}

in your MWE produces

enter image description here

The same holds if you use a [t]op-aligned tabular:

  I would like to put a break here \\ in the caption.

In the \parbox you specify the width, while in the tabular you specify the line break.

Finally, there is the varwidth package that will shrink to the natural width of a box if its contents is narrower than the width specified:

\usepackage{varwidth}% http://ctan.org/pkg/varwidth
  I would like to put a break here \\ in the caption.

Although I've specified 10cm, the natural width (which now allows for line breaking using \\ since the contents is boxed) is narrower.

share|improve this answer
Awesome, thanks! – Glen Feb 11 '12 at 4:38

Your Answer


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.