[Tex/LaTex] Caption Justification

captionshorizontal alignment

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,

\captionsetup[figure]{justification=justified, singlelinecheck=off} 

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 the threeparttable package.
  • floatrow defines a \ffigbox[\FBwidth]{\caption{...}\label{...}}{figure commands} to be inserted in a figure environment. If necessary, you can have a caption width different from the figure width, changing the optional argument to, say, [0.25\textwidth].
Related Question