ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to make Figure captions justify if long?
@ 2012-02-08 23:50 Wagner Macedo
  2012-02-09  0:43 ` Marco
  2012-02-09 12:06 ` Peter Münster
  0 siblings, 2 replies; 8+ messages in thread
From: Wagner Macedo @ 2012-02-08 23:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 346 bytes --]

Hello,

The title is not self explaining, I'll try to do this.

My layout style require that table or figure captions stay centered only if
short. If long, it needs that the caption be justified (like normal text,
but less width).

In LaTeX, I know that this works on article document class, like the pdf
file I attached shows.

--
Wagner Macedo

[-- Attachment #1.2: Type: text/html, Size: 396 bytes --]

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 16057 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-08 23:50 How to make Figure captions justify if long? Wagner Macedo
@ 2012-02-09  0:43 ` Marco
  2012-02-09  1:13   ` Wagner Macedo
  2012-02-09 12:06 ` Peter Münster
  1 sibling, 1 reply; 8+ messages in thread
From: Marco @ 2012-02-09  0:43 UTC (permalink / raw)
  To: ntg-context

On 2012-02-08 Wagner Macedo <wagnerluis1982@gmail.com> wrote:

> My  layout  style  require  that table  or  figure  captions  stay
> centered only  if short.  If long,  it needs  that the  caption be
> justified (like normal text, but less width).

I don't know if  I get you right, but I think  you are talking about
the width  of the  caption. It  adaptes to the  with of  the figure.
There is the “minwidth” parameter  for \setupcaptions, but since the
short captions  will not be centred  it's probably not what  you aim
for.  I don't  have a  solution, but  a workaround  that alters  the
global width setting for an individual caption:

\useMPlibrary [dum]
\starttext

\startplacefigure [title=Foo Bar]
	\externalfigure [placeholder]
\stopplacefigure

\setupcaptions [width=.8\textwidth]
\startplacefigure [title={\input tufte\par}]
	\externalfigure [placeholder]
\stopplacefigure
\setupcaptions [width=fit]

\startplacefigure [title=Foo Bar]
	\externalfigure [placeholder]
\stopplacefigure

\input knuth

\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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-09  0:43 ` Marco
@ 2012-02-09  1:13   ` Wagner Macedo
  2012-02-09  7:34     ` Steffen Wolfrum
  0 siblings, 1 reply; 8+ messages in thread
From: Wagner Macedo @ 2012-02-09  1:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 825 bytes --]

Thanks by the answer, but I had already thought in this. I would like
something more definitive.

By the way, at http://wiki.contextgarden.net/Reference/en/setupcaptions I
can see a command argument. I was wondering if a custom command can do the
trick, but I don't know how I should use this arg and what it is for.

--
Wagner Macedo


On 8 February 2012 21:43, Marco <netuse@lavabit.com> wrote:

> I don't know if  I get you right, but I think  you are talking about
> the width  of the  caption. It  adaptes to the  with of  the figure.
> There is the “minwidth” parameter  for \setupcaptions, but since the
> short captions  will not be centred  it's probably not what  you aim
> for.  I don't  have a  solution, but  a workaround  that alters  the
> global width setting for an individual caption:
>

[-- Attachment #1.2: Type: text/html, Size: 1194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-09  1:13   ` Wagner Macedo
@ 2012-02-09  7:34     ` Steffen Wolfrum
  2012-02-09 11:55       ` Wagner Macedo
  0 siblings, 1 reply; 8+ messages in thread
From: Steffen Wolfrum @ 2012-02-09  7:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 09.02.2012 um 02:13 schrieb Wagner Macedo:

> Thanks by the answer, but I had already thought in this. I would like something more definitive.


How about this:

\starttext

\placefigure[here]{This is just an example for this is just an example for this is just an example for this is just an example for this is just an example for this is just an example for this}{\externalfigure[any][width=0.5\textwidth]}

\stoptext

-------
Steffen
___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-09  7:34     ` Steffen Wolfrum
@ 2012-02-09 11:55       ` Wagner Macedo
  0 siblings, 0 replies; 8+ messages in thread
From: Wagner Macedo @ 2012-02-09 11:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 634 bytes --]

In your example, the caption is limited to image width.

What I want is something as

    \setupcaption[figure][width=\textwidth, align=middle]

does. But long texts should behave as document text (hyphenated, including).

Thanks by attention.

--
Wagner Macedo


On 9 February 2012 04:34, Steffen Wolfrum <context@st.estfiles.de> wrote:

> How about this:
>
> \starttext
>
> \placefigure[here]{This is just an example for this is just an example for
> this is just an example for this is just an example for this is just an
> example for this is just an example for
> this}{\externalfigure[any][width=0.5\textwidth]}
>
> \stoptext
>

[-- Attachment #1.2: Type: text/html, Size: 963 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-08 23:50 How to make Figure captions justify if long? Wagner Macedo
  2012-02-09  0:43 ` Marco
@ 2012-02-09 12:06 ` Peter Münster
  2012-02-09 12:40   ` Wagner Macedo
  2012-02-09 14:18   ` Marco
  1 sibling, 2 replies; 8+ messages in thread
From: Peter Münster @ 2012-02-09 12:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Feb 09 2012, Wagner Macedo wrote:

> My layout style require that table or figure captions stay centered only if
> short. If long, it needs that the caption be justified (like normal text, but
> less width).

--8<---------------cut here---------------start------------->8---
\defineframed[FullWidth][offset=overlay, width=\textwidth,
  frame=off, align=middle]
\starttext
\placefigure[here]{\input tufte\relax}
            {\FullWidth{\externalfigure[any][width=3cm]}}
\placefigure[here]{Short}
            {\FullWidth{\externalfigure[any][width=3cm]}}
\stoptext
--8<---------------cut here---------------end--------------->8---

Is this a solution?

-- 
           Peter
___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-09 12:06 ` Peter Münster
@ 2012-02-09 12:40   ` Wagner Macedo
  2012-02-09 14:18   ` Marco
  1 sibling, 0 replies; 8+ messages in thread
From: Wagner Macedo @ 2012-02-09 12:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 416 bytes --]

Yes, thank you.

And to not need to enclose \externalfigure with \FullWidth, I found that I
can set the command attribute on \setupfloat[figure] as following:

    \defineframed[FullWidth][offset=overlay, width=\textwidth, frame=off,
align=middle]
    \setupfloat[figure][command=\FullWidth]

--
Wagner Macedo


On 9 February 2012 09:06, Peter Münster <pmlists@free.fr> wrote:

> Is this a solution?

[-- Attachment #1.2: Type: text/html, Size: 675 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 8+ messages in thread

* Re: How to make Figure captions justify if long?
  2012-02-09 12:06 ` Peter Münster
  2012-02-09 12:40   ` Wagner Macedo
@ 2012-02-09 14:18   ` Marco
  1 sibling, 0 replies; 8+ messages in thread
From: Marco @ 2012-02-09 14:18 UTC (permalink / raw)
  To: ntg-context

On 2012-02-09 Peter Münster <pmlists@free.fr> wrote:

> \defineframed[FullWidth][offset=overlay, width=\textwidth,
>   frame=off, align=middle]
> \starttext
> \placefigure[here]{\input tufte\relax}
>             {\FullWidth{\externalfigure[any][width=3cm]}}
> \placefigure[here]{Short}
>             {\FullWidth{\externalfigure[any][width=3cm]}}
> \stoptext
> 
> Is this a solution?

This looks  like the solution,  yes. However you scatter  the source
with \FullWidth commands.  Wagners solution seems to  be more clean.
So we end up with the following:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sorry Aditya, for not using your kitties ;)
\useMPlibrary [dum]

\defineframed [FigureFramed]
	[
		 width=.8\textwidth,
		offset=overlay,
		 frame=off,
	]

% Doesn't work :( Why not?
%\setupfloat [figure] [width=.8\textwidth]

\setupfloat [figure] [command=\FigureFramed]

\starttext

\startplacefigure [title=Foo Bar]
	\externalfigure [placeholder]
\stopplacefigure

\startplacefigure [title={\input tufte\par}]
	\externalfigure [placeholder]
\stopplacefigure

\input knuth

\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

But the question is, why does setting the float width in \setupfloat
fail?  What  else is  it  supposed  to do?  It  doesn't  seem to  do
anything.

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] 8+ messages in thread

end of thread, other threads:[~2012-02-09 14:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08 23:50 How to make Figure captions justify if long? Wagner Macedo
2012-02-09  0:43 ` Marco
2012-02-09  1:13   ` Wagner Macedo
2012-02-09  7:34     ` Steffen Wolfrum
2012-02-09 11:55       ` Wagner Macedo
2012-02-09 12:06 ` Peter Münster
2012-02-09 12:40   ` Wagner Macedo
2012-02-09 14:18   ` Marco

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