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.

I am trying to introduce a linebreak after the caption label so that the caption starts below the caption label in context. However, the suffix key for the \captionsetup only accepts text like : or --. I would like something like this:

Caption label above the caption.

MWE:

\setupbodyfont[modern,11pt]
\setuplayout
  [width=11cm,
   rightmargin=6cm]

\setupcaption
  [figure]
  [width=\rightmarginwidth,
   headstyle=smallcaps,
   suffix={:},
   prefix=yes,
   way=bysection,
   prefixsegments=chapter,
   align=right,
   location={rightmargin,high}]

\starttext
\showframe
\chapter{One}
\placefigure{A cow is a cow is a cow.}{\externalfigure[cow]}
\stoptext
share|improve this question
1  
You can set \setupcaption[figure][distance=\textwidth]. –  Marco Jan 13 '13 at 10:28
1  
@Marco Thanks. I see the option on the contextgarden page for captionsetup but didn't see any description. Neither does contextref.pdf that comes with texlive2012 has any info. Where did you find this? Also, if you could write this as an answer with the explanation about how this works, that would be great. –  devendra Jan 13 '13 at 12:10
2  
Using distance=\textwidth is an ugly hack. The right way to do this is to use spaceinbetween=none, or, if you want a different space spaceinbetween=small|medium|big|<dimen>, etc. –  Aditya Jan 13 '13 at 19:11

1 Answer 1

up vote 2 down vote accepted
\setupcaption
  [figure]
  [distance=\textwidth]

The distance key specifies the space between the suffix and the actual caption text. I actually looked into the source to find out the possible options. The manual and wiki are both helpful and mostly provide detailed explanations, but are often incomplete. The sources are – by definition – complete and up-to-date.

In strc-flt.mkvi you find that the default value for distance is 1em:

\setupcaptions
  […
   \c!distance=1em,
   …]

Further down this value is assigned to \scratchskip. Now you know that distance is a glue value with the default size of 1em and no stretch or shrink which is being inserted between the suffix and the caption text. If this value is increased beyond the size of the surrounding box (the actual value does not matter) ConTeXt places the content on the next line.

share|improve this answer

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.