ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Colored rule using MPgraphic
@ 2017-05-17  7:25 Jan Willem Flamma
  2017-05-17  7:52 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Willem Flamma @ 2017-05-17  7:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list members,

I’m trying to make certain text standout from the surrounding text by adding a colored rule to the side.
See below MWE.

The colored rule is not shown over the area where the picture is displaced. Does anybody know how can I fix this?

Kind regards,
Jan Willem


\definetextbackground
    [Example]
    [mp=background:rule,location=paragraph,
    rulethickness=3pt,framecolor=red,
    leftoffset=1em,rightoffset=1em,
    toptoffset=1em,bottomoffset=1em,
    before={\testpage[3]\blank[3*big]},
    after={\blank[3*big]}]

\startuseMPgraphic{background:rule}
    linecap := butt;
    begingroup;
        for i=1 upto nofmultipars :
            draw (ulcorner multipars[i]--llcorner multipars[i]) 
            withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth} ;
        endfor ;
    endgroup;
\stopuseMPgraphic

\useMPlibrary[dum]

\starttext

\startExample
{\bf Example - Title\hfill{Subtitle}} \blank

\placefigure
	[force,none][]{}
    {\externalfigure[dum][width=0.3\textwidth]}

\input knuth

\stopExample

\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Colored rule using MPgraphic
  2017-05-17  7:25 Colored rule using MPgraphic Jan Willem Flamma
@ 2017-05-17  7:52 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2017-05-17  7:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5/17/2017 9:25 AM, Jan Willem Flamma wrote:
> Dear list members,
>
> I’m trying to make certain text standout from the surrounding text by adding a colored rule to the side.
> See below MWE.
>
> The colored rule is not shown over the area where the picture is displaced. Does anybody know how can I fix this?

you can try

\setupfloats
     [freeregion=no]


see details.pdf in the doc subtree

> Kind regards,
> Jan Willem
>
>
> \definetextbackground
>     [Example]
>     [mp=background:rule,location=paragraph,
>     rulethickness=3pt,framecolor=red,
>     leftoffset=1em,rightoffset=1em,
>     toptoffset=1em,bottomoffset=1em,
>     before={\testpage[3]\blank[3*big]},
>     after={\blank[3*big]}]
>
> \startuseMPgraphic{background:rule}
>     linecap := butt;
>     begingroup;
>         for i=1 upto nofmultipars :
>             draw (ulcorner multipars[i]--llcorner multipars[i])
>             withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth} ;
>         endfor ;
>     endgroup;
> \stopuseMPgraphic
>
> \useMPlibrary[dum]
>
> \starttext
>
> \startExample
> {\bf Example - Title\hfill{Subtitle}} \blank
>
> \placefigure
> 	[force,none][]{}
>     {\externalfigure[dum][width=0.3\textwidth]}
>
> \input knuth
>
> \stopExample
>
> \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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-17  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17  7:25 Colored rule using MPgraphic Jan Willem Flamma
2017-05-17  7:52 ` Hans Hagen

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