On 2/17/2021 12:18 AM, Jairo A. del Rio wrote:
I've copied the following example from the ConTeXt archive:
\defineoverlay[frames][\positionoverlay{frames}]
\setupbackgrounds[text][background=frames]
\startMPpositiongraphic{frame}
if unknown context_apos : input mp-apos.mpiv ; fi
I've copied the following example from the ConTeXt archive:
\defineoverlay[frames][\positionoverlay{frames}]
\setupbackgrounds[text][background=frames]
\startMPpositiongraphic{frame}
if unknown context_apos : input mp-apos.mpiv ; fi ;
\MPgetposboxes{\MPvar{self}}{\MPanchorid}
if nofposboxes
(0,1)
withshadecolors (red, blue) ;
\stopuseMPgraphic
\defineoverlay[MyShade][\useMPgraphic{MyShade}]
\setupbackgrounds[page][background=MyShade]
\startmakeup
\definedfont[SerifBold*default @ 50pt] \setupinterlinespace
\defineeffect[MyOutline][alternative=outer,rulethickness
,backgroundcolor=blue]
},
after={\stopbackground
},
]
- which creates a rectangular backround to the text, and the text may
spread over pages;
2. or this:
\defineoverlay[AnOverlayDefinition][]
\definetyping[Test]
[before={\startframedtext[background=AnOverlayDefinition
t; \dorecurse {5} {Before #1\page}
>
> \getfiguredimensions[oeps.pdf]
>
> \startsetups SomeNumber
> \vbox to \overlayheight \bgroup
> \vss
> \hbox to \overlaywidth \bgroup
> \hss
> \bfd \red You can figure it out: \pagenumber
>
dimensions[oeps.pdf]
\startsetups SomeNumber
\vbox to \overlayheight \bgroup
\vss
\hbox to \overlaywidth \bgroup
\hss
\bfd \red You can figure it out: \pagenumber
\hss
\egroup
\vss
\egroup
\stopsetups
\defineoverlay[
entpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay[booktabs_bottom] [\uniqueMPgraphic{booktabs_bottom}]
\installbottomframerenderer{booktabs}{\uniqueMPgraphic{booktabs_bottom}}
\startsetups booktabs
\setupTABLE[each][each][frame=off, rulethickness=1.2bp]
\setupTABLE[row][first][topframe=
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed (but without the
frame borders). Am I at least correct about this?
You don't need metafun for something
> manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
>>> not find one. But I'd be quite prepared to 'have a go' at this, if I had
>>> some pointers of just where to start! I assume I would have to
>>> \defineoverlay[number] and then
to
\defineoverlay[number] and then add text on top \framed (but without the
frame borders). Am I at least correct about this?
You don't need metafun for something this simple. Here is a crude
implementation:
\setuphead[chapter]
[
numberstyle={\switchtobodyfont[48pt
looking for one in the
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed (but without
rs of just where to start! I assume I would have to
> \defineoverlay[number] and then add text on top \framed (but without the
> frame borders). Am I at least correct about this?
You don't need metafun for something this simple. Here is a crude
implementation:
\setuphead[chapter]
was keenly looking for one in the
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed
, \overlayheight-rulethickness);
rightcorner := (\overlaywidth-rulethickness, rulethickness);
draw leftcorner -- rightcorner;
\stopuseMPgraphic
\defineoverlay
[DiagonalRule]
[\useMPgraphic{DiagonalRule}]
\define[2]\DiagonalLabel{%
\setuptabulate [after={\blank[\frameddimension{offset
a background to a framed text. —
>>> I can not make it working though…
>>>
>>> \startuniqueMPgraphic{Markings}
>>> %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged
>>> 5mm withcolor blue; \stopuniqueMPgraphic
>>>
>>&
ngs}
> > %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged
> > 5mm withcolor blue; \stopuniqueMPgraphic
> >
> > \defineoverlay[Marks]{\useMPgraphic{Markings}}
>
> \defineoverlay[Marks][{\useMPgraphic{Markings}}]
gt; withcolor blue; \stopuniqueMPgraphic
>
> \defineoverlay[Marks]{\useMPgraphic{Markings}}
\defineoverlay[Marks][{\useMPgraphic{Markings}}]
Marco
___
If your question is of interest to others as well, please add an entry
Hello listmembers,
I try to use a Metapost drawing as a background to a framed text. — I can not
make it working though…
\startuniqueMPgraphic{Markings} %{Markings:\overlaywidth:\overlayheight}
fill OverlayBox enlarged 5mm withcolor blue;
\stopuniqueMPgraphic
\defineoverlay[Marks
Floris van Manen schrieb am 11.06.2020 um 23:03:
On 11/06/2020 22:31, Jairo A. del Rio wrote:
The watermark is partially outside the page, whereas the Wiki result is
more "centered". Is that an intended behaviour?
A slightly better version.
\defineoverlay
[WatermarkOverlay]
{blueShade}
draw lmt_shade [
path = fullsquare xyscaled (OverlayWidth,OverlayHeight) ,
direction = "up",
alternative = "linear",
colors = { "red", "blue" },
] ;
\stopuniqueMPgraphic
\defineoverlay [mybg] [\uniqueMPgraphic{blueShade
in the metafun manual).
\setuppapersize [A4,landscape]
\startuniqueMPgraphic{blueShade}
draw lmt_shade [
path= fullsquare xyscaled (OverlayWidth,OverlayHeight) ,
direction = "up",
alternative = "linear",
colors = { "red", "blue" },
icture to OverlayBox ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyFramedText]
[
frame=off,
background=FunnyFrame,
offset=\bodyfontsize,
width=\textwidth,
]
\defineenumeration[Counter]
[
title=yes,
alternati
OverlayWidth
yscaled 2.5 OverlayHeight ;
draw p withcolor red ;
setbounds currentpicture to p topenlarged 6mm ;
\stopuseMPgraphic
\defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}]
\starttext
\bTABLE[frame=off]
\bTR
\bTD[nx=2,align=middle,background=triangle] \dontleavehmode a\crlf
eMPgraphic{frameborder}
draw OverlayBox withcolor blue ;
\stopuseMPgraphic
\defineoverlay[frameborder][\useMPgraphic{frameborder}]
\setupheader[state=high]
\setupfooter[state=high]
\starttext
\setupframed
[width=4cm,
height=4cm,
offset=1cm]
\framed{}
\framed[frame=off,background=f
,
this MWE is a simplified version of a real case:
\startuseMPgraphic{cell:triangle}
path p ; p := unittriangle rotated 90 xscaled 2.5 OverlayWidth
yscaled 2.5 OverlayHeight ;
draw p withcolor red ;
\stopuseMPgraphic
\defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}]
\starttext
\bTABLE[frame=of
;
\stopuseMPgraphic
\defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}]
\starttext
\bTABLE[frame=off]
\bTR
\bTD[nx=2,background=triangle,align=middle] \dontleavehmode
a\crlf text \eTD
\eTR
\bTR[toffset=1mm]
\bTD left \eTD
\bTD right \eTD
\eTR
\eTABLE
\stoptext
On 4/11/2020 4:15 PM, mf wrote:
Hello list,
this MWE is a simplified version of a real case:
\startuseMPgraphic{cell:triangle}
path p ; p := unittriangle rotated 90 xscaled 2.5 OverlayWidth
yscaled 2.5 OverlayHeight ;
draw p withcolor red ;
\stopuseMPgraphic
\defineoverlay[triangle
Hello list,
this MWE is a simplified version of a real case:
\startuseMPgraphic{cell:triangle}
path p ; p := unittriangle rotated 90 xscaled 2.5 OverlayWidth
yscaled 2.5 OverlayHeight ;
draw p withcolor red ;
\stopuseMPgraphic
\defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle
t[location=middle, width=27.5cm, height=18cm,
backspace=1cm,header=4cm]
\setupcaptions[location=none]
\setupbackgrounds[header][text][background={Logos}, state=repeat]
\defineoverlay
[Logos][{
\framed[width=\textwidth, height=3cm, align=right, strut=no, offset=none]{
\framed[width=0.280\textwidth,
tuppapersize[A4, landscape]
\setuplayout[location=middle, width=27.5cm, height=18cm,
backspace=1cm,header=4cm]
\setuppagenumbering[state=stop]
\setupcaptions[location=none]
\setupbackgrounds[header][text][background={Logos}, state=repeat]
\setupnumbering [location=]
\setupframed[offset=none]
\
} ) ;
\stopuniqueMPgraphic
\setupMPvariables
[meta:hash]
[gap=.25\bodyfontsize,
angle=45,
linewidth=\overlaylinewidth,
linecolor=\overlaylinecolor]
\def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}}
\defineoverlay[meta:hash:right]
[\metahashoverlay{ +45}]
\defineoverlay[meta:hash:left
\structureuservariable – this is really cool.
Thanks a lot Wolfgang.
juh
Am 14.02.20 um 19:53 schrieb Wolfgang Schuster:
> \setupexternalfigures[location=default]
>
> \defineoverlay
> [SlideBackground]
> [\doifsomething
> {\structureuservariable{background}}
>
peat]
>
> Thanks. There was a dark idea of this in the back of my brain.
>
> >
> > In your case a simple overlay is the simpler solution to get repeated
> > images on every page, i.e.
> >
> > \defineoverlay [bg:hs2020-mond]
> > [{\externalfigure[backgro
lay is the simpler solution to get repeated images
> on every page, i.e.
>
> \defineoverlay [bg:hs2020-mond]
> [{\externalfigure[background.jpg][height=\paperheight]}]
>
> or
>
> \defineoverlay [bg:hs2020-mond] [\overlayfigure{background.jpg}]
Is this defining and se
your case a simple overlay is the simpler solution to get repeated images on
every page, i.e.
\defineoverlay [bg:hs2020-mond]
[{\externalfigure[background.jpg][height=\paperheight]}]
or
\defineoverlay [bg:hs2020-mond] [\overlayfigure{background.jpg}]
Wolfgang
_
On 1/2/2020 5:00 PM, Peter Rolf wrote:
Hi Hans
There is a small problem with overlays.
%-
\starttext
\defineoverlay[foo][{\blackrule[color=black,width=20mm,height=20mm]}]%
\framed[background=foo,strut=no,offset=overlay]%{\blackrule[color=white,width=16mm,height=16mm]}
\stoptext
Hi Hans
There is a small problem with overlays.
%-
\starttext
\defineoverlay[foo][{\blackrule[color=black,width=20mm,height=20mm]}]%
\framed[background=foo,strut=no,offset=overlay]%{\blackrule[color=white,width=16mm,height=16mm]}
\stoptext
%-
The inner square should be centered.
Peter
Jon Wong schrieb am 27.12.2019 um 04:13:
Any way to put the watermark in front?
You can use the foreground to flush the content in a frame and place
then your layer on top of it.
\definecolor [Watermark] [s=1,a=1,t=0.5]
% \defineoverlay
% [watermark]
%
[{\backgroundimage{1
height]
>> % \setlayerframed[WatermarkOverlay]
>> %[preset=center]
>> %[foregroundcolor=red,frame=off]
>> %{\scale[factor=max]{\rotate[rotation=60.0]{~Oops!~}}}
>>
>> \defineoverl
=center]
% [foregroundcolor=red,frame=off]
% {\scale[factor=max]{\rotate[rotation=60.0]{~Oops!~}}}
\defineoverlay [WatermarkOverlay]
[{\framed[frame=off,
foregroundcolor=red
,
% width=\paperwidth,
% height=\paperheight]
% \setlayerframed [WatermarkOverlay]
% [preset=center]
% [foregroundcolor=red,frame=off]
% {\scale[factor=max]{\rotate[rotation=60.0]{~Oops!~}}}
\defineoverlay
Hi Altoff.
Maybe this markup will help?
\startuniqueMPgraphic{cancel}
pickup pencircle scaled 0.7pt ;
path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged -ExHeight ;
draw llcorner p -- urcorner p withcolor OverlayColor ;
\stopuniqueMPgraphic
\defineoverlay[cancel
)--
(0,1.05*OverlayHeight)--cycle;
fill p shifted (3,-3);
fill p withcolor 0.8white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
\defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}]
\definecolor[ColorA][0.8(white)]
\startsetups [headertext
On Thu, 10 Oct 2019, cont...@vivaldi.net wrote:
Hello,
this is a probably basic question, but the following code doesn't compile:
\setupbackgrounds[page][background={Bkg}]
\defineoverlay[Bkg][\useMPgraphic{Bkg}]
\startuseMPgraphic{Bkg}
externalfigure "hacker.png";
\stopus
> On 10 Oct 2019, at 13:23, cont...@vivaldi.net wrote:
>
> Hello,
>
> this is a probably basic question, but the following code doesn't compile:
>
>
> \setupbackgrounds[page][background={Bkg}]
>
> \defineoverlay[Bkg][\useMPgraphic{Bkg}]
>
> \star
Hello,
this is a probably basic question, but the following code doesn't
compile:
\setupbackgrounds[page][background={Bkg}]
\defineoverlay[Bkg][\useMPgraphic{Bkg}]
\startuseMPgraphic{Bkg}
externalfigure "hacker.png";
\stopuseMPgraphic
\starttext
Ahoj
n shadedup
withshadecolors ("VerlaufVon", "VerlaufNach")
;
\stopuniqueMPgraphic
\defineoverlay[verlaufen][\useMPgraphic{Verlauf}]
\setupbackgrounds[paper][background={verlaufen}]
\starttext
\strut
\stoptext
The background consists of a blue and a green area instead of a shade. While
test
> fill p shifted (2,-2);
> fill p withcolor 0.8white;
> draw p;
> setbounds currentpicture to p;
> \stopuseMPgraphic
>
> \defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}]
>
> \starttext
> \setvariables
> [headert
}{\directsetup{headertext}}
> >
> > \startuseMPgraphic{framewithshadow}
> > path p;
> >
> p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
> > fill p shifted (2,-2);
> > fill p withcolor 0.8white;
> > draw p;
\defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}]
\starttext
\setvariables
[headertext]
[title={Devoir maison},
number={6},
day={02},
month={09},
year={2019},
location={Seconde B},
time={}]
\input knuth
\stoptext
There was a bug with the \date macro which I
{headertext}{set}{\directsetup{headertext}}
\startuseMPgraphic{framewithshadow}
path p;
p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.8white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
\defineoverlay
;
\stopuseMPgraphic
\defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}]
\starttext
\setvariables
[headertext]
[title={Devoir maison},
number={6},
day={22},
month={08},
year={2019},
location={Seconde B},
time={}]
\framed[background=framewithshadow,offset=4bp]{\bf DM
uld work for you:
\startuseMPgraphic{framewithshadow}
path p;
p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.7white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
\defineoverlay[framewithshadow][\useMPgraphic{framewithsh
>
>> \definecolor[color-1][.5(red,green)]
>> \definecolor[color-2][.5(green,blue)]
>> \definecolor[color-3][.5(blue,red)]
>> \definecolor[color-4][.5(white,black)]
>> \definecolor[color-5][.5(white,color-4)]
>>
>> \startuniqueMPgraphic{frame}
>> fill O
ck)]
> \definecolor[color-5][.5(white,color-4)]
>
> \startuniqueMPgraphic{frame}
> fill OverlayBox withcolor \MPcolor{color-1} ;
> \stopuniqueMPgraphic
>
> \startuniqueMPgraphic{contrast}
> fill OverlayBox withcolor \MPcolor{color-2} ;
> \stopuniqueMPgraphic
>
>
} ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{contrast}
fill OverlayBox withcolor \MPcolor{color-2} ;
\stopuniqueMPgraphic
\defineoverlay[frame] [\uniqueMPgraphic{frame}]
\defineoverlay[contrast][\uniqueMPgraphic{contrast}]
\definecolumnset[example][n=2]
%\setupcolumnsetstart[example][1][1][2
cycle)
enlarged(0,0.25u)
shifted (0,6i)
withcolor \MPcolor{rojo} ;
fi;
StopPage;
\stopuseMPgraphic
\defineoverlay
[chapter:background]
[\useMPgraphic{page:background}]
\setupbackgrounds[page][background=chapter:background]
\definepagebreak[first
fi;
StopPage;
\stopuseMPgraphic
\defineoverlay
[chapter:background]
[\useMPgraphic{page:background}]
\setupbackgrounds[page][background=chapter:background]
\definepagebreak[firstpagebreak][yes,header]
\startsetups [chapter:before]
\doifoddpageelse
{}
{\pushbackground[page]
ound:
>
> \showframe
> \showboxes
> \defineframedtext[leftbartext][
>width=broad,
>frame=off,
>rulethickness=.5ex,
>background=mp:offsetframe,
>offset=overlay,
> ]
>
> \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
>
offsetframe,
> offset=overlay,
> ]
>
> \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
>
\startuseMPgraphic{mp:offsetframe}
linecap:=butt;
draw leftboundary OverlayBox
xshifted -(LeftMarginDistance + 0.5OverlayLineWidth)
withpen pe
,
rulethickness=.5ex,
background=mp:offsetframe,
offset=overlay,
]
\defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
\startuseMPgraphic{mp:offsetframe}
draw leftboundary OverlayBox
xshifted -(LeftMarginDistance + 0.5OverlayLineWidth)
withpen pencircle scaled
enter p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\d
Fabrice Couvreur schrieb am 27.01.19 um 00:59:
Hi Henry,
Thank you for your proposition. I tested both : the first work but
not the second.
Fabrice
Remove the empty line between the two arguments of the \defineoverlay
command.
Wolfgang
4 \startuseMPgraphic{tablebackground}{i,j}
5 if (\MPvar{i} = 1) or (\MPvar{j} = 1):
6 fill OverlayBox withcolor \MPcolor{fondpaille} ;
7 fi;
8 \stopuseMPgraphic
9
10 \defineoverlay
11 [tablebackground]
12
13 >>
[\useMPgraphic{tablebackground}{i=\current
uate the conditional purely in MetaPost. I don't
know if that would be faster, but it's a bit more readable to me.
\startuseMPgraphic{tablebackground}{i,j}
if (\MPvar{i} = 1) or (\MPvar{j} = 1):
fill OverlayBox withcolor \MPcolor{fondpaille} ;
fi;
\stopuseMPgraphic
\defineoverlay
[table
layBox withcolor \MPcolor{fondpaille} ;
\stopuseMPgraphic
\defineoverlay
[tablebackground]
[\ifnum\currentxtablerow=1
\useMPgraphic{tablebackground}%
\else\ifnum\currentxtablecolumn=1
\useMPgraphic{tablebackground}%
\fi\fi]
\setupxtable[background=tablebackground]
\sta
rightcorner;
draw toprightcorner -- lowerleftcorner;
\stopuseMPgraphic
\defineoverlay[ZRule][\useMPgraphic{ZRule}]
\starttext
\setupTABLE[c][each][width=30mm]
\setupTABLE[r][each][width=6mm]
% in an attempt to place the table at known positions, I put it into a
layer. Though it is not really "backg
[BigColorOne][r=.86,g=.850,b=.54]
\definecolor[BigColorTwo][r=.43,g=.425,b=.27]
\define[1]\TitlePage
{\begingroup
\defineoverlay[back][{\BigFontOne \blue \starteffect[outer]#1\stopeffect}]%
\framed[frame=off,background=back,align={hilo}]
{\kern-3pt{\BigFontOne\BigColorOne \starteffect[inner
z[j]
endfor .. z1 & cycle ;
\stopuseMPgraphic
% braces are scaled to fit the box
\defineoverlay[leftbrace] [\middlealigned{\scale[height=\overlayheight,width=\dimexpr 3pt+.015\dimexpr\overlayheight\relax\relax]{\useMPgraphic{accolade}}}]
\defineoverlay[rightbrace][\middlealigned{\mirror{\scal
Hi,
I run into this error after updating my ConTeXt version.
Small (but not minimal) example attached.
mtx-context | current version: 2018.10.18 00:07
Peter
\startuniqueMPgraphic{column:bg}
fill OverlayBox withcolor yellow;
\stopuniqueMPgraphic
\defineoverlay[columnbg
handsixth]
[first]
[backspace=\measure{big},
width=\dimexpr\paperwidth-2\measured{big}\relax]
\definelayout [1] [first]
\definelayout [2] [second]
\definelayout [3] [thirdandfourth]
\definelayout [4] [thirdandfourth]
\definelayout [5] [fifthandsixth]
\definelayout [6] [fifthandsixth]
arbitrary
shapes, maybe even letters (like drop shadows e.g. in InDesign do).
\startuniqueMPgraphic{mpnewshadow}{offset}
MyOffset := \MPvar{offset} ;
...
... OverlayWidth ...
\defineoverlay[newshadow][\uniqueMPgraphic{mpnewshadow}{offset=.3em}]
you use unique graphics ... so you need to make
\bold \MPtext{Pare3}
etex, (0, -50))
withcolor yellow
;
\stopuseMPgraphic
% Overlays
\defineoverlay[Pare][\useMPgraphic{Pare}]
\setupbackgrounds[page][background={foreground,Pare}]
\starttext
\startTEXpage[width=210mm,height=297mm]
Aaa
\stopTEXpage
\stoptext
Here, t
[20mm]\sans\bold \MPtext{Pare} etex, (0,
50))
withcolor green
;
draw thelabel(btex \switchtobodyfont[20mm]\sans\bold \MPtext{Pare2} etex, (0,
0))
withcolor blue
;
draw thelabel(btex \switchtobodyfont[20mm]\sans\bold \MPtext{Pare3} etex, (0,
-50))
withcolor yell
Frame,
> width=\textwidth,
> location=right]
>
> \defineoverlay
>[MyFrame]
>[\useMPgraphic{MyFrame}]
>
> \definelabel
>[Définition]
>[headstyle=\bf\smallcaps]
>
>
> \startuseMPgraphic{MyFrame}
> picture p ;
> p := texte
ColorB][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]
>[\useMPgra
=\textwidth,
location=right]
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
\definelabel
[Définition]
[headstyle=\bf\smallcaps]
\startuseMPgraphic{MyFrame}
picture p ;
p := textext.rt(\MPstring{MyFrame}) ;
p := p shifted (0,OverlayHeight-ypart center p
actor 1.5
> withshadecolors (.85white,white)
>% withtransparency (multiplytransparent,.7)
> withtransparency (normaltransparent,.7)
> \stopuseMPgraphic
>
> \defineoverlay[test][\useMPgraphic{test}]
>
> \framed
>[align=middle,background={fore
dedirection shadedup
withshadefactor 1.5
withshadecolors (.85white,white)
% withtransparency (multiplytransparent,.7)
withtransparency (normaltransparent,.7)
\stopuseMPgraphic
\defineoverlay[test][\useMPgraphic{test}]
\framed
[align=middle,background={foreground,test}]
{\samplefile{s
;) doesn't work here
withshadecolors (white, white) withtransparency (0, .7);
\stopuseMPgraphic
%% to illustrate the effect, actual background is white
\setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
\defineoverlay [gradient-mp] [\useMPgraphic{trans}]
%% requires external
ure to OverlayBox enlarged 2.5mm;
fi
\stopuseMPgraphic
\defineoverlay
[verticalrule]
[\useMPgraphic{verticalrule}]
\definecolumnset
[exam]
[n=2,
background=verticalrule]
\starttext
\startcolumnset[exam]
\startcolumns[n=2, rule=on]
\startitemize[n]
\item Question 1.
G
withcolor darkred ;
setbounds currentpicture to boundingbox p ;
\stopuniqueMPgraphic
\defineoverlay[half circle][\uniqueMPgraphic{half circle}]
\starttext
\framed[background=half circle,frame=off]{Text width half circle.}
\stoptext
Well, if you really want a tear down
darkred ;
setbounds currentpicture to boundingbox p ;
\stopuniqueMPgraphic
\defineoverlay[half circle][\uniqueMPgraphic{half circle}]
\starttext
\framed[background=half circle,frame=off]{Text width half circle.}
\stoptext
>
> My greatest problems seem to be in the e
etuptyping[bodyfont=9pt, numbering=line, before=\blank, after=\blank]
\setupitemize[paragraph, packed, broad]
%
\setupcombinedlist[content][alternative=c,aligntitle=yes,interaction=pagenumber]
\setuplist[section][margin=2em,]
\setuplist[subsection][margin=5em,]
\setuplist[subsubsection][margin=8em,
age]
[background=color,
backgroundcolor=MyBackgroundColor]
Thanks.
---8< - Start example
\usemodule[present-original]
\usemodule[present-common]
\definecolor [PageColor] [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor] [r=.75]
\definecolor [Po
or [PageColor] [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor] [r=.75]
\definecolor [PositionColor] [s=.55]
\defineoverlay
[PageShape][\useMPgraphic{PageShape}]
\startuseMPgraphic{PageShape}
StartPage ;
path p ; pair pa, pb ; numeric len ; color contrastc
rawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[MyFrame][\u
ndingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[frame=off,
background=FunnyFrame,
before={\blank[lin
le scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
\
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[F
;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[frame=off,
background=FunnyFrame,
before={\blank[line,halfline]},
%before={\blank[line]},
after={\
;
> p := p shifted (2o,OverlayHeight-ypart center p) ;
> drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
> b := a superellipsed .95 ;
> draw b ;
> b := (boundingbox p) superellipsed .95 ;
> fill b withcolor .85white ;
> draw b ;
> dr
eMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext
[FunnyText]
[frame=off,
background=FunnyFrame,
before={\blank[line,halfline]},
after={\blank[line]},
offset=\bodyfontsize,
width=\textwidth]
\defineenumeration[Theorem]
[title=no,
text=Theorem,
ipsed .95 ;
fill b withcolor .85white ; %.425green;%.
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame,
offset=\bodyfontsize, width=\
.625red) ;
b := a superellipsed .95 ;
%fill b withcolor .85white ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ; %.425green;%.
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame
caled 1pt withcolor
darkred;
draw p;
setbounds currentpicture to boundingbox currentpicture enlarged 2mm;
\stopuseMPgraphic
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
% Fin de la définition d'un texte encadré en rouge
\starttext
\startMyFrame[Title=Knuth Text]
\knuth
\stopMyFrame
\stopt
b withcolor darkred;
draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor
darkred;
draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor
darkred;
draw p;
setbounds currentpicture to boundingbox currentpicture enlarged 2mm;
\stopuseMPgraphic
\defineoverlay
[MyFram
eMPgraphic
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
\defineframedtext
[MyFrame]
[frame=off,
foregroundstyle={\switchtobodyfont[10pt]},
background=MyFrame,
align={verytolerant},
height=fit]
\definefloat
[recipe]
[figure]
\setupfloat
[recipe]
[default={right,none}]
dyFontSize,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
linecap := squared ;
> > drawoptions(withcolor \MPcolor{darkred}) ;
> > draw ulcorner p -- urcorner p ;
> > setbounds currentpicture to p ;
> > \stopuniqueMPgraphic
> >
> > \defineoverlay[titled][\uniqueMPgraphic{titled}]
> >
> > \startuseMPgrap
101 - 200 of 788 matches
Mail list logo