Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!!

share|improve this question
add comment

1 Answer

\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}

enter image description here enter image description here

share|improve this answer
    
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
show 6 more comments

Your Answer

 
discard

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.