[NTG-context] Re: How to use Metapost libraries with Metafun?

2025-08-14 Thread Henning Hraban Ramm
Am 14.08.25 um 19:04 schrieb Hans Hagen via ntg-context: On 8/14/2025 2:06 PM, Shiv Shankar Dayal wrote: I tried metaUML library as you suggested but it didn't work as Hans said. Then you need to figure out what makes it fail; keep in mind that arbitrary lua or metapost or tex code i

[NTG-context] Re: How to use Metapost libraries with Metafun?

2025-08-14 Thread Hans Hagen via ntg-context
On 8/14/2025 2:06 PM, Shiv Shankar Dayal wrote: Dear Henning, I tried metaUML library as you suggested but it didn't work as Hans said. Then you need to figure out what makes it fail; keep in mind that arbitrary lua or metapost or tex code is not supposed to work in any other lua, met

[NTG-context] Re: How to use Metapost libraries with Metafun?

2025-08-14 Thread Shiv Shankar Dayal
dium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Aug 13, 2025 at 4:59 PM Hans Hagen via ntg-context wrote: > > On 8/13/2025 11:26 AM, Shiv Shankar Dayal wrote: > > Hi, > > > > How can I us

[NTG-context] Re: How to use Metapost libraries with Metafun?

2025-08-13 Thread Hans Hagen via ntg-context
On 8/13/2025 11:26 AM, Shiv Shankar Dayal wrote: Hi, How can I use Metapost libraries from texlive in ConTeXt? maybe by using "input" but i wouldn't gamble on them working (read: they could overload and for sure have a different tex

[NTG-context] Re: How to use Metapost libraries with Metafun?

2025-08-13 Thread Henning Hraban Ramm
Am 13.08.25 um 11:26 schrieb Shiv Shankar Dayal: How can I use Metapost libraries from texlive in ConTeXt? If you run on TeXlive, \useMPlib[libname] should be enough. Otherwise you must install it in one of your texmf trees, e.g. ~/texmf (= HOMETEXMF), /tex/texmf-project, /tex/texmf-local

[NTG-context] How to use Metapost libraries with Metafun?

2025-08-13 Thread Shiv Shankar Dayal
Hi, How can I use Metapost libraries from texlive in ConTeXt? -- Respect, Shiv Shankar Dayal ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl

[NTG-context] Re: Metapost through context incorrect `hex` function output

2025-05-20 Thread Yann Herklotz
Ah thanks for the pointer, I did not know about the luametafun manual, that looks like a great resource. Thanks, Yann On 20/05/2025 10:30, Hans Hagen wrote: On 5/20/2025 10:22 AM, Yann Herklotz wrote:  > just not implemented ... i pushed an update so you can check the binary from the build f

[NTG-context] Re: Metapost through context incorrect `hex` function output

2025-05-20 Thread Hans Hagen
On 5/20/2025 10:22 AM, Yann Herklotz wrote: > just not implemented ... i pushed an update so you can check the binary from the build farm Oh thanks! I wasn't aware that there was a separate implementation in LMTX. Side note: the source code has been reorganized, cleaned up a bit, and additi

[NTG-context] Re: Metapost through context incorrect `hex` function output

2025-05-20 Thread Yann Herklotz
ote: Hi, I have found that the metapost `hex` function outputs a strange result when run through `context`.  I'm not quite sure what is leading to this output, maybe `hex` is redefined in `metafun`? just not implemented ... i pushed an update so you can check the binary from the bui

[NTG-context] Re: Metapost through context incorrect `hex` function output

2025-05-11 Thread Hans Hagen via ntg-context
On 5/9/2025 11:30 AM, Yann Herklotz wrote: Hi, I have found that the metapost `hex` function outputs a strange result when run through `context`.  I'm not quite sure what is leading to this output, maybe `hex` is redefined in `metafun`? just not implemented ... i pushed an update so yo

[NTG-context] Metapost through context incorrect `hex` function output

2025-05-09 Thread Yann Herklotz
Hi, I have found that the metapost `hex` function outputs a strange result when run through `context`. I'm not quite sure what is leading to this output, maybe `hex` is redefined in `metafun`? To reproduce, place the following in test.mp: ``` show hex "8d"; ``` Then run

[NTG-context] Re: MetaPost behaviour differs between standalone and \startreusableMPgraphic

2025-02-19 Thread Aditya Mahajan
On Tue, 18 Feb 2025, Pavneet Arora via ntg-context wrote: > I am in the process of converting a bunch of old TikZ notepaper > templates to native ConTeXt and MetaPost. If speed is not a huge concern, you can directly use Tikz code in context, both as standalone code and also an

[NTG-context] Re: MetaPost behaviour differs between standalone and \startreusableMPgraphic

2025-02-19 Thread luigi scarso
On Wed, 19 Feb 2025 at 04:41, Gavin via ntg-context wrote: > > I whole heatedly support converting TikZ to MetaPost! > I don't think it will happen soon, if ever . Instead, these two can be useful tools to have at hand: https://ipe.otfried.org/ https://asymptote.sourceforge

[NTG-context] Re: MetaPost behaviour differs between standalone and \startreusableMPgraphic

2025-02-19 Thread Hans Hagen
re or less. This is why we often see these within 'eps' range tests. My guess is that Pavneet runs mp stand alone in scaled mode while context by default uses double mode. For them to run the same one can do. One can try mtxrun --script metapost foo.mp instead. I whole heatedly sup

[NTG-context] Re: MetaPost behaviour differs between standalone and \startreusableMPgraphic

2025-02-18 Thread Gavin via ntg-context
Hi Pavneet, I recommend avoiding the mod function. Just draw the two grids (major and minor) each with their own spacing and pen. I whole heatedly support converting TikZ to MetaPost! - Gavin \startreusableMPgraphic{graph} minor=2mm; % Minor lines, each every 2mm major=8mm; % Major

[NTG-context] MetaPost behaviour differs between standalone and \startreusableMPgraphic

2025-02-18 Thread Pavneet Arora via ntg-context
I am in the process of converting a bunch of old TikZ notepaper templates to native ConTeXt and MetaPost. This is a part of a project to generate notebooks with documentation data and then blank pages appended to fill out full sheets, and then collated in a particular order for trimming and

[NTG-context] Re: Functional shading with MetaPost / MetaFun

2025-01-09 Thread Florent Michel
effect in MetaPost? Here are two screenshots to whos the difference: https://imgur.com/a/SlJ4BiE Thank you also for pointing me to the test suite! It seems to have many useful examples! Cheers, Florent On Fri, Jan 10, 2025, 00:17 Hans Hagen wrote: > On 1/9/2025 10:44 PM, Florent Michel

[NTG-context] Re: Functional shading with MetaPost / MetaFun

2025-01-09 Thread Hans Hagen
On 1/9/2025 10:44 PM, Florent Michel wrote: Hi, I was trying to see if I could use MetaFun / MetaPost as my main tool for generating figures. I really like its close integration with ConTeXt, speed, and expressivity making it, even for a beginner like me, a  pleasure to work with. One

[NTG-context] Functional shading with MetaPost / MetaFun

2025-01-09 Thread Florent Michel
Hi, I was trying to see if I could use MetaFun / MetaPost as my main tool for generating figures. I really like its close integration with ConTeXt, speed, and expressivity making it, even for a beginner like me, a pleasure to work with. One difficulty I encountered is for generating 2D

[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 Mikael Sundqvist
Hi, as far as I have understood one can only either use a circle (and then, lowlevel, Postscript/PDF uses that) or a polygon (and then that is used low-level). Since a few weeks (not sure if it is in distribution yet) there is also a penstroked macro that imitates the penstroke a bit (one can mak

[NTG-context] Re: Rounded pens with Metapost

2024-12-07 Thread Wolfgang Schuster
Keith McKay schrieb am 07.12.2024 um 13:29: Hi Wolfgang I thought using the metapost variable tcircle as a pen would work but for some reason it does not give rounded corners for the square in the first MPpage. Not a solution unfortunately. Best Wishes Keith path Tcircle; Tcircle

[NTG-context] Re: Rounded pens with Metapost

2024-12-07 Thread Keith McKay
Hi Wolfgang I thought using the metapost variable tcircle as a pen would work but for some reason it does not give rounded corners for the square in the first MPpage. Not a solution unfortunately. Best Wishes Keith path Tcircle; Tcircle := tcircle; draw Tcircle scaled 20 shifted(0,24

[NTG-context] Rounded pens with Metapost

2024-12-06 Thread Wolfgang Schuster
Hi, are there now better ways to create rounded pens without adding many support points? \starttext \startMPpage[offset=1dk] path Halfcircle ; Halfcircle = (1,0){up} for i = 1 upto 180 : .. ((1,0) rotated i) endfor -- cycle ; draw Halfcircle scaled 10 shifted (0,12) ; pen HalfcirclePen ;

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Wolfgang Schuster
Mikael Sundqvist schrieb am 01.12.2024 um 14:02: Hi On Sun, Dec 1, 2024 at 1:28 PM Wolfgang Schuster wrote: Hans Hagen via ntg-context schrieb am 01.12.2024 um 12:34: On 12/1/2024 11:54 AM, Bruce Horrocks wrote: Sorry, brain not in gear so once you're rebooted, you can figure out the logi

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Hans Hagen
On 12/1/2024 2:02 PM, Mikael Sundqvist wrote: Hi On Sun, Dec 1, 2024 at 1:28 PM Wolfgang Schuster wrote: Hans Hagen via ntg-context schrieb am 01.12.2024 um 12:34: On 12/1/2024 11:54 AM, Bruce Horrocks wrote: Sorry, brain not in gear so once you're rebooted, you can figure out the logic

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Mikael Sundqvist
Hi On Sun, Dec 1, 2024 at 1:28 PM Wolfgang Schuster wrote: > > Hans Hagen via ntg-context schrieb am 01.12.2024 um 12:34: > > On 12/1/2024 11:54 AM, Bruce Horrocks wrote: > > > >> Sorry, brain not in gear > > > > so once you're rebooted, you can figure out the logic behind this: > > > > linecap

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Wolfgang Schuster
Hans Hagen via ntg-context schrieb am 01.12.2024 um 12:34: On 12/1/2024 11:54 AM, Bruce Horrocks wrote: Sorry, brain not in gear so once you're rebooted, you can figure out the logic behind this: linecap := butt ; linejoin := beveled ; This doesn't result in the desired output I want. or

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Wolfgang Schuster
Bruce Horrocks schrieb am 01.12.2024 um 11:45: On 1 Dec 2024, at 09:51, Wolfgang Schuster wrote: While I can get the desired result which a filled path I'm looking for a solution where I have to set fewer control points. Draw the paths two grid squares sorter and at each end draw a “dot” w

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Hans Hagen via ntg-context
On 12/1/2024 11:54 AM, Bruce Horrocks wrote: Sorry, brain not in gear so once you're rebooted, you can figure out the logic behind this: linecap := butt ; linejoin := beveled ; or even pickup pensquare rotated -60 scaled (1/sqrt(2)) ; linecap := 1 ; Hans

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Bruce Horrocks
> On 1 Dec 2024, at 10:45, Bruce Horrocks wrote: > > > >> On 1 Dec 2024, at 09:51, Wolfgang Schuster >> wrote: >> >> While I can get the desired result which a filled path I'm looking for a >> solution where I have to set fewer control points. > > Draw the paths two grid squares sorter a

[NTG-context] Re: Metapost lines with fancy line endings and connections

2024-12-01 Thread Bruce Horrocks
> On 1 Dec 2024, at 09:51, Wolfgang Schuster > wrote: > > While I can get the desired result which a filled path I'm looking for a > solution where I have to set fewer control points. Draw the paths two grid squares sorter and at each end draw a “dot” which is a triangle of the right direct

[NTG-context] Metapost lines with fancy line endings and connections

2024-12-01 Thread Wolfgang Schuster
Hi, I have a bunch of similar graphics on a 7x7 where some lines have exceptions for the endings and connections. - When a line ends in one of the four corners the line end has an angle of 45 degrees. - When a line takes a turn the outer corner results also in a 45 degree angle. - Single po

[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
red a (to me) slightly 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 > s

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

2024-11-29 Thread Florent Michel
Hi, I have just encountered a (to me) slightly 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: Problem with Metapost

2024-11-03 Thread Fabrice Couvreur
; > > and it might work. > > (It is a bit weird that ymax = 7 several times result in an error, but ... > ) > > /Mikael > > On Sun, Nov 3, 2024 at 4:47 PM Fabrice Couvreur > wrote: > > > > Hi, > > I think I have never encountered this problem. Rece

[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: Metapost and write to file...

2024-10-01 Thread Willi Egger
Thank you for checking and fixing Hans! Willi > On 1 Oct 2024, at 19:03, Hans Hagen wrote: > > On 10/1/2024 4:58 PM, Willi Egger wrote: >> Hello! >> I think that I am missing something here. I should use an older file of >> mine, where some data calculated by META

[NTG-context] Re: Metapost and write to file...

2024-10-01 Thread Hans Hagen
On 10/1/2024 4:58 PM, Willi Egger wrote: Hello! I think that I am missing something here. I should use an older file of mine, where some data calculated by METAPOST should be written to a file. However in the latest version of CONTEXT luametatex exits with error code 1 when running this

[NTG-context] Metapost and write to file...

2024-10-01 Thread Willi Egger
Hello! I think that I am missing something here. I should use an older file of mine, where some data calculated by METAPOST should be written to a file. However in the latest version of CONTEXT luametatex exits with error code 1 when running this minimal example. What has changed? Kind

[NTG-context] Re: Curious about 3D Metapost

2024-09-25 Thread Hans Hagen
On 9/25/2024 3:16 PM, Shiv Shankar Dayal wrote: You're kidding right? Interfacing to some huge system that dwarfs the luametatex code base, creates a horrible dependency on what is fashion today (and replaced in a few years by what is then the fashion in graphics), adds plenty of runtime while in

[NTG-context] Re: Curious about 3D Metapost

2024-09-25 Thread Shiv Shankar Dayal
> You're kidding right? Interfacing to some huge system that dwarfs the > luametatex code base, creates a horrible dependency on what is fashion > today (and replaced in a few years by what is then the fashion in > graphics), adds plenty of runtime while in practice one can just create > these grap

[NTG-context] Re: Curious about 3D Metapost

2024-09-25 Thread Hans Hagen via ntg-context
On 9/25/2024 2:30 PM, Shiv Shankar Dayal wrote: Please correct me if I'm wrong. LMTX has Metapost built in then can we not write a pure lua extension of it to do real 3D probably using Vulkan? You're kidding right? Interfacing to some huge system that dwarfs the luametatex code bas

[NTG-context] Curious about 3D Metapost

2024-09-25 Thread Shiv Shankar Dayal
Please correct me if I'm wrong. LMTX has Metapost built in then can we not write a pure lua extension of it to do real 3D probably using Vulkan? -- Respect, Shiv Shankar Dayal ___ If your question is of intere

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

2024-08-30 Thread Shiv Shankar Dayal
> try "dashed evenly" instead of just "dashed". > Thanks. It works nicely. -- Respect, Shiv Shankar Dayal ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-contex

[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 > \startMPcode > draw function(1,"x", "log(x)",

[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, i*cm) -- (10cm, i*cm) dashe

[NTG-context] MetaPost dirtree?

2024-08-29 Thread Henning Hraban Ramm
Hi, did someone already create directory trees with MetaPost? It should be quite easy, but I couldn’t find examples and was thinking about porting the LaTeX dirtree package (i.e. look at the code and try to implement something similar in Lua and MP). I have ideas… (but I have always too many

[NTG-context] Re: Metapost logo typesetting

2024-08-03 Thread Shiv Shankar Dayal
Many thanks. It worked like a charm. On Sun, Aug 4, 2024 at 11:44 AM Pablo Rodriguez via ntg-context < ntg-context@ntg.nl> wrote: > On 8/4/24 06:45, Shiv Shankar Dayal wrote: > > Hi, > > > > I believe that there is a LaTeX package which typesets the METAPOST text >

[NTG-context] Re: Metapost logo typesetting

2024-08-03 Thread Pablo Rodriguez via ntg-context
On 8/4/24 06:45, Shiv Shankar Dayal wrote: > Hi, > > I believe that there is a LaTeX package which typesets the METAPOST text > in a certain font, I do not remember which. How can I typeset same > Metapost logo in ConTeXt. It looks like below; These are the right commands for bot

[NTG-context] Metapost logo typesetting

2024-08-03 Thread Shiv Shankar Dayal
Hi, I believe that there is a LaTeX package which typesets the METAPOST text in a certain font, I do not remember which. How can I typeset same Metapost logo in ConTeXt. It looks like below; [image: image.png] -- Respect, Shiv Shankar Dayal

[NTG-context] Re: MetaPost background

2024-07-23 Thread alan . caruanambom
The frame is only for reference, what I need is that the background is not wider than or higher than the frame, changing the coordinates of the points can be done but I remember seeing an example in which using "shifted" it could be done move to a corner, without worrying about the coordinates o

[NTG-context] Re: MetaPost background

2024-07-23 Thread Wolfgang Schuster
alan.caruanam...@gmail.com schrieb am 23.07.2024 um 20:29: Hello, I need the background (lines and points) to be inside (tangent) of the frame, I don't know how to do it \startuseMPgraphic{fullheightbackground} fill unitsquare xyscaled (OverlayWidth, OverlayHeight) withcolor "gray" ;

[NTG-context] Re: MetaPost background

2024-07-23 Thread Otared Kavian
Hi, If you change drawdot (0,0) withpen pencircle scaled 8pt withcolor red; into drawdot (6pt,6pt) withpen pencircle scaled 8pt withcolor red ; you get what you want (at least for the red dot on the lower left corner). Here 6pt = 2pt (with of the pen used for the frame) + 4pt (half the diame

[NTG-context] MetaPost background

2024-07-23 Thread alan . caruanambom
Hello, I need the background (lines and points) to be inside (tangent) of the frame, I don't know how to do it \startuseMPgraphic{fullheightbackground} fill unitsquare xyscaled (OverlayWidth, OverlayHeight) withcolor "gray" ; w := MakeupWidth; h := OverlayHeight; draw (0,0)--(Ma

[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Mikael Sundqvist
Hi, On Sun, May 12, 2024 at 6:24 PM Fabrice Couvreur < fabrice1.couvr...@gmail.com> wrote: > > With Okular, it works ! Very good. You can still try the thing below: \startluacode local exp = math.exp local N = 1000 local xstep = 1.6/N local ystep = 1.8/N local xmin = 0.3 local

[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
With Okular, it works ! Le dim. 12 mai 2024 à 17:55, Hans Hagen a écrit : > On 5/12/2024 5:36 PM, Fabrice Couvreur wrote: > > Sorry for the comment ! > > I use Evince > so how about okular or mupdf > > - >

[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen
On 5/12/2024 5:36 PM, Fabrice Couvreur wrote: Sorry for the comment ! I use Evince so how about okular or mupdf - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | T

[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Sorry for the comment ! I use Evince Le dim. 12 mai 2024 à 17:30, Hans Hagen a écrit : > On 5/12/2024 3:57 PM, Fabrice Couvreur wrote: > > Hi, > > When I want to draw the curve which corresponds to n=60 (blue curve), it > > doesn't seem possible: I don't understand. > > Thanks > > Fabrice > > >

[NTG-context] Re: Metapost limitation ?

2024-05-12 Thread Hans Hagen
On 5/12/2024 3:57 PM, Fabrice Couvreur wrote: Hi, When I want to draw the curve which corresponds to n=60 (blue curve), it doesn't seem possible: I don't understand. Thanks Fabrice  \startMPpage[offset=1DK]           numeric u;           u = 6cm;           interim linejoin := mitered;  

[NTG-context] Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Hi, When I want to draw the curve which corresponds to n=60 (blue curve), it doesn't seem possible: I don't understand. Thanks Fabrice \startMPpage[offset=1DK] numeric u; u = 6cm; interim linejoin := mitered; interim ahangle := 30; path xx, yy;

[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 for i within tt : pat

[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 withshademethod "linear"

[NTG-context] Re: MetaPost lines in tables?

2024-02-22 Thread Henning Hraban Ramm
{10}{ \bTR \bTD\strut \eTD\bTD \eTD\bTD \eTD \eTR } \eTABLE """ Hraban%D \module %D [ file=mp-sketch.mp %Dversion=2021.05.13 %D title=\CONTEXT\ \METAPOST\ graphics, %D subtitle=Sketch drawing, %D author=Aditya Mahajan, %D date=\

[NTG-context] Re: MetaPost lines in tables?

2024-02-22 Thread Hans Hagen via ntg-context
On 2/21/2024 7:47 PM, Henning Hraban Ramm wrote: Am 21.02.24 um 19:43 schrieb Wolfgang Schuster: … but it would be visible on a colored background. I’m sure you can show me a better way… \startuseMPgraphic{dottedborder}    draw bottomboundary OverlayBox withpen pencircle scaled 2 dashed withd

[NTG-context] Re: MetaPost lines in tables?

2024-02-21 Thread Henning Hraban Ramm
Am 21.02.24 um 19:43 schrieb Wolfgang Schuster: … but it would be visible on a colored background. I’m sure you can show me a better way… \startuseMPgraphic{dottedborder}   draw bottomboundary OverlayBox withpen pencircle scaled 2 dashed withdots withcolor "red";   setbounds currentpicture

[NTG-context] Re: MetaPost lines in tables?

2024-02-21 Thread Wolfgang Schuster
Henning Hraban Ramm schrieb am 21.02.2024 um 19:04: Am 19.02.24 um 23:15 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 19.02.2024 um 22:39: I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics

[NTG-context] Re: MetaPost lines in tables?

2024-02-21 Thread Henning Hraban Ramm
Am 19.02.24 um 23:15 schrieb Wolfgang Schuster: Henning Hraban Ramm schrieb am 19.02.2024 um 22:39: I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics? ATM I’m trying to place my MP lines behind a frame

[NTG-context] Re: MetaPost lines in tables?

2024-02-19 Thread Wolfgang Schuster
Henning Hraban Ramm schrieb am 19.02.2024 um 22:39: I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics? ATM I’m trying to place my MP lines behind a frame-less TABLE; it will probably work, but it’s a

[NTG-context] MetaPost lines in tables?

2024-02-19 Thread Henning Hraban Ramm
I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics? ATM I’m trying to place my MP lines behind a frame-less TABLE; it will probably work, but it’s a crutch… Hraban

[NTG-context] Re: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
Thanks Mikael. This helped indeed. I updated my example on the Metapost page in the wiki accordingly. The`pagestate=start` functionality is not documented in the wiki. It's not clear for which context commands it can or should be used. Who is willing to help out here? Best regards Emanu

[NTG-context] Re: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Mikael Sundqvist
e numbering in a pdf > viewer? > > On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context > wrote: > > I think I could solve all the problems. Attached the finalized working > example. I created the > https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_p

[NTG-context] Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
created the https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry with it. Feel free to modify.CheersEmanuelOn Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote:Hi,not sure I get what you are missing. But you can trysetbounds currentpicture to (fullsquare scaled 200) ;in base

[NTG-context] Re: Working with layer sets with Metapost

2024-02-17 Thread Emanuel Han via ntg-context
I think I could solve all the problems. Attached the finalized working example. I created the https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry with it. Feel free to modify. Cheers Emanuel On Feb. 16 2024, at 7:56 am, Mikael Sundqvist wrote: > Hi, > > n

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Mikael Sundqvist
Emanuel Han via ntg-context wrote: > > Resp. the solution should be such that each generated PDF page has the same > dimension, the same background colour and a page number and the metapost > content on each page has the same scaling factor. > > On Feb. 15 2024, at 11:10 pm, E

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Resp. the solution should be such that each generated PDF page has the same dimension, the same background colour and a page number and the metapost content on each page has the same scaling factor. On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context wrote: > Dear Mikael, > > I

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
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 \useMPgraphic{lay

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Dear Mikael, thanks a lot! this seems to be the solution! And it looks beatiful enough to me 😄 I'll try to port all my layers to this new method and see if I run into new problems again 😅 Emanuel On Feb. 15 2024, at 8:19 am, Mikael Sundqvist wrote: > Hi > > On Thu, Feb 15, 2024 at 1:03 AM Emanu

[NTG-context] Re: Working with layer sets with Metapost

2024-02-14 Thread Mikael Sundqvist
Hi On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context wrote: > > Dear list, > > the attached .tex file is the minimal working example we discussed today in > the online meeting. > > I realized that the approach of looping through k of p[k] is not fitting my > needs, because it's not fl

[NTG-context] Working with layer sets with Metapost

2024-02-14 Thread Emanuel Han via ntg-context
Dear list, the attached .tex file is the minimal working example we discussed today in the online meeting. I realized that the approach of looping through k of p[k] is not fitting my needs, because it's not flexible enough. I need another approach, one which works with layer sets. I would stop u

[NTG-context] Re: Metapost docs

2024-01-11 Thread Hans Hagen
On 1/11/2024 4:54 PM, Shiv Shankar Dayal wrote: Dear Gavin, I am aware of these resources. My question is about docs of those Metapost libs which are in the distribution in Metapost directory. If something is not in the metafun, luametafun or another manual, then you should not use it as it&#

[NTG-context] Re: Metapost docs

2024-01-11 Thread Shiv Shankar Dayal
Dear Gavin, I am aware of these resources. My question is about docs of those Metapost libs which are in the distribution in Metapost directory. On Thu, Jan 11, 2024 at 9:12 PM Gavin via ntg-context wrote: > Hi Shiv, > > I am working with MetaPost in ConTeXt. Here are the resour

[NTG-context] Re: Metapost docs

2024-01-11 Thread Gavin via ntg-context
Hi Shiv, I am working with MetaPost in ConTeXt. Here are the resources I use, roughly in the order I search when trying to solve a problem. - MetaFun Manual (http://www.pragma-ade.nl/general/manuals/metafun-p.pdf) This is most comprehensive and helpful source. - MetaPost Manual (http

[NTG-context] Re: Metapost docs

2024-01-10 Thread shivshankar . dayal
I have files in my installation like 'mp-form.mkiv, mp-chem.mkiv' and so on. -- Respect, Shiv Shankar Dayal ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-conte

[NTG-context] Lua and inject.path to make a disconnected MetaPost path?

2024-01-08 Thread Gavin via ntg-context
Hello LuaMetaFun Fans, Can I use mp.inject.path in Lua to create a disconnected path in MetaPost? This is for my module that draws globes. I currently do something like this for drawing the continents. (This MWE has two triangular continents.) \startluacode continents = {} continents[1

[NTG-context] Re: Metapost docs

2024-01-08 Thread Hans Hagen via ntg-context
On 1/8/2024 1:50 AM, Shiv Shankar Dayal wrote: I see many libraries for Metapost in Context source. Where are these documented? I see Metafun manual as well, but I do not find all the included libraries described. i'm not sure what you mean with library ... can you give an example?

[NTG-context] Metapost docs

2024-01-07 Thread Shiv Shankar Dayal
I see many libraries for Metapost in Context source. Where are these documented? I see Metafun manual as well, but I do not find all the included libraries described. -- Respect, Shiv Shankar Dayal ___ If your

[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 > > > \startMPcode > numeric u; u=1cm;

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

2024-01-06 Thread Emanuel Han via ntg-context
>> z4 = (30,50); > > >> z5 = (90,70); > > >> z6 = (-10,70); > > >> > > >> path A; A = z0..z1..z2..z3..z4 ; > > >> pair AStartPoint; AStartPoint = point 0 of A; > > >> pair AEndPoint; AEndPoint = point 4 of A; > > >

[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 360: .. a *

[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 s

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

2023-12-04 Thread Fabrice L
gt; > >> p2:=image(draw A; label(lmt_outline [ > >> text = "\JapaneseFont 日本語" > >> ], AEndPoint);); > >> > >> p3:=image( > >> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, > >> BStartPoint); > >

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

2023-12-02 Thread Emanuel Han via ntg-context
t; z0 = (0,0); > > >> z1 = (60,40); > > >> z2 = (40,90); > > >> z3 = (10,70); > > >> z4 = (30,50); > > >> z5 = (90,70); > > >> z6 = (-10,70); > > >> > > >> path A; A = z0..z1..z2..z3..z4 ; > > >

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

2023-12-02 Thread Mikael Sundqvist
> p1:=image( > >> draw A withcolor red; > >> ); > >> > >> p2:=image(draw A; label(lmt_outline [ > >> text = "\JapaneseFont 日本語" > >> ], AEndPoint);); > >> > >> p3:=image( > >> label(textext("\notona

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

2023-12-02 Thread Emanuel Han via ntg-context
; ], AEndPoint);); > >> > >> p3:=image( > >> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, > >> BStartPoint); > >> ); > >> > >> p4:=image(draw A; label(lmt_outline [ > >> text = "\KoreanFont 한

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

2023-12-02 Thread Mikael Sundqvist
withcolor green; >> ); >> >> p6:=image( >> draw B withcolor blue; >> ); >> \stopMPinclusions >> >> \starttext >> >> \dorecurse{6}{ % Frame >> \setupMPpage[background=color, backgroundcolor=SpringGreen] >> \startMPpage[pa

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

2023-12-02 Thread fv leung
ot;T="&decimal(currentime)) scaled 2 shifted(0,2in) withcolor > magenta ; > for k=1 upto currentime: draw p[k]; endfor > setbounds currentpicture to TheFrame ; > > desiredformat := 1080;% In pixels (will be converted by default at 72dpi) > currentpicture := currentpicture xy

  1   2   3   4   5   6   7   8   9   10   >