4

What I try to do: I want to place figures left so that text wraps around them if they have less width than \textwidth. The figure captions should be aligned left (flushleft).

What happens: The captions are all centered.

Details:

  • If I use default={here,nonumber} instead of default={left,nonumber} in\setupfloat[figure][default=..., the captions are aligned left, just like they should.

  • It does not matter if the text warps around the captioned image, the centered is present for all figure-captions, regardless of their width.

Code:

\setupfloat[figure][default={left,nonumber}]

\setupcaption[figure][align=flushleft] %prefix: section-wise number prefix

\starttext

%here is some text...
Lorem Ipsum....

\placefigure{my figure caption}{\externalfigure[images/image1.jpg]}


%here is some text
Lorem Ipsum....
\placefigure{my figure caption}{\externalfigure[images/image1.jpg]}

Is there any way to left-place figures and have the captions flushleft aligned? (Ideally while keeping the content after starttext the same)

addition: I tried with an comes-with-Ubuntu-14.04 and a LiveTex2015 Version of ConTeXt, no difference in behavior.

3

When the width of the caption is less than that of the float, by default, ConTeXt centers the caption box. So, visually, the captions don't appear to be left aligned.

The simplest workaround is to tell ConTeXt to always choose the width of the caption box to be equal to that of the float. This can be done by adding the option width=max to \setupcaption. So:

\setupfloat[figure][default={left,nonumber}]

\setupcaption[figure][align=flushleft, width=max]

\starttext

\placefigure{my figure caption a really long caption}{\externalfigure[images/image1.jpg]}
\input knuth

\placefigure{my figure caption}{\externalfigure[images/image1.jpg]}
\input tufte
\stoptext

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.