ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Piotr Kopszak <kopszak@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Framedtext in a float
Date: Tue, 1 Nov 2016 11:17:58 +0100	[thread overview]
Message-ID: <CADawwoBNgOrdWqbF-2G8WhmfOUCMge+K4DEHeoa0Tn-6TNVDgg@mail.gmail.com> (raw)
In-Reply-To: <CACyK-eokfrm3wL-LMEKy8E3xrFoHKYTSs_iw=hbS1q7Lc3J4+g@mail.gmail.com>

You mean, you effectively want ConTeXt to choose best proportions for
the framed text on its own? I guess very few designers would agree for
that, if any.

2016-11-01 10:47 GMT+01:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>:
> Hello,
> The option align = tolerant rule one of the problems I may encounter. But I
> wonder if it's possible that I should not choose myself width = 6cm to fit
> the text. If I have to use the command several times with different content,
> how make ?
> Thank you
> Fabrice
>
> 2016-11-01 9:23 GMT+01:00 Piotr Kopszak <kopszak@gmail.com>:
>>
>> Just use
>> ...
>> \startMyFrame[Title=Info]
>> \setupalign[hyphenated,morehyphenation,verytolerant]
>> ...
>>
>> Piotr
>>
>> 2016-11-01 0:12 GMT+01:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>:
>> > Hello,
>> > How to make the width of framedtext automatically adapts to its
>> > contents.
>> > Fabrice
>> >
>> > \definefloat
>> >    [recipe]
>> >    [figure]
>> >
>> > \setupfloat
>> >    [recipe]
>> >    [default={right,none}]
>> >
>> > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784]
>> > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00]
>> >
>> >
>> > \defineframedtext
>> >   [MyFrame]
>> >   [before={\blank},
>> >    after={\blank},
>> >    frame=off,
>> >    background=MyFrame,
>> >    width=6cm,
>> >    height=fit]
>> >
>> > \startuseMPgraphic{MyFrame}
>> >  path b;
>> >  picture p;
>> >  p := textext.rt("\tfx\white\framedtextparameter{Title}");
>> >  p := p shifted (2BodyFontSize,OverlayHeight-ypart center
>> > p+.25ExHeight);
>> >  b := boundingbox p enlarged .3EmWidth ;
>> >  fill OverlayBox withcolor \MPcolor{MyColorA};
>> >  fill b withcolor \MPcolor{MyColorB} ;
>> >  draw p ;
>> >  setbounds currentpicture to boundingbox currentpicture enlarged 2mm ;
>> > \stopuseMPgraphic
>> >
>> > \defineoverlay
>> >   [MyFrame]
>> >   [\useMPgraphic{MyFrame}]
>> >
>> >   \starttext
>> >
>> >   \placerecipe{}{
>> >   \startMyFrame[Title=Info]
>> >   L'histogramme est constitué de rectangles dont les bases correspondent
>> > aux
>> > classes et dont les aires sont proportionnelles aux effectifs ou
>> > fréquences
>> > des classes.
>> >   \stopMyFrame}
>> >
>> >   \input Knuth
>> >
>> >   \stoptext
>> >
>> >
>> > ___________________________________________________________________________________
>> > 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://context.aanhet.net
>> > archive  : https://bitbucket.org/phg/context-mirror/commits/
>> > wiki     : http://contextgarden.net
>> >
>> > ___________________________________________________________________________________
>>
>>
>>
>> --
>> http://okle.pl
>>
>> ___________________________________________________________________________________
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>>
>> ___________________________________________________________________________________
>
>
>
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________



-- 
http://okle.pl
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2016-11-01 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 23:12 Fabrice Couvreur
2016-11-01  7:51 ` Marco Patzer
2016-11-01  8:23 ` Piotr Kopszak
2016-11-01  9:47   ` Fabrice Couvreur
2016-11-01 10:17     ` Piotr Kopszak [this message]
2016-11-01 11:09       ` Fabrice Couvreur
2016-11-05 14:55         ` Wolfgang Schuster
2016-11-05 14:48       ` Alan Braslau

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=CADawwoBNgOrdWqbF-2G8WhmfOUCMge+K4DEHeoa0Tn-6TNVDgg@mail.gmail.com \
    --to=kopszak@gmail.com \
    --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).