I know that is has been asked several times. But I think my problem is a bit different. I want to make my figure captions left aligned and justified. I don't want all of them to be like this because I have subfigures for them I want centered caption.
\captionsetup{justification=raggedright}
is working but the text is not justified and \captionsetup{justification=justified}
gives me a centered caption! I am using TeXstudio.
Best Answer
If I understand well what you want,
should do it.
However, note the caption will begin at the text left margin, not at the left side of the figure, which will be ugly for small figures.
Two packages allow to have a caption width equal to the figure width:
measuredfigure
, an environment defined by thethreeparttable
package.floatrow
defines a\ffigbox[\FBwidth]{\caption{...}\label{...}}{figure commands}
to be inserted in afigure
environment. If necessary, you can have a caption width different from the figure width, changing the optional argument to, say,[0.25\textwidth]
.