ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Align caption text separately from figure label
@ 2012-05-11 17:27 John Dyreby
  2012-05-13 11:09 ` Marco
  0 siblings, 1 reply; 3+ messages in thread
From: John Dyreby @ 2012-05-11 17:27 UTC (permalink / raw)
  To: ntg-context

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-centering

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Align caption text separately from figure label
  2012-05-11 17:27 Align caption text separately from figure label John Dyreby
@ 2012-05-13 11:09 ` Marco
  2012-05-24 11:44   ` John Dyreby
  0 siblings, 1 reply; 3+ messages in thread
From: Marco @ 2012-05-13 11:09 UTC (permalink / raw)
  To: ntg-context

On 2012-05-11 John Dyreby <jjdyreby@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


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Align caption text separately from figure label
  2012-05-13 11:09 ` Marco
@ 2012-05-24 11:44   ` John Dyreby
  0 siblings, 0 replies; 3+ messages in thread
From: John Dyreby @ 2012-05-24 11:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
> 
> 
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-24 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 17:27 Align caption text separately from figure label John Dyreby
2012-05-13 11:09 ` Marco
2012-05-24 11:44   ` John Dyreby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).