Re: [NTG-context] Text around a figure in a framedtext

2015-08-14 Thread Fabrice Couvreur
Hi Rik,
I actually read that Wolfgang had written, but there is some confusion for
me. Indeed, my environment uses a frame and Wolfgang said to be used \
starthanging ... \stophanging rather than \placefigure. But my text contains
a blank line which is to create a new paragraph and so I should use \
placefigure !!!

2015-08-14 3:38 GMT+02:00 Rik Kabel :

> On 2015-08-13 11:19, Fabrice Couvreur wrote:
>
> Hi,
> Sorry to revive this discussion (which I initiated), but the text in the
> following code does not wrapped around the figure.
> Why ?
> Fabrice
>
>
> \setupcolors
>   [state=start]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> \definecolor[MyColorA][.75(MyColorB,white)]
>
> \defineframedtext
>   [MyText]
>   [frame=off,
>background=MyFrame,
>width=\textwidth,
>height=fit,
>location=left,
>style=italic]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ;
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
> \stopuseMPgraphic
>
> \starttext
>
> \startMyText
>
> \starthanging[location=right]
> {\startMPcode
>   path p ;
>   p := fullcircle xscaled 4cm yscaled 2cm ;
>   fill p withcolor  cmyk(0,0.62,1,0) ;
>   path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center
> p) ;
>   fill q withcolor blue ;
>   picture r ;
>   r := textext("\white E")shifted (-0.75cm,ypart center p) ;
>   picture s ;
>   s := textext("\white A")shifted (1cm, ypart center p) ;
>   draw r ;
>   draw s ;
>   draw p ;
>   draw q ;
>  \stopMPcode}
> Soit A une partie d'un ensemble E.
>
> Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
> la {\bi proportion} des éléments de A dans E est le quotient
> $p=\frac{n_A}{n_E}$.
> \stophanging
>
> \stopMyText
>
>
> Wolfgang wrote on the list a few days ago (
> 
> http://www.mail-archive.com/ntg-context%40ntg.nl/msg79347.html):
>
> The \starthangaround environment reserves space for the image etc. only for
> the first paragraph
>
> while \placefigure includes more paragraphs if necessary.
>
> --
> Rik
>
>
> ___
> 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
>
> ___
>
___
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
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-13 Thread Rik Kabel

On 2015-08-13 11:19, Fabrice Couvreur wrote:

Hi,
Sorry to revive this discussion (which I initiated), but the text in 
the following code does not wrapped around the figure.

Why ?
Fabrice


\setupcolors
  [state=start]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center 
p+.25ExHeight) ;

b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext

\startMyText

\starthanging[location=right]
{\startMPcode
  path p ;
  p := fullcircle xscaled 4cm yscaled 2cm ;
  fill p withcolor  cmyk(0,0.62,1,0) ;
  path q ; q := fullcircle scaled 1cm shifted (1cm, ypart 
center p) ;

  fill q withcolor blue ;
  picture r ;
  r := textext("\white E")shifted (-0.75cm,ypart center p) ;
  picture s ;
  s := textext("\white A")shifted (1cm, ypart center p) ;
  draw r ;
  draw s ;
  draw p ;
  draw q ;
 \stopMPcode}
Soit A une partie d'un ensemble E.

Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et 
de A, la {\bi proportion} des éléments de A dans E est le quotient 
$p=\frac{n_A}{n_E}$.

\stophanging

\stopMyText


Wolfgang wrote on the list a few days ago 
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg79347.html):


   The \starthangaround environment reserves space for the image etc.
   onlyfor the first paragraph

   while \placefigure includes more paragraphs if necessary.

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

Re: [NTG-context] Text around a figure in a framedtext

2015-08-13 Thread Fabrice Couvreur
Hi,
Well, I think I have solved the problem : it is because of the blank line.
Why ?
Fabrice

2015-08-13 17:19 GMT+02:00 Fabrice Couvreur :

> Hi,
> Sorry to revive this discussion (which I initiated), but the text in the
> following code does not wrapped around the figure.
> Why ?
> Fabrice
>
>
> \setupcolors
>   [state=start]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> \definecolor[MyColorA][.75(MyColorB,white)]
>
> \defineframedtext
>   [MyText]
>   [frame=off,
>background=MyFrame,
>width=\textwidth,
>height=fit,
>location=left,
>style=italic]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ;
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
> \stopuseMPgraphic
>
> \starttext
>
> \startMyText
>
> \starthanging[location=right]
> {\startMPcode
>   path p ;
>   p := fullcircle xscaled 4cm yscaled 2cm ;
>   fill p withcolor  cmyk(0,0.62,1,0) ;
>   path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center
> p) ;
>   fill q withcolor blue ;
>   picture r ;
>   r := textext("\white E")shifted (-0.75cm,ypart center p) ;
>   picture s ;
>   s := textext("\white A")shifted (1cm, ypart center p) ;
>   draw r ;
>   draw s ;
>   draw p ;
>   draw q ;
>  \stopMPcode}
> Soit A une partie d'un ensemble E.
>
> Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
> la {\bi proportion} des éléments de A dans E est le quotient
> $p=\frac{n_A}{n_E}$.
> \stophanging
>
> \stopMyText
>
>
> 2015-08-10 1:11 GMT+02:00 Jeong Dal :
>
>> Dear Otared and Wolfgang,
>>
>> It works fine after replacing the text itself.
>> Thank you for the info.
>>
>> Best regards,
>>
>> Dalyoung
>>
>>
>> ___
>> 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
>>
>> ___
>>
>
>
___
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
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-13 Thread Fabrice Couvreur
Hi,
Sorry to revive this discussion (which I initiated), but the text in the
following code does not wrapped around the figure.
Why ?
Fabrice


\setupcolors
  [state=start]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext

\startMyText

\starthanging[location=right]
{\startMPcode
  path p ;
  p := fullcircle xscaled 4cm yscaled 2cm ;
  fill p withcolor  cmyk(0,0.62,1,0) ;
  path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center p)
;
  fill q withcolor blue ;
  picture r ;
  r := textext("\white E")shifted (-0.75cm,ypart center p) ;
  picture s ;
  s := textext("\white A")shifted (1cm, ypart center p) ;
  draw r ;
  draw s ;
  draw p ;
  draw q ;
 \stopMPcode}
Soit A une partie d'un ensemble E.

Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
la {\bi proportion} des éléments de A dans E est le quotient
$p=\frac{n_A}{n_E}$.
\stophanging

\stopMyText


2015-08-10 1:11 GMT+02:00 Jeong Dal :

> Dear Otared and Wolfgang,
>
> It works fine after replacing the text itself.
> Thank you for the info.
>
> Best regards,
>
> Dalyoung
>
>
> ___
> 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
>
> ___
>
___
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
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-09 Thread Jeong Dal
Dear Otared and Wolfgang,

It works fine after replacing the text itself.
Thank you for the info.

Best regards,

Dalyoung

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

Re: [NTG-context] Text around a figure in a framedtext

2015-08-09 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for all these explanations that make me progress in the use of
Context.
Fabrice

2015-08-08 10:40 GMT+02:00 Wolfgang Schuster :

> Fabrice Couvreur 
> 8. August 2015 00:49
> Hi,
> Why the text does not move in the first framedtext like the second
> framedtext ?
>
> You have to use \starthanging instead of \placefgure when you’re in a
> frame.
>
> \starttext
>
> \startframedtext[width=max]
> \starthanging[location=right]
> {\startMPcode
>  draw unitsquare scaled 2cm ;
>  \stopMPcode}
> \input tufte
> \stophanging
> \stopframedtext
>
> \stoptext
>
> Wolfgang
>
>
> ___
> 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
>
> ___
>
___
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
___

Re: [NTG-context] Text around a figure in a framedtext (Wolfgang Schuster)

2015-08-08 Thread Wolfgang Schuster

Jeong Dal 
8. August 2015 15:49
Dear Wolfgang,


Thank you for letting me know the command “starthanging”.
I tried the command “\startfiguretext … \stopfiguretext”, and found 
that there is no text below the square.


\startframedtext[width=\textwidth]{
\startfiguretext[right,none]{}{%
\startMPcode
draw unitsquare scaled 2cm ;
\stopMPcode}
\input knuth
\stopfiguretext}
\stopframedtext

Your example worked fine, but if we replace tufte by knuth, then text 
is written over the square while the tufte’s text was witten surround 
the square.

Is it expected result?
The \starthangaround environment reserves space for the image etc. only 
for the first paragraph

while \placefigure includes more paragraphs if necessary.

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

Re: [NTG-context] Text around a figure in a framedtext (Wolfgang Schuster)

2015-08-08 Thread Otared Kavian
Hi Jeong,

You are right, but probably this is due to the way the source file knuth.tex is 
encoded: if you replace 
\input knuth
by the text itself, that is by the following

Thus, I came to the conclusion that the designer of a new system must not only 
be the implementer and first large--scale user; the designer should also write 
the first user manual.
The separation of any of these four components would have hurt TEX 
significantly. If I had not participated fully in all these activities, 
literally hundreds of improve- ments would never have been made, because I 
would never have thought of them or perceived why they were important.
But a system cannot be successful if it is too strongly influenced by a single 
person. Once the initial design is complete and fairly robust, the real test 
begins as people with many different viewpoints undertake their own experiments.

then the text is wrapped around the figure when using \starthanging.

Best regards: OK

> On 08 Aug 2015, at 15:49, Jeong Dal  wrote:
> 
> Dear Wolfgang,
> 
>> You have to use \starthanging instead of \placefgure when you’re in a frame.
>> 
>> \starttext
>> 
>> \startframedtext[width=max]
>>\starthanging[location=right]
>>{\startMPcode
>> draw unitsquare scaled 2cm ;
>> \stopMPcode}
>>\input tufte
>>\stophanging
>> \stopframedtext
>> 
>> \stoptext
>> 
>> Wolfgang
> 
> Thank you for letting me know the command “starthanging”.
> I tried the command  “\startfiguretext … \stopfiguretext”, and found that 
> there is no text below the square.
> 
> \startframedtext[width=\textwidth]{
> \startfiguretext[right,none]{}{%
> \startMPcode
> draw unitsquare scaled 2cm ;
> \stopMPcode}
> \input knuth
> \stopfiguretext}
> \stopframedtext
> 
> Your example worked fine, but if we replace tufte by knuth, then text is 
> written over the square while the tufte’s text was witten surround the square.
> Is it expected result?
> 
> Thank you again.
> 
> Best regards,
> 
> Dalyoung
> ___
> 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
> ___

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

Re: [NTG-context] Text around a figure in a framedtext (Wolfgang Schuster)

2015-08-08 Thread Jeong Dal
Dear Wolfgang,

> You have to use \starthanging instead of \placefgure when you’re in a frame.
> 
> \starttext
> 
> \startframedtext[width=max]
> \starthanging[location=right]
> {\startMPcode
>  draw unitsquare scaled 2cm ;
>  \stopMPcode}
> \input tufte
> \stophanging
> \stopframedtext
> 
> \stoptext
> 
> Wolfgang

Thank you for letting me know the command “starthanging”.
I tried the command  “\startfiguretext … \stopfiguretext”, and found that there 
is no text below the square.

\startframedtext[width=\textwidth]{
\startfiguretext[right,none]{}{%
\startMPcode
 draw unitsquare scaled 2cm ;
 \stopMPcode}
\input knuth
\stopfiguretext}
\stopframedtext

Your example worked fine, but if we replace tufte by knuth, then text is 
written over the square while the tufte’s text was witten surround the square.
Is it expected result?

Thank you again.

Best regards,

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

Re: [NTG-context] Text around a figure in a framedtext

2015-08-08 Thread Wolfgang Schuster

Fabrice Couvreur 
8. August 2015 00:49
Hi,
Why the text does not move in the first framedtext like the second 
framedtext?

You have to use \starthanging instead of \placefgure when you’re in a frame.

\starttext

\startframedtext[width=max]
\starthanging[location=right]
{\startMPcode
 draw unitsquare scaled 2cm ;
 \stopMPcode}
\input tufte
\stophanging
\stopframedtext

\stoptext

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

Re: [NTG-context] Text around a figure in a framedtext

2015-08-08 Thread Fabrice Couvreur
Hi Otared,
A small mistake on your part : do not write \input knuth.tex but \input
knuth.
Then I want the text in the first framedtext wrapped around the figure as in
the second.
Fabrice

2015-08-08 6:18 GMT+02:00 Otared Kavian :

> Hi,
>
> You should use the same width if you want to obtain the same result (by
> the way, you have to say also \stopframedtext in your source file):
>
> \startframedtext[width=\textwidth]{
> \placefigure[right,none]{}{%
>  \startMPcode
>   draw unitsquare scaled 2cm ;
>   \stopMPcode}
> \input knuth.tex }
> \stopframedtext
>
> Best regards: OK
>
> > On 08 Aug 2015, at 00:49, Fabrice Couvreur 
> wrote:
> >
> > Hi,
> > Why the text does not move in the first framedtext like the second
> framedtext ?
> > Thank you.
> > Fabrice
> >
> > \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> > \definecolor[MyColorA][.75(MyColorB,white)]
> >
> > \defineframedtext
> >   [MyText]
> >   [frame=off,
> >background=MyFrame,
> >width=\textwidth,
> >location=right]
> >
> > \defineoverlay
> >   [MyFrame]
> >   [\useMPgraphic{MyFrame}]
> >
> > \definelabel
> >   [Définition]
> >   [headstyle=\bf\smallcaps]
> >
> > \startuseMPgraphic{MyFrame}
> > path b ;
> > picture p ;
> > p := textext.rt("\white\Définition") ;
> > p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
> > b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> > fill OverlayBox withcolor \MPcolor{MyColorA} ;
> > fill b withcolor \MPcolor{MyColorB} ;
> > draw p ;
> > \stopuseMPgraphic
> >
> > \starttext
> > \startMyText
> > \placefigure[right,none]{}{%
> >  \startMPcode
> >   draw unitsquare scaled 2cm ;
> >   \stopMPcode}
> > \input knuth
> > \stopMyText
> >
> > \startframedtext{
> > \placefigure[right,none]{}{%
> >  \startMPcode
> >   draw unitsquare scaled 2cm ;
> >   \stopMPcode}
> > \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://tex.aanhet.net
> > archive  : http://foundry.supelec.fr/projects/contextrev/
> > 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-07 Thread Otared Kavian
Hi,

You should use the same width if you want to obtain the same result (by the 
way, you have to say also \stopframedtext in your source file):

\startframedtext[width=\textwidth]{
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth.tex }
\stopframedtext

Best regards: OK

> On 08 Aug 2015, at 00:49, Fabrice Couvreur  
> wrote:
> 
> Hi,
> Why the text does not move in the first framedtext like the second framedtext 
> ?
> Thank you.
> Fabrice
> 
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> \definecolor[MyColorA][.75(MyColorB,white)]  
> 
> \defineframedtext
>   [MyText]
>   [frame=off,
>background=MyFrame,
>width=\textwidth,
>location=right]
> 
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
> 
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
> 
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ; 
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
> \stopuseMPgraphic
> 
> \starttext
> \startMyText
> \placefigure[right,none]{}{%
>  \startMPcode
>   draw unitsquare scaled 2cm ;
>   \stopMPcode}
> \input knuth
> \stopMyText
> 
> \startframedtext{
> \placefigure[right,none]{}{%
>  \startMPcode
>   draw unitsquare scaled 2cm ;
>   \stopMPcode}
> \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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Text around a figure in a framedtext

2015-08-07 Thread Fabrice Couvreur
Hi,
Why the text does not move in the first framedtext like the second
framedtext ?
Thank you.
Fabrice

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   location=right]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext
\startMyText
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth
\stopMyText

\startframedtext{
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___