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 am

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 ConTeX

[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
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] Applicati

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

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

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

2020-03-16 Thread Hans Hagen
s, of course. Main point: Metapost is not an easy language to grasp. If you want to really understand how it works, you should study the Metafont book by DEK. > As you can clearly see, even experienced users are likely to make mistakes. it's the mixture of delayed parsing and expansion

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

2020-03-16 Thread Taco Hoekwater
scantokens(y&":=5”); enddef; Foo("x"); This would work, but that is weird. This also works, and that is why I had the erroneous memory that it would work always: vardef Foo(expr a)(text y) = y[a] := 5; enddef; numeric foo[]; foo[1] = 6; Foo(1,foo); or y

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

2020-03-16 Thread Taco Hoekwater
> On 16 Mar 2020, at 09:53, Gerben Wierda wrote: > > Hola! So, the arguments passed to macros are by reference and not by value? I > could have known of course, they are simple expansions, but I’d like to be > sure. IfI assign to a variable inside a vardef macro and that variable is not > ’s

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

2020-03-16 Thread Gerben Wierda
, I cannot access the components of the picture anymore with pathpart. >> >> I found metapost vardef returning multiple values on StackExchange but that >> is about returning multiple values of the same numeric type. Is it possible >> to have vardef return a set of (pictu

Re: [NTG-context] Why do I see the outline of the green box in this METAPOST code?

2020-03-16 Thread Taco Hoekwater
Move the fills to within the image(), and build it up in stacking order. > On 14 Mar 2020, at 16:29, Gerben Wierda wrote: > > Code: > > vardef Foo(expr w, h, lh) = >save pth; path pth; >save pthtwo; path pthtwo; >save pththree; path pththree; >save pic; picture pic; >pth =

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

2020-03-16 Thread Taco Hoekwater
thpart. > > I found metapost vardef returning multiple values on StackExchange but that > is about returning multiple values of the same numeric type. Is it possible > to have vardef return a set of (picture, path) or (picture, picture) in some > way? If not, I need to make two

Re: [NTG-context] Is it possible to use the macOS Optima font in ConTeXt/METAPOST?

2020-03-15 Thread Pablo Rodriguez
On 3/15/20 4:54 PM, Gerben Wierda wrote: > Subject line says it all… Hi Gerben, this should work: \definefontfamily[mainface][rm][Optima] %~ \definefontfamily[mainface][rm][URW Classico] \setupbodyfont[mainface] \starttext This is Optima. \stoptext I need the commented l

[NTG-context] Is it possible to use the macOS Optima font in ConTeXt/METAPOST?

2020-03-15 Thread Gerben Wierda
Subject line says it all… Thanks in advance, G ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context w

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

2020-03-15 Thread Gerben Wierda
I would like a vardef macro to return the pair of a picture and a bounding box. I don't want to use the setbound operator, because as soon as I do that, I cannot access the components of the picture anymore with pathpart. I found metapost vardef returning multiple values &

[NTG-context] Why do I see the outline of the green box in this METAPOST code?

2020-03-14 Thread Gerben Wierda
Code:vardef Foo(expr w, h, lh) =   save pth; path pth;   save pthtwo; path pthtwo;   save pththree; path pththree;   save pic; picture pic;   pth = fullsquare xysized (w, h);   pthtwo = fullsquare xysized (2*lh, lh) shifted (-w/2, 2.5*lh);   pththree = fullsquare xysized (2*lh, lh) shifted (-w/2, l

Re: [NTG-context] Why does this METAPOST vardef 'save' statement fail?

2020-03-14 Thread Gerben Wierda
mment the bold line (first comment) a mtxrun fails. Whatever > I try, a single save statement, etc., I fail in getting a second local > variable. The METAPOST manual is no help. > > The error shown is: > > metapost log> ! Extra tokens will be flushed. > metapost log

[NTG-context] Why does this METAPOST vardef 'save' statement fail?

2020-03-14 Thread Gerben Wierda
here ); setbounds pic to pth; pic enddef ; As soon as I uncomment the bold line (first comment) a mtxrun fails. Whatever I try, a single save statement, etc., I fail in getting a second local variable. The METAPOST manual is no help. The error shown is: metapost log> ! Ex

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

2020-03-14 Thread Gerben Wierda
> On 13 Mar 2020, at 14:59, Hans Hagen wrote: > > On 3/13/2020 2:33 PM, Aditya Mahajan wrote: >> On Fri, 13 Mar 2020, Taco Hoekwater wrote: >>> Hi, >>> >>> >>> On 13 Mar 2020, at 12:53, Gerben Wierda wrote: Suppose I have this code: Can I reuse that varied a

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

2020-03-13 Thread Hans Hagen
On 3/13/2020 2:33 PM, Aditya Mahajan wrote: On Fri, 13 Mar 2020, Taco Hoekwater wrote: Hi, On 13 Mar 2020, at 12:53, Gerben Wierda wrote: Suppose I have this code: Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: or \startMPdefinition

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

2020-03-13 Thread Gerben Wierda
Thank you. And if I want these in a separate file, what is the correct way to include them? > On 13 Mar 2020, at 13:24, Taco Hoekwater wrote: > > Hi, > > > >> On 13 Mar 2020, at 12:53, Gerben Wierda wrote: >> >> Suppose I have this code: >> >> >> Can I reuse that varied across follow-up

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

2020-03-13 Thread Aditya Mahajan
On Fri, 13 Mar 2020, Taco Hoekwater wrote: Hi, On 13 Mar 2020, at 12:53, Gerben Wierda wrote: Suppose I have this code: Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: or \startMPdefinitions ... \stopMPdefinitions (don't remember what

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

2020-03-13 Thread Taco Hoekwater
Hi, > On 13 Mar 2020, at 12:53, Gerben Wierda wrote: > > Suppose I have this code: > > > Can I reuse that varied across follow-up MPPages? Sure, put the vardef inside \startMPinclusions: \startMPinclusions vardef MyShape(expr w, h) = ... enddef ; \stopMPinclusions \startMPpage picture s

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

2020-03-13 Thread Gerben Wierda
Suppose I have this code: \startMPpage vardef MyShape(expr w, h) = save pth; path pth ; save pic; picture pic; pth = fullsquare xysized (w, h); pic := image ( draw pth; % all kind of stuff here ); setbounds pic to pth; pic enddef ; picture s ; s := MyShape(4cm,

Re: [NTG-context] Problem with shading when using rotation (Metapost)

2020-03-03 Thread Fabrice Couvreur
Hi, No idea ? Thanks Fabrice Le sam. 29 févr. 2020 à 11:01, Fabrice Couvreur a écrit : > Hi, > Sorry to come back with my match problem. In fact, I do not understand > why a rotation of 90 influences the degraded color of the ends of the > matches. > Thank you. > Fabrice > > \starttext > \startM

[NTG-context] Problem with shading when using rotation (Metapost)

2020-02-29 Thread Fabrice Couvreur
Hi, Sorry to come back with my match problem. In fact, I do not understand why a rotation of 90 influences the degraded color of the ends of the matches. Thank you. Fabrice \starttext \startMPcode def match (expr alpha, pos) = numeric l; l = 4.6cm; picture pic; pic = image (

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-20 Thread Hans Hagen
On 2/20/2020 10:29 AM, Jan U. Hasecke wrote: Am 18.02.20 um 19:24 schrieb Jan U. Hasecke: Am 18.02.20 um 19:17 schrieb mf: Il 18/02/20 19:07, Jan U. Hasecke ha scritto: Am 18.02.20 um 14:53 schrieb Hans Hagen: \setupcolors[rgb=no] \startMPcode draw lmt_svg [ filename = "sample.svg" ] ;

Re: [NTG-context] Howto metapost textext set or change basepoint (origin) baseline of text

2020-02-20 Thread Christoph Hintermüller
Hi Hans On Thu, 2020-02-20 at 10:28 +0100, Hans Hagen wrote: > On 2/20/2020 10:15 AM, Christoph Hintermüller wrote: > > You can append a palcement suffix, like: > >textext.dflt > > you can try: > >lft rt bot top ulft urt llft lrt d dflt drt origin raw > Thanks again. textext.origin

Re: [NTG-context] Howto metapost textext set or change basepoint (origin) baseline of text

2020-02-20 Thread Christoph Hintermüller
Hi Hans On Thu, 2020-02-20 at 10:28 +0100, Hans Hagen wrote: > On 2/20/2020 10:15 AM, Christoph Hintermüller wrote: > > > You can append a palcement suffix, like: > >textext.dflt > > you can try: > >lft rt bot top ulft urt llft lrt d dflt drt origin raw > Thank you very much, that wa

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-20 Thread Jan U. Hasecke
Am 18.02.20 um 19:24 schrieb Jan U. Hasecke: > Am 18.02.20 um 19:17 schrieb mf: >> Il 18/02/20 19:07, Jan U. Hasecke ha scritto: >>> Am 18.02.20 um 14:53 schrieb Hans Hagen: >>> \setupcolors[rgb=no] \startMPcode draw lmt_svg [ filename = "sample.svg" ] ; \stopMPcode >>> I g

Re: [NTG-context] Howto metapost textext set or change basepoint (origin) baseline of text

2020-02-20 Thread Hans Hagen
On 2/20/2020 10:15 AM, Christoph Hintermüller wrote: Hi I have the following problem. I convert a eps file using pstoedit into meta post file. When running this file through mptopdf the resulting pdf image is as expected. When i include, using the input command, the file within a startMPcode end

[NTG-context] Howto metapost textext set or change basepoint (origin) baseline of text

2020-02-20 Thread Christoph Hintermüller
Hi I have the following problem. I convert a eps file using pstoedit into meta post file. When running this file through mptopdf the resulting pdf image is as expected. When i include, using the input command, the file within a startMPcode endMPcode or startMPpage stopMPpage after replacing sim

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-18 Thread Jan U. Hasecke
Am 18.02.20 um 19:17 schrieb mf: > Il 18/02/20 19:07, Jan U. Hasecke ha scritto: >> Am 18.02.20 um 14:53 schrieb Hans Hagen: >> >>> \setupcolors[rgb=no] >>> \startMPcode >>> draw lmt_svg [ filename = "sample.svg" ] ; >>> \stopMPcode >> I get this error. >> >> ! Not implemented: (unknown numeri

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-18 Thread mf
Il 18/02/20 19:07, Jan U. Hasecke ha scritto: Am 18.02.20 um 14:53 schrieb Hans Hagen: \setupcolors[rgb=no] \startMPcode     draw lmt_svg [ filename = "sample.svg" ] ; \stopMPcode I get this error. ! Not implemented: (unknown numeric)=(string). ] <*> ... ; p := lmt_svg [ filename = "sample.

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-18 Thread Jan U. Hasecke
Am 18.02.20 um 14:53 schrieb Hans Hagen: > > \setupcolors[rgb=no] > \startMPcode >     draw lmt_svg [ filename = "sample.svg" ] ; > \stopMPcode I get this error. ! Not implemented: (unknown numeric)=(string). ] <*> ... ; p := lmt_svg [ filename = "sample.svg" ] juh __

Re: [NTG-context] metapost: remapping colors of an SVG picture

2020-02-18 Thread Hans Hagen
p ; draw p shifted ( bbwidth(p) + 5mm, 0) ; \stopMPcode \stoptext \setupcolors[rgb=no] \startMPcode draw lmt_svg [ filename = "sample.svg" ] ; \stopMPcode but recolor gives an error: metapost log    > >> picture metapost log    > ! Wrong picture color model: redpart of gre

[NTG-context] metapost: remapping colors of an SVG picture

2020-02-18 Thread mf
) + 5mm, 0) ; \stopMPcode \stoptext but recolor gives an error: metapost log> >> picture metapost log> ! Wrong picture color model: redpart of grey object. metapost log> _f_:=(redpart(EXPR0), metapost log> greenpart(EXPR0),bluepart(EXPR0));if.bou... metapost log

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-15 Thread Hans Hagen
On 2/15/2020 12:25 PM, Fabrice Couvreur wrote: Hi Henri, Why does the blue path not rotate 90 with the draw command but rotate with the fill command? compare draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor red;

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-15 Thread Floris van Manen
On 15-02-2020 12:25, Fabrice Couvreur wrote: > Hi Henri, > Why does the blue path not rotate 90 with the draw command but rotate > with the fill command? > Why not draw the match as a picture first, then rotate and shift that picture? Also, if you use a local scale unit, it will be easier to st

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-15 Thread Fabrice Couvreur
en. 14 févr. 2020 à 16:43, Fabrice L a > écrit : > >> Hi, >> >> Le 13 févr. 2020 à 16:45, Fabrice Couvreur >> a écrit : >> >> >> How to have the color defined by {yellow!60!black} with Metapost

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice Couvreur
it : > Hi, > > Le 13 févr. 2020 à 16:45, Fabrice Couvreur > a écrit : > > > How to have the color defined by {yellow!60!black} with Metapost ? > > > color MyColor ; MyColor := .6[yellow,black] ; > > See metafun manual, section 1.13. >

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice L
Hi, > Le 13 févr. 2020 à 16:45, Fabrice Couvreur a > écrit : > How to have the color defined by {yellow!60!black} with Metapost ? color MyColor ; MyColor := .6[yellow,black] ; See metafun manual, section 1.13. > Thank you. > Fabrice Fabri

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice Couvreur
i Henri, Thank you for your answer. The idea is to make the graph as an attachment. I converted to Metapost but the road is still long! The code is from percusse on StackExchange. As you can see, there is a problem with the ellipse. How do I fix this ? Thank you Fabrice \usemodule[tikz

Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-13 Thread Henri Menke
On 2/14/20 10:45 AM, Fabrice Couvreur wrote: > Hi, > How to have the color defined by {yellow!60!black} with Metapost ? \usemodule[tikz] \starttext \startMPcode fill fullsquare scaled 1cm withcolor (.6yellow + black) ; \stopMPcode \starttikzpicture \fill[yellow!60!black] (0,0) rectangl

[NTG-context] Metapost and TikZ color code equivalent

2020-02-13 Thread Fabrice Couvreur
Hi, How to have the color defined by {yellow!60!black} with Metapost ? Thank you. Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http

Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi Mikael, Thanks. Fabrice Le mar. 11 févr. 2020 à 14:01, Mikael P. Sundqvist a écrit : > On Tue, Feb 11, 2020 at 1:22 PM Fabrice Couvreur < > fabrice1.couvr...@gmail.com> wrote: > >> Hi Hans, >> I tried this but without success : >> >> \startMPcode >> suite{1,0}; >> suite{2,1}; >> \

Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Mikael P. Sundqvist
On Tue, Feb 11, 2020 at 1:22 PM Fabrice Couvreur < fabrice1.couvr...@gmail.com> wrote: > Hi Hans, > I tried this but without success : > > \startMPcode > suite{1,0}; > suite{2,1}; > \stopMPcode > > Fabrice > > Le mar. 11 févr. 2020 à 13:08, Hans Hagen a écrit : > >> On 2/11/2020 11:50

Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi Hans, I tried this but without success : \startMPcode suite{1,0}; suite{2,1}; \stopMPcode Fabrice Le mar. 11 févr. 2020 à 13:08, Hans Hagen a écrit : > On 2/11/2020 11:50 AM, Fabrice Couvreur wrote: > > Hi, > > I have some problems with the following macro : > > > > tex error

Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Hans Hagen
On 2/11/2020 11:50 AM, Fabrice Couvreur wrote: Hi, I have some problems with the following macro : tex error       > mp error on line 23 in file /home/viserion/macro.tex: ! Missing argument to suite. { <*> suite{ 1,0}; suite(2,1); ; That macro has more parameters than you thought. I'll continu

[NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi, I have some problems with the following macro : tex error > mp error on line 23 in file /home/viserion/macro.tex: ! Missing argument to suite. { <*> suite{ 1,0}; suite(2,1); ; That macro has more parameters than you thought. I'll continue by pretending that each missing argument is eit

[NTG-context] New to metapost, could use some help with first steps

2020-02-02 Thread Gerben Wierda
Hans was so kind to help me with a setup for some generated output. I am trying to understand every line of his example so I can expand on his exmaple to make it fully functional. In his example there is: context('draw textext("\\framed[frame=off,offset=5bp,align={middle,lohi,verytolerant,broad

Re: [NTG-context] A question about whatever (Metapost)

2020-01-26 Thread Alan Braslau
What error are you getting? (perhaps you need "save carre,p,a,b,c,d,N,P,M ;") A perpendicular line is also the line "rotated 90" (about the intersection point). Alan On Sun, 26 Jan 2020 00:09:38 +0100 Fabrice Couvreur wrote: > Hi, > The point M is such that the line (CM) is perpendicular to

[NTG-context] A question about whatever (Metapost)

2020-01-25 Thread Fabrice Couvreur
Hi, The point M is such that the line (CM) is perpendicular to the line (NP). I do not understand the error of this code. Thank you Fabrice \usecolors[xwi] \starttext \startMPcode path carre, p; carre = unitsquare scaled 138; pair a, b, c, d, N, P, M; a = point 0 of carre; b = point 1 o

Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Wolfgang Schuster
Fabrice Couvreur schrieb am 01.12.2019 um 21:56: Hi Hans, I updated lmtx, but your code does not compile except that the output is a pdf file where it is written ERROR. Can you clear the cache. Wolfgang ___ If yo

Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Fabrice Couvreur
Hi Hans, I updated lmtx, but your code does not compile except that the output is a pdf file where it is written ERROR. Fabrice tex error > tex error on line 1 in file ./blond.tex: ? \font_helpers_low_level_define ...\scaledfontmode \relax

Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Jeong Dal
Dear Fabrice, I run your code using ConTeXt LMTX and got the figure. (LuaMetaTeX 2.00, ConTeXt version: 2019.11.14.) I don’t know why you have errors. Here is the beginning of log file: resolvers | formats | executing runner 'run luametatex format': /Users/graph/ConTeXtLMTX/tex/texmf-osx-

Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Hans Hagen
On 12/1/2019 11:32 AM, Fabrice Couvreur wrote: Hello Thank you for your suggestion. However, it works with context and not with lmtx. Fabrice \starttext \startMPcode    defaultfont := "texgyrepagella-regular*default" ;    defaultscale :=0.8;    color brown;    brown = (0.128,0.00,0.00);

Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Fabrice Couvreur
Hello Thank you for your suggestion. However, it works with context and not with lmtx. Fabrice \starttext \startMPcode defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8; color brown; brown = (0.128,0.00,0.00); path twos, threes, sixes; twos = fullcircle xscal

Re: [NTG-context] Transparency (Metapost)

2019-11-30 Thread Jeong Dal
> \ Dear Fabrice, I got color and transparency using the following command in LMTX(metafun). fill p withcolor yellow withtransparency(1, .75); I hope that it helps. Best regards, Dalyoung___ If your question is of

[NTG-context] Transparency (Metapost)

2019-11-30 Thread Fabrice Couvreur
Hello, I have a little trouble with the management of transparency : the colors are not respected. Thank you. Fabrice \starttext \startMPcode defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8; color brown; brown = (0.165,0.42,0.42); path twos, threes; twos =

Re: [NTG-context] Size of the font (Metapost + xtable)

2019-09-23 Thread Wolfgang Schuster
Fabrice Couvreur schrieb am 23.09.2019 um 23:31: Hi Wolfgang, As I understand it, the following instructions have no effect on the figures defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8 ; You change the font because you typeset your labels in math mode. label.llft(btex

Re: [NTG-context] Size of the font (Metapost + xtable)

2019-09-23 Thread Wolfgang Schuster
Fabrice Couvreur schrieb am 23.09.2019 um 16:12: Hello, I can not change the font size of my figures in the table. \startxcell[foregroundstyle={\switchtobodyfont[...]}] or \setupxtable[smallbodyfont][foregroundstyle={\switchtobodyfont[...]}] \startxcell[smallbodyfont] Wolfgang

Re: [NTG-context] Size of the font (Metapost + xtable)

2019-09-23 Thread Thomas A. Schmitz
On 9/23/19 4:12 PM, Fabrice Couvreur wrote: Hello, I can not change the font size of my figures in the table. Thank you Fabrice Does changing \usecolors [xwi] to \usecolors [ema] help? All best Thomas ___ I

[NTG-context] Size of the font (Metapost + xtable)

2019-09-23 Thread Fabrice Couvreur
Hello, I can not change the font size of my figures in the table. Thank you Fabrice \usecolors[xwi] \startbuffer[myfigure] \dontleavehmode \startMPcode defaultfont := "texgyrepagella-regular*default" ; defaultscale :=0.8 ;

Re: [NTG-context] MetaPost with Multiple Variable Sections

2019-09-18 Thread Jeong Dal
Dear Jeroen, If you change “pair a;” to “numeric a;” in the second MPcode, it draws a circle without error. Best regards, Dalyoung > > \placefloatright{}{ > \startMPcode > pair a; numeric a; > a := 2cm; > draw fullcircle scaled (2*a); > \stopMPcode} > > \stoptext > __

Re: [NTG-context] MetaPost with Multiple Variable Sections

2019-09-18 Thread Aditya Mahajan
On Wed, 18 Sep 2019, Jeroen wrote: \startMPcode pair a; a := 2cm; You define a to be a pair and then assign it to a number. Metapost is telling you that you cannot do that: (xpart a,ypart a) 56.6929 ! Equation cannot be performed (pair=numeric). ; <*> pair a; a := 2cm; draw full

[NTG-context] MetaPost with Multiple Variable Sections

2019-09-18 Thread Jeroen
I have been working with MetaPost as following, which worked fine with one startMPcode section with variables, but with 2 startMPcode Metapost sections, it keeps telling me the numbers dont add up: \definefloat [floatright][figure] \setupfloat [floatright][default={right,none

Re: [NTG-context] colors in MetaPost

2019-09-11 Thread Hans Hagen
On 9/11/2019 2:18 PM, Henning Hraban Ramm wrote: Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm : \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] Of course I need values between 0 and 1. Sorry for the noise. I think I’m too tired... there is an a

Re: [NTG-context] colors in MetaPost

2019-09-11 Thread Henning Hraban Ramm
Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm : > \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] > \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] Of course I need values between 0 and 1. Sorry for the noise. I think I’m too tired... Greetlings, Hraban --- https://www.fiee.net http://wiki.conte

[NTG-context] colors in MetaPost

2019-09-11 Thread Henning Hraban Ramm
Hi, I’m trying to get a linear shade in the background of my presentation. But it seems like MetaPost can’t handle my self-defined colors: \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] \startuniqueMPgraphic{Verlauf} % old method, also doesn’t work

Re: [NTG-context] Convert SVG to MetaPost

2019-08-13 Thread Hans Hagen
On 8/12/2019 1:33 PM, Jon Wong wrote: Hi Taco! Very enlightening! I’ll just use both MetaPost and SVG for their intended purposes. (SVG will come from workflow involving GIMP/Inkscape; MetaPost for logical, rather than graphical, figures.) if you have inkscape installed you can do

Re: [NTG-context] Convert SVG to MetaPost

2019-08-13 Thread Hans Hagen
On 8/12/2019 1:15 PM, Taco Hoekwater wrote: Hi, On 12 Aug 2019, at 12:10, Jon Wong wrote: Hi all, Is it possible to convert SVG to MetaPost? Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX. If I can

Re: [NTG-context] Convert SVG to MetaPost

2019-08-12 Thread Jon Wong
Hi Taco! Very enlightening! I’ll just use both MetaPost and SVG for their intended purposes. (SVG will come from workflow involving GIMP/Inkscape; MetaPost for logical, rather than graphical, figures.) Regards Jon > On Aug 12, 2019, at 7:30 PM, luigi scarso wrote: > > > >

Re: [NTG-context] Convert SVG to MetaPost

2019-08-12 Thread luigi scarso
On Mon, Aug 12, 2019 at 12:11 PM Jon Wong wrote: > Hi all, > > Is it possible to convert SVG to MetaPost? > > Currently, I have Bash scripts in my workflow to invoke Inkscape > (converting SVG to PDF). I don’t like to allow shell access to TeX. > > If I can convert SVG to

Re: [NTG-context] Convert SVG to MetaPost

2019-08-12 Thread Taco Hoekwater
Hi, > On 12 Aug 2019, at 12:10, Jon Wong wrote: > > Hi all, > > Is it possible to convert SVG to MetaPost? > > Currently, I have Bash scripts in my workflow to invoke Inkscape (converting > SVG to PDF). I don’t like to allow shell access to TeX. > > If I can c

[NTG-context] Convert SVG to MetaPost

2019-08-12 Thread Jon Wong
Hi all, Is it possible to convert SVG to MetaPost? Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX. If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files instead of SVG files. That will do

Re: [NTG-context] Wrong MetaPost text output

2019-08-11 Thread Alan Braslau
On Sun, 11 Aug 2019 11:12:55 -0700 Henri Menke wrote: > Thank you for the quick repsonse. This looks good to me. However, > could you tell me a way to get the correct baseline with textext? When > I use > > \startMPpage > draw btex dummy etex shifted (0,0); > draw btex foo etex

Re: [NTG-context] Wrong MetaPost text output

2019-08-11 Thread Henri Menke
On 8/11/19 10:51 AM, Hans Hagen wrote: > I'll do this (lmtx): > > metapost> use 'textext(.)' instead of 'btex . etex' > metapost> rewrapping btex ... etex at the outer level [[dummy]] > metapost> rewrapping btex

Re: [NTG-context] Wrong MetaPost text output

2019-08-11 Thread Hans Hagen
On 8/11/2019 6:09 PM, Henri Menke wrote: Dear devs, There seems to be a bug in the MetaPost integration of ConTeXt. The MWE below should produce three different labels “dummy foo bar” but instead produces “bar bar bar”. The same example works correctly in plain MetaPost. Originally reported

[NTG-context] Wrong MetaPost text output

2019-08-11 Thread Henri Menke
Dear devs, There seems to be a bug in the MetaPost integration of ConTeXt. The MWE below should produce three different labels “dummy foo bar” but instead produces “bar bar bar”. The same example works correctly in plain MetaPost. Originally reported on https://tex.stackexchange.com

Re: [NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

2019-07-05 Thread Zhichu
and draw every glyph carefully in a metapost file "cas-chars.mp": beginglyph(20013,1000,1000,0); % a lot of fillings and drawingsendglyph; then call them in a test file: \definemetafont[cas-logo][cas-chars.mp] \startTEXpage \definefont[cas][cas@cas-logo] \cas 中國科學院\stopTEXp

Re: [NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

2019-07-05 Thread Hans Hagen
On 7/5/2019 8:32 AM, Zhichu wrote: Hi everyone, I was using metapost to generate some symbols, as in  "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex" How do you use these symbols in a document? Do you call them up by number somehow? Using some glyph interface do

[NTG-context] I (metapost) can't handle numbers bigger than 32767.99998

2019-07-04 Thread Zhichu
Hi everyone, I was using metapost to generate some symbols, as in "tex/texmf-context/metapost/context/fonts/mpiv/demo-symbols.tex" Occasionally, I want to customize a glyph whose charcode is a little large, say the character "院": ~~

Re: [NTG-context] using metapost library makecirc with context.

2019-04-21 Thread Alan Braslau
On Sat, 20 Apr 2019 23:49:26 +0200 Hans Hagen wrote: > > let latex=textext ; > > That crashed here. In fact, when I used makecirc.mp, I just commented out the following few lines at the head of the file: %input latex; % % Commands definitions to do the labeled easier % % %LaTeXsetup:=La

Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Hans Hagen
On 4/20/2019 11:16 PM, Alan Braslau wrote: On Sat, 20 Apr 2019 23:00:09 +0200 Hans Hagen wrote: On 4/20/2019 10:09 PM, Andrea De Michele wrote: I didn't understand the magic behind that but it's works. mp has no real text typesetting options so this hack provides it Why not let

Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Alan Braslau
On Sat, 20 Apr 2019 23:00:09 +0200 Hans Hagen wrote: > On 4/20/2019 10:09 PM, Andrea De Michele wrote: > > > I didn't understand the magic behind that but it's works. > > mp has no real text typesetting options so this hack provides it Why not let latex=textext ; > > Another questi

Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Hans Hagen
On 4/20/2019 10:09 PM, Andrea De Michele wrote: I didn't understand the magic behind that but it's works. mp has no real text typesetting options so this hack provides it Another question: there is a library to draw electrics circuit alternative to makecirc but more context/metafun friendly

Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Andrea De Michele
Hans Hagen writes: > On 4/19/2019 5:48 PM, Andrea De Michele wrote: >> >> I'm trying to use with Context makecirc a metapost library to draw >> electric circuits, but I have problems with the labels of the circuits >> element that are not displayed correctly. &g

Re: [NTG-context] using metapost library makecirc with context.

2019-04-19 Thread Hans Hagen
On 4/19/2019 5:48 PM, Andrea De Michele wrote: I'm trying to use with Context makecirc a metapost library to draw electric circuits, but I have problems with the labels of the circuits element that are not displayed correctly. FIRST EXAMPLE (No labels are displayed) - \star

[NTG-context] using metapost library makecirc with context.

2019-04-19 Thread Andrea De Michele
I'm trying to use with Context makecirc a metapost library to draw electric circuits, but I have problems with the labels of the circuits element that are not displayed correctly. FIRST EXAMPLE (No labels are displayed) - \starttext \startMPinclusions input mak

Re: [NTG-context] *** Spam *** Drawing scaled externalfigure in Metapost produces erroneous size in the latest beta

2019-04-04 Thread Lutz Haseloff
Hi Thorsten, I had the same problem a couple of months ago. Use sized instead of scaled now. The same goes for xscaled and yscaled. Greetings Lutz Am 4. April 2019 01:31:29 MESZ schrieb "Thorsten S." : >Hello! > >The simple Metapost code that follows worked fine until upgrad

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