Align caption text separately from figure label
Hello, I spent a few hours googling and trying random things but am not able to get figure captions looking the way I want them. Basically, I'd like long captions to be left aligned as a framed chunk of text, similar to this post here: http://tex.stackexchange.com/questions/8739/multiline-figure-caption-centeri... Or if this formatting works... How it currently looks: Figure 1 This is a caption that extends to multiple lines. What I'm trying to get: Figure 1 This is also a caption that extends to multiple lines. I was able to produce what I wanted with an aligned \framed command, but the width of the caption and the width of the framed box had to be set for each figure, which is less than ideal. I'm hoping that there is a way to adjust the amount of indent for the text of the caption so that I can 'push' all the lines after the first one to line up with it? Thanks much, John
On 2012-05-11 John Dyreby
Or if this formatting works...
How it currently looks: Figure 1 This is a caption that extends to multiple lines.
What I'm trying to get: Figure 1 This is also a caption that extends to multiple lines.
This is a hack, but seems to work: \setupcaptions [headstyle={\hskip-5em\bold}] \starttext \startplacefigure [title={\input knuth\par}] \externalfigure [dummy] \stopplacefigure \stoptext Marco
Marco - thanks for your help! I found an alternative way to do it that centers the whole caption, including the figure label: \starttext % Centers the caption text, label is offset (suggested by Marco): \setupcaptions [headstyle={\hskip-5em\bold},width=4in] \startplacefigure [title={This is a very, very, very, very, very, very, very, very, very, very, very long caption.}] \externalfigure [dummy] \stopplacefigure % Centers the entire caption, including the label: \setupcaptions [headstyle=bold,style={\hangindent=6em},distance=2em,width=4in] \startplacefigure [title={This is a very, very, very, very, very, very, very, very, very, very, very long caption.}] \externalfigure [dummy] \stopplacefigure \stoptext For both methods the spacing is hardcoded; for my application I ended up creating a short macro that checked the length of the figure label and adjusted things accordingly so that the the spacing for Figure 10+ worked the same as for Figures 1-9. John On May 13, 2012, at 6:09 AM, Marco wrote:
On 2012-05-11 John Dyreby <jjdyreby at wisc.edu> wrote:
Or if this formatting works...
How it currently looks: Figure 1 This is a caption that extends to multiple lines.
What I'm trying to get: Figure 1 This is also a caption that extends to multiple lines.
This is a hack, but seems to work:
\setupcaptions [headstyle={\hskip-5em\bold}] \starttext \startplacefigure [title={\input knuth\par}] \externalfigure [dummy] \stopplacefigure \stoptext
Marco
participants (2)
-
John Dyreby
-
Marco