Text around a figure in a framedtext
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
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 ___________________________________________________________________________________
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
___________________________________________________________________________________
Fabrice Couvreur mailto:fabrice1.couvreur@gmail.com 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
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
___________________________________________________________________________________
participants (3)
-
Fabrice Couvreur
-
Otared Kavian
-
Wolfgang Schuster