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 and

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

2020-03-16 Thread Taco Hoekwater
text y) = 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,f

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 >

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

2020-03-16 Thread Gerben Wierda
annot 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 (picture, p

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
t. > > 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 vard

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

[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

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

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

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

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

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

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

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

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 >

[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

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

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

[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

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

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 =

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

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

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

[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

[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

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

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

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

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

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

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 ___

[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

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

[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

[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 ... etex at the outer le

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
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 中國科學院\stopTEXpage I

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-05 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 % %

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

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

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

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) - \starttext

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

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

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

2019-04-04 Thread Hans Hagen
On 4/4/2019 1:31 AM, Thorsten S. wrote: Hello! The simple Metapost code that follows worked fine until upgrading to recent beta. I don't have a clue exactly when this behaviour was introduced since I switched just recently from the standard Texlive version available in Arch Linux

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

2019-04-04 Thread Thorsten S.
Hello! The simple Metapost code that follows worked fine until upgrading to recent beta. I don't have a clue exactly when this behaviour was introduced since I switched just recently from the standard Texlive version available in Arch Linux. \starttext \startMPcode draw externalfigure

Re: [NTG-context] Metapost graphic in setupbackground

2019-02-08 Thread Jan U. Hasecke
Thanks a lot Wolfgang and Marco. :-) juh Am 08.02.19 um 12:57 schrieb Wolfgang Schuster: > > > Jan U. Hasecke schrieb am 08.02.19 um 12:36: >> Hi all, >> >> I make my first steps with Metapost. >> >> I would like to set the background of all page

Re: [NTG-context] Metapost graphic in setupbackground

2019-02-08 Thread Wolfgang Schuster
Jan U. Hasecke schrieb am 08.02.19 um 12:36: Hi all, I make my first steps with Metapost. I would like to set the background of all pages to a Metapost graphic. But only the first page has the defined background. I also tried with \startuseMPgraphic with no success --- mwe

Re: [NTG-context] Metapost graphic in setupbackground

2019-02-08 Thread Marco Patzer
On Fri, 8 Feb 2019 12:36:16 +0100 "Jan U. Hasecke" wrote: > \definelayer[kreisbackground][width=70mm,height=70mm] \definelayer[kreisbackground][width=70mm,height=70mm, state=repeat] start: layer appears only on the current page stop : layer doesn't show up repeat : layer prints on

[NTG-context] Metapost graphic in setupbackground

2019-02-08 Thread Jan U. Hasecke
Hi all, I make my first steps with Metapost. I would like to set the background of all pages to a Metapost graphic. But only the first page has the defined background. I also tried with \startuseMPgraphic with no success --- mwe --- \startreusableMPgraphic{kreis} draw fullcircle scaled

Re: [NTG-context] About the macro path intersectionpoint path with Metapost

2019-02-04 Thread Fabrice L
Hi, I guess your problem is to find the two points of intersection between p and r ? If so, the problem is that intersectionpoint does return the same intersection when there is several, as it is the case here. So a quick solution that you can do is to find intersections for the two part. A

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-04 Thread Fabrice Couvreur
Hi, @ Henri Thank you @ Alan How to use it in my code ? Thank you Fabrice Le dim. 3 févr. 2019 à 21:26, Alan Braslau a écrit : > On Mon, 4 Feb 2019 09:19:26 +1300 > Henri Menke wrote: > > > Use the infont operator. > > Easier yet, the string can contain the font switch \bf: > > draw

Re: [NTG-context] About the macro path intersectionpoint path with Metapost

2019-02-03 Thread Jeong Dal
Dear Fabrice, Metapost is great for drawiang figures but it is not easy for me to use it. > b:= fullcircle scaled 2cm shifted (0,-3cm); > pair A, B ; > A:= p intersectionpoint r ; > B:= p intersectionpoint r ; > path u ; > u:= A--B--cycle ; A and B are the same point.

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-03 Thread Alan Braslau
On Mon, 4 Feb 2019 09:19:26 +1300 Henri Menke wrote: > Use the infont operator. Easier yet, the string can contain the font switch \bf: draw textext("\bf "(i)) ; ___ If your question is of interest to others as

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-03 Thread Henri Menke
On 4/02/19 12:50 AM, Fabrice Couvreur wrote: > Sorry Henri, but I still have a question : how to have the letters in bold > type ? Use the infont operator. That info is a bit hidden in “2.10 Analyzing pictures” of the MetaFun manual. \starttext \startMPcode for i=0 upto 3 : for j=0

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-03 Thread Fabrice Couvreur
Sorry Henri, but I still have a question : how to have the letters in bold type ? Thank you. Fabrice Le dim. 3 févr. 2019 à 10:12, Fabrice Couvreur a écrit : > Hi Henry > Thank you for everything. > Fabrice > > Le sam. 2 févr. 2019 à 20:58, Henri Menke a écrit : > >> On 2/2/19 11:49 PM,

[NTG-context] About the macro path intersectionpoint path with Metapost

2019-02-03 Thread Fabrice Couvreur
Hi, I would like to reproduce the attached figure. My problem is to create the points of intersection between the circles. It seems that my approach is not the right one. Thank you. Fabrice \starttext \startMPcode path p, q, r, b ; p:= fullcircle scaled 6cm ; q:= fullcircle scaled 4cm

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-03 Thread Fabrice Couvreur
Hi Henry Thank you for everything. Fabrice Le sam. 2 févr. 2019 à 20:58, Henri Menke a écrit : > On 2/2/19 11:49 PM, Fabrice Couvreur wrote: > > Hi Henri, > > Great ! I would also like these letters to be randomly colored. > > You should play with randomseed, the starting color (here white) and

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-02 Thread Henri Menke
On 2/2/19 11:49 PM, Fabrice Couvreur wrote: > Hi Henri, > Great ! I would also like these letters to be randomly colored. You should play with randomseed, the starting color (here white) and the randomization amplitude (1,1,1). You mileage may vary. \starttext \startMPcode for i=0 upto 3 :

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-02 Thread Fabrice Couvreur
Hi Henri, Great ! I would also like these letters to be randomly colored. Thank you. Fabrice Le sam. 2 févr. 2019 à 11:16, Henri Menke a écrit : > On 2/2/19 10:47 PM, Fabrice Couvreur wrote: > > The idea is to display the first 25 letters of the alphabet. The code > below > > shows the letter a

Re: [NTG-context] Show the letters of the alphabet with a loop (Metapost)

2019-02-02 Thread Henri Menke
On 2/2/19 10:47 PM, Fabrice Couvreur wrote: > The idea is to display the first 25 letters of the alphabet. The code below > shows the letter a to show what I want to do. > Thank you. > Fabrice Use char and ASCII. \starttext \startMPcode for i=0 upto 3 : for j=0 upto 3 : draw

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