12

This question already has an answer here:

\documentclass[letterpaper,12pt]{article}

\begin{document}

\begin{table}
\caption{Test test test test test}
\begin{tabular}{c c c c}
\hline\noalign{\smallskip}
$V_{a}$ & $B$ & $r$ & $e/m$\\
(V) & (T) & (m) & (C/kg)\\
\hline\noalign{\smallskip}
1 $\pm$ 1 & 2.04 $\pm$ 0.04 & 2.36 $\pm$ 0.1 & 1 $\pm$ 1\\
\hline\noalign{\smallskip}
\end{tabular}
\end{table}

\end{document}

I'd like to keep the formating of the table above how it is. It is the caption that I'd like to change. I don't like how it seems to be hanging off the right side of the table. I think the caption should be aligned with the left side of the table. How would I do this?

marked as duplicate by Mico, texenthusiast, cmhughes, Guido, Werner Nov 19 '13 at 7:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 5
    Welcome to TeX.SX!. Add to your preamble \usepackage{caption} \captionsetup[table]{singlelinecheck=false}. – karlkoeller Oct 6 '13 at 17:32
  • Otherwise, you can center the table adding \centering just after \begin{table} (probably this way it looks better inside a document). – karlkoeller Oct 6 '13 at 17:40
10

Use the caption package und use the singlelinecheck=false option.

\documentclass{article}

\usepackage[
singlelinecheck=false % <-- important
]{caption}

\begin{document}

\begin{table}
\caption{Test test test test test}
\begin{tabular}{c c c c}
\hline\noalign{\smallskip}
$V_{a}$ & $B$ & $r$ & $e/m$\\
(V) & (T) & (m) & (C/kg)\\
\hline\noalign{\smallskip}
1 $\pm$ 1 & 2.04 $\pm$ 0.04 & 2.36 $\pm$ 0.1 & 1 $\pm$ 1\\
\hline\noalign{\smallskip}
\end{tabular}
\end{table}

\end{document}

Explanation from the package documentation:

The standard LATEX document classes (article, report, and book) automatically center a caption if it fits in one single line:

enter image description here

  • Wasn't this already in my comment? – karlkoeller Oct 6 '13 at 18:21
  • @karlkoeller: Oh yes sorry - didn't see it. But it's a bit more than in the comment though. – Dr. Manuel Kuehner Oct 6 '13 at 18:53
  • 1
    I'm the first to give you more 10k :-) My best wishes. Hi. – Sebastiano Aug 31 at 12:27
  • 1
    @Sebastiano much appreciated! – Dr. Manuel Kuehner Aug 31 at 12:49

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