6

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.

  • 1
    Welcome to TeX.SX! Please post a minimal, but working example (MWE). – TeXnician Jun 8 '17 at 8:13
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – CarLaTeX Jun 8 '17 at 8:21
  • 1
    Exactly the same thing happened. Did you solve it in the end? – Doris Sep 6 '18 at 21:46
3

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].
| improve this answer | |
  • 1
    Thank you so much. However, \captionsetup[figure]{justification=justified, singlelinecheck=off} makes the caption centered for my document! I don't know why! This is getting very frustrating! I am using revtex4-1. Any comment on this? – user87115 Jun 9 '17 at 11:10
  • Could you post a minimal example? – Bernard Jun 9 '17 at 11:15
  • I wanted to attach some photos but I didn't know how. Here is an example. This gives the caption centered. \begin{figure}[htbp] \begin{center} \captionsetup[figure]{justification=justified, singlelinecheck=off} \setlength{\belowcaptionskip}{-22pt} \includegraphics[width=3 in]{SchematicHB.jpg} \caption{Exerted force of the nonzero ... } \label{Fig:SchematicHB} \end{center} \end{figure} – user87115 Jun 9 '17 at 11:27
  • You should edit our question, and post a full compilable short code, rather than a snipet in a comment. – Bernard Jun 9 '17 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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