Define the z[] values in the \startMPdefinitions block
> 2. Modified the drawing method in \startMPbuffer
>
> When I run it, it doesn’t recognize the z[] values defined already.
> I think that the z[] values are not delivered to \startbuffer.
> I tried \startMPinclusions, \startMPinitia
run it, it doesn’t recognize the z[] values defined already.
I think that the z[] values are not delivered to \startbuffer.
I tried \startMPinclusions, \startMPinitialization, but I couldn’t succeed.
1. How can I deliver the z[] values into the buffer?
2. What is wrong in the following code?
Thank
=middleblue]
\placebookmarks[section]
\setupexternalfigures[location=default]
\starttext
\startMPinclusions
color mycolor;
def gridscaled =
pair ur;
ur = urcorner currentpicture;
width := xpart ur;
height := ypart ur;
xstep := ceiling(width / 10);
ystep := ceiling(height / 10
-program = ConTeXt (LMTX)
\setupinteraction[state=start, color=middleblue]
\placebookmarks[section]
\setupexternalfigures[location=default]
\starttext
\startMPinclusions
color mycolor;
def gridscaled =
pair ur;
ur = urcorner currentpicture;
width := xpart ur;
height := ypart ur;
xstep
« AnImage » and a random text in
another picture called « AnotherImage », I can use these two pictures in the
first page of the document, but only one of them appears in the second page of
the document (with the same code). I know that if I replace
startMPinclusions/stopMPinclusions by
://wiki.contextgarden.net
>
> ___
>
% Metafun
% filename: moons.tex
% Boede 2021
% \setupbodyfont[plex,ss,14pt]
\defineMPinstance
[Moon]
[metafun]
[]
\startMPinclusions[]{Moon}
numeric w,h;
path p[];
pai
Dear Gavin,
I have managed to create an implementation for these operations which I
think I can convert into functions and put in startMPinclusions and then
use them from. there.
On Fri, Jan 12, 2024 at 9:42 PM Gavin via ntg-context
wrote:
> Hi Shiv,
>
> > Do we have a geometry
also p[k]; endfor
setbounds currentpicture to TheFrame ;
desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );
\stopMPpage
}
\stoptext
On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist wrote:
> Hi,
>
> I don
e
> position should be visible, and the text "Mot 2" in position p2 should be
> added. And so on.
>
> \startMPinclusions
>
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
>
> z1 = (60,40);
> z2 = (40,90);
> z3
Thank you Mikael,
this works!
Emanuel
On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseM
Hi,
I don't know if \startMPinclusions \stopMPinclusions shall work with
\startMPpage and \stopMPpage. In this case, one can use a separate
graphics:
\startuseMPgraphic{base}
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
p1:=
Hi Mikael,
here's a very simple mwe for the label(textext()) issue. On page 1, the text
"Word 1" should be drawn in position z1. On page 2, the same text in the same
position should be visible, and the text "Mot 2" in position p2 should be
added. And so on.
\startMPinc
t [serif] [notonaskharabic]
>> \usetypescript[serif][fallback]
>> \definefontsynonym [Serif] [notonaskharabic-Light]
>>[features=fea]
>> \definefontsynonym [SerifItalic] [notonaskharabic-Italic]
>> [features=fea]
askharabic-Bold-Italic] [features=fea]
> \stoptypescript
>
> \starttypescript [notonaskharabic]
> \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic]
> [default]
> \stoptypescript
>
> \usetypescript[notonaskharabic]
>
> \setupbodyfont [RomanFont]
>
> \usecolor
> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
> \definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
> \definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic]
> [features=fea]
> \stoptypescript
>
> \starttypescript [notonask
askharabic-Bold-Italic]
[features=fea]
\stoptypescript
\starttypescript [notonaskharabic]
\definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
\stoptypescript
\usetypescript[notonaskharabic]
\setupbodyfont [RomanFont]
\usecolors[crayola]
\startMPinclusions
picture p[];
path TheFrame ;
T
nce
\starttext
% We can put in the inclusions the material we will use at each page, to
declare things only one time.
\startMPinclusions
% the frame of the video ;
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
randomseed := 53 ;
path TheBrownianMotion ;
pair Coordinate[];
Coordinat
vconnect ("photon", __v1, __v2);
vfreeze;
vdraw;
endsubgraph;
endchar;
% the end.
end.
endinput;
So, I created a context file:
\startMPinclusions
input feynmp;
require_RCS_revision "1.30";
\stopMPinclusions
\starttext
\sta
, these annotations are not translated.
I have to prepare a set of pictures for every language.
Well, that changed last week.
Here is my first try (actually the 4th iteration):
%%%
\setupexternalfigures[location=default]
\starttext
\startMPinclusions
%draft := 0
e the position of all objects ;
>> % File second2.pdf
>> Read (access) the position of all objects from second 1(after frame 30);
>> for frame =31 to 60 :
>> simulate position of objects ;
>> draw the frame ;
>> endfor;
>> save the position of al
30);
>> for frame =31 to 60 :
>> simulate position of objects ;
>> draw the frame ;
>> endfor;
>> save the position of all objects ;
>> Etc...
>> Does someone has an idea of how to do such a thing ? I can read text file in
>> Context with no prob
the animation process with
\startMPinclusions (…) \stopMPinclusions, but I did not find a way to write
information from MetaFun to a text file. Is Lua the solution ?
there's always an idea ...
\starttext
\startMPpage
runscript("metapost.setparameterset('test',
ta
problem and integrate them in the animation
process with \startMPinclusions (…) \stopMPinclusions, but I did not
find a way to write information from MetaFun to a text file. Is Lua
the solution ?
Lua is always the solution ;) but I don’t understand enough of both Lua
and MetaFun...
Maybe
\startMPinclusions (…) \stopMPinclusions, but I did not find a way to write
information from MetaFun to a text file. Is Lua the solution ?
Lua is always the solution ;) but I don’t understand enough of both Lua
and MetaFun...
Maybe there’s something in luametafun.pdf*?
*) Hans, this is one of the
60 :
simulate position of objects ;
draw the frame ;
endfor;
save the position of all objects ;
Etc...
Does someone has an idea of how to do such a thing ? I can read text file in
Context with no problem and integrate them in the animation process with
\startMPinclusions
}
\def\numB{4}
\def\numC{8}
\def\numD{14}
\def\mygap{0.001pt}
%===
\startMPinclusions
path pleft ; path pright ;
numeric LA ; LA := (\numA-1)*LineHeight + StrutHeight + StrutDepth + \mygap ;
numeric LB ; LB := \numB *LineHeight
On Thu, 2022-05-19 at 14:23 +0530, śrīrāma wrote:
> On 5/19/22 1:53 PM Vincent Hennebert via ntg-context wrote:
> > Looking at the wiki, it seems that \startMPinclusions is not meant
> > to
> > actually render any content, just to include MetaPost code like
> > func
On 5/19/22 1:53 PM Vincent Hennebert via ntg-context wrote:
> Looking at the wiki, it seems that \startMPinclusions is not meant to
> actually render any content, just to include MetaPost code like
> function definitions. I guess I would have expected \startMPpage
> instead.
>
scaled 10cm;
Whether I run
context metapost.mp
or
mtxrun --script metapost metapost.mp
I get a PDF document that contains no page.
The mtxrun version generates the following temp file:
mptopdf-temp.tex
\starttext
\startMPinclusions
fill fullcircle scaled 10cm;
\stopMPinclusions
Hi list,
I realized that circleit throws an error.
It works fine if I replace boxes_generic_declare by boxes_declare in line 244
in mp-xbox.mpxl
rboxit is probably affected as well, but I did not test that.
MWE:
\startMPinclusions
input boxes;
\stopMPinclusions
\startMPpage
circleit.a(textext
hadow" macro that produces a shadow of any picture with an adjustable
gray.
I’m having lots of metafun!
Gavin
\startMPinclusions
picture ball;
ball := image(
fill fullcircle scaled 1cm
withshademethod "circular"
withshadecenter (.25,.25)
withshadeco
macro that produces a shadow of any picture with an adjustable gray.I’m having lots of metafun!Gavin\startMPinclusions picture ball; ball := image( fill fullcircle scaled 1cm withshademethod "circular" withshadecenter (.25,.25) withshadecolors (.8white, black); draw f
the fade. It works great with a picture that is
made with fill and draw, but it doesn’t work with shading. The example below
has a flat disk and a round ball. The disk looks fine, but the shaded ball is
not surviving the application of inverted / uncolored.
\startMPinclusions
picture disk
the fade. It works great with a picture that is
made with fill and draw, but it doesn’t work with shading. The example below
has a flat disk and a round ball. The disk looks fine, but the shaded ball is
not surviving the application of inverted / uncolored.
\startMPinclusions
picture disk
Hi list,
I’m trying to produce figures like this, showing motion as a series of
snap-shots, with the earlier moments more faint.
PastedGraphic-1.pdf
Description: Adobe PDF document
Here are three examples of metafun code using transparency and “decorated".
\startMPinclusions
picture
m/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
> > <
> https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
> >):
> >
> > \startMPinclusions
> >
> > vardef MotMystere(e
can-i-use-luas-string-len-inside-a-metapost-function>):
\startMPinclusions
vardef MotMystere(expr taille, speciale, index) =
save avant,apres,case;
numeric avant,apres;
path case;
case := fullsquare scaled 13;
avant := speciale-1;
%For Unicode, use "utflen" instead
apres
Hi, list. The following works for MkIV, but not LMTX (adapted from here:
https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
):
\startMPinclusions
vardef MotMystere(expr taille, speciale, index) =
save avant,apres,case;
numeric avant,apres
not if the color is in a Lua variable. Any suggestions?
Thanks!
Gavin
The code below produces four pie shape wedges to show the different results of
handling the color. They should all be red, but the last two are black.
\startMPinclusions
color rouge; % To avoid changing the data
Dear list,
I’m experimenting LuaMetaFun. The following MWE example works as expected, but
stop to work as soon as I uncomment the « doublefun » commands, like :
\startMPinclusions{doublefun} (… )
\startMPpage[instance=doublefun]
% MWE ——
\startMPinclusions%{doublefun}
vardef
if this information is
not complete enough to identify the problem.
Here is the MWE that I used for the input figure file that demonstrates the
problem.
\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]
\startMPinclusions{ns_hier}
directory as the document but is in the
>configured through the usepath/usesubpath interface from an environment file.
I can put together and share a runnable MWE set of files if this information is
not complete enough to identify the problem.
Here is the MWE that I used for the inpu
I used for the input figure file that demonstrates
the problem.
\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]
\startMPinclusions{ns_hier}
input boxrow
\stopMPinclusions
\startMPdefinitions{ns_hier}
% nothi
gure file that demonstrates the
problem.
\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]
\startMPinclusions{ns_hier}
input boxrow
\stopMPinclusions
\startMPdefinitions{ns_hier}
% nothing to see here
\stopMPdefinitions
\startM
eter;
endfig;
end
But what you are proposing unfortunately does not work.
Fabrice
Le mar. 1 sept. 2020 à 14:25, Taco Hoekwater a écrit :
> Hi,
>
> I think you need this:
>
> \startMPinclusions
> input mp-scratch;
> \stopMPinclusions
>
> \startMPcode
> Scra
Hi,
I think you need this:
\startMPinclusions
input mp-scratch;
\stopMPinclusions
\startMPcode
Scratchversion:=3;
….
If that also doesn’t work, perhaps attach the log file / terminal output to a
new message.
Best wishes,
Taco
> On 1 Sep 2020, at 13:07, Fabrice Couvreur wr
Foo( 0, -75, 150, 50, \"%s\");", mpLabelString(
> labelString))
> labelString = "3. Label \"a\" [Text]! OK"
> warnAndConTeXt( "pic := Foo( 0, -150, 150, 50, \"%s\");", mpLabelString(
> labelString))
> labelString = "4. {Label}
:= Foo( 0, -300, 150, 50, \"%s\");", mpLabelString( labelString)) context( "drawdot (0,0) withpen pencircle scaled 4 withcolor red;") context.stopMPpage()end\stopluacode\usemodule[article-basic]%\enabletrackers[metapost.tracingall,metapost.lua,metapost.runs,metapost.textexts,metapost.scri
ditya Mahajan wrote:
>> On Fri, 13 Mar 2020, Taco Hoekwater wrote:
>>> Hi,
>>>
>>>
>>>
>>>> On 13 Mar 2020, at 12:53, Gerben Wierda wrote:
>>>>
>>>> Suppose I have this code:
>>>>
>>>>
&
t;
>>>> Suppose I have this code:
>>>>
>>>>
>>>> Can I reuse that varied across follow-up MPPages?
>>>
>>> Sure, put the vardef inside \startMPinclusions:
>> or \startMPdefinitions ... \stopMPdefinitions (don't re
On 3/13/2020 2:33 PM, Aditya Mahajan wrote:
On Fri, 13 Mar 2020, Taco Hoekwater wrote:
Hi,
On 13 Mar 2020, at 12:53, Gerben Wierda wrote:
Suppose I have this code:
Can I reuse that varied across follow-up MPPages?
Sure, put the vardef inside \startMPinclusions:
or
gt;
>> Can I reuse that varied across follow-up MPPages?
>
> Sure, put the vardef inside \startMPinclusions:
>
> \startMPinclusions
> vardef MyShape(expr w, h) =
> ...
> enddef ;
> \stopMPinclusions
> \startMPpage
> picture s ; s := MyShape(4cm, 2cm);
>
On Fri, 13 Mar 2020, Taco Hoekwater wrote:
Hi,
On 13 Mar 2020, at 12:53, Gerben Wierda wrote:
Suppose I have this code:
Can I reuse that varied across follow-up MPPages?
Sure, put the vardef inside \startMPinclusions:
or \startMPdefinitions ... \stopMPdefinitions (don't rem
Hi,
> On 13 Mar 2020, at 12:53, Gerben Wierda wrote:
>
> Suppose I have this code:
>
>
> Can I reuse that varied across follow-up MPPages?
Sure, put the vardef inside \startMPinclusions:
\startMPinclusions
vardef MyShape(expr w, h) =
...
enddef ;
\stopMPinclusions
\s
ter a regular
(even) page, everything works as expected (no color-filled page, no header
in the start-chapter page).
MWE:
%% START MWE
\definecolor[rojo][h=ED553B]
\definehighlight[rojo][color=rojo]
\startMPinclusions
numeric u ; u := 1.125pt ;
numeric i ;
-chapter page).
MWE:
%% START MWE
\definecolor[rojo][h=ED553B]
\definehighlight[rojo][color=rojo]
\startMPinclusions
numeric u ; u := 1.125pt ;
numeric i ; i := 0.125in ;
string prevChapterTitle, currentChapterTitle;
prevChapterTitle := "&
t;>
>> FIRST EXAMPLE (No labels are displayed)
>> -----
>> \starttext
>>
>> \startMPinclusions
>>input makecirc;
>> \stopMPinclusions
>>
>>
>> \startstaticMPfigure{circ1}
>> u:= 1cm ;
>&
ttext
\startMPinclusions
input makecirc;
\stopMPinclusions
\startstaticMPfigure{circ1}
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","2V") ;
resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
resistor.b((2u,-1u),normal,90,&
I'm trying to use with Context makecirc a metapost library to draw
electric circuits, but I have problems with the labels of the circuits
element that are not displayed correctly.
FIRST EXAMPLE (No labels are displayed)
-
\starttext
\startMPinclusions
input mak
Pinclusions store path and not pairs.
>
>
> (1) %%
> \setuppapersize[A4,landscape]
>
> \startMPinclusions
> u:=1mm ;
> %fond
> path p ;
> p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u) -- cycle ;
> pair x[] ;
> x[0]:=
On 2/21/2019 10:03 AM, Damien Thiriet wrote:
Hi,
Why does (1) compile, whereas (2) doesn't?
I can't understand why can MPinclusions store path and not pairs.
(1) %%
\setuppapersize[A4,landscape]
\startMPinclusions
u:=1mm ;
%fond
path p
Hi,
Why does (1) compile, whereas (2) doesn't?
I can't understand why can MPinclusions store path and not pairs.
(1) %%
\setuppapersize[A4,landscape]
\startMPinclusions
u:=1mm ;
%fond
path p ;
p:= (0,0) -- (150u,0) -- (150u,95u) -- (0,95u
\stoptext
This is not much different from:
\starttext
\startMPinclusions
string t;
t := "foo";
\stopMPinclusions
\startMPcode
draw textext(t);
\stopMPcode
\startMPcode
draw textext(t) rotated 45;
\stopMPcode
\stoptext
but the problem was not with passing just te
optext
This is not much different from:
\starttext
\startMPinclusions
string t;
t := "foo";
\stopMPinclusions
\startMPcode
draw textext(t);
\stopMPcode
\startMPcode
draw textext(t) rotated 45;
\stopMPcode
\stoptext
but the problem was not with passing just
performed (color=vacuous).
Minimal example would be:
\startMPinclusions
picture p;
p := image(
draw textext("Foo");
);
\stopMPinclusions
\startMPcode
\stopMPcode
tested on http://live.contextgarden.net/
you can use
\startMPinitializations
\stopMPinitializations
as these are expanded ea
:
\startMPinclusions
picture p;
p := image(
draw textext("Foo");
);
\stopMPinclusions
\startMPcode
\stopMPcode
tested on http://live.contextgarden.net/
___
If your question is of interest to others as well,
Hello,
I have some documents that contain:
\startMPinclusions
input "mycode";
\stopMPinclusions
where mycode.mp is somewhere in my project's directory. Is there a way
to tell ConTeXt how to fi
I guess the code I am looking for is the below to hatch the cut-out
section. How can I load the MetaPost hatching package in Context minimals
so it understands the hatchfill command?
Thanks
Jeroen
\startMPinclusions
input hatching;
\stopMPinclusions
\starttext
\placefigure[here,force
tried to write a loop to display the title, but it does not. How to
>>>> do ?
>>>> Thank you,
>>>> Fabrice
>>>>
>>>> \setuppagenumbering[location=]
>>>>
>>>> \setupcolors
>>>>[state=start]
>>>>
>>
>
>>> \setupcolors
>>>[state=start]
>>>
>>> \definecolor[pagecolor][s=.6]
>>> \definecolor[textcolor][r=.6]
>>>
>>>
>>> \startMPinclusions
>>>color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>>colo
title, but it does not. How to do ?
>> Thank you,
>> Fabrice
>>
>> \setuppagenumbering[location=]
>>
>> \setupcolors
>>[state=start]
>>
>> \definecolor[pagecolor][s=.6]
>> \definecolor[textcolor][r=.6]
>>
>>
>>
On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
Hi,
I tried to write a loop to display the title, but it does not. How to do ?
Thank you,
Fabrice
\setuppagenumbering[location=]
\setupcolors
[state=start]
\definecolor[pagecolor][s=.6]
\definecolor[textcolor][r=.6]
\startMPinclusions
Hi,
I tried to write a loop to display the title, but it does not. How to do ?
Thank you,
Fabrice
\setuppagenumbering[location=]
\setupcolors
[state=start]
\definecolor[pagecolor][s=.6]
\definecolor[textcolor][r=.6]
\startMPinclusions
color pagecolor ; pagecolor := \MPcolor{pagecolor
uot;CONTEXTEN".
Thank you,
Fabrice
\setuppagenumbering[location=]
\setupcolors
[state=start]
\definecolor[maincolor][g=.6]
\definecolor[pagecolor][s=.6]
\definecolor[darkcolor][s=.2]
\definecolor[textcolor][r=.6]
\startMPinclusions
color maincolor ; maincolor := \MPcolor{maincolor} ;
raphics.
Using overlays is also possible (urcorner OverlayBox), but I see no real
need or benefit to do so.
HTH, Peter
\startMPinclusions
numeric lw; lw:= 1;
numeric n; n:= 8;
numeric u; u:= 1cm;
\stopMPinclusions
\starttext
Before:\\
\startMPcode
pickup pencircle scaled lw;
draw unitsqu
int:
english/english
# with mpcirc.mp ##
With this code:
\startMPinclusions
input mpcirc;
\stopMPinclusions
\starttext
%\forceMPTEXgraphictrue %%% command don't work
\startMPcode
u:=10bp; % unit of length
prepare(L,C,Vac); % mention your elements
z0=(10u,10u); % lower
t preloaded
languages > language 'en' is active
(d:/mydocs/TeX/dokumente/D3/glyph.mkiv{R:/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts > preloading latin modern fonts (second stage)
fonts > typescripts > unknown library 'loc&
. What
am I doing wrong?
Thanks in advance
Jorge
\startMPinclusions
def SoundEnergy =
path pr ; pr := unitsquare xscaled .3cm yscaled 2cm ;
currentpicture:=nullpicture;
for i=0 step 2 until 10:
linear_shade(pr shifted (i*.3cm,0),0,white,black);
linear_shade(pr shifted ((i+1)*.3cm,0),0
ourth overlay][\positionoverlay{my backgraphics}]
\startpositionoverlay{my backgraphics}
\setMPpositiongraphic{three}{mypos:circle}{mypos:circleradius=1cm,mypos:circlecolor=red}
\setMPpositiongraphic{three}{mypos:circle}{mypos:circleradius=.5cm,mypos:circlecolor=green}
\stoppositionoverlay
\start
.
>
>
> What can coming from the module "mps-core.mp" that
>> interfere with Metapost labels?
>>
>
> If it's a big subsystem there might be conflicts; anyway, better load
the module "mps-core.mp" that
interfere with Metapost labels?
If it's a big subsystem there might be conflicts; anyway, better load
like this:
\startMPinclusions
input mps-core.mp ;
\stopMPinclusions
\startMPcode
label.bot(btex Metapost and Statistics etex,(5mm,0)) ;
#x27;ll get
inconsistent equations.
[^2]: You also need to keep in mind that all metapost graphics are
processed in a single run (think of a single mp file with multiple
beginfigs). So you have to be careful with initializing and resetting
variables (\startMPinclusions, \startMPinitializati
Hi,
You know the price you have to pay: wikifying ..
\setuplayout
[header=0cm,
topspace=1.625cm,
footer=0cm,
width=fit,
height=fit]
\startMPinclusions
numeric MyTitlePageDone[] ;
\stopMPinclusions
\startuseMPgraphic{background:normal}
StartPage ;
fill
Three ; ColorThree := blue ;
\stopMPextensions
\startMPextensions{doublefun}
color ColorThree ; ColorThree := magenta ;
\stopMPextensions
\startMPinclusions
def DoWhatever = draw textext("N") ; enddef ;
\stopMPinclusions
\startMPinclusions
def DoWhatever = draw textex
tions, already,
to which the user may wish to add his own MPinclusions (eventually
several times using the [+] argument).
\startMPinclusions{myinstance} does not work.
Alan
___
If your question is of interest to othe
s
radius 1)
\edef\N{10} % Number of frames in animation per hypocycloid "branch"
\edef\K{1}\doloop{\ctxlua{commands.doifelse(math.abs(\K*\r -
math.floor(\K*\r+0.5))<0.01)}{\exitloop}{\edef\K{\luaexpr{\K+1
\startMPinclusions[+]
r:=\r; % Radius of smaller circle (larger cir
\starttext
\startMPinclusions[+]
picture J;
\stopMPinclusions
\startMPpage
J:=thelabel(btex J etex scaled 2,origin);
draw J;
\stopMPpage
\startMPpage
draw J;
\stopMPpage
\stoptext
\starttext
\startMPinclusions[+]
vardef J
gt; Troy Henderson
>
> \starttext
> \startMPinclusions[+]
> picture J;
> \stopMPinclusions
> \startMPpage
> J:=thelabel(btex J etex scaled 2,origin);
> draw J;
> \stopMPpage
>
The following code produces the letter "J" on the first page, but does not
draw that same picture on the second page. I would appreciate some advice
on how to save and redraw this label in subsequence figures.
Thanks,
Troy Henderson
\starttext
\startMPinclusions[+]
That works great. Now I have defined a global numeric
N:=8;
in \startMPinclusions ... \stopMPinclusions at the be beginning of my
document. All of my \startMPpage ... \stopMPpage environments understand
this N, but how do I reference this value as the start value for
\dostepwiserecurse? That
That works great. Now I have defined a global numeric
N:=8;
in \startMPinclusions ... \stopMPinclusions at the be beginning of my
document. All of my \startMPpage ... \stopMPpage environments understand
this N, but how do I reference this value as the start value for
\dostepwiserecurse? That
> draw ll shifted (0mm,60mm) ; % fill both circles with blue
>
>
> What is the shortest way of doing this? I don't mind writing
> definitions earlier in the file, but I'd rather keep this part as
> short as possible to be able to see the pattern at one glance. The
>
h MKII there is a fatal error, which is after
>> stoptext in the attached test-file.
>
> patch:
>
> \startMPinclusions
>def graphictext primary t =
>hide (
>if mfun_trial_run :
>let mfun_graphic_text = mfun_no_graphic_text ;
>
stoptext in the attached test-file.
patch:
\startMPinclusions
def graphictext primary t =
hide (
if mfun_trial_run :
let mfun_graphic_text = mfun_no_graphic_text ;
else :
let mfun_graphic_text = mfun_do_graphic_text
Am 29.09.2011 um 21:10 schrieb Meer, H. van der:
> Finding the file works with \ReadFile{} works. But is generates another
> problem because
>
> \input ../../../metapost-setup
> and
> \ReadFile{metapost-setup}
>
> behave differently! The \input process my \startMP
Finding the file works with \ReadFile{} works. But is generates another problem
because
\input ../../../metapost-setup
and
\ReadFile{metapost-setup}
behave differently! The \input process my \startMPinclusions correctly but the
ReadFile does not, because the following metapost has the
o the
example from [1] works fine with the added boolean flag, but the
following example (which means basically all built-in MetaObj objects
with text) does not. It compiles well but there is no text.
--8<start----8<--
\startMPinclusions[+]
in
like to have some MP code shared between unique graphics (in
> >>> MkIV).
> >>>
> >>> One example: I'd like to have drawoptions for all
> >>> graphics.
> >>
> >> \startMPinclusions
> >>drawoptions(...) ;
> >&g
l graphics.
\startMPinclusions
drawoptions(...) ;
\stopMPinclusions
Thanks!
Another one: I'd like to have two similar (but different) unique
graphics, and I'd like them to share some code.
\startuseMPgraphic{common}
...
\stopuseMPgraphic
\startuseMPgraphic{one}
\inc
Dnia 2011-09-19, pon o godzinie 11:19 -0400, Aditya Mahajan pisze:
> On Mon, 19 Sep 2011, Marcin Borkowski wrote:
>
> > I'd like to have some MP code shared between unique graphics (in MkIV).
> >
> > One example: I'd like to have drawoptions for all
1 - 100 of 276 matches
Mail list logo