\stopuseMPgraphic
>
> % Define an overlay using the above image...
> \defineoverlay[textcircle][\useMPgraphic{textcircle}]
>
> % Define a frame we can use via \textcircled{X} that uses as its
> background
> % the above overlay...
> \defineframed
draw fullcircle
xscaled OverlayWidth
yscaled OverlayWidth
withcolor OverlayLineColor;
\stopuseMPgraphic
% Define an overlay using the above image...
\defineoverlay[textcircle][\useMPgraphic{textcircle}]
% Define a frame we can use via \textcircled{X} t
fullcircle
xscaled OverlayWidth
yscaled OverlayWidth
withcolor OverlayLineColor ;
\stopuseMPgraphic
\defineoverlay[textcircle][\useMPgraphic{textcircle}]
\defineframed
[textcircled]
[ width=1.5em,
height=1.5em,
frame=off,
background
> xscaled OverlayWidth
> yscaled OverlayWidth
> withcolor OverlayLineColor ;
> \stopuseMPgraphic
>
> \defineoverlay[textcircle][\useMPgraphic{textcircle}]
>
> \defineframed
> [textcircled]
> [ width=1.5em,
> height=1.5em
erlayWidth,
y = OverlayHeight/2, ] ;
\stopuniqueMPgraphic
\defineoverlay
[svgback]
[\useMPgraphic{centered_svg}]
\defineframed[Sback][location=low,background=svgback,frame=off,offset=8pt]
\starttext
this is a sample \Sback{1} text
\stoptext
Hello Seyal,
This does work but
> y = OverlayHeight/2, ] ;
> \stopuniqueMPgraphic
>
> \defineoverlay
> [svgback]
> [\useMPgraphic{centered_svg}]
>
> \defineframed[Sback][location=low,background=svgback,frame=off,offset
> =8pt]
>
> \starttext
> this is a sample \Sback{1} text
>
if you don't want to use metapost you can also use svg for background
for example:
\startuniqueMPgraphic{centered_svg}
draw lmt_svg [
filename = "badge.svg",
width = OverlayWidth,
y = OverlayHeight/2, ] ;
\stopuniqueMPgraphic
\defineoverlay
[svgback]
[\us
) ;
fill SavedShape withcolor red;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\showframe
\defineoverlay[myoverlay][\useMPgraphic{shape:2}]
\setupbackgrounds[text][text][background=myoverlay]
\startsection[title={test}]
\startshapedparagraph[mp=shape:1]%
\setupalign[verytolera
;
build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ;
fill p withcolor \MPcolor{tan};
\stopuseMPgraphic
\defineoverlay[myoverlay][\useMPgraphic{mymetafunpath}]
%--
\define[2]\MySubSectionCommand
;
drawoptions (withpen pencircle scaled .25pt withcolor blue) ;
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
%draw boundingbox p ; %%%quitamos el frame pequeño
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame
urcorner p,h) ;
%draw boundingbox p ; %%%quitamos el frame pequeño
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off,
background=FunnyFrame, align
,myheighta) -- (4cm,myheightb) -- (6cm,myheightb)
--
(6cm,myheight) -- (0cm,myheight) -- cycle;
build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ;
fill p withcolor \MPcolor{lightyellow};
\stopuseMPgraphic
\defineoverlay[ol1][\useMPgraphic{mp1
fullsquare xscaled r yscaled e shifted (r/2, h/2) withcolor darkred;
\stopuseMPgraphic
\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]
\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]
\starttext
\dorecurse{10}{\input tufte\page}
\stoptext
Any clue is warmly
darkred;
\stopuseMPgraphic
\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]
\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]
\starttext
\dorecurse{10}{\input tufte\page}
\stoptext
Any clue is warmly welcome
1pt withcolor
darkred;
draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor
darkred;
draw p;
setbounds currentpicture to boundingbox currentpicture enlarged 2mm;
\stopuseMPgraphic
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
\setupwhitespace[medium]
\
tch_amount := 1 + (uniformdeviate 2);
sketch_passes := 3;
sketch_segments := 2 + (uniformdeviate 3);
sketch_length := OverlayWidth / 3;
draw topboundary withpen pensquare withcolor lightgray;
naturalizepaths;
\stopuseMPgraphic
\defineoverlay[sketchylines][\useMPgraphic{mp:sketchy}]
\setupTABLE[
(OverlayBox is the size
of the cell).
begin example
\startuseMPgraphic{dottedborder}
draw OverlayBox withpen pencircle scaled 2 dashed withdots
withcolor "red";
\stopuseMPgraphic
\defineoverlay[dottedborder][\useMPgraphic{dottedborder}]
\starttext
\bTABLE[frame=off,
example
\startuseMPgraphic{dottedborder}
draw OverlayBox withpen pencircle scaled 2 dashed withdots withcolor
"red";
\stopuseMPgraphic
\defineoverlay[dottedborder][\useMPgraphic{dottedborder}]
\starttext
\bTABLE[frame=off,background=dottedborder]
Thank you!
Since I needed only horizo
OverlayBox withpen pencircle scaled 2 dashed withdots withcolor
"red";
\stopuseMPgraphic
\defineoverlay[dottedborder][\useMPgraphic{dottedborder}]
\starttext
\bTABLE[frame=off,background=dottedborder]
\bTR
\bTD Hello Table! \eTD
\eTR
\eTABLE
\stoptext
end example
7:56 am, Mikael Sundqvist wrote:
> >
> > Hi,
> >
> > not sure I get what you are missing. But you can try
> >
> > setbounds currentpicture to (fullsquare scaled 200) ;
> >
> > in base. And then do
> >
> > \dorecurse{5}{
> > \start
ages entry
> with it. Feel free to modify.
>
> Cheers
> Emanuel
>
> On Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote:
>
> Hi,
>
> not sure I get what you are missing. But you can try
>
> setbounds currentpicture to (fullsquare scaled 200) ;
>
>
. And then do\dorecurse{5}{\startTEXpage[offset=1DK]\useMPgraphic{layerset#1}\stopTEXpage}if that is the looping you are after./MikaelOn Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context wrote:>> Resp. the solution should be such that each generated PDF page has the same dimension, th
ot sure I get what you are missing. But you can try
> setbounds currentpicture to (fullsquare scaled 200) ;
> in base. And then do
> \dorecurse{5}{
> \startTEXpage[offset=1DK]
> \useMPgraphic{layerset#1}
> \stopTEXpage
> }
>
> if that is the looping you are after.
> /M
Hi,
not sure I get what you are missing. But you can try
setbounds currentpicture to (fullsquare scaled 200) ;
in base. And then do
\dorecurse{5}{
\startTEXpage[offset=1DK]
\useMPgraphic{layerset#1}
\stopTEXpage
}
if that is the looping you are after.
/Mikael
On Fri, Feb 16, 2024 at 6:54 AM
actually need to keep the \dorecurse mechanism of the mwe (from line 44
> on), because I need the "setbounds currentpicture to TheFrame" and also
> because I need page numbering inside the MPpage, as done with draw
> textext(decimal(currentime)).
> So, how can I use t
Dear Mikael,
I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on),
because I need the "setbounds currentpicture to TheFrame" and also because I
need page numbering inside the MPpage, as done with draw
textext(decimal(currentime)).
So, how can I use the \us
icture layerC;
> layerC:=image(
> label("Wort 4", z3+z1);
> );
>
> picture layerY;
> layerY:=image(
> label("Nummer 5", z2+z3);
> );
>
> picture layerU;
> layerU:=image(
> label("number 6", z2+z1);
> );
> \stopuseMPgraphic
>
rtuseMPgraphic{layerset2}
\includeMPgraphic{layerset1} ;
draw layerY ;
\stopuseMPgraphic
\startuseMPgraphic{layerset3}
\includeMPgraphic{layerset2} ;
\includeMPgraphic{Gamma} ;
\stopuseMPgraphic
\startuseMPgraphic{layerset4}
\includeMPgraphic{layerset2} ;
draw layerU ;
\stopuseMPgraphic
\startu
ed 1mm rightenlarged 1mm; draw topboundary OverlayBox leftenlarged 1mm rightenlarged 1mm;\stopuseMPgraphic\defineoverlay [verticalrule] [\useMPgraphic{verticalrule3}]\setuppagenumbering[state=stop]\setupexternalfigures[location={local,defalut}]\definecolumnset [quiz] [n=2,background=vertic
leftenlarged 1mm rightenlarged 1mm;\stopuseMPgraphic\defineoverlay [verticalrule] [\useMPgraphic{verticalrule3}]\setuppagenumbering[state=stop]\setupexternalfigures[location={local,defalut}]\definecolumnset [quiz] [n=2,background=verticalrule]\setupbodyfont[bonum, rm, 11pt]\starttext %\startcolumns[n=2
;), .75A + .25B);\stopuseMPgraphic\starttext\dorecurse{4}{\startcombination[3*1]%distance=0mm]{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}\stopcombination\startcombination[3*1]%distance=0mm]{\useMPg
xyscaled
(OverlayWidth-OverlayLineWidth,OverlayHeight-OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayColor ;
\stopusableMPgraphic
\defineoverlay[MetaCirc][\useMPgraphic{MetaCirc}]
a\dontleavehmode\framed
[background=MetaCirc,
bac
withcolor OverlayColor ;
\stopusableMPgraphic
\defineoverlay[MetaCirc][\useMPgraphic{MetaCirc}]
\framed
[background=MetaCirc,
backgroundcolor=red,
frame=off,
rulethickness=1pt]
{test}
\framed
[background=MetaCirc,
backgroundcolor=blue,
rulethickness=.5pt]
{test}
is more
;
draw b;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay
[CountFrame]
[\useMPgraphic{CountFrame}]
\defineframedtext
[CountFramedText]
[frame=off,
background=CountFrame,
offset=\bodyfontsize,
width=\textwidth,
% style={\switchtobodyfont[11pt,tt]}]
bod
ndingbox p enlarged (o/10);
drawoptions (withpen pencircle scaled 1pt withcolor black);
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h);
draw b;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay
[CountFrame]
[\useMPgraphic{
boundingbox p ;
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame]
\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{FunnyFrame
2)) ...
> endfor
> (OverlayWidth,yoffset)--(OverlayWidth,0)--cycle;
> fill wave withcolor "Sea";
> endfor;
>
> pair pos;
> pos := (OverlayWidth * RealPageNumber/NOfPages, height/2 randomized 2);
> path ship;
> ship := (0,10)---(70,10)...(60,0)---(10,0)...cycle;
&
= (0,10)---(70,10)...(60,0)---(10,0)...cycle;
fill ship xysized (10,5) shifted pos rotatedaround (pos, 15) withcolor red;
\stopuseMPgraphic
\defineoverlay[Waves][\useMPgraphic{Waves}]
\setupbackgrounds[state=repeat]
\setupbackgrounds[page][background={Waves}]
\starttext
\dorecurse{10}{\recurs
\setupbackgrounds[state=repeat].
\setuppapersize[SW]
\startuseMPgraphic{Blocks}
fill unitsquare xysized (OverlayWidth * PageNumber / LastPageNumber,
OverlayHeight) withcolor blue;
%setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay[Blocks][\useMPgraphic{Blocks}]
\setupbackgrounds[state
tsquare xysized (800 * RealPageNumber/NOfPages, 50) withcolor blue;
\stopuseMPgraphic
\defineoverlay[Blocks][\useMPgraphic{Blocks}]
\setupbackgrounds[footer][background={Blocks}]
\starttext
\dorecurse{10}{\recurselevel\page}
\stopt
welcome. My MWE:
\setuppapersize[S6]
\startuseMPgraphic{itemize:toc}
save p; path p;
p := ( (0,-0.5)--(0,0.5)--(0.866,0)--cycle ) scaled 1.5ExHeight;
fill p withcolor \MPcolor{Black};
\stopuseMPgraphic
\definesymbol[itemize:toc][\useMPgraphic{itemize:toc}]
\definelistalternative
[toclist
ithcolor .625yellow) ;
> draw fullcircle xscaled 1.5cm yscaled 1cm ;
> \stopuseMPgraphic
>
> %\startnotmode[proof]
> % \defineoverlay[circled][\useMPgraphic{circled}]
> %\stopnotmode
>
> \define[1]\Circled%
> {\framed
> [background=circled,frame=off,offset=overlay]
>
ons(withcolor (.6+uniformdeviate.35)*white) ;
fill fullcircle xscaled 1.5cm yscaled 1cm ;
drawoptions(withcolor .625yellow) ;
draw fullcircle xscaled 1.5cm yscaled 1cm ;
\stopuseMPgraphic
%\startnotmode[proof]
% \defineoverlay[circled][\useMPgraphic{circled}]
%\stopnotmode
\define[1]\Circ
ot;x","vdw(3,x)+vdw(2,x)+vdw(1,x)+vdw(0,x)",epsed(-1),epsed(1),1/1000)
scaled u ;
\stopuseMPgraphic
\startplacefigure[reference=fig:vdw]
\startcombination[nx=2,ny=4]
{\useMPgraphic{vanderwaerden0}} {(a)}
{\useMPgraphic{vanderwaerden0}} {(b)}
{\useMPgraphic{vanderwaerden1}}
led (0,2) shifted ( (i-1)*factor,-diff-0.85cm)
withcolor blue ;
else :
fill p shifted ( (i-1)*factor, 0)
withcolor red ;
fi ;
endfor ;
StopPage ;
\stopuseMPgraphic
\defineoverlay
[Ornament]
[\useMPgraphic{ornament}]
\setupbackgrounds[page]
[state=rep
I would suggest the approach of Wolfgang because the standard setting of
\framed(texts)’ width is fit and the height setting can be changed to this too.
Further I would suggest to use an overlay and a Metafun graphic for the
cut-indicators.
\defineoverlay[Cutpointstight][\useMPgraphic
leftenlarged 1mm rightenlarged 1mm;
draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm;
draw rightboundary OverlayBox shifted (1mm,0);
draw leftboundary OverlayBox shifted (-1mm,0);
\stopuseMPgraphic
\defineoverlay
[headerBox]
[\useMPgraphic{squareBox}]
\startuseMPgraphic
(\MPvar{tt})
(withcolor .75white)
(withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick});
\stopuseMPgraphic
\definefont[BigFontOne][NotoSansCJKkr-Bold sa 4]
\define[1]\outlineTitle{\useMPgraphic{outlineT}{tt="#1"}}
\setuphead[chapter]
[textcommand=\outlineTit
{\useMPgraphic{outlineT}{tt="#1"}}
\setuphead[chapter]
[textcommand=\outlineTitle,
style=\BigFontOne,
numbercommand=\outlineTitle,
% align = middle,
number=yes]
\setupexternalfigures[location={default,local,global}]
%\definefont[fancy][Zapfino at 24pt]
\starttext
\startchapter[title={Very Long
ted (i*5pt, 0pt)
withcolor if i < PageNumber : red
else : black
fi ;
endfor ;
StopPage ;
\stopuseMPgraphic
\defineoverlay[background:ornament][\useMPgraphic{MP:ornament}]
\setupbackgrounds[page][background={background:ornament}]
\set
else : black
fi ;
endfor ;
StopPage ;
\stopuseMPgraphic
\defineoverlay[background:ornament][\useMPgraphic{MP:ornament}]
\setupbackgrounds[page][background={background:ornament}]
\setupbodyfont[ss,18pt]
\starttext
\dorecurse{10}{
\strut\par
; exact same dimensions as my page. I'd like to set that graphic as a
> > background. How do I do this?
>
> (Again, untested)
>
> \startuseMPgraphic{background-image}
> input graphic.mp;
> \stopuseMPgraphic
>
> \defineo
{background-image}
input graphic.mp;
\stopuseMPgraphic
\defineoverlay[background-image][\useMPgraphic{background-image}]
\setupbackgrounds[page][background={background-image}]
Aditya
___
If your question is of interest t
{transparentred} ;
\stopuseMPgraphic
\defineoverlay[myOL1][\useMPgraphic{mytest1}]
\defineoverlay[myOL2][\useMPgraphic{mytest2}]
%===
\defineframed
[MyBigFrame]
[offset=-0.26pt,
frameoffset=0pt,
frame=off,
strut=yes,
before
,TextHeight+\mygap-\posB*LineHeight) --
(0.0*TextWidth,TextHeight+\mygap-\posB*LineHeight) --
cycle ;
lmt_parshape [path = p] ;
draw p withpen pencircle scaled \mypen ;
endgroup ;
\stopuseMPgraphic
\defineoverlay[myOL1][\useMPgraphic{mytest1}]
\defineoverlay[myOL2
).
\defineoverlay[TextBubbleRxOverlay][\useMPgraphic{TextBubble}{side=0}]
\defineframedtext[TextBubbleRxFrame][TextBubbleFrame][
background=TextBubbleRxOverlay,
location=left,
]
% Send text (right-facing).
\defineoverlay[TextBubbleTxOverlay][\useMPgraphic{TextBubble}{side=1}]
\defineframedtext
b := urcorner chap_frame ;
pos := urcorner Field[Text][RightMarginSeparator] - ulcorner chap_frame
- (-1mm,skip) ;
fill chap_frame shifted pos withcolor "chap_frame" ;
draw Chap rotated 90 shifted (xpart pos-4mm,ypart pos) ;
StopPage ;
\stopuseMPgraphic
\defi
,
height=fit]
\startuseMPgraphic{page}
StartPage;
draw Area[Text][Text]
shifted (InnerMarginWidth,BottomHeight+FooterHeight);
draw Field[Text][Text] withcolor blue;
StopPage;
\stopuseMPgraphic
\defineoverlay[page][\useMPgraphic{page
>> and output below, for anyone who is interested.
>> Even when I’m a bit confused, I’m glad to be working with ConTeXt rather
>> than any other system!
>
> % your hack:
>
> \define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,boffset=-\strutdep
=-\strutdepth,xframe=off]{\useMPgraphic{name}}}
% but ... you just don't want struts
\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,strut=no,frame=off]{\useMPgraphic{name}}}
% and no offset but also no invisible frame
\define[1]\mycolordot{\def\mycolor{#1}\framed[location
]{\useMPgraphic{name}}}
Here are a few great looking multiple choice questions about colors.
\startquestions
\question What is your favorite color?
\startchoices[columns,four]
\choice \mycolordot{.625red}
\choice \mycolordot{.625blue}
\choice \mycolordot{.625green}
\choice \mycolordot
withcolor \mycolor;
\stopuseMPgraphic
\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,frame=off]{\useMPgraphic{name}}}
What is your favorite color? (There is too much space after these choices.)
\startchoices[columns,four]
\choice \mycolordot{.625red}
\choice \mycolordot
gt; > u:=.095cm;
> > draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted
> > (0u,-0u);
> > draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted
> > (0u,-5u);
> > \stopuseMPgraphic
> > \useMPgraphic{mapa}
> > \stopte
;
\stopuseMPgraphic
\useMPgraphic{mapa}
\stoptext
But instead I got two huge sprites of 2.8 cm x 4.4 cm.
Am I forgetting something?
Originally that worked because the image was always 'included' at 1 bp
and then scaled but that was (1) inaccurate and (2) a bit depending on
the image and (3) cou
[termes,8pt]}]
\startuseMPgraphic{mapa}
u:=.095cm;
draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted
(0u,-0u);
draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted
(0u,-5u);
\stopuseMPgraphic
\useMPgraphic{mapa}
\stoptext
But instead I got two huge
s follows to produce a stylized 'title' head:
\setupMPtext{TitleText}{%
\starteffect[stretch]\bfc\namedstructurevariable{title}{title}\stopeffect}
\useMPgraphic{TitleGraphic}
low level pdf magic ... so not done in mp
[colors "titlefg" and "titleoutline" are set using \define
gt; \stopuseMPgraphic
>
> which I tried to use as follows to produce a stylized 'title' head:
>
> \setupMPtext{TitleText}{%
> \starteffect[stretch]\bfc\namedstructurevariable{title}{title}\stopeffect}
> \useMPgraphic{TitleGraphic}
>
> [colors "titlefg" and
etupMPtext{TitleText}{%
\starteffect[stretch]\bfc\namedstructurevariable{title}{title}\stopeffect}
\useMPgraphic{TitleGraphic}
[colors "titlefg" and "titleoutline" are set using \definecolor]
But, the 'stretch' effect caused by \starteffect[stretch]…\stopeffect does not
work with 'outl
ted (-1mm,0); %if CurrentColumn = 2:
shifted(2mm,0) fi ;
draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm;
\stopuseMPgraphic
\defineoverlay
[headerBox]
[\useMPgraphic{squareBox}]
\startuseMPgraphic{verticalrule3}
draw rightboundary OverlayBox shifted (1m
ted (-1mm,0); %if CurrentColumn = 2:
shifted(2mm,0) fi ;
draw bottomboundary OverlayBox leftenlarged 1mm rightenlarged 1mm;
\stopuseMPgraphic
\defineoverlay
[headerBox]
[\useMPgraphic{squareBox}]
\startuseMPgraphic{verticalrule3}
draw rightboundary OverlayBox shifted (1m
:= q rotated 20 ;
drawarrow q withpen pencircle scaled .5mm withcolor green ;
draw followtext(q, "\strut TEXT TWO") ;
\stopuseMPgraphic
\useMPgraphic{empedocless}
___
If your question is of interes
a withpen pencircle scaled 2mm;
q := p cutafter a ;
q := q rotated 20 ;
drawarrow q withpen pencircle scaled .5mm withcolor green ;
draw followtext(q, "\strut TEXT TWO") ;
\stopuseMPgraphic
\useMPgraphic{empedocless}
So, just always start at point 0 and then just rotate t
aw followtext(S[18], "\strut\hbox to 2em{\EmpArrow}\hskip2em
RUHEPAUSE\hskip4em\strut") ;
draw followtext(S[19], "\strut\hbox to 2em{\EmpArrow}EINHEIT
(SPHAIROS)\hskip2em\strut") ;
\stopuseMPgraphic
\useMPgraphic{empedocles}
\stoptext
I have a big problem and some smaller ques
\hskip2em
RUHEPAUSE\hskip4em\strut") ;
draw followtext(S[19], "\strut\hbox to 2em{\EmpArrow}EINHEIT
(SPHAIROS)\hskip2em\strut") ;
\stopuseMPgraphic
\useMPgraphic{empedocles}
\stoptext
I have a big problem and some smaller questions, for those who are
better at math and at metaf
Pict /2 , (bbheight Pict / -2) ) ;
Pict := Pict rotated 45;
Pict := Pict shifted (.5PaperWidth, .5PaperHeight) ;
draw Pict withcolor darkyellow ;
StopPage ;
\stopuseMPgraphic
%-
\defineoverlay[MonOverlay][\useMPgraphic{MonGraphique}]
\setupbackgrounds[page][background=MonOverlay
color .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[rFrame][\useMPgraphic{red
leftenlarged (BackSpace + 5mm)
rightenlarged ExHeight
withcolor "lightgray";
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\defineoverlay
[acframe]
[\useMPgraphic{acframe}]
\defineframed
[ACFRAME]
[...,
background=acframe,
...]
; > == End of Example
> =
> >
> > That didn't seem to have any effect.
> >
> > Is there a way to have every odd row of every table in my document
> > have color background?
>
> \startuseMPgraphic{xtablerow}
[\ifodd\currentxtablerow
\useMPgraphic{xtablerow}%
\fi]
\starttext
\startxtable[frame=off,background=xtablerow]
\dorecurse{20}
{\startxrow
\startxcell Column 1 \stopxcell
\startxcell Column 2 \stopxcell
\stopxrow}
\stopxtable
\stoptext
Dear Hans, Wolfgang,
Both of your methods are working well.
Using \frame, the \dorecurse problem is solved.
\starttext
\startanimation[menu=yes]
\dorecurse{10}
{ \frame{\useMPgraphic[stacking={#1}]{demo}}}
\stopanimation
\stoptext
Thank you for your solutions.
Best regards,
Dalyoung
apterframe]
[\useMPgraphic{chapterframe}]
\defineframedtext
[ChapterFrame]
[frame=off,
background=chapterframe,
width=max,
height=6cm,
after={\blank[2*line]},
offset=0pt]
\setuphead
[chapter]
[align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
;
endfor ;
\stopuseMPgraphic
\unprotect
\tolerant\protected\def\useMPanimation[#1]#2%
{\begingroup
\scratchtoks\emptytoks
\dorecurse{10}{\etoksapp\scratchtoks{{\useMPgraphic[\c!stacking={\recurselevel}]{#2%
\expanded{\startanimation[#1]\the\scratchtoks
;
\stopuseMPgraphic
\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
% \dorecurse{10}
% { {\useMPgraphic[stacking={#1}]{demo}}}
{\useMPgraphic[stacking={1}]{demo}}
{\useMPgraphic[stacking={2}]{demo}}
{\useMPgraphic[stacking={3}]{demo}}
{\useMPgraphic[stacking={4
[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
% \dorecurse{10}
% { {\useMPgraphic[stacking={#1}]{demo}}}
{\useMPgraphic[stacking={1}]{demo}}
{\useMPgraphic[stacking={2}]{demo}}
{\useMPgraphic[stacking={3}]{demo}}
{\useMPgraphic[stacking={4}]{demo}}
{\useMPgraphic
\unprotect
\tolerant\protected\def\useMPanimation[#1]#2%
{\begingroup
\scratchtoks\emptytoks
\dorecurse{10}{\etoksapp\scratchtoks{{\useMPgraphic[\c!stacking={\recurselevel}]{#2%
\expanded{\startanimation[#1]\the\scratchtoks\stopanimation}%
\endgroup}
\protect
;
\stopuseMPgraphic
\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
% \dorecurse{10}
% { {\useMPgraphic[stacking={#1}]{demo}}}
{\useMPgraphic[stacking={1}]{demo}}
{\useMPgraphic[stacking={2}]{demo}}
{\useMPgraphic[stacking={3}]{demo}}
{\useMPgraphic[stacking={4
Dear Aditya,
Thank you for your code and an explanation.
> Let's assume that the last MPpage was a \startuseMPgraphic{boxes}
> \stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation.
> On the first slide, I can use
>
> \useMPgraphic[stacking=0]{boxe
On the first slide, I can use
> >
> >\useMPgraphic[stacking=0]{boxes}
> >
> > to show the three boxes, and on the next slide, I can use
> >
> >\useMPgraphic[stacking={-1,0}]{boxes}
> >
>
> I tried to reproduce your example using \start
's assume that the last MPpage was a \startuseMPgraphic{boxes}
\stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On
the first slide, I can use
\useMPgraphic[stacking=0]{boxes}
to show the three boxes, and on the next slide, I can use
\useMPgraphic[stacking={-1
's assume that the last MPpage was a \startuseMPgraphic{boxes}
\stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On
the first slide, I can use
\useMPgraphic[stacking=0]{boxes}
to show the three boxes, and on the next slide, I can use
\useMPgraphic[stacking={-1
et's assume that the last MPpage was a \startuseMPgraphic{boxes}
\stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On
the first slide, I can use
\useMPgraphic[stacking=0]{boxes}
to show the three boxes, and on the next slide, I can use
\useMPgraphic[stacki
pencircle scaled 2mm ;
endfor ;
draw boundingbox currentpicture
withpen pencircle scaled 1pt
withstacking 0 ;
currentpicture := currentpicture xsized 15mm;
\stopuseMPgraphic
\setupMPvariables[demo]
\startTEXpage
\vskip1ex
\hbox{\space\dore
pencircle scaled 2mm ;
endfor ;
draw boundingbox currentpicture
withpen pencircle scaled 1pt
withstacking 0 ;
currentpicture := currentpicture xsized 15mm;
\stopuseMPgraphic
\setupMPvariables[demo]
\startTEXpage
\vskip1ex
\hbox{\space\dore
ithstacking (if odd(i) : i else : 5 fi)
> withpen pencircle scaled 2mm ;
> endfor ;
> draw boundingbox currentpicture
> withpen pencircle scaled 1pt
> withstacking 0 ;
> currentpicture := currentpicture xsized 15mm;
> \stopuse
withstacking 0 ;
currentpicture := currentpicture xsized 15mm;
\stopuseMPgraphic
\setupMPvariables[demo]
\startTEXpage
\vskip1ex
\hbox{\space\dorecurse{10}{\useMPgraphic{demo}{list={0,#1}}\space}}
\vskip1ex \nointerlineskip
\hbox{\space\dorecurse{10}{\useMPgraphic{demo}{list={0,1
{\udCount}
{\useMPgraphic{foldUD}{num=\recurselevel}}
{\useMPgraphic{dotLines}{num=\recurselevel}}
%}
%\stopanimation
\stoptext
However, it draws all the figures under the \startanimation case.
There may be something I missed or there is something uncertain between
\dorecurse and \startanimation.
:= \MPvar{num}-1;
G := z[n-1];
grayUD(n);
\stopuseMPgraphic
\startuseMPgraphic{dotLines}{num}
numeric n;
n := \MPvar{num}-1;
linesUD(n);
\stopuseMPgraphic
\setupinteraction[state=start]
\usemodule[animation]
\starttext
%\startanimation[menu=yes]
%{
\dorecurse{\udCount}
{
On 6/24/2021 5:39 AM, Aditya Mahajan wrote:
You need to call the setglobalmacro(...) macro. The code inside
\startMPinitializations is only executed when you call any MP environment. But
you are using \udCount before \useMPgraphic. A simple solution is to run dummy
MP code so that MP
alcount("udCount",maxNum);
>
> \stopMPinitializations
>
> \startuseMPgraphic{foldUD}{num}
>numeric n;
>n := \MPvar{num}-1;
>G := z[n-1];
>grayUD(n);
> \stopuseMPgraphic
> \startuseMPgraphic{dotLines}{num}
>numeric n;
>n := \MPvar{n
n := \MPvar{num}-1;
G := z[n-1];
grayUD(n);
\stopuseMPgraphic
\startuseMPgraphic{dotLines}{num}
numeric n;
n := \MPvar{num}-1;
linesUD(n);
\stopuseMPgraphic
\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
\dorecurse{7}
{
{\useMPgraphic{f
1 - 100 of 925 matches
Mail list logo