Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Hans Hagen
On 7/15/2021 6:22 PM, Aditya Mahajan wrote: On Thu, 15 Jul 2021, Hans Hagen wrote: On 7/14/2021 4:43 PM, Gavin wrote: Hello ConTeXters, I’d like to use the mp-geo Metapost package with ConTeXt to draw simple globes viewed from various directions. The package is here: https

Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Aditya Mahajan
On Thu, 15 Jul 2021, Hans Hagen wrote: > On 7/14/2021 4:43 PM, Gavin wrote: > > Hello ConTeXters, > > > > I’d like to use the mp-geo Metapost package with ConTeXt to draw simple > globes viewed from various directions. The package is here: > > > > https:/

Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-15 Thread Hans Hagen
On 7/14/2021 4:43 PM, Gavin wrote: Hello ConTeXters, I’d like to use the mp-geo Metapost package with ConTeXt to draw simple globes viewed from various directions. The package is here: https://melusine.eu.org/syracuse/poulecl/mp-geo/ It looks like the last update was 2008 and I don’t

[NTG-context] mp-geo Metapost package with ConTeXt

2021-07-14 Thread Gavin
Hello ConTeXters, I’d like to use the mp-geo Metapost package with ConTeXt to draw simple globes viewed from various directions. The package is here: https://melusine.eu.org/syracuse/poulecl/mp-geo/ It looks like the last update was 2008 and I don’t read French, so I though my chances

Re: [NTG-context] Hand Style Sketching in Metapost

2021-05-21 Thread Jeroen
I have updated LMTX and indeed seems to be working now Thanks Op do 20 mei 2021 om 21:05 schreef Aditya Mahajan : > On Thu, 20 May 2021, Jeroen wrote: > > > I have the following working example with hatching. This works fine, but > > when I uncomment the sketching commands, no figure is rendered

Re: [NTG-context] Hand Style Sketching in Metapost

2021-05-20 Thread Aditya Mahajan
. Aditya hatch.pdf Description: Adobe PDF document hatch.tex Description: TeX document %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=\curren

[NTG-context] Hand Style Sketching in Metapost

2021-05-20 Thread Jeroen
I have the following working example with hatching. This works fine, but when I uncomment the sketching commands, no figure is rendered. Is the mp-sketch macro still working? \starttext \startMPcode input hatching; %input mp-sketch; %sketchypaths; %sketch_amount := 2bp; u := 1cm; path c

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-27 Thread Hans Hagen
Hi, you can't assume fuzzy scratch variables as used in def flex(text t) = % t is a list of pairs hide(n_:=0; for z=t: z_[incr n_]:=z; endfor dz_:=z_[n_]-z_1) z_1 for k=2 upto n_-1: ...z_[k]{dz_} endfor ...z_[n_] enddef; newinternal n_; pair z_[],dz_; to be official ..

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-27 Thread Hans Hagen
On 4/27/2021 6:31 PM, Jairo A. del Rio wrote: Hi, Hans. I've attached the relevant files. Jairo El mar, 27 de abr. de 2021 a la(s) 07:35, Hans Hagen (j.ha...@xs4all.nl ) escribió: On 4/27/2021 9:23 AM, Jairo A. del Rio wrote: > So, should I share relevant f

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-27 Thread Hans Hagen
On 4/27/2021 9:23 AM, Jairo A. del Rio wrote: So, should I share relevant files? AFAIK only cmarrows and .mf files in the cm source folder are involved. I hope you can check it if a solution is possible and not too demanding. Thanks beforehand. you can make a minimal failure example but I gues s

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-27 Thread Jairo A. del Rio
pair) > > I don't know, but from the message it looks like some 'local' > variables > > is not saved and defined. I'm surprised that loading some mf file > works > > at all (because it also assumes some mf related definitions). I also > > hav &g

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-26 Thread Hans Hagen
nitions). I also hav eno clue if such a package adopts 'core' metafun code (and mpiv metafun is different from mpii). It's a generic, "pure" MetaPost package: https://www.ctan.org/pkg/cmarrows <https://www.ctan.org/pkg/cmarrows> that doesn't make

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-26 Thread Jairo A. del Rio
I don't know, but from the message it looks like some 'local' variables > is not saved and defined. I'm surprised that loading some mf file works > at all (because it also assumes some mf related definitions). I also hav > eno clue if such a package adopts 'core'

Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-25 Thread Hans Hagen
On 4/26/2021 6:59 AM, Jairo A. del Rio wrote: The following: \starttext \startMPinitializations input cmarrows; setup_cmarrows(arrow_name = "texarrow"; parameter_file = "cmr6.mf"; macro_name = "nicearrow"); \stopMPinitializations \startMPpage metafun > log > error: Equation cannot be p

[NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-25 Thread Jairo A. del Rio
ompiles perfectly with ConTeXt MkIV. With LMTX, however, the following happens: metapost > initializing instance 'metafun:1' using format 'metafun' and method 'default' metapost > loading 'metafun' as 'metafun.mpxl' using method 'default&#x

Re: [NTG-context] Parenthesis error in metapost

2021-04-07 Thread Hans Hagen
On 4/7/2021 10:14 AM, Mikael Sundqvist wrote: Hi, the following code has been working before: \starttext \startMPpage[instance=decimalfun] draw function(1,"x","x*sin(x)",0.5,1,1/100) scaled 1in; \stopMPpage \stoptext Now (with an updated ConTeXt) I get an error: metap

[NTG-context] Parenthesis error in metapost

2021-04-07 Thread Mikael Sundqvist
Hi, the following code has been working before: \starttext \startMPpage[instance=decimalfun] draw function(1,"x","x*sin(x)",0.5,1,1/100) scaled 1in; \stopMPpage \stoptext Now (with an updated ConTeXt) I get an error: metapost> loading 'metafun' as &#x

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

2021-02-12 Thread Hans Hagen
Hi, Like this: metapost.registerscript("scrutenized", function() local p = mp.scan.path() local r = math.round local d = 10^mp.scan.numeric() for i=1,#p do local pi = p[i] pi[1] = r(pi[1] * d) / d pi[2] = r(pi[2] * d) / d end local x1 = r(p[1][1])

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

2021-02-12 Thread Taco Hoekwater
eps to be just a ’small enough value that a human will not notice it’ where epsilon is intended as ’the smallest representable value’. Neither really work that way because depending on how you use metapost eps can be quite visible (especially in non-scaled number systems) and (more important

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

2021-02-12 Thread Hans Hagen
On 2/12/2021 9:35 AM, Taco Hoekwater wrote: 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 whil

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

2021-02-12 Thread Mikael Sundqvist
Hi Taco, thanks, from your observation and the way I build the paths, I found out that I can avoid the problem by shortening the paths I join just slightly: cl := (fullcircle scaled 4u) shifted z0; cl := cl cutbefore point (1/6+epsilon) along cl cutafter point (2/6-epsilon) along cl; cs := (fullc

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 the

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 o

[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? Or

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) thetext

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

[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(i

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 required steps

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

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

2020-11-09 Thread Sylvain Hubert
info 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"

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

2020-11-09 Thread Jairo A. del Rio
oad 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 M

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

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

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 H

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 track

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 Tournerd("90"

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 t

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 ... Li

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

2020-08-09 Thread Jairo A. del Rio
(j.ha...@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 bet

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 passin

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

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 pa

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-08 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) dashed

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

2020-07-08 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 ... A

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 t

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 > > When

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

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`. \startMPdefinitions

[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 >> [background=color,

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 textext("\definecolor[labelbackground][a=0.2,r=1,g=

[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 textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]\framed[height=1.2em,background=color,backgr

[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. -- B

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) of

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 su

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 intersection_p

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 p

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 tric

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 fo

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 yo

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 t

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

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, fillTranspar

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 := imag

[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
7; },       [8] =  { '|', '{\\textbar}' },       [9] =  { '_', '{\\textunderscore}' },       [10] = { '~', '{\\textasciitilde}' },       [11] = { '^', '{\\textasciicircum}' },       [12] = { '"

[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
;{\\textbar}' }, [9] = { '_', '{\\textunderscore}' }, [10] = { '~', '{\\textasciitilde}' }, [11] = { '^', '{\\textasciicircum}' }, [12] = { '"', "\"&ditto&\"" }, } return lpe

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