# How to align table or figure caption where the table starts?

HI

How can I start the caption where table starts or figure starts?

\captionsetup{justification=justified, singlelinecheck=false}


does not work for me because it places the caption at the beginning of the paragraph not the beginning of the table.

Thanks!!

-

\documentclass[a4paper]{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow,blindtext}

\begin{document}
\blindtext

\begin{figure}[!htb]
\ffigbox[\FBwidth]
{\caption{\blindtext}\label{foo}}
{\includegraphics{bar}}
\end{figure}

\blindtext

\begin{table}[!htb]
\ttabbox{\caption{A not so long caption.}\label{bar}}
{\begin{tabular}{ccc} \hline
foo & bar & baz \\\hline
\end{tabular}}
\end{table}

\end{document}


-
Any ideas about tables? – Aharoun Baalan Feb 2 '11 at 9:03
@Aharoun: maybe that you are able to replace figure with table and ffigbox with ttabbox ... ;-) – Herbert Feb 2 '11 at 9:38
@Herbert: The definition of \ttabbox is \floatbox[\captop]{table}[\FBwidth], so you don't need to specify [\FBwidth] explicitly. (Contray to that, \ffigbox equates to \floatbox{figure}.) – lockstep Feb 2 '11 at 10:02
@lockstep: true, I shouldn't use copy and paste ... ;-) thanks – Herbert Feb 2 '11 at 10:13
Thanks again, When I compile your code only, it works fine but when I use \usepackage{floatrow} in my document (my work), it gives me this error: ! Package floatrow Error: Do not use float package with floatrow.(floatrow) The latter will be skipped. – Aharoun Baalan Feb 7 '11 at 11:47