[NTG-context] Re: Custom background color for \framed inside lmt_text

2025-07-02 Thread Wolfgang Schuster
Am 30.06.2025 um 05:32 schrieb Emanuel Han via ntg-context: I want my custom color rose_color to be applied for background color for \framed inside lmt_text. For fill fullcircle, it works. With predefined colors as green, it works. \starttext \startMPcode color rose_color; rose_color = 1

[NTG-context] Re: Custom background color for \framed inside lmt_text

2025-07-02 Thread Florent Michel
Hi, In addition to Mikael's solution, defining the color using the ConTeXt function \definecolor seems to work: \starttext \definecolor[rose_color_ctx][r=.99609375,g=.796875,b=.99609375] \startMPcode color rose_color; rose_color = 1/256(255,204,255); %now working draw lmt_text

[NTG-context] Re: Custom background color for \framed inside lmt_text

2025-07-02 Thread Mikael Sundqvist
> > 2025/06/30 12:39、Emanuel Han via ntg-context のメール: > >  > > I want my custom color rose_color to be applied for background color for > \framed inside lmt_text. For fill fullcircle, it works. With predefined > colors as green, it works. > > \starttext > > \start

[NTG-context] Re: Custom background color for \framed inside lmt_text

2025-07-02 Thread Emanuel Han via ntg-context
as green, it works. > > \starttext > > \startMPcode > > color rose_color; rose_color = 1/256(255,204,255); > > %not working > draw lmt_text [text > ="\framed[background=color,backgroundcolor=rose_color,frame=on, > location=low]{a rose box}",]; >

[NTG-context] Custom background color for \framed inside lmt_text

2025-06-29 Thread Emanuel Han via ntg-context
I want my custom color rose_color to be applied for background color for \framed inside lmt_text. For fill fullcircle, it works. With predefined colors as green, it works. \starttext \startMPcode color rose_color; rose_color = 1/256(255,204,255); %not working draw lmt_text [text ="\f

[NTG-context] Re: Lua question - table.save, table.load

2025-01-11 Thread Hans Hagen
On 1/11/2025 4:01 PM, Jeong Dal via ntg-context wrote: Dear all, I save a table “tfList” using table.save in Lua: \startluacode ... table.save(“tempList.lua”,tfList) ... \stopluacode And I call it in MetaFun using a method explained in the MetaFun book. \startMPcode lua("MP = { } MP

[NTG-context] Lua question - table.save, table.load

2025-01-11 Thread Jeong Dal via ntg-context
Dear all, I save a table “tfList” using table.save in Lua: \startluacode ... table.save(“tempList.lua”,tfList) ... \stopluacode And I call it in MetaFun using a method explained in the MetaFun book. \startMPcode lua("MP = { } MP.data = table.load('te

[NTG-context] Re: [ scaling colors ]

2025-01-01 Thread vm via ntg-context
s! I also came across the definition as described on page 32 of https://www.pragma-ade.nl/general/manuals/colors-mkiv.pdf \startMPcode color Salmon ; Salmon := ( 1.0, 0.568, 0.643 ) ; fill fullsquare xyscaled (40mm, 15mm) withcolor Salmon ; fill fullsquare xyscaled (40mm, 15mm) shifted (42mm,0) withco

[NTG-context] Re: [ scaling colors ]

2025-01-01 Thread Florent Michel
Hi, It seems to work when defining a color as described in https://wiki.contextgarden.net/Color_in_MetaPost , if that's an option: ____ \startMPcode color MyColor ; MyColor = (.5, .25, .25) ; fill fullsquare xyscaled (40mm, 15mm) withcolor My

[NTG-context] Re: [ scaling colors ]

2025-01-01 Thread Hans Hagen
On 1/1/2025 10:02 PM, vm via ntg-context wrote: with the environment of \startMPcode you can scale a color with a factor like 0.25red and 0.5blue But this not seem to work when you define a color yourself first definecolor [ name = "MyColor", r = .5, g = .25, b = .25 ] ; fill

[NTG-context] [ scaling colors ]

2025-01-01 Thread vm via ntg-context
with the environment of \startMPcode you can scale a color with a factor like 0.25red and 0.5blue But this not seem to work when you define a color yourself first definecolor [ name = "MyColor", r = .5, g = .25, b = .25 ] ; fill fullsquare xyscaled (40mm, 15mm) withcolor "M

[NTG-context] Issues with included images on some epub readers

2024-12-28 Thread Florent Michel
amplefile{tufte} % Include a simple MetaPost image \starttextdisplay \startimage \startMPcode fill fullcircle scaled 3cm withcolor darkred ; \stopMPcode \stopimage \stoptextdisplay % Some text again \samplefile{tufte} % Include an equation as SVG image \starttextdisplay

[NTG-context] Re: How to make this Metapost diagram adjust to the width of text?

2024-12-09 Thread Gavin via ntg-context
\starttext % Define the macro outside the Metapost code block \def\macroXa#1#2#3#4#5#6#7 { \startMPcode u := 1.5cm; % Reduced unit size for compact spacing picture l[]; l0 = thelabel.lft(textext("#1"), origin); % Fruit l2 = thelabel.rt(textext("#2"), origin); % Apple l3 = the

[NTG-context] How to make this Metapost diagram adjust to the width of text?

2024-12-08 Thread Joel via ntg-context
st if the words in the middle branches are longer? --Joel \starttext % Define the macro outside the Metapost code block \def\macroXa#1#2#3#4#5#6#7 { \startMPcode u := 1.5cm; % Reduced unit size for compact spacing % Main node positions z0 = (0, 0);   % Fruit position z1 = (1u, 0);

[NTG-context] Re: Rounded pens with Metapost

2024-12-07 Thread Wolfgang Schuster
h the number of steps. \starttext \doloopoverlist   {90,60,45,30,20,15,10,5,1}   {\recursestring:    \startMPcode     draw ((-1cm,0)--(5cm,0)) shifted (0,1cm) withcolor (1,0,0);     pen testpen ; testpen := makepen ((1,0){up} for i = 1 step \recursestring\space until 181 : .. ((1,0) rota

[NTG-context] Re: Hiding a part of a path

2024-12-02 Thread Jeong Dal via ntg-context
erased. >> Is there a way to do that not changing it into an image? >> Thank you for reading. >> >> Best regards, >> >> Dalyoung >> >> \startMPcode >> path p,q; >> picture pic; >> numeric u; u:= 1cm; >> >> p := origin-

[NTG-context] Re: Hiding a part of a path

2024-12-02 Thread Mikael Sundqvist
ou for reading. > > Best regards, > > Dalyoung > > \startMPcode > path p,q; > picture pic; > numeric u; u:= 1cm; > > p := origin--(2u,0)--(3u,u)--(3u,0)--(4u,0); > q := (3u,u)--(3u,0); > pic := image(draw p; draw q withcolor white;); > > draw pic; >

[NTG-context] Hiding a part of a path

2024-12-02 Thread Jeong Dal via ntg-context
Dear all, I’d like to hide a part of a path. I can do that after changing it into an image, but it is not clearly erased. Is there a way to do that not changing it into an image? Thank you for reading. Best regards, Dalyoung \startMPcode path p,q; picture pic; numeric u; u:= 1cm; p

[NTG-context] Re: Line break after a Metapost picture at start of paragraph

2024-11-29 Thread Florent Michel
surprising behaviour in > ConTeXt LMTX 2024.10.31: there seems to be an automatic line break after a > Metapost picture if it is at the start of a paragraph. Here is a simple > example showing this behaviour: > > > > -------

[NTG-context] Re: Line break after a Metapost picture at start of paragraph

2024-11-29 Thread Mikael Sundqvist
howing this behaviour: > > -- > \starttext > % Two different lines > \startMPcode > fill fullcircle scaled 10pt; > \stopMPcode > text > > % Single line > text > \startMPcode > fill fullcircle scaled 10pt; > \stopMPcode > \stoptext > --

[NTG-context] Line break after a Metapost picture at start of paragraph

2024-11-29 Thread Florent Michel
: -- \starttext % Two different lines \startMPcode fill fullcircle scaled 10pt; \stopMPcode text % Single line text \startMPcode fill fullcircle scaled 10pt; \stopMPcode \stoptext -- I'm not sure whether

[NTG-context] A few question about defining symbols and creating downarrow to illustrate function rules

2024-11-24 Thread Jethro Djan
re you are then required to tell the rule of the mapping). The inputs will be up with the outputs below and a downward pointing arrow between them. %% start MWE \starttext \define[2]\xdownarrow{ \startframed[frame=off,offset=0pt,width=0.8cm] \startMPcode numeric u, w; u := .3cm; w := 2pt; p

[NTG-context] Re: Problem with Metapost

2024-11-03 Thread Fabrice Couvreur
ntly, I can no longer > have a succession of figures with Metapost; only the first one appears. > > Thanks. > > Fabrice > > > > \starttext > > \dorecurse{3}{\startMPcode > > numeric u; > > u = 0.5cm; > >

[NTG-context] Re: Problem with Metapost

2024-11-03 Thread Mikael Sundqvist
:47 PM Fabrice Couvreur wrote: > > Hi, > I think I have never encountered this problem. Recently, I can no longer have > a succession of figures with Metapost; only the first one appears. > Thanks. > Fabrice > > \starttext > \dorecurse{3}{\startMPcode > nume

[NTG-context] Problem with Metapost

2024-11-03 Thread Fabrice Couvreur
Hi, I think I have never encountered this problem. Recently, I can no longer have a succession of figures with Metapost; only the first one appears. Thanks. Fabrice \starttext \dorecurse{3}{\startMPcode numeric u; u = 0.5cm; ymax = xmax = 7; xmin

[NTG-context] Re: for loop not working in metapost

2024-08-30 Thread Mikael Sundqvist
Hi, try "dashed evenly" instead of just "dashed". /Mikael (did not test...) On Fri, Aug 30, 2024 at 1:24 PM Shiv Shankar Dayal wrote: > > Hi, > > I have plotted a log function and I want to draw an xy axis grid. > Below is the code > > \starttext >

[NTG-context] for loop not working in metapost

2024-08-30 Thread Shiv Shankar Dayal
Hi, I have plotted a log function and I want to draw an xy axis grid. Below is the code \starttext \startMPcode draw function(1,"x", "log(x)", .1, 10, .01) scaled 1cm; for i = 0 upto 10: draw (i*cm, -5cm) -- (i*cm, 5cm) dashed; endfor; for i = -5 upto 5: draw (0,

[NTG-context] Re: Help with Metapopst code

2024-08-28 Thread Wolfgang Schuster
with respect to what reference? You rotate around a point with the x and y coordinates 0. The blue dot shows the point with the coordinates 0. The green dot is rotated around this point. \starttext \startMPcode drawdot (0,0) withpen pencircle scaled 5mm withcolor blue; draw fullsquare scaled (4cm

[NTG-context] Re: weekend update

2024-06-23 Thread Gerion Entrup
. It will be nice to have a syntax to easily handle case 2 and 3. > > As a bonus, I found that tex stacking plays nicely with metapost stacking! > > \starttext > > \definestacking[1] > \definestacking[2] > \definestacking[3] > > \startbuffer > \subject{How to draw

[NTG-context] Re: weekend update

2024-06-21 Thread Aditya Mahajan
ubject{How to draw a circle} \startitemize \startstacking[2] \startitem Pick a point \stopitem \stopstacking \startstacking[3] \startitem Draw the circle \stopitem \stopstacking \stopitemize \startplacefigure[location={here,none}] \startMPcode[stacking={\namedstackingparameter\emp

[NTG-context] Re: applying style to frame content

2024-05-14 Thread Wolfgang Schuster
] \starttexdefinition spaces protected Mystyle #1 \startMPcode picture tt ; tt:= lmt_outline [ kind = "path", text = "\Myframe{#1}", ]; fill for i within tt : pathpart i && endfor cycle withshademethod "linear" withshadedirect

[NTG-context] applying style to frame content

2024-05-14 Thread seyal . zavira
Hi all, what is the better way to apply a metapost effect to a piece of any structure text for example when defining footnotes, frames , etc. i use this method for frames: this is my MWE: \defineframed[Myframe][frame=off] \starttexdefinition spaces protected Mystyle #1 \startMPcode

[NTG-context] Re: The graph is not visible.

2024-04-26 Thread Fabrice Couvreur
numeric a,b; > > > > fixes the problem in chapter 14. > > Woundn't newnumeric be better? > > There are very few instances where I want variables defined in one block > to be reused in another block. So, I almost always use > > \startMPcode > begingroup; >

[NTG-context] Re: The graph is not visible.

2024-04-26 Thread Aditya Mahajan
> >numeric a,b; > > fixes the problem in chapter 14. Woundn't newnumeric be better? There are very few instances where I want variables defined in one block to be reused in another bloc

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi, Here is the code that interferes with the graph from the last chapter but why ? \startMPcode pickup pencircle xscaled 1; defaultfont := "texgyrepagella-regular*default" ; defaultscale := 0.8 ; path circle, p, q, b;

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
raph by itself > renders fine: > > > > Best wishes, > Taco > (if all else fails, you can replace \startMPcode with \startMPpage and > generate a standalone graph that way) > > > On 25 Apr 2024, at 12:27, Fabrice Couvreur > wrote: > > > > Hi, >

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Taco Hoekwater
H Fabrice, You did not provide a good minimum test because the graph by itself renders fine: fabr.pdf Description: Adobe PDF document Best wishes, Taco (if all else fails, you can replace \startMPcode with \startMPpage and generate a standalone graph that way) > On 25 Apr 2024, at 12

[NTG-context] The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
t encounter any problems except with a graphic from the last chapter. It is indeed in chapter 14 but not in the project ! I give the code for this graph. Thanks. Fabrice \startMPcode interim linejoin := mitered; interim ahangle := 30; numeric u, pi;

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-09 Thread Hans Hagen
will be in the next upload so with the current one you need to use the also posted here for ... endfor variant also when i edit the code and replace metapost part like this: \startMPcode      draw lmt_outline [          kind = "outline",          text

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-09 Thread seyal zavira
seams this code means to put a hidden text with same size behind metapost shape. but it does not work properly for me (current version: 2024.04.01 08:59) and produce empty page but with searchable hidden text. also when i edit the code and replace metapost part like this: \startMPcode draw

[NTG-context] Re: how to apply metapost effects to section title?

2024-04-09 Thread Wolfgang Schuster
seyal.zav...@gmail.com schrieb am 09.04.2024 um 14:53: i want to produce a gradient header i tried this code but it does not produce any result: \startext \def\Mystyle#1{\startMPcode picture tt ; tt := lmt_outline [ kind = "path", text = "#1", ] ; fill

[NTG-context] how to apply metapost effects to section title?

2024-04-09 Thread seyal . zavira
i want to produce a gradient header i tried this code but it does not produce any result: \startext \def\Mystyle#1{\startMPcode picture tt ; tt := lmt_outline [ kind = "path", text = "#1", ] ; fill for i within tt : pathpart i && endfor cycle

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread Hans Hagen
s paths which implies no search but you can do this (Keith and/or Hraban will explain and/or wikify it) \starttext \startbuffer[MyText] \definedfont[name:texgyrepagellabold*default]foo f o o% \stopbuffer \startbuffer[MyText] \framed[align=normal,frame=off]{\input{tufte}}% \stopbuf

[NTG-context] Re: how to include an an svg file?

2024-03-16 Thread Jean-Pierre Delange
des. Hans Hagen % If we use another call to the same smile drawing (but in *.svg format) % the svg file is given by Inkscape (as the smile.pdf, exported through Inkscape) \startMPcode draw lmt_svg [ filename = "smile.svg"] \stopMPcode \stopchapter \startchapter[title={H

[NTG-context] Re: how to include an an svg file?

2024-03-15 Thread seyal zavira
st be callable on the command > > line (which doesn’t work for me on MacOS any more, must investigate…). > \startMPcode > draw lmt_svg [ filename = "smile.svg"] > \stopMPcode > > Now gives the attached but it took me a while to figure out what wo

[NTG-context] Re: how to include an an svg file?

2024-03-15 Thread Hans Hagen via ntg-context
? \externalfigure[smile] without any other settings, but inkscape must be callable on the command line (which doesn’t work for me on MacOS any more, must investigate…). \startMPcode draw lmt_svg [ filename = "smile.svg"] \stopMPcode Now gives the attached but it took me a while

[NTG-context] Re: how to include an an svg file?

2024-03-12 Thread Jean-Pierre Delange
y here is the code: > > \starttext > \startMPcode > draw lmt_svg [ > filename = "smile.svg"] > \stopMPcode > \stoptext I can confirm the problem also with the regular image call

[NTG-context] Re: how to include an an svg file?

2024-03-12 Thread Henning Hraban Ramm
Am 12.03.24 um 14:53 schrieb seyal zavira: > when i want to put some SVGs in my document the svg does not render properly here is the code: > > \starttext > \startMPcode > draw lmt_svg [ > filename = "smile.svg"] > \stop

[NTG-context] Re: how to include an an svg file?

2024-03-12 Thread seyal zavira
is : > > https://wiki.contextgarden.net/SVG > > Le 12/03/2024 à 14:36, seyal.zav...@gmail.com a écrit : > > hi all. > > > > when i want to put some SVGs in my document the svg does not render > properly here is the code: > > > > \starttext > > \startMPco

[NTG-context] Re: how to include an an svg file?

2024-03-12 Thread Jean-Pierre Delange
Hi ! Did you have a look at this : https://wiki.contextgarden.net/SVG Le 12/03/2024 à 14:36, seyal.zav...@gmail.com a écrit : hi all. when i want to put some SVGs in my document the svg does not render properly here is the code: \starttext \startMPcode draw lmt_svg [ filename = "smil

[NTG-context] how to include an an svg file?

2024-03-12 Thread seyal . zavira
hi all. when i want to put some SVGs in my document the svg does not render properly here is the code: \starttext \startMPcode draw lmt_svg [ filename = "smile.svg"] \stopMPcode \stoptext also when i look at evenmore manual at page15, for font Abelone-FREE the gradients has rendere

[NTG-context] Re: After Compiling the Context test, there was no PDF.

2024-01-24 Thread Shiv Shankar Dayal
> yesterday, I downloaded context-win64, and tried the test today . > > > > Here is the test: > > \starttext > > > > \startmode[mkiv] > > > > \startluacode > > tex.sprint("hello") > > \stopluacode > >

[NTG-context] Re: After Compiling the Context test, there was no PDF.

2024-01-24 Thread Ursula Hermann
Dear List, I am sorry, but once again me: I downloaded the last upload from Hans yesterday, I downloaded context-win64, and tried the test today . Here is the test: \starttext \startmode[mkiv] \startluacode tex.sprint("hello") \stopluacode \startMPcode

[NTG-context] Re: Metapost: draw only subpath; changing thickness of line

2024-01-06 Thread Emanuel Han via ntg-context
Hi Taco, thanks for your help. This works for me! On Jan. 5 2024, at 2:13 pm, Taco Hoekwater wrote: > Hi, > > Here is 'a' way to draw the subpath, at least. I do not have time to come up > with a nice “thicker in the middle” solution. > Best wishes, > Taco > >

[NTG-context] Re: Metapost: draw only subpath; changing thickness of line

2024-01-05 Thread Taco Hoekwater
Hi, Here is 'a' way to draw the subpath, at least. I do not have time to come up with a nice “thicker in the middle” solution. Best wishes, Taco \startMPcode numeric u; u=1cm; %equiangular spiral numeric a, k ; a = 2.3; %scaling factor k = 8.61722335; path S; S = right for t=1 upto

[NTG-context] Metapost: draw only subpath; changing thickness of line

2024-01-05 Thread Emanuel Han via ntg-context
Hi all, I have this MWE. Now I want to draw only the subpath of S between gong6 and gong7 with a red line which is narrower at the two ends and thicker in the middle part. How to achieve this? Thanks! Emanuel \setuppapersize[A4,landscape] \starttext \startMPcode numeric u; u=1cm; %equiangular

[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Fabrice L
> [features=fea] > \definefontsynonym [SerifBold] [notonaskharabic-Bold] > [features=fea] > \definefontsynonym [SerifBoldItalic] > [notonaskharabic-Bold-Italic] [features=fea] > \stoptypescript > > \starttypescript [notonaskharabic] > \

[NTG-context] multipage metapost output from ConTeXt

2023-11-27 Thread Emanuel Han via ntg-context
tonaskharabic] \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default] \stoptypescript \usetypescript[notonaskharabic] \setupbodyfont [RomanFont] \starttext \startMPcode picture p[]; path bb; %bounding box z0 = (0,0); z1 = (60,40); z2 = (40,90); z3 = (10,70); z4 = (30,50); z5 = (90,

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-21 Thread Fabrice Couvreur
arger in the lower rectangle). >> >> I attach the PDF created with your code. >> >> Best regards: Otared >> >> >> >> On 19 Nov 2023, at 18:56, Fabrice Couvreur >> wrote: >> >> Hi, >> I don't understand why th

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-20 Thread Fabrice L
>> >> >>> On 19 Nov 2023, at 18:56, Fabrice Couvreur >> <mailto:fabrice1.couvr...@gmail.com>> wrote: >>> >>> Hi, >>> I don't understand why the hatching of the two rectangles is not the same >>> color. >>> T

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-20 Thread Fabrice Couvreur
es is not the same > color. > Thanks for your help. > Fabrice > > \starttext > \setupbodyfont[8pt] > \startMPcode >path p, q, r, b ; > >z[0] = (2cm,0cm) ; >z[1] = (2cm,2cm) ; >z[2] = (0cm,2cm) ; > >

[NTG-context] Re: Strange behavior with anglestriped()

2023-11-19 Thread Otared Kavian
document On 19 Nov 2023, at 18:56, Fabrice Couvreur <fabrice1.couvr...@gmail.com> wrote:Hi,I don't understand why the hatching of the two rectangles is not the same color. Thanks for your help.Fabrice\starttext        \setupbodyfont[8pt]        \startMPcode           path

[NTG-context] Strange behavior with anglestriped()

2023-11-19 Thread Fabrice Couvreur
Hi, I don't understand why the hatching of the two rectangles is not the same color. Thanks for your help. Fabrice \starttext \setupbodyfont[8pt] \startMPcode path p, q, r, b ; z[0] = (2cm,0cm) ; z[1] = (2cm,2cm) ; z[2] = (0c

[NTG-context] Re: Large unwanted white space

2023-10-22 Thread Fabrice Couvreur
file. If I insert this piece of code, > there > > is a large white space that is created between the horizontal line of the > > header and the first exercise. > > \startMPcode makes an image so it will take space > > for definitions use \startMPdefinitions > > &

[NTG-context] Re: Large unwanted white space

2023-10-21 Thread Hans Hagen
the first exercise. \startMPcode makes an image so it will take space for definitions use \startMPdefinitions \startMPcode def suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: for j=0 upto n: drawdot (i*u,j*u)

[NTG-context] Re: Large unwanted white space

2023-10-21 Thread Henning Hraban Ramm
er and the first exercise. Thanks for your help. Fabrice \startMPcode If I’m not wrong, \startMPcode immediately executes the code. I don’t know why it does if it only contains definitions. Try \startMPinitializations (executed for every MP instance) or \startMPdefinitions (only once)

[NTG-context] Large unwanted white space

2023-10-21 Thread Fabrice Couvreur
p. Fabrice \startMPcode def suite (expr n, t) = begingroup numeric u; u := 5mm; pickup pencircle scaled 5pt; for i=0 upto n: for j=0 upto n: drawdot (i*u,j*u) shifted(t*u,0) withcolor \MPcolor{darkred}; endfor endfor endgroup enddef; def Suite (expr n, t) =

[NTG-context] Gray gradient with Metapost

2023-10-05 Thread Fabrice Couvreur
Hi, I would like to obtain, if possible, a gray gradient like in the image. My code uses Metapost but maybe this is possible with Metafun. Thanks. Fabrice \starttext \startMPcode u=1.2cm; interim ahangle := 30; z0=(0,0); z1=(3u,0

[NTG-context] How can I use a variable for a MetaPost coordinate ?

2023-10-04 Thread peter.hopcroft--- via ntg-context
on it. Is there a way of doing calculations on the coordinates for the draw using ConTexT variables like \textheight? Thank you, Peter Hopcroft -- \starttext Some text \startMPcode pickup pensquare scaled 1pt; draw (0mm,0mm)--(0mm,\textheight) withcolor red \stopMPcode More

[NTG-context] Re: Triaging tikz error: Cannot parse this coordinate

2023-08-08 Thread Hans Hagen
 \starttikzpicture    \foreach \p in {(6,2)}    {    \tracingall \startscope[shift={\p}]     \draw[color=green!60, thick] (0,0) -- (1,1); \stopscope    }   \stoptikzpicture looks like some parsing issue, are you sure that you can assign \p to shift this way? puzzle: \startMPcode

[NTG-context] Re: access image properties in Lua

2023-07-17 Thread Alan Braslau via ntg-context
On 17/07/23 17/07/23, 18:20, Henning Hraban Ramm wrote: Bonus question: how also to handle the case of \startMPcode draw figure "MyFigure" xsized TextWidth ; ... \stopMPcode Is MyFigure a pixel image? You could use \externalfigure within MP code. The MP operator figure calls \exte

[NTG-context] Re: access image properties in Lua

2023-07-17 Thread Henning Hraban Ramm
ging") report("Now calculating...") Bonus question: how also to handle the case of \startMPcode draw figure "MyFigure" xsized TextWidth ; ... \stopMPcode Is MyFigure a pixel image? You could use \externalfigure within MP code. Hraban ___

[NTG-context] Re: access image properties in Lua

2023-07-17 Thread Alan Braslau via ntg-context
xternally and manually case-by-case would be sufficient. Any suggestions on how to hook-in such reporting? Bonus question: how also to handle the case of \startMPcode draw figure "MyFigure" xsized TextWidth ; ... \stopMPcode -- Alan __

[NTG-context] Re: Fwd: Re: text width shadow background

2023-07-09 Thread Keith McKay
Hraban (and others), You got me thinking so I added this code to end of your code as a bit of fun. It's code from the luametafun manual to which I added two and a half lines. Best Wishes Keith %%% \startMPcode vardef tst (expr x, y, i, n) = definecolor [ name = "My

[NTG-context] Fwd: Fwd: Re: Fwd: Re: text width shadow background

2023-07-09 Thread Keith McKay
: mailing list for ConTeXt users , Henning Hraban Ramm I played about with the number of shadow layers and added a wee bit randomness which gave a nice effect. See the code below and the attached png. Best Wishes Keith %%% \startMPcode steps := 30 ; % number of shadow layers rulesize

[NTG-context] Re: text width shadow background

2023-07-07 Thread Henning Hraban Ramm
Please, can you explain why the result of lmt_outline is shifted to the right, if I use it in a macro? """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode steps := 5 ; % number of shadow layers rulesize := BodyFontSi

[NTG-context] Re: text width shadow background

2023-07-06 Thread Henning Hraban Ramm
: """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode{doublefun} steps := 10 ; rulesize := BodyFontSize/steps/3; for step = 1 upto steps: draw lmt_outline [ text = "\bf #1", %style = "bold",

[NTG-context] text width shadow background

2023-07-06 Thread Henning Hraban Ramm
Hi, maybe you remember that I wanted this since 2017... I finally managed to get a fuzzy background behind text: """ \setupbodyfont[ss,24pt] \definecolor[tshade][t=.05,a=1,k=1] \starttexdefinition MyCaption #1 \startMPcode{doublefun} steps := 10 ; rulesize := BodyFontSize/steps/

[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Henning Hraban Ramm
actually was \startMPcode; had nothing to do with \startdocument or your code, sorry. Also sorry, seems like I can’t help you. Hraban ___ If your question is of interest to others as well, please add an entry to the

[NTG-context] Re: MPcode inserts page

2023-07-06 Thread Henning Hraban Ramm
Am 06.07.23 um 12:02 schrieb Alan Braslau: On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote: Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for

[NTG-context] Re: MPcode inserts page

2023-07-06 Thread Alan Braslau via ntg-context
On 06/07/23 06/07/23, 11:23, Henning Hraban Ramm wrote: Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for random value reasons I must load it only once

[NTG-context] MPcode inserts page

2023-07-06 Thread Henning Hraban Ramm
Hi, if I use \startMPcode to declare variables etc. that I need in several MP graphics, it always inserts an empty page. How can I avoid that? (Actually, I load an external mp file, and for random value reasons I must load it only once. But the MWE already shows the problem.) ""&quo

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Carlos via ntg-context
I think you miss a few points here: > > (1) I know Hans vd Meer well and he knows ConTeXt well. He's quite capable > of figuring out how to use advanced features and I bet he likes the > following variant of arrows in text. Next time we meet I'll show him some >

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Hans Hagen via ntg-context
[width=\usedadaptivewidth, %height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]% %\egroup % \stopsetups \startsetups adaptive:test \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex \bgroup \startMPcode drawarrow ((0,0) -- (\the\usedadaptivew

Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context
d is to put large settings into a setups-blocks and > pass the block to a setup-command. > > \startsetups [apage] > \startMPcode > StartPage; > ... > StopPage; > \stopMPcode > \stopsetups > > \defineoverlay[apage][\directsetup{apage}] > > Wolfgang > > __

Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Wolfgang Schuster via ntg-context
r=1cm,   footer=1cm] Another useful method is to put large settings into a setups-blocks and pass the block to a setup-command. \startsetups [apage] \startMPcode StartPage; ... StopPage; \stopMPcode \stopsetups \defineoverlay[apage][\directsetup{apage}] Wol

[NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context
] \setuplayout[ backspace = 2.5cm, margin = 0.5cm, width = 16cm, header = 1cm, footer = 1cm, ] \setupbackgrounds[state=repeat] \defineoverlay[apage][ {\startMPcode StartPage; definecolor[ name = "MyColor1", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformdeviate(1

Re: [NTG-context] What's the current method for using a variable font in Context and Metapost?

2023-01-20 Thread Lutz Haseloff via ntg-context
\starttext Test Test \definefont[bahnlight][name:bahnschriftlight*default] \startMPcode picture pic; pic := thelabel(textext("\bahnlight This is Bahnschrift light in Metafont 0123456789"), (0, 0)); draw pic; \stopMPcode \stoptext Am 20. Januar 2023 18:28:23 MEZ schrieb Guido Bart

Re: [NTG-context] What's the current method for using a variable font in Context and Metapost?

2023-01-20 Thread Guido Bartolucci via ntg-context
[ss] [bahnschrift] > \setupbodyfont[mainface] > > \ss 123456789 Wild! \medskip > > \startMPcode > picture pic; > pic := thelabel(textext("\ss This is in Metafont 0123456789"), (0, 0)); > draw pic; > \stopMPcode > > > Greetings Lutz > > > Am 20

Re: [NTG-context] What's the current method for using a variable font in Context and Metapost?

2023-01-19 Thread Lutz Haseloff via ntg-context
Hi Guido, this works here: \starttext Test Test \usemodule[fonts-variable] \definefontfamily [mainface] [ss] [bahnschrift] \setupbodyfont[mainface] \ss 123456789 Wild! \medskip \startMPcode picture pic; pic := thelabel(textext("\ss This is in Metafont 0123456789"), (0, 0))

[NTG-context] What's the current method for using a variable font in Context and Metapost?

2023-01-19 Thread Guido Bartolucci via ntg-context
dskip \startMPcode picture pic; pic := thelabel("This is in Metafont 0123456789", (0, 0)); draw pic; \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki!

Re: [NTG-context] MP figure continuation

2023-01-06 Thread Alan Braslau via ntg-context
seful. > > Thanks in advance and happy new year, > Alex Another solution is to save the picture: \startMPcode draw fullcircle scaled 1cm ; picture mypicture ; mypicture := currentpicture ; \stopMPcode Then, the next call to \startMPcode (or whatever you use) will have access to the sa

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
I just tried but I got an empty file... Do we agree that I have to replace the two lines with the other two ? Regarding what you proposed, how to get the same type of hatching in both figures ? \startMPcode path p, q, r, b ; p := unitsquare xyscaled (4cm,4cm) ; z[0] = (2cm,0cm

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Hans Hagen via ntg-context
ng on the dimensions of the squares. some unexpected side effect show up when the unitsquare is xyscaled to a rectangle like (2.5cm,1cm) it seems related to the angle chosen e.g. \startMPcode path p, q, r, b ; p  := unitsquare xyscaled (4cm,4cm) ; q := unitsquare xyscaled (1cm,1cm) shifted(

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
Not only, it is also true with the code below : \startMPcode path p, q, r, b ; p := unitsquare xyscaled (4cm,4cm) ; z[0] = (2cm,0cm) ; z[1] = (2cm,4cm) ; z[2] = (0cm,2cm) ; q := llcorner p--z[0]--z[1]--z[2]--cycle ; r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Floris van Manen via ntg-context
show up when the unitsquare is xyscaled to a rectangle like (2.5cm,1cm) it seems related to the angle chosen e.g. \startMPcode path p, q, r, b ; p := unitsquare xyscaled (4cm,4cm) ; q := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ; r := unitsquare xyscaled (2.5cm,1cm) shifted(1cm,3cm

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
> \startlinecorrection[blank] > > \startmidaligned > > \switchtobodyfont[9pt] > > \startMPcode > > path p, q, r, b ; > > p := unitsquare xyscaled (4cm,4cm) ; > > z[0] = (2cm,0cm) ; > > z[1] = (2cm,4cm) ; > &

Re: [NTG-context] About macro numberstriped ()

2022-10-01 Thread Mikael Sundqvist via ntg-context
t; \startlinecorrection[blank] > \startmidaligned > \switchtobodyfont[9pt] > \startMPcode > path p, q, r, b ; > p := unitsquare xyscaled (4cm,4cm) ; > z[0] = (2cm,0cm) ; > z[1] = (2cm,4cm) ; > z[2] = (0cm,2cm) ; > q := llcorner p--z[0]--z[1]--z[2]--cyc

Re: [NTG-context] About macro numberstriped ()

2022-10-01 Thread Fabrice Couvreur via ntg-context
Hi Hans, When the rectangles are not identical, how to have the same type of hatching in both ? Thanks. Fabrice \starttext \startlinecorrection[blank] \startmidaligned \switchtobodyfont[9pt] \startMPcode path p, q, r, b ; p := unitsquare xyscaled (4cm,4cm) ; z[0

Re: [NTG-context] About macro numberstriped ()

2022-09-28 Thread Fabrice Couvreur via ntg-context
22 7:49 PM, Fabrice Couvreur via ntg-context wrote: > > Hello, > > I notice a strange behavior of the macro numberstriped ( ). > > Thanks. > > Fabrice > > > > \starttext > > \switchtobodyfont[9pt] > > \startMPcode > > > >path p

  1   2   3   4   5   6   7   8   9   10   >