Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-12 Thread Taco Hoekwater
Hi, > On 11 Feb 2021, at 17:41, Mikael Sundqvist wrote: > > Thanks for your investigation and extended example! > > So, if I understand it correctly, the problem occurs where the > different circles are glued together with the .. construction. Took me a while to get it, but the problem is the

Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-11 Thread Mikael Sundqvist
, 2021 at 3:54 PM Hans Hagen wrote: > > On 2/11/2021 2:45 PM, Mikael Sundqvist wrote: > > Hi, > > > > since I already started this thread, I continue here. My metapost code > > is still not always working, and I do not understand what is going > > wrong. In

Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-11 Thread Hans Hagen
On 2/11/2021 2:45 PM, Mikael Sundqvist wrote: Hi, since I already started this thread, I continue here. My metapost code is still not always working, and I do not understand what is going wrong. In the example below, I draw two curves of constant width (p1 and p2), one rotated 180 degrees

Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-11 Thread Mikael Sundqvist
Hi, since I already started this thread, I continue here. My metapost code is still not always working, and I do not understand what is going wrong. In the example below, I draw two curves of constant width (p1 and p2), one rotated 180 degrees around the origin. Then I draw the curve (p3

Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-05 Thread Mikael Sundqvist
Hi, I was too quick to push send. This must be some rounding error. Changing the instance fixes the problem. Sorry for the noise. /Mikael On Fri, Feb 5, 2021 at 5:48 PM Mikael Sundqvist wrote: > > Hi, > > I get sometimes the wrong directionpoint. In the example below it > works for all values

[NTG-context] Metapost: directionpoint gives unexpected point(?)

2021-02-05 Thread Mikael Sundqvist
Hi, I get sometimes the wrong directionpoint. In the example below it works for all values of direx except between 0 and 90. If I put direx to something in this interval, it seems that the point between cs and cl are chosen. Is there a better way to construct the paths not to get this problem?

Re: [NTG-context] About baseline alignment in metapost - issue on the wiki ?

2021-01-29 Thread Stefan Nedeljkovic
Thank you very much Garulfo! On Fri, Jan 29, 2021 at 9:34 AM Garulfo wrote: > The dlft version doesn't seem to work on the wiki. > > A MVE here https://wiki.contextgarden.net/textext_positioning#Test_dlft > > > > > Le 29/01/2021 à 09:01, Garulfo a écrit : > > To align with the baseline : > > >

Re: [NTG-context] About baseline alignment in metapost - issue on the wiki ?

2021-01-29 Thread Taco Hoekwater
> On 29 Jan 2021, at 09:33, Garulfo wrote: > > The dlft version doesn't seem to work on the wiki. > > A MVE here https://wiki.contextgarden.net/textext_positioning#Test_dlft Version issue? The wiki is still running a context from june last year. > > > > > Le 29/01/2021 à 09:01, Garulfo a

Re: [NTG-context] About baseline alignment in metapost - issue on the wiki ?

2021-01-29 Thread Garulfo
The dlft version doesn't seem to work on the wiki. A MVE here https://wiki.contextgarden.net/textext_positioning#Test_dlft Le 29/01/2021 à 09:01, Garulfo a écrit : To align with the baseline : thetextext.drt("Hello, World!", (1cm, 5cm)) ; Also existing : thetextext.d  (center)

[NTG-context] About baseline alignment in metapost

2021-01-29 Thread Garulfo
To align with the baseline : thetextext.drt("Hello, World!", (1cm, 5cm)) ; Also existing : thetextext.d (center) thetextext.dlft (left) ___ If your question is of interest to others as well, please add an

[NTG-context] About baseline alignment in metapost

2021-01-28 Thread Stefan Nedeljkovic
Dear list, Consider the following example: \definepapersize [custom] [width=20cm, height=15cm] \setuppapersize [custom] \setuplayout [ width=fit, rightmargin=0cm, leftmargin=0cm, leftmargindistance=0pt, rightmargindistance=0pt, height=fit, header=0pt, footer=0pt,

[NTG-context] Appearance of ticks and grids with ConTeXt metapost graph module

2021-01-04 Thread Jean-Philippe Rey
in red. The original metapost graph module doesn't apply drawing instructions to the label. That seems a better choice as you usually don't want to apply special effect on the labels. If you really want to draw the label with specific parameters you can write, for example, grid.bot(image(draw

Re: [NTG-context] metapost graph and ConTeXt LMTX

2021-01-03 Thread Jean-Philippe Rey
Le 3 janv. 2021 à 19:21, Hans Hagen <j.ha...@xs4all.nl> a écrit :On 1/3/2021 7:12 PM, Jean-Philippe Rey wrote:Dear List,I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several f

Re: [NTG-context] metapost graph and ConTeXt LMTX

2021-01-03 Thread Hans Hagen
On 1/3/2021 7:12 PM, Jean-Philippe Rey wrote: Dear List, I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several figures with metapost/metafun and some with the help of metaobj

[NTG-context] metapost graph and ConTeXt LMTX

2021-01-03 Thread Jean-Philippe Rey
Dear List, I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several figures with metapost/metafun and some with the help of metaobj and I am fully satisfied with the result. I am

Re: [NTG-context] drop shadows with metapost/ metafun

2021-01-02 Thread Henning Hraban Ramm
> Am 29.12.2020 um 22:56 schrieb Garulfo : > > Which process would you advice to add « drop shadows » to any kind of metafun > / metapost figures like: > picture p; > p := textext("MetaPost is fun!") shifted (10cm,10cm); > > > My current understanding of

Re: [NTG-context] drop shadows with metapost/ metafun

2020-12-31 Thread Aditya Mahajan
On Fri, 1 Jan 2021, Aditya Mahajan wrote: > On Tue, 29 Dec 2020, Garulfo wrote: > > > Which process would you advice to add « drop shadows » to any kind of > > metafun / metapost figures like: > > > Actually, all this seems long and tedious, and contrasts with the

Re: [NTG-context] drop shadows with metapost/ metafun

2020-12-31 Thread Aditya Mahajan
On Tue, 29 Dec 2020, Garulfo wrote: > Which process would you advice to add « drop shadows » to any kind of metafun > / metapost figures like: > picture p; > p := textext("MetaPost is fun!") shifted (10cm,10cm); > > My current understanding of the requir

[NTG-context] drop shadows with metapost/ metafun

2020-12-29 Thread Garulfo
Which process would you advice to add « drop shadows » to any kind of metafun / metapost figures like: picture p; p := textext("MetaPost is fun!") shifted (10cm,10cm); My current understanding of the required steps : 1- fill p with the shadow color 2- write it to an external met

Re: [NTG-context] Bugs using \startTEXpage ... \stopTEXpage, Metapost and text

2020-12-06 Thread Pablo Rodriguez
On 12/6/20 3:29 PM, Jairo A. del Rio wrote: > [...] > gives a normal output in MkIV, but buggy output in LMTX. It seems only > TeX commands in Metapost (textext, thetextext, etc.) are affected. Am I > missing something? Hi Jairo, the sample can be much simpler: \starttext

[NTG-context] Bugs using \startTEXpage ... \stopTEXpage, Metapost and text

2020-12-06 Thread Jairo A. del Rio
ut in MkIV, but buggy output in LMTX. It seems only TeX commands in Metapost (textext, thetextext, etc.) are affected. Am I missing something? Thank you in advance. Regards, Jairo :) ___ If your question is of interest

Re: [NTG-context] embed metapost figure into document

2020-11-09 Thread Sylvain Hubert
here: > https://wiki.contextgarden.net/MetaFun_-_MetaPost_in_ConTeXt > To actually answer your question, if you actually want to load a Metapost > graphic externally generated, you should have something like: > > %nice.mp > %"begin ... endfig", as well as "end" are

Re: [NTG-context] embed metapost figure into document

2020-11-09 Thread Jairo A. del Rio
a Metapost graphic externally generated, you should have something like: %nice.mp %"begin ... endfig", as well as "end" are important beginfig (1); draw fullcircle scaled cm %withcolor black ; endfig; end so when you compile it via mpost nice.mp (obviously supposing you have Metapo

[NTG-context] embed metapost figure into document

2020-11-09 Thread Sylvain Hubert
Dear List, I'm trying to embed a metapost image into the document. According the MetaFun manual <http://www.pragma-ade.com/general/manuals/metafun-p.pdf>, "embedding such a graphic is done by: \externalfigure[graphic.123][width=4cm]", but the following example produc

[NTG-context] About Metapost and patterns, tessellations, fractals, etc.

2020-09-07 Thread Jairo A. del Rio
Hi, list! I have a problem with some graphics in Metapost. I've tried to replicate the Koch curve cited here using ConTeXt: https://en.wikipedia.org/wiki/L-system To my own amusement, the patterns seem to appear. However, when I try with a number from 6, ConTeXt stops doing anything or output

Re: [NTG-context] Import a metapost extension

2020-09-02 Thread Fabrice Couvreur
Hello, That's okay, I'll compile the files with mpost and do an image insert. Thanks for your help. Fabrice Le mar. 1 sept. 2020 à 19:32, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a écrit : > Taco Hoekwater schrieb am 01.09.2020 um 19:12: > > Hi, > > > On 1 Sep 2020, at 16:46, Hans

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Wolfgang Schuster
Taco Hoekwater schrieb am 01.09.2020 um 19:12: Hi, On 1 Sep 2020, at 16:46, Hans Hagen wrote: On 9/1/2020 3:04 PM, Fabrice Couvreur wrote: Hi Taco, Thank you for your help. I specify that this extension works perfectly by compiling the following file. A logfile of a failed run would have

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Taco Hoekwater
Hi, > On 1 Sep 2020, at 16:46, Hans Hagen wrote: > > On 9/1/2020 3:04 PM, Fabrice Couvreur wrote: >> Hi Taco, >> Thank you for your help. I specify that this extension works perfectly by >> compiling the following file. A logfile of a failed run would have been more helpful in trying to

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Hans Hagen
On 9/1/2020 3:04 PM, Fabrice Couvreur wrote: Hi Taco, Thank you for your help. I specify that this extension works perfectly by compiling the following file. input mp-scratch; Scratchversion:=3; beginfig(1);   draw Drapeau;   draw Repeter("4");   draw Avancer("100");   draw

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Fabrice Couvreur
tchversion:=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 > wrote: > > > > Hello > > Is it possible to import

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Taco Hoekwater
ote: > > Hello > Is it possible to import a metapost extension into a file compiled with the > lmtx engine ? > I tried unsuccessfully with this example : > > begin test.tex > > \starttext > \startMPcode > input mp-scratch; > > Scratchversion:=3; >

[NTG-context] Import a metapost extension

2020-09-01 Thread Fabrice Couvreur
Hello Is it possible to import a metapost extension into a file compiled with the lmtx engine ? I tried unsuccessfully with this example : begin test.tex \starttext \startMPcode input mp-scratch; Scratchversion:=3; draw Drapeau; draw Repeter("4"); draw Avancer("50&q

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
Nice, I'm reading results right now. Thank you a lot, Hans. Jairo :) El dom., 9 de ago. de 2020 a la(s) 13:05, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 8/9/2020 8:03 PM, Jairo A. del Rio wrote: > > Oh, thank you a lot, Hans, that's a really cleaner way than mine. One > > more question, is

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Hans Hagen
On 8/9/2020 8:03 PM, Jairo A. del Rio wrote: Oh, thank you a lot, Hans, that's a really cleaner way than mine. One more question, is there something similar to EmWidth for \textwidth or \linewidth? Better, a better way to access TeX dimensions? Thank you again. When you grep for EmWidth ...

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
...@xs4all.nl) escribió: > On 8/9/2020 5:39 PM, Jairo A. del Rio wrote: > > Hi, list! I'm doing the following to scale squares and other stuff in > > MetaPost/MetaFun. Although the following kinda works (maybe I'm just > > lucky with this), I want to know how to do a better piece from

Re: [NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Hans Hagen
On 8/9/2020 5:39 PM, Jairo A. del Rio wrote: Hi, list! I'm doing the following to scale squares and other stuff in MetaPost/MetaFun. Although the following kinda works (maybe I'm just lucky with this), I want to know how to do a better piece from it. I'm concerned with passing data from Lua

[NTG-context] How to properly pass TeX/Lua data to MetaPost/MetaFun?

2020-08-09 Thread Jairo A. del Rio
Hi, list! I'm doing the following to scale squares and other stuff in MetaPost/MetaFun. Although the following kinda works (maybe I'm just lucky with this), I want to know how to do a better piece from it. I'm concerned with passing data from Lua and TeX to Metapost and better ways to do

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-11 Thread Gerben Wierda
> On 9 Jul 2020, at 08:37, Aditya Mahajan wrote: > > On Wed, 8 Jul 2020, Gerben Wierda wrote: > >> I found out this in the PDF spec: >> >> The minimum page size should be 3 by 3 units in default user space; the >> maximum should be 14,400 by 14,400 units. > > So, does the following work: >

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-09 Thread Gerben Wierda
The minimum is a relative one: It is page 650 in the (normative) Annex C Implementation Limits for PDF readers and writers: Additionally, conforming writers should adhere to the following constraints, and conforming readers should accommodate PDF files that obey the constraints. The minimum

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-09 Thread Hans Hagen
On 7/9/2020 9:08 AM, Taco Hoekwater wrote: On 9 Jul 2020, at 08:32, Hans Hagen wrote: On 7/8/2020 8:14 PM, Gerben Wierda wrote: I found out this in the PDF spec: The minimum page size should be 3 by 3 units in default user space; the I never noticed that ... what section/paragraph in the

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-09 Thread Aditya Mahajan
On Wed, 8 Jul 2020, Gerben Wierda wrote: I found out this in the PDF spec: The minimum page size should be 3 by 3 units in default user space; the maximum should be 14,400 by 14,400 units. So, does the following work: \startMPpage[instance=doublefun, offset=2pt] draw (0,0)--(100,0)

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-09 Thread Hans Hagen
On 7/8/2020 8:14 PM, Gerben Wierda wrote: I found out this in the PDF spec: The minimum page size should be 3 by 3 units in default user space; the I never noticed that ... what section/paragraph in the spec? maximum should be 14,400 by 14,400 units. So we should bump tex's maxima ...

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-08 Thread Gerben Wierda
I found out this in the PDF spec: The minimum page size should be 3 by 3 units in default user space; the maximum should be 14,400 by 14,400 units. Apparently, Adobe InDesign demands that in a hard way. G > On 8 Jul 2020, at 01:08, Jairo A. del Rio wrote: > > Evince and Okular (Linux) open

Re: [NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-07 Thread Jairo A. del Rio
Evince and Okular (Linux) open the PDF output without warnings nor issues. Jairo :) El mar., 7 de jul. de 2020 a la(s) 17:50, Gerben Wierda ( gerben.wie...@rna.nl) escribió: > The following code: > > \startMPpage[instance=doublefun] > draw (0,0)--(100,0) dashed withdots; > \stopMPpage > >

[NTG-context] Minimum METAPOST code produces problematic PDF

2020-07-07 Thread Gerben Wierda
The following code: \startMPpage[instance=doublefun] draw (0,0)--(100,0) dashed withdots; \stopMPpage When run through LuaMetaTeX produces a PDF about which Acrobat complains: The dimensions of this page are out-of-range. Page content might be truncated. and Adobe InDesign cannot

Re: [NTG-context] 'debug' version of METAPOST draw?

2020-05-28 Thread Keith McKay
Would Chapter 11, section 11.1 Showing Paths of the MetaPost manual, be any help here? Below is a MWE of a random path of curves and straight lines. The points are shown using drawpoints. The arrow path and control lines are also shown and are better described in the Metapost manual

[NTG-context] 'debug' version of METAPOST draw?

2020-05-28 Thread Gerben Wierda
I would like to be able (during development) to draw paths where the points of the path (and maybe thing slike directions) are visualised. E.g. a path where each pair in teh path is also drawn as a dot and maybe teh directions drawn as small arrows. Does someone have such a beast lying around?

Re: [NTG-context] metapost boxes error

2020-05-20 Thread Aditya Mahajan
On Wed, 20 May 2020, jk...@inradius.net wrote: Is there a different approach to use boxes.mp? MNWE: \startMPpage input boxes.mp; boxit.bl("left"); boxit.br("right"); br.sw - bl.ne = (20,0); drawboxed(bl,br); \stopMPpage Move `input boxes` outside the `\startMPpage`.

[NTG-context] metapost boxes error

2020-05-20 Thread jk...@inradius.net
int: english/english metapost log> loading metafun, including plain.mp version 1.004 for metafun iv and xl metapost log> metapost log> >> _dojoin metapost log> ! Isolated expression. __

[NTG-context] Looking for a way to use lua to output console/debug messages from MetaPost instead of 'show'

2020-05-18 Thread Gerben Wierda
I often need some debugging info to find out what is going on in my METAPOST code (as I often do not have exact knowledge of what some things do). MetaPost’s ‘show’ command has limited formatting functionality (e.g. I would like to add a number as a string to a show message instead of putting

Re: [NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Thank you. That works. > On 14 May 2020, at 17:13, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 14.05.2020 um 11:47: >> Is it possible to get a transparent background in a textext()? The following >> minimal example doesn’t work. >> \starttext >> \setupMPpage >>

Re: [NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Wolfgang Schuster
Gerben Wierda schrieb am 14.05.2020 um 11:47: Is it possible to get a transparent background in a textext()? The following minimal example doesn’t work. \starttext \setupMPpage   [background=color,    backgroundcolor=gray] \startMPpage draw

[NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Is it possible to get a transparent background in a textext()? The following minimal example doesn’t work. \starttext \setupMPpage [background=color, backgroundcolor=gray] \startMPpage draw

[NTG-context] \goto works but links don't when passed via textext() in METAPOST

2020-05-10 Thread Gerben Wierda
I am trying to get an URL link in a textext() via METAPOST. I’ve got this before \starttext (or after, tried both): \setupinteraction [state=start, color=blue, style=bold] The intended link shows up in blue and bold, but it is not clickable. I’ve turned ConTeXt tracing on and see

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-10 Thread Gerben Wierda
> On 10 May 2020, at 00:01, Bruce Horrocks wrote: > >> You can save extracting the xparts and yparts by using direct subtraction of >> pairs and comparing with (0,0) like this: > > Aaaargh, no, ignore that, it's nonsense. It's amazing how you can stare at > something for minutes but only see

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-09 Thread Bruce Horrocks
> You can save extracting the xparts and yparts by using direct subtraction of > pairs and comparing with (0,0) like this: Aaaargh, no, ignore that, it's nonsense. It's amazing how you can stare at something for minutes but only see the flaw the moment you press send. Sorry for the noise. --

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-09 Thread Bruce Horrocks
> On 8 May 2020, at 13:58, Gerben Wierda wrote: > >> On 8 May 2020, at 00:46, n...@scorecrow.com wrote: >> >>> On 7 May 2020, at 20:28, Gerben Wierda wrote: >>> >>> I have a METAPOST algorithm that splits a path at a certain time in two, &g

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-08 Thread Gerben Wierda
> On 8 May 2020, at 00:46, n...@scorecrow.com wrote: > > > >> On 7 May 2020, at 20:28, Gerben Wierda wrote: >> >> I have a METAPOST algorithm that splits a path at a certain time in two, >> does something with both ends (not the ends where they w

[NTG-context] METAPOST subpath rounding issue

2020-05-07 Thread Gerben Wierda
I have a METAPOST algorithm that splits a path at a certain time in two, does something with both ends (not the ends where they were split) and then rejoins them. In very rare cases this crashes, because the subpath doesn’t work as expected. firstPart := subpath (0,halfWayTime

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-07 Thread ntg
> On 7 May 2020, at 20:28, Gerben Wierda wrote: > > I have a METAPOST algorithm that splits a path at a certain time in two, does > something with both ends (not the ends where they were split) and then > rejoins them. > > In very rare cases this crashes, because the

Re: [NTG-context] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Hans Hagen
On 4/27/2020 10:47 AM, Gerben Wierda wrote: I am in METAPOST which is inside TeX and I’d like (in METAPOST, not in TeX) to let a string follow a path. Adapting from the MetaFun manual around page 250, I tried this: \starttext \startMPpage[instance=doublefun] pic p; p := textext

[NTG-context] Using \startuseMPgraphic inside a textext() in METAPOST?

2020-04-27 Thread Gerben Wierda
I am in METAPOST which is inside TeX and I’d like (in METAPOST, not in TeX) to let a string follow a path. Adapting from the MetaFun manual around page 250, I tried this: \starttext \startMPpage[instance=doublefun] pic p; p := textext("\startuseMPgraphic[instance=doublefun]{followtokens

Re: [NTG-context] Solution: METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-25 Thread Gerben Wierda
0, >> b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm >> [My]\\Application\\(Component)\par }} > > Thank you, that works. (Can’t put in the images to show, as this gets my > message over 100k) > > But it turns out, I have an additional problem because I

[NTG-context] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
put in the images to show, as this gets my message over 100k) But it turns out, I have an additional problem because I am doing this inside a textext() from METAPOST and that seems to strip the \pars again. Tracking ConTeXt: cld > tex > f : 8 : picture pic; x:=33.000; y:=

[NTG-context] METAPOST textext() eats my \pars. Was: Setting vertical spacing of lines inside a \framed[align=]

2020-04-24 Thread Gerben Wierda
r to make the change of > linespacing work: > > \framed[align=flushright,frame=on,offset=none,width=106.400bp]{\colored[r=0.000, > g=0.000, > b=0.000]{\switchtobodyfont[11.0pt] \setupinterlinespace[14pt] \rm > [My]\\Application\\(Component)\par }} Thank you, that works: B

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-22 Thread Gerben Wierda
> On 22 Apr 2020, at 09:30, Taco Hoekwater wrote: > > Hi, > >> On 21 Apr 2020, at 17:52, Gerben Wierda wrote: >> >>> pair a ; a := arrowHead intersection_point connection ; > > Hans’ example also works with “intersectionpoint”: the differences between > intersectionpoint > and

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-22 Thread luigi scarso
On Wed, Apr 22, 2020 at 9:30 AM Taco Hoekwater wrote: > > In contrast, intersectionpoint finds the first intersection on the > non-reversed paths, which > is the base of the arrowhead. > > IIrc , it's the first in shuffle order @ Incidentally, if the given cubics intersect more than once, the

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-22 Thread Taco Hoekwater
Hi, > On 21 Apr 2020, at 17:52, Gerben Wierda wrote: > >> pair a ; a := arrowHead intersection_point connection ; Hans’ example also works with “intersectionpoint”: the differences between intersectionpoint and intersection_point are minimal except if there is no intersection at all. The

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Hans Hagen
On 4/21/2020 5:52 PM, Gerben Wierda wrote: Pretty deep into MP now. Even looked up the reference in John Hobby’s manual to the METAFONT book, but that reference did not help. in the end it all has to do with accuracy and rounding ... the intersection_point trickery is probably less sensitive

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Gerben Wierda
d. The first algo that I was using worked fine in most cases, as well, then I created one that worked with paths with ‘internal spikes’ and now I run into this where two comparable situations behaved differently and my question copied the one that didn’t work. And while this example from

Re: [NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Hans Hagen
On 4/21/2020 1:29 PM, Gerben Wierda wrote: I have these two paths, but cutting doesn’t work because the path to be cut takes the wrong intersection regardless of how I direct the path to be cut after (reverse or not). The path to cut after is a triangle with the base horizontal and the path

[NTG-context] METAPOST: How do I get this 'max' cutafter to work?

2020-04-21 Thread Gerben Wierda
I have these two paths, but cutting doesn’t work because the path to be cut takes the wrong intersection regardless of how I direct the path to be cut after (reverse or not). The path to cut after is a triangle with the base horizontal and the path to cut is a vertical line. The top of the

Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-10 Thread Gerben Wierda
As I only use one transparency method anyway I could also fix this by passing a numeric instead of a pair and use the standard withtransparency (I don’t like overriding a standard MetaFun method, one never knows what might break in future updates). vardef Foo( expr w, h, fillColor,

Re: [NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Hans Hagen
On 4/9/2020 4:58 PM, Gerben Wierda wrote: \starttext \startMPpage[instance=doublefun] vardef Foo( expr w, h, fillColor, fillTransparency) =   show "FOO:", w, h, fillColor, fillTransparency;   save pic; picture pic;   save circ; path circ;   circ := (fullcircle xyscaled (h,h));   pic :=

[NTG-context] METAPOST/MetaFun withtransparency doesn't accept my pair primary argument, what am I doing wrong?

2020-04-09 Thread Gerben Wierda
c := image ( fill (circ shifted (w-h/2,-h/2)) withcolor fillColor withtransparency fillTransparency; ); pic enddef; pic := Foo( 150, 50, (0.686,1.000,1.000), (1,1.000)); draw pic; \stopMPpage \stoptext and the result is: metapost log> >> "FOO:" metapost log>

Re: [NTG-context] Bounding box of picture returned by textext() in METAPOST

2020-04-05 Thread Gerben Wierda
Nobody? > On 4 Apr 2020, at 22:58, Gerben Wierda wrote: > > I have this METAPOST macro: > > vardef makeTeXLabel( expr w, h, name) = > if debugProgram or debugLabels: show "NAME makeTeXLabel:", name, tostring > 0.8w, tostring 0.8h; fi > s

Re: [NTG-context] Solved: Minimum example of problem getting curly braces printed in METAPOST

2020-04-05 Thread Hans Hagen
[11] = { '^', '{\\textasciicircum}' },       [12] = { '"', "\"&\"" },   }   return lpeg.replacer(rep):match(str) end And the string becomes something that can safely be given toi METAPOST and safely handled by TeX when called from METAPOST via textext() more eff

[NTG-context] Bounding box of picture returned by textext() in METAPOST

2020-04-04 Thread Gerben Wierda
I have this METAPOST macro: vardef makeTeXLabel( expr w, h, name) = if debugProgram or debugLabels: show "NAME makeTeXLabel:", name, tostring 0.8w, tostring 0.8h; fi save p; picture p; p := textext( "\startframedtext[middle]" & "[align=middle,frame=on&quo

[NTG-context] Solved: Minimum example of problem getting curly braces printed in METAPOST

2020-04-03 Thread Gerben Wierda
[12] = { '"', "\"&\"" }, } return lpeg.replacer(rep):match(str) end And the string becomes something that can safely be given toi METAPOST and safely handled by TeX when called from METAPOST via textext() G > On 2 Apr 2020, at 14:05, Gerben Wierda wrote: > > Her

[NTG-context] Minimum example of problem getting curly braces printed in METAPOST

2020-04-02 Thread Gerben Wierda
Here is a minimum example of a problem that I have in getting curly braces printed in METAPOST in code that is generated by lua.Any help is welcome.\usemodule[scite]\setupxml [entities=yes]\startluacodefunction warn( ... )  texio.write_nl("-> " .. string.format(...))endl

Re: [NTG-context] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-02 Thread Gerben Wierda
Actually, the backslashes disappear before the call to textext() G > On 1 Apr 2020, at 23:44, Aditya Mahajan wrote: > > On Wed, 1 Apr 2020, Gerben Wierda wrote: >> >> My route is probably to complex anyway, but what can I do for the curly >> braces to be actually typeset? > > MkII had a

Re: [NTG-context] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-01 Thread Aditya Mahajan
On Wed, 1 Apr 2020, Gerben Wierda wrote: My route is probably to complex anyway, but what can I do for the curly braces to be actually typeset? MkII had a feature called \sometxt http://dl.contextgarden.net/myway/sometxt.pdf I wonder if that still works in MkIV. Aditya

[NTG-context] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-01 Thread Gerben Wierda
I have lua code that generates this for METAPOST: ApplicationComponentLogo( w, h, "withcolor (0.686,1.000,1.000) withtransparency (1,0.200)", "withcolor (0.000,0.000,0.000) withtransparency (1,1.000) withpen pencircle scaled 1.000", "\{Hello\}, "&"(a)&q

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
Wolfgang Schuster >>>>> >>>> <mailto:wolfgang.schuster.li...@gmail.com>> wrote: >>>>> >>>>> Gerben Wierda schrieb am 29.03.2020 um 12:52: >>>>>> I am using MetaFun (Lua code) to create METAPOST commands from a

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Wolfgang Schuster
t; wrote: Gerben Wierda schrieb am 29.03.2020 um 12:52: I am using MetaFun (Lua code) to create METAPOST commands from an XML file. One of the issues I am running into that in METAPOST I have to handle strings with " characters in them and METAPOST doesn’t like those. The argument using th

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
> On 29 Mar 2020, at 14:35, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 29.03.2020 um 14:30: >>> On 29 Mar 2020, at 12:58, Wolfgang Schuster >>> wrote: >>> >>> Gerben Wierda schrieb am 29.03.2020 um 12:52: >>>> I

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
> On 29 Mar 2020, at 12:58, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 29.03.2020 um 12:52: >> I am using MetaFun (Lua code) to create METAPOST commands from an XML file. >> One of the issues I am running into that in METAPOST I have to handle >

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Wolfgang Schuster
Gerben Wierda schrieb am 29.03.2020 um 14:30: On 29 Mar 2020, at 12:58, Wolfgang Schuster wrote: Gerben Wierda schrieb am 29.03.2020 um 12:52: I am using MetaFun (Lua code) to create METAPOST commands from an XML file. One of the issues I am running into that in METAPOST I have to handle

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-29 Thread Wolfgang Schuster
Gerben Wierda schrieb am 29.03.2020 um 10:47: On 28 Mar 2020, at 19:04, Wolfgang Schuster wrote: Gerben Wierda schrieb am 28.03.2020 um 18:58: Actually, I would already be helped with a way to convert this string: My “Büsiness" sérvice into something that can be typeset by

[NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Gerben Wierda
I am using MetaFun (Lua code) to create METAPOST commands from an XML file. One of the issues I am running into that in METAPOST I have to handle strings with " characters in them and METAPOST doesn’t like those. The argument using the string Foo "Bar” Foo turns into someCall( &quo

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-29 Thread Gerben Wierda
I tried this and it worked. Next issue: if the string has a “ character in it, METAPOST cannot handle it. New question for the list... G > On 29 Mar 2020, at 10:47, Gerben Wierda wrote: > > > >> On 28 Mar 2020, at 19:04, Wolfgang Schuster >> wrote: >>

Re: [NTG-context] How do I handle strings with " characters in it in METAPOST?

2020-03-29 Thread Wolfgang Schuster
Gerben Wierda schrieb am 29.03.2020 um 12:52: I am using MetaFun (Lua code) to create METAPOST commands from an XML file. One of the issues I am running into that in METAPOST I have to handle strings with " characters in them and METAPOST doesn’t like those. The argument using the string

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-29 Thread Gerben Wierda
> On 28 Mar 2020, at 19:04, Wolfgang Schuster > wrote: > > Gerben Wierda schrieb am 28.03.2020 um 18:58: >> Actually, I would already be helped with a way to convert this string: >> My “Büsiness" sérvice >> into something that can be typeset by ConTeXt. Using embedded lua is fine. > >

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-28 Thread Wolfgang Schuster
Gerben Wierda schrieb am 28.03.2020 um 18:58: Actually, I would already be helped with a way to convert this string: My “Büsiness" sérvice into something that can be typeset by ConTeXt. Using embedded lua is fine. Does enabling entities help? \setupxml [entities=yes] Wolfgang

Re: [NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-28 Thread Gerben Wierda
I want to turn into labels for objects > in a METAPOST picture (using MetaFun). These strings can have arbitrary > characters (like accents) and some characters are coded. Examples of how > these are coded: > > My "Application” Fünction > > [My] Application

[NTG-context] I could use some ideas for a strategy to get these kind of labels in a METAPOST picture

2020-03-27 Thread Gerben Wierda
I have strings I get from an XML that I want to turn into labels for objects in a METAPOST picture (using MetaFun). These strings can have arbitrary characters (like accents) and some characters are coded. Examples of how these are coded: My "Application” Fünction

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-16 Thread Aditya Mahajan
On Mon, 16 Mar 2020, Gerben Wierda wrote: This worked when I was just doing METAPOST. Now, I am using my lua code to produce the METAPOST code that produces the pictures. And the picture itself is put in a file for METAPOST as follows: File test4-mplib-run-001.mp: % begin graphic: n=0

Re: [NTG-context] Can I share METAPOST vardefs over multiple pages?

2020-03-16 Thread Gerben Wierda
This worked when I was just doing METAPOST. Now, I am using my lua code to produce the METAPOST code that produces the pictures. And the picture itself is put in a file for METAPOST as follows: File test4-mplib-run-001.mp: % begin graphic: n=0 ; beginfig(1) ; defaultfont:="name:dejavu

Re: [NTG-context] METAPOST vardef returning multiple and non-numeric types as a single answer?

2020-03-16 Thread Gerben Wierda
Maybe a nice little explanation (educational with good examples) of ‘how to use pass by reference’ and ‘building and using complex data structures’ would be useful for people. Say, some ‘patterns’. G > On 16 Mar 2020, at 10:38, Hans Hagen wrote: > > that said, after muy share of mp

Re: [NTG-context] METAPOST vardef returning multiple and non-numeric types as a single answer?

2020-03-16 Thread Gerben Wierda
] := 5; > enddef; > numeric foo[]; > foo[1] = 6; > Foo(1,foo); This was initially complete gobbledegook to me. But I now think that after the last statement foo[1] equals 5. Very weird/counterintuitive that y[a] := 5 works here without the use of scantokens. The first one i

<    1   2   3   4   5   6   7   8   9   10   >