ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Maximum width of a caption
Date: Mon, 05 Jan 2015 11:51:10 +0100	[thread overview]
Message-ID: <54AA6C9E.2060805@wxs.nl> (raw)
In-Reply-To: <CALBOmsYmxYyZaauyL_Q-zWty0pHcmK9ag8ykmSQRTH_Ymg0CZg@mail.gmail.com>

On 1/5/2015 11:22 AM, Mojca Miklavec wrote:
> On Sun, Jan 4, 2015 at 12:30 PM, Hans Hagen wrote:
>> On 1/3/2015 11:11 AM, Mojca Miklavec wrote:
>>>
>>> Hi,
>>>
>>> Is there any way to set the maximum width of a caption? I would like
>>> to make sure that no figure caption exceeds, say, 75% of text width.
>>>
>>> Here's an example of "bad behaviour" in the second figure:
>>>
>>> \starttext
>>>
>>> \reservefigure
>>> [width=5cm,height=2cm,frame=on][force]
>>> {Some very small figure with not too much text: OK}
>>>
>>> \input tufte
>>>
>>> This can hardly be distinguished from the main text:
>>>
>>> \reservefigure
>>> [width=\textwidth,height=.2\textwidth,frame=on][force]
>>> {\input tufte}
>>>
>>> \input tufte
>>>
>>> Desired behaviour:
>>>
>>> \placefigure[force]{\input tufte}
>>> {\hbox to
>>> .75\textwidth{\hss\framed[width=\textwidth,height=.2\textwidth]{}\hss}}
>>>
>>> \input tufte
>>>
>>> \stoptext
>>>
>>> I've seen an option maxwidth, but only in connection to
>>> \externalfigure[...][maxwidth=...].
>>>
>>> I can cheat as on the third figure above, but that seems like an ugly
>>> approach to me.
>>
>>
>> can you test this a bit:
>>
>> \unprotect
>>
>> \setupcaptions
>>    [\c!maxwidth=.75\hsize]
>
> Thank you very much. The patch that you sent me for strc-flt.mkvi
> seems to work as expected on a long document with many figures.
>
> The only exception are one-liners. The following creates a caption
> that extends to almost the whole text width:
>
>      \placefigure
>        % Why are there two spaces between "dummy" and "text"?
>        {Some \dorecurse{7}{dummy } text}
>        {\externalfigure[dummy][width=\textwidth,height=.2\textwidth]}
>
> As soon as slightly more text is added, it shrinks to the desired text width.

oneliners have a separate branch


> (But then again I'm not sure if that is a bug or a feature ;)
>
> Mojca
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

      reply	other threads:[~2015-01-05 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-03 10:11 Mojca Miklavec
2015-01-04 11:30 ` Hans Hagen
2015-01-05 10:22   ` Mojca Miklavec
2015-01-05 10:51     ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54AA6C9E.2060805@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).