][.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
, \startMyText ... \
stopMyText ... this return Définition 1, Définition 2 ...
Thank you,
Fabrice
\setupbodyfont [palatino,11pt]
\setupcolors[state=start,cmyk=yes]
\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]
\defineoverlay[MyFrame
=0.62, y=1.00, k=0.00]
\setupbodyfont[11pt]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
\defineframedtext
[MyText]
[frame=off,
background=MyFrame,
width=0.9\textwidth,
location=right]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
\def\StartFrame{\startMyText}
\def
\setupcolors[state=start,cmyk=yes]
\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]
\setupbodyfont[11pt]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
\defineframedtext
[MyText]
[frame=off,
background=MyFrame,
width=0.9
you,
Fabrice
\showframe
\setupcolors[state=start,cmyk=yes]
\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]
\setupbodyfont[11pt]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
\defineframedtext
[MyText]
[frame=off
p, q;
h := \overlayheight;
w := \overlaywidth;
% imagine this is more complex
p = (0, 0) -- (w, .5h);
q = (0, h) -- (w, 0);
draw p;
draw q;
z0 = p intersectionpoint q;
% btex \def\Z{ ypart z0 } etex;
\stopuniqueMPgraphic
\defineoverlay[canon][\uniqueMPgraphic
]}]
\defineoverlay[chapterimage][\overlayfigure{\structureuservariable{image}}]
\setuphead
[chapter]
[ before={\startmakeup[chapterpage]},
%command=\ChapterCommand,
placehead=empty,
after={\stopmakeup}]
\setuphead
[title]
[ before={\blank[big]},
after={\blank[2*big
bottomenlarged 0.5pt ;
\stopuseMPgraphic
\defineoverlay[ACFRAME][\useMPgraphic{ACFRAME}]
\defineframed
[ACFRAME]
[frame=off,
background=ACFRAME]
\starttext
\ACFRAME{ Example }
\stoptext
Wolfgang
___
If your question
and arrows. So it looks
a bit dry.
\startMPdefinitions
% I don't know why this does not get loaded automatically.
input mp-abck.mpiv;
\stopMPdefinitions
\defineoverlay[highlight] [\positionoverlay{highlightoverlay}]
\startpositionoverlay{highlightoverlay}
\setMPpositiongraphic{n1
not bother to set the style of the boxes and arrows. So it
looks a bit dry.
\startMPdefinitions
% I don't know why this does not get loaded automatically.
input mp-abck.mpiv;
\stopMPdefinitions
\defineoverlay[highlight] [\positionoverlay{highlightoverlay}]
\startpositionoverlay{highlightoverlay
= (-71,-1125) ;
z22 = (-97,-1106) ;
z23 = (-143,-1031) ;
z24 = (-199,-673) ;
z25 = (-155,-211) ;
z26 = (-220,-22) ;
fill z1 for i=2 upto 14: .. z[i] endfor z14 for j=15 upto 26: .. z[j]
endfor .. z1 cycle withcolor red ;
\stopuseMPgraphic
\defineoverlay[leftbrace] [\leftaligned
{\scale[height
=lightgray]
\definecolor[Border][c=0.00, m=0.00, y=0.00, k=0.25]
\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic
\defineoverlay[borderline
=0.00, y=0.00, k=0.25]
\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic
\defineoverlay[borderline][\uniqueMPgraphic{borderline
\overlayheight ;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic
\defineoverlay[borderline][\uniqueMPgraphic{borderline}]
\startxtable[frame=off]
\startxrow
\startxcell[align=normal]
Compléter chacun des algorithmes ci-dessous afin qu'ils
;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic
\defineoverlay[borderline][\uniqueMPgraphic{borderline}]
\placefigure[right,none]{}{
\start
\switchtobodyfont[7pt]
\startMPcode
numeric u;
u=0.7cm;
z0=(0,0) ;
z1=(2.5u,0) ;
z2=(2.5u,2.5u) ;
z3
currentpicture to p ;
draw p withcolor \MPcolor{\overlaylinecolor} ;
\stopuniqueMPgraphic
\defineoverlay[funny][\uniqueMPgraphic{funny}]
\define[2]\MySectionCommand
{\framed
[background=funny,
frame=off,
width=fit,
align={right},
framecolor
} ;
\stopuniqueMPgraphic
\defineoverlay[funny][\uniqueMPgraphic{funny}]
\define[2]\MySectionCommand
{\framed
[background=funny,
frame=off,
width=0.5\textwidth,
align={right},
framecolor=mycolor,
rulethickness=1.5pt,
backgroundcolor=white
withcolor \MPcolor{\overlaycolor} ;
draw p withcolor \MPcolor{\overlaylinecolor} ;
draw (20,0)--(20,h) withcolor red ;
\stopuniqueMPgraphic
\defineoverlay[funny][\uniqueMPgraphic{funny}]
\define[2]\MySectionCommand
{\framed
[background=funny,
frame=off,
width=0.5
;
\stopuniqueMPgraphic
\defineoverlay[line][{\uniqueMPgraphic{line}}]
and using it in \framed, but placing the line correctly is elusive.
Just a quick and dirty solution. The trick is to draw the extra line as
part of the graphic and then fake the boundingbox. This is also limited
to a few
;
\stopuniqueMPgraphic
\defineoverlay[line][{\uniqueMPgraphic{line}}]
and using it in \framed, but placing the line correctly is elusive.
Just a quick and dirty solution. The trick is to draw the extra line as
part of the graphic and then fake the boundingbox. This is also limited
to a few
;
endfor;
\stopMPcode
\stoptext
How can a line be drawn connecting the right edges of the rectangles? I have
played with:
\startuniqueMPgraphic{line}
path a;
a:=(0,0)--(0,3cm);
draw a withpen pencircle scaled 3pt withcolor green;
\stopuniqueMPgraphic
\defineoverlay[line
of the rectangles? I have
played with:
\startuniqueMPgraphic{line}
path a;
a:=(0,0)--(0,3cm);
draw a withpen pencircle scaled 3pt withcolor green;
\stopuniqueMPgraphic
\defineoverlay[line][{\uniqueMPgraphic{line}}]
and using it in \framed, but placing the line correctly is elusive
Hi,
Macro written by Hans does not work.
Best regards,
Fabrice
% macros=mkvi
\starttext
\starttexdefinition MyOtherHeader #where #day #month #year #title
\defineoverlay[whatever][\useMPgraphic{whatever}]
\startuseMPgraphic{whatever}
path p;
p:=fullsquare xyscaled (\overlaywidth
to
have my cake and eat it too ;)
You can test if the layers are hidden when you print the following example, I
tried the Adobe Reader on my Mac and they where still visible.
\setupinteraction[state=start]
\defineoverlay[PageBackground] [\startMPcode fill fullsquare
xyscaled(OverlayWidth
]
\defineoverlay
[thumbs]
[\setups{thumbs}]
\def\NOfChapters{4} % i need to make this one available
\startsetups thumbs
\definemeasure[thumbheight][\dimexpr\paperheight/\NOfChapters\relax]
\vbox to \paperheight \bgroup
\vskip \rawsectionnumber{section-2}
\measure{thumbheight
\defineoverlay[whatever][\uniqueMPgraphic{whatever}]
\framed
[background=whatever,
backgroundcolor=green,
frame=off,
width=\textwidth]
{test}%
Thank you for this interesting solution! I didn’t know one could do
that with Metapost. This does
StopPage;
51 \stopreusableMPgraphic
52
53 \defineoverlay [page:background][\reuseMPgraphic{page:background}]
54
55 \setupbackgrounds[page][background={page:background}]
56
57 %\usemodule[visualcounter]
58
59 \definevisualcounter
60 [userpage]
Any help will be most appreciated
leftenlarged BackSpace
rightenlarged CutSpace
withcolor OverlayColor ;
setbounds currentpicture to OverlayBox
enlarged max(BackSpace,CutSpace) ;
\stopuniqueMPgraphic
\defineoverlay[whatever][\uniqueMPgraphic{whatever}]
\framed
The Stepper example on the wiki,
http://wiki.contextgarden.net/Stepperfrom which the following
snippet comes,
\usemodule[pre-60] % use the stepper
\setuppapersize[S6][S6]
\defineoverlay[invoke] [\overlaybutton{InvokeStepper}]
\setupbackgrounds[text] [background=invoke]
\setupinteraction[state
On 3/28/2014 11:30 AM, Michael Guravage wrote:
The Stepper example on the wiki, http://wiki.contextgarden.net/Stepper
from which the following snippet comes,
\usemodule[pre-60] % use the stepper
\setuppapersize[S6][S6]
\defineoverlay[invoke] [\overlaybutton{InvokeStepper
withcolor red
withtransparency (1,0.4) ;
\stopMPcode
\stoptext
or
\starttext
\defineoverlay
[page]
[\overlayfigure{mill.png}]
\setupbackgrounds
[page]
[background=page]
\definecolor[myred][a=1,t=.4,r=.4]
{\color[myred]{\definedfont[Bold*default at 60pt]LOOK THROUGH
#number
\defineoverlay[whatever][\useMPgraphic{whatever}]
\startuseMPgraphic{whatever}
path p;
p:=fullsquare xyscaled (\overlaywidth,\overlayheight) squeezed 1pt;
fill p withcolor white ;
draw p withpen pencircle scaled 2pt withcolor 0.625white ;
picture d ;
d :=
textext(\quad#where\space
}]
\starttext
\defineoverlay[muh][{\externalfigure[cow][width=\overlaywidth,
height=\overlayheight]}]
\startframed[width=max,height=0.4\textheight,background=muh,align=right,foregroundcolor=darkred]%
\startboxedcolumns[n=3]
It was a dark and stormy night. The rain came down in tons
the normal columns environment
doesn’t work in a frame.
\setupexternalfigures[location={local,global,default}]
\starttext
\defineoverlay[muh][{\externalfigure[cow][width=\overlaywidth,
height=\overlayheight]}]
\startframed[width=max,height=0.4\textheight,background=muh,align=right,foregroundcolor
On Thu, Feb 13, 2014 at 10:52:44AM +0100, Wolfgang Schuster wrote:
You have to use boxedcolumns environment because the normal columns
environment doesn’t work in a frame.
\setupexternalfigures[location={local,global,default}]
\starttext
\defineoverlay[muh][{\externalfigure[cow
\stopnarrower
}
\starttext
\vbox to .4\textheight{\externalfigure[moe]}
\vskip-.35\textheight
\txt
%---2. example-
\vskip.3\vsize
\useexternalfigure[muh][cow.pdf][width=\overlaywidth, height=\overlayheight]
\setupframed[height=.4\vsize, width=\hsize]
\defineoverlay
[muh
it's quite similar to the examples in metafun-p.pdf, p. 127:
\framed[background=demo circle]{This text is overlayed.}, but mine
refuses to work.
you need to anchor the graphic:
\starttext
\defineoverlay[my fourth overlay][\positionoverlay{my backgraphics}]
\startpositionoverlay{my backgraphics
to start your tex file with this line:
% macros=mkvi
\starttext
\starttexdefinition MyOtherHeader #where #day #month #year #title
#number
\defineoverlay[whatever][\useMPgraphic{whatever}]
\startuseMPgraphic{whatever}
draw OverlayBox withpen pencircle scaled .5pt
, OverlayHeight) -- (OverlayWidth, OverlayHeight)
-- (OverlayWidth, 0) -- cycle withcolor OverlayLineColor;
\stopuniqueMPgraphic
%% Define Overlay for NassiSimpleFrameBox
%%
\defineoverlay[NassiSimpleFrameBox][\uniqueMPgraphic{NassiSimpleFrameBox
;
\stopuniqueMPgraphic
\defineoverlay[mytest][\uniqueMPgraphic{mytest}]
\startMPpage[offset=1pt]
fill fullcircle scaled 10cm withcolor red ;
draw textext(\framed[background=mytest]{bla}) ;
draw textext(test 1.1) xsized 8cm rotated 45 withcolor white/2 ;
draw
;
fill p withcolor green ;
\stopuniqueMPgraphic
\defineoverlay[mytest][\uniqueMPgraphic{mytest}]
\starttext
\framed[background=mytest]{this works}
\startFLOWchart[test]
\startFLOWcell
\name{test}
\text{test}
\connection[lr]{test}
% \comment[t:0.5]{\framed{this works}}
\comment[t
\defineoverlay[mytest][\uniqueMPgraphic{mytest}]
\starttext
\framed[background=mytest]{this works}
\startFLOWchart[test]
\startFLOWcell
\name{test}
\text{test}
\connection[lr]{test}
% \comment[t:0.5]{\framed{this works}}
\comment[t:0.5]{\framed[background=mytest]{bla
for it)
\defineoverlay [myoverlay] [\ssd Foo]
\definetextbackground [mybackgroundColour] [background=color,
backgroundcolor=gray]
\definetextbackground [mybackgroundOverlay] [background=myoverlay]
\starttext
%% overlay works
\framed [background=myoverlay, align=normal] {\input knuth\par}
%% background
Hi,
overlays are not displayed when used as a background for
textbackground. Is this a bug or are overlays not supported?
\defineoverlay [myoverlay] [\ssd Foo]
\definetextbackground [mybackgroundColour] [background=color,
backgroundcolor=gray]
\definetextbackground [mybackgroundOverlay
\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]
\starttext
\bTABLE
\setupTABLE[align=middle]
\setupTABLE[header][background={foreground,OL:thickBtm}]
%
\bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead
\bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR
:\rightorleftpageaction rl]
[]
[width=\marginwidth,
align={lohi,middle},
foregroundstyle=\tx]
{\floatuserdataparameter{text}}
\flushlayer
[extrafiguretextlayer:\rightorleftpageaction rl]
\stopsetups
\defineoverlay
in the cell?
For testing:
%***
\defineoverlay[eslami][{\externalfigure[eslamivorlage.pdf]}]
\def\esl[#1][#2][#3][#4][#5][#6][#7]{%
\page
\startframed[frame=off,width=fit,offset=overlay,align=middle]%
\bTABLE[width=4.55cm,align={middle,lohi
Am 21.05.2013 um 07:38 schrieb H. Özoguz h.oezo...@mmnetz.de:
Hi there,
for a card game I have this macro:
\defineoverlay[eslami][{\externalfigure[somepicture.pdf]}]
\def\esl[#1][#2][#3]{%
\startframed[frame=on,width=4.75cm,offset=overlay,align=middle,background=eslami
,%
strut=no,%
heigth=fit,%
offset=0pt,
frameoffset=0pt,
depth=0pt,
top=,
backgroundoffset=0pt%
]
\defineoverlay[MyBoxit][MyBoxit]
\starttext
Here is the First Problem\par
\MyBoxit[width=10cm]
{
\Statement{First Statement}
\Statement{Second Statement}
}
\crlf
With a \% after the opening
Hi there,
for a card game I have this macro:
\defineoverlay[eslami][{\externalfigure[somepicture.pdf]}]
\def\esl[#1][#2][#3]{%
\startframed[frame=on,width=4.75cm,offset=overlay,align=middle,background=eslami]%
\offinterlineskip
\framed[width=4.75cm,frame=off,height=2cm]{\blank[-3mm]#1
, % height of a line
\strutdepth, % depth of a line
\strutheight % height of the first line
) ;
% For visualization purposes only
draw p ;
\stopuseMPgraphic
% For visualization purposes only
\defineoverlay[shape][\useMPgraphic{shape}]
\setupshapetexts
]{\blackrule[width=1pt,height=\textheight]}
\defineoverlay[rule][{\ifconditional\placeRULE\placelayer[rule]\fi}]
\setupbackgrounds[text][background=rule]
\starttext
\input knuth
\page \settrue\placeRULE
\input tufte
\page
\input zapf
\page \setfalse\placeRULE
\input ward
\stoptext
Wolfgang
xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{blue}
;
\stopuseMPgraphic
\defineoverlay[pagenumber][\useMPgraphic{pagenumber}]
\define[1]\PagenumberCommand
{\framed[frame=off,background=pagenumber]{#1}}
\setuppagenumbering[command=\PagenumberCommand]
\starttext
\chapter{This is a chapter
sequence.
system tex error on line 19 in file custo.tex: Undefined control sequence ...
9 \stopuseMPgraphic
10
11 \defineoverlay[pagenumber][\useMPgraphic{pagenumber}]
12
13 \define[1]\PagenumberCommand
14 {\framed[frame=off,background=""&g
pencircle scaled 1pt dashed withdots;
setbounds currentpicture to boundingbox OverlayBox;
\stopuniqueMPgraphic
\defineoverlay[Label][\useMPgraphic{Label}]
\def\dottext#1%
{ \mframed[frame=off, background=Label, location=low]
{ #1 }
}
\setupcolors[state=start]
\def\rndgraymath{\mframed[frame
OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay[LabelA][\uniqueMPgraphic{LabelA}]
\defineoverlay[LabelB][\uniqueMPgraphic{LabelB}]
\def\VariantA{\mframed[foregroundstyle=\tfc,frame=off,background=LabelA,backgroundoffset=3pt,backgroundcolor=red]}
\def\VariantB{\mframed[foregroundstyle=\tfc,frame
\defineoverlay [background:normal] [\useMPgraphic{background:normal}]
\startuseMPgraphic{background:title}
StartPage ;
numeric h ; h = 10mm ;
z[1] = ulcorner Page shifted (0, -1.5*h) ;
z[2] = urcorner Page shifted (0, -1.5*h);
z[3] = z[2] shifted (0, -h) ;
z[4] = z[1] shifted (0, -h) ;
path p ; p = z[1] -- z
(topboundary Page --cycle) enlarged(0,5mm) shifted (0,-5mm)
withcolor
\MPcolor{color:background:\namedstructureuservariable{chapter}{mycolor}} ;
StopPage ;
\stopuseMPgraphic
\defineoverlay
[background:normal]
[\useMPgraphic{background:normal}]
\startuseMPgraphic
\stoptext
\startuseMPgraphic{framed:background}
fill unitsquare xyscaled(OverlayWidth,OverlayHeight) leftenlarged 1cm
withcolor \MPcolor{lightgray};
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic
\defineoverlay[framed:background][\useMPgraphic{framed:background
On 3/5/2013 11:21 AM, Alexandre Gerussi wrote:
Hi there,
i'm having problems with metapost and positional graphics in mkIV.
Here is a small test file that compiles OK with texexec but fails to
compile with context:
% the beginning
\defineoverlay[frames][\positionoverlay{frames
Hi there,
i'm having problems with metapost and positional graphics in mkIV.
Here is a small test file that compiles OK with texexec but fails to
compile with context:
% the beginning
\defineoverlay[frames][\positionoverlay{frames}]
\setupbackgrounds[page][background=frames
.8white;
\stopuniqueMPgraphic
\starttext
\defineoverlay[encadrement][\uniqueMPgraphic{essai}]
\framed[frame=off,background=encadrement]{\it\tfb\color[darkred]{Devoir de
mathématiques}}
\stoptext
___
If your question
';
pair B; B:=q intersectionpoint p';
pair C; C:=p intersectionpoint q;
pair D; D:=q'intersectionpoint p;
path s; s:= A--B--C--D--cycle;
fill s withcolor .8white;
\stopuniqueMPgraphic
\defineoverlay
[encadrement]
[\uniqueMPgraphic{essai}]
\defineframed
[boxframed]
[frame=off
';
pair A; A:=q'intersectionpoint p';
pair B; B:=q intersectionpoint p';
pair C; C:=p intersectionpoint q;
pair D; D:=q'intersectionpoint p;
path s; s:= A--B--C--D--cycle;
fill s withcolor .8white;
\stopuniqueMPgraphic
\defineoverlay
[encadrement]
[\uniqueMPgraphic{essai}]
\defineframed
.7white;
StopPage;
\stopuniqueMPgraphic
\defineoverlay[figram][\uniqueMPgraphic{figram}]
\setupbackgrounds[page][background=figram]
\starttext
\dorecurse{10}{\input knuth}
\stoptext
___
If your question is of interest
(beforetext: preset=righttop)? - Related code given before:
\starttext
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
\startsetups[beforetext]
\setlayer[beforetext][preset=righttop
A
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
\startsetups[beforetext]
\setlayer[beforetext][preset=righttop]{\framed[width=2in]{\directlua{context(userdata.LPr.text)}}}
\stopsetups
,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
\startsetups[beforetext]
\setlayer[beforetext][preset=righttop]{\framed[width=2in]{\directlua{context(userdata.LPr.text)}}}
\stopsetups
\startluacode
userdata = userdata
, and each \setlayer takes one value
back, so we can simplify to:
\setupbodyfont[30pt]
\starttext
A
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
\startsetups[beforetext]
\setlayer
to the top right corner of the page from
within \start/stop-TEXpage, where page size is not known in advance?
\setupbodyfont[30pt]
\starttext
A
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext
... Thanks again.
On Tue, 15 Jan 2013 11:09:48 +0100, Wolfgang Schuster
wolfgang.schus...@gmail.com wrote:
\setupbodyfont[30pt]
\starttext
A
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext
]
\starttext
\startoverlay
{\strut\red m}
{\strut\green a}
{\strut\blue l}
\stopoverlay
\stoptext
After you do know now what overlays are I come to the real overlay mechanism.
Overlays are created with the \defineoverlay command which takes a name for the
overlay and its content
and vertical centered.
\setupbodyfont[40pt]
\starttext
\startoverlay
{\strut\red m}
{\strut\green a}
{\strut\blue l}
\stopoverlay
\stoptext
After you do know now what overlays are I come to the real overlay mechanism.
Overlays are created with the \defineoverlay command which takes a name
horizontal and vertical centered.
\setupbodyfont[40pt]
\starttext
\startoverlay
{\strut\red m}
{\strut\green a}
{\strut\blue l}
\stopoverlay
\stoptext
After you do know now what overlays are I come to the real overlay mechanism.
Overlays are created with the \defineoverlay command
:= unitsquare
xscaled OverlayWidth yscaled OverlayHeight ;
fill p withcolor .8white ;
draw p withcolor .625red ;
\stopuseMPgraphic
\defineoverlay[button][\useMPgraphic{wrong or right}]
\setupbuttons[background=button,frame=off]
\setupinteraction[state=start
\stopluacode
\defineoverlay
[BitMess]
[{\scale
[width=\dimexpr\overlaywidth+2ex,height=\dimexpr\overlayheight+2ex]
{\ctxlua{document.TestBitmap(\number\dimexpr\overlaywidth,\number\dimexpr\overlayheight)}}}]
\framed
[width=10cm,
height=10cm,
frame=off,
background={BitMess,color
(uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopuseMPgraphic
\defineoverlay
[alpha]
[\useMPgraphic{alpha}]
\startreusableMPgraphic{beta}
fill unitsquare
xyscaled (\overlaywidth, \overlayheight)
withcolor (uniformdeviate 1, uniformdeviate 1, uniformdeviate 1);
\stopreusableMPgraphic
layer take a look at this wiki page:
http://wiki.contextgarden.net/Layers#Use_dynamic_content
here is another variant:
\defineoverlay[pagenumber:preset][\texsetup{pagenumber:preset}]
\startsetups pagenumber:preset
PRESET
\stopsetups
\defineoverlay[pagenumber:action][\texsetup
) --
(\overlaywidth,\overlayheight) -- (0,\overlayheight) -- cycle;}
\stoptikzpicture}
\defineoverlay[decoration][\TIKZdecorationoverlay]
\setupframed
[decoration=snake]
\starttext
\framed[frame=off, rulethickness=3bp, background=decoration,
backgroundoffset=3mm, framecolor=red, align
to OverlayBox;
\stopuseMPgraphic
\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]
\starttext
\bTABLE
\setupTABLE[align=middle]
\setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm]
\setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm
kludgy.
Perhaps there is a better way...
Michael
\startuseMPgraphic{MP:thickBtm}
draw bottomboundary OverlayBox withpen pensquare scaled
\frameddimension{bottomrulethickness};
clip currentpicture to OverlayBox;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay
to OverlayBox;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]
\starttext
\bTABLE % Overlay method
\setupTABLE[align=middle]
% By eye, by trial: boffset = bottomrulethickness/2 - 0.2mm
\setupTABLE[header
black ;
setbounds currentpicture to a ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame,
offset=\bodyfontsize, width=\overlaywidth]%.8\textwidth]
\def\StartFrame{\startFunnyText}
\def\StopFrame {\stopFunnyText
);
draw leftcorner -- rightcorner;
\stopuseMPgraphic
\defineoverlay
[DiagonalRule]
[\useMPgraphic{DiagonalRule}]
\define[2]\DiagonalLabel{%
\setuptabulate [after={\blank[\frameddimension{offset}]}]
\starttabulate [|p|r|]
\NC\NC #2 \NC\NR
\NC #1 \NC\NC\NR
\stoptabulate
})
shifted (\frameddimension{offset},\frameddimension{offset}) ;
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic
\defineoverlay[table:line:diagonal][\useMPgraphic{table:line:diagonal}]
\starttext
\bTABLE[width=4cm,height=4cm]
\bTR
\bTD[background=table:line:diagonal
) withcolor red withpen pencircle
scaled 2pt;
\stopusableMPgraphic
\defineoverlay[myOverlay][\useMPgraphic{myFrame}]
\defineframedtext[myStatement][frame=off]
\setupframedtexts[myStatement][background=myOverlay,offset=overlay,autowidth=force]
\starttext
\framed[strut=no]{\startmyStatement FIRST
green;
draw (currentpicture enlarged 2cm) withcolor red withpen pencircle scaled
2pt;
\stopusableMPgraphic
\defineoverlay[myOverlay][\useMPgraphic{myFrame}]
\defineframedtext[myStatement][frame=off]
\setupframedtexts[myStatement][background=myOverlay,offset=overlay,autowidth=force]
\starttext
OverlayBox withpen pencircle scaled 1pt withcolor green;
draw (currentpicture enlarged 2cm) withcolor red withpen pencircle
scaled 2pt;
\stopusableMPgraphic
\defineoverlay[myOverlay][\useMPgraphic{myFrame}]
\defineframedtext[myStatement][frame=off]
\setupframedtexts[myStatement][background=myOverlay
green;
You could also use
draw OverlayBox withpen ...
draw (d enlarged 2cm) withcolor red withpen pencircle scaled 2pt;
draw boundingbox currentpicture withpen pencircle scaled .1mm dashed
evenly withcolor blue ;
\stopusableMPgraphic
\defineoverlay[myOverlay][\useMPgraphic{myFrame
(-OverlayWidth/2,-OverlayHeight/2)) withpen pencircle scaled 1pt
withcolor green;
draw (d enlarged 2cm) withcolor red withpen pencircle scaled 2pt;
draw boundingbox currentpicture withpen pencircle scaled .1mm dashed
evenly withcolor blue ;
\stopusableMPgraphic
\defineoverlay[myOverlay
\defineoverlay [verticalline] [\useMPgraphic{verticalline}]
\setupbackgrounds [text] [background=verticalline]
\definecolumnset [example] [n=2]
\starttext
\startcolumnset [example]
\input knuth
\stopcolumnset
\stoptext
Marco
to OverlayBox ;
\stopuseMPgraphic
that (experimental) mechanism has been removed (maybe something else get
in place, like regions we have already elsewhere)
\defineoverlay [verticalline] [\useMPgraphic{verticalline}]
\setupbackgrounds [text] [background=verticalline]
\definecolumnset [example] [n=2
Dear Thomas,
I tested making my simpleslides module SsuWave by modifying
simpleslides-s-Rounded.tex
(1) I just replaced MP figures for horizontal and title with some figures as
follows for test :
\defineoverlay
[simpleslides:background:horizontal]
% [\useMPgraphic{simpleslides:MP:horizontal
Am 19.07.2012 um 16:27 schrieb dalyoung:
Dear Thomas,
I tested making my simpleslides module SsuWave by modifying
simpleslides-s-Rounded.tex
(1) I just replaced MP figures for horizontal and title with some figures as
follows for test :
\defineoverlay
:
\defineoverlay
[simpleslides:background:horizontal]
[{\externalfigure[/Users/graph/Documents/figures/background/ssuwave1][]}]
And I would advice to have a look at the directory key of
\setupexternalfigures. It is almost always a mistake to have a hard
coded path in the code.
Marco
page.
Is there a way to do such a job?
2. Is it possible to use my own figure as a background under the simpleslide
module?
-- Example--
\usemodule[simpleslides][style=HorizontalStripes,font=]
\defineoverlay[yellow-spring][{\externalfigure[./background/yellowspring][width=\paperwidth
at last appeared at the header of every page.
Is there a way to do such a job?
2. Is it possible to use my own figure as a background under the simpleslide
module?
-- Example--
.
\usemodule[simpleslides][style=HorizontalStripes,font=]
.
\defineoverlay[yellow-spring][{\externalfigure
{\externalfigure
[Makeup/Images/Background.png]
[align=center,
\paperwidth,
\paperheight]} % the actual contents of the layer
less code:
\defineoverlay
[BackgroundImage]
[\overlayfigure{Makeup/Images/Background.png}]
, the following
on second page,
\setupbackgrounds[page][background=BackgroundImage]
. But this does not work properly. What ends up happening is the cover
image is displayed correctly, but every page after that just has a blank
white background.
\setupexternalfigures[directory=Makeup/Images]
\defineoverlay
On Mon, 2012-07-09 at 10:06 +0200, Wolfgang Schuster wrote:
\setupexternalfigures[directory=Makeup/Images]
\defineoverlay
[backgroundimage]
[{\ifnum\rawcountervalue[userpage]=1\relax
\overlayfigure{Cover}%
\else
\overlayfigure{Background}%
\fi
301 - 400 of 788 matches
Mail list logo