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

2021-01-03 Thread Jean-Philippe Rey
te the following ==\usemodule[graph]\starttext\startMPcode{graph}draw begingraph(150mm, 100mm); gdraw "test-mpgraph.txt"; endgraph;\stopMPcode\stoptext==which fails with "error: Improper type" (see attache

[NTG-context] metapost graph and ConTeXt LMTX

2021-01-03 Thread Jean-Philippe Rey
ment LMTX example ===== \starttext \startMPcode troffmode:=0; prologues:=0; input graph draw begingraph(150mm, 100mm); gdraw "test-mpgraph.txt"; endgraph; \stopMPcode \stoptext === I had to define troffmode and prologu

[NTG-context] About \includeMPgraphic and local presets

2021-01-01 Thread Jairo A. del Rio
Hi, list! I've read elsewhere \MPrawvar allows a preset to be applied outside \start...\stopuseMPgraphic. \startuseMPgraphic{hi} draw fullcircle scaled \MPrawvar{hi}{u}; \stopuseMPgraphic \setupMPvariables[hi][u=1cm] \startMPcode \includeMPgraphic{hi} \stopMPcode However, \includeMPgr

[NTG-context] Metafun: dotlabel issue in latest LMTX

2020-12-27 Thread Otared Kavian
; \stopMPdefinitions \starttext \startMPcode newpath p ; p := (2cm, 3cm) -- (3cm, 5cm); mydotlabeldiam := 15pt; mydotlabelshape := fullsquare ; draw p ; mydotlabel(textext("\switchtobodyfont[8pt]" & "A"), point 0 of p) withcolor transparent("exclusion&

Re: [NTG-context] freedotlabel not defined in LMTX ?

2020-12-26 Thread Hans Hagen
version 2020.12.24 17:30 LMTX. %% begin freedotlabel.tex \setupbodyfont[pagella] \starttext \startMPcode pair destination ; for whereto = "up", "down", "left", "right" : destination := scantokens(whereto) * 1cm ; freedotlabel(whereto, destina

[NTG-context] freedotlabel not defined in LMTX ?

2020-12-26 Thread Otared Kavian
freedotlabel.tex \setupbodyfont[pagella] \starttext \startMPcode pair destination ; for whereto = "up", "down", "left", "right" : destination := scantokens(whereto) * 1cm ; freedotlabel(whereto, destination, origin) ; drawarrow origin -- dest

Re: [NTG-context] MetaFun labels and xsized

2020-12-25 Thread Pablo Rodriguez
On 12/25/20 10:09 PM, Hans Hagen wrote: >> [...] > \startMPcode > path p ; p := ( > ( 1, 1) -- > ( 1, 5) -- > (10, 10) -- > (14, 4) -- > cycle) xsized .75TextWidth; > > draw p ; > > fre

Re: [NTG-context] MetaFun labels and xsized

2020-12-25 Thread Hans Hagen
On 12/25/2020 6:36 PM, Fabrice L wrote: Hi, Le 25 déc. 2020 à 12:30, Pablo Rodriguez a écrit : Dear list, I have this minimal MetaFun sample (the only one in my real document): \setupbodyfont[pagella] \starttext \startMPcode pair a ; a := (1, 1) ; pair b ; b := (1, 10) ; pair c

Re: [NTG-context] MetaFun labels and xsized

2020-12-25 Thread Pablo Rodriguez
here is a simple > one: > > \setupbodyfont[pagella] > \starttext > \startMPcode > pair a ; a := (1, 1) ; > pair b ; b := (1, 10) ; > pair c ; c := (10, 10) ; > pair d ; d := (10, 1) ; > path square ; > square := (a--b--c--d--cycle) xsized .75TextWidth ; > > draw sq

Re: [NTG-context] MetaFun labels and xsized

2020-12-25 Thread Fabrice L
Hi, > Le 25 déc. 2020 à 12:30, Pablo Rodriguez a écrit : > > Dear list, > > I have this minimal MetaFun sample (the only one in my real document): > > \setupbodyfont[pagella] > \starttext > \startMPcode > pair a ; a := (1, 1) ; > pair b ; b := (

[NTG-context] MetaFun labels and xsized

2020-12-25 Thread Pablo Rodriguez
Dear list, I have this minimal MetaFun sample (the only one in my real document): \setupbodyfont[pagella] \starttext \startMPcode pair a ; a := (1, 1) ; pair b ; b := (1, 10) ; pair c ; c := (10, 10) ; pair d ; d := (10, 1) ; draw (a--b--c--d--a) xsized .75TextWidth; draw

Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-18 Thread Hans Hagen
issue is PDF-viewer-specific, I'm using Chromium as the PDF viewer). I tried doing this in two different ways: using includesvgfile with the offset option, and using startMPcode with setbounds in the MetaFun code. In both cases I just get blank space instead of the cut-off content How can I fix th

Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Neven Sajko
rse-1023-1013.svg][offset=20pt]}} {some offset} \startMPcode draw lmt_svg [ filename = "../hammingCoderStopwatch-hammingCoder-gcc-RowsSparse-1023-1013.svg" ]; setbounds currentpicture

Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Aditya Mahajan
ecific, I'm using Chromium as the PDF viewer). Can you check with a desktop pdf viewer as well. > I tried doing this in two different ways: using includesvgfile with > the offset option, and using startMPcode with setbounds in the MetaFun > code. In both cases I just get blank space in

[NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Neven Sajko
um as the PDF viewer). I tried doing this in two different ways: using includesvgfile with the offset option, and using startMPcode with setbounds in the MetaFun code. In both cases I just get blank space instead of the cut-off content How can I fix this? Related question: is it possible to get

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Hans Hagen
to be a square: \starttext \startMPcode draw (2cm,3cm) -- (3cm,5cm) ; dotlabel(textext("\switchtobodyfont[8pt]" & "A"), (2cm,3cm)) withpen pencircle scaled 12pt withcolor transparent("exclusion",.5,red) ; dotlabel(textext("\switchtobodyfont[8

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Otared Kavian
oint I woul dlike to have some dots >> represented by a square (or even by another scalable symbol): for instance >> in the following I would like the dot at the point B to be a square: >> >> \starttext >> \startMPcode >> draw (2cm,3cm) -- (3cm,5cm) ; >>

Re: [NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Aditya Mahajan
> > \starttext > \startMPcode > draw (2cm,3cm) -- (3cm,5cm) ; > dotlabel(textext("\switchtobodyfont[8pt]" & "A"), (2cm,3cm)) > withpen pencircle scaled 12pt > withcolor transparent("exclusion",.5,red) ; > > dotlabel(textext("

[NTG-context] Metafun: is it possible to redefine dotlabel to draw a square ?

2020-12-10 Thread Otared Kavian
Hi all, In Metafun when representing a point I woul dlike to have some dots represented by a square (or even by another scalable symbol): for instance in the following I would like the dot at the point B to be a square: \starttext \startMPcode draw (2cm,3cm) -- (3cm,5cm) ; dotlabel(textext

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
nks for the alternative method, which comes handy if one wishes to extend >> the straight line by a different amount at either end: >> >> \starttext >> \startMPcode >> z1 = (1cm,3cm) ; >> z2 = (5cm, 9cm) ; >> z3 = 1cm * dir(angle (z2 - z1)) shifted

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
On Wed, 9 Dec 2020, Otared Kavian wrote: > Hi Aditya, > > Thanks for the alternative method, which comes handy if one wishes to extend > the straight line by a different amount at either end: > > \starttext > \startMPcode >z1 = (1cm,3cm) ; >z2 = (5cm, 9cm)

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
Hi Aditya, Thanks for the alternative method, which comes handy if one wishes to extend the straight line by a different amount at either end: \starttext \startMPcode z1 = (1cm,3cm) ; z2 = (5cm, 9cm) ; z3 = 1cm * dir(angle (z2 - z1)) shifted z2 ; z4 = -.5cm*dir(angle(z2 - z1

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
On Wed, 9 Dec 2020, Otared Kavian wrote: > Thanks a lot ! Indeed that does the job, which shows how wonderful Metafun is > ! Or, if you want to use high school algebra: \starttext \startMPcode z1 = (1cm,3cm) ; z2 = (5cm, 9cm) ; z3 = 1cm * dir(angle (z2 - z1)) shifted z2;

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
Hi. The following: \starttext %Using \startMPpage instead doesn't help \startTEXpage[width=1920px,height=1080px,margin=1em] \startplacefigure[location=force,number=no] \startMPcode draw textext("some text"); \stopMPcode \stopplacefigure \stopTEXpage \stoptext gives a normal outp

[NTG-context] sacling isue in lmt_followtext

2020-12-05 Thread Pablo Rodriguez
Hi Hans, I have this sample: \starttext \startMPcode{doublefun} draw lmt_followtext [ text = " ·\input{zapf} ", path = ((12,0)--(32,15)--(50,0)--(45,26)--(64,42) --(40,42)--(32,65)--(24,42)--(0,42)--(0,42) ..(20,26)--(12,0)), autoscaleup = "max&q

Re: [NTG-context] Indentation after \placefigure

2020-11-10 Thread Sylvain Hubert
> following example? > > > > > > \indenting[2em] > > > \setupindenting[yes] > > > > > > \starttext > > > > > > \dorecurse{50}{a b c } > > > > > > \placefigure[here,none][indentnext=yes]{}{ >

Re: [NTG-context] Indentation after \placefigure

2020-11-10 Thread Aditya Mahajan
\setupindenting[yes] > > > >     \starttext > > > >     \dorecurse{50}{a b c } > > > >     \placefigure[here,none][indentnext=yes]{}{ > >     \startMPcode > >     draw fullcircle scaled 1cm; > >     \stopMPcode > >     } > > >

Re: [NTG-context] Indentation after \placefigure

2020-11-10 Thread Sylvain Hubert
\setupindenting[yes] > > > > \starttext > > > > \dorecurse{50}{a b c } > > > > \placefigure[here,none][indentnext=yes]{}{ > > \startMPcode > > draw fullcircle scaled 1cm; > > \stopMPcode > > } > > &g

Re: [NTG-context] Indentation after \placefigure

2020-11-10 Thread mf
]{}{     \startMPcode     draw fullcircle scaled 1cm;     \stopMPcode     }     \dorecurse{50}{d e f } % not indented     \dorecurse{50}{g h i }     \stoptext The second bracket group of \placefigure is for references. Instead of \placefigure[here,none][indentnext=yes]{}{... write

[NTG-context] Indentation after \placefigure

2020-11-10 Thread Sylvain Hubert
Dear List, Does anyone know how to indent the paragraph beneath \placefigure in the following example? \indenting[2em] \setupindenting[yes] \starttext \dorecurse{50}{a b c } \placefigure[here,none][indentnext=yes]{}{ \startMPcode draw fullcircle scaled 1cm

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

2020-11-09 Thread Sylvain Hubert
eXt environment? E.g.: > > \starttext > \startMPcode %\startuseMPgraphic{} if you want to reuse your graphic > with \useMPgraphic{} > draw fullcircle scaled cm > %withcolor black % black is default > ; > \stopMPcode %\stopuseMPgraphic > \stoptext > > More

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

2020-11-09 Thread Jairo A. del Rio
Hi, Sylvain. LuaMetaTeX and LuaTeX, the engines used by ConTeXt nowadays, use an embedded library, so external compilations/files are not necessary. Just out of curiosity, wouldn't it be easier to use a ConTeXt environment? E.g.: \starttext \startMPcode %\startuseMPgraphic{} if you want to

Re: [NTG-context] Changing the colors of Charts in luametafun

2020-10-18 Thread Hans Hagen
On 10/16/2020 3:34 PM, Jan U. Hasecke wrote: Hi, as I'll need to make some business charts in the near future I had a look into metafun xl. Here is the first example: \startMPcode draw lmt_chart_circle [ samples = { { 1, 4, 3, 2, 5, 7, 6 } }, percentage = true, trace = true, ] ; \stopM

[NTG-context] Changing the colors of Charts in luametafun

2020-10-16 Thread Jan U. Hasecke
Hi, as I'll need to make some business charts in the near future I had a look into metafun xl. Here is the first example: \startMPcode draw lmt_chart_circle [ samples = { { 1, 4, 3, 2, 5, 7, 6 } }, percentage = true, trace = true, ] ; \stopMPcode How can I change the colors used fo

[NTG-context] Add arrow tips to axes in lmt_function

2020-09-19 Thread Jairo A. del Rio
Hi, list! I want to know how to add arrow tips for axes (x, y) to a function. I did the following based on a luametafun example: \starttext \startMPcode{doublefun} draw lmt_function [ xmin=0, xmax=10, xstep=.05, ymin=-2, ymax=2, code="1.5 * math.cosd(240 * math.sqrt(x))", xlabels=&q

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Fabrice Couvreur
eter; endfig; end But what you are proposing unfortunately does not work. Fabrice Le mar. 1 sept. 2020 à 14:25, Taco Hoekwater a écrit : > Hi, > > I think you need this: > > \startMPinclusions > input mp-scratch; > \stopMPinclusions > > \startMPcode > Scra

Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Taco Hoekwater
Hi, I think you need this: \startMPinclusions input mp-scratch; \stopMPinclusions \startMPcode Scratchversion:=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 wr

[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
: > > \starttext > > \startluacode > > userdata = userdata or {} > userdata.dummydata = { {1, 2}, {3, 4} } > > function MP.GetI() > mp.print(#userdata.dummydata) > end > function MP.GetJ(i) > mp.print(#userdata.dummydata[

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

2020-08-09 Thread Hans Hagen
.dummydata[i][j]) end \stopluacode \startMPcode numeric myunit ; myunit := EmWidth; for i = 1 upto lua.MP.GetI() : for j = 1 upto lua.MP.GetJ(i) : draw unitsquare scaled myunit shifted (myunit * (lua.MP.GetIJ(i,j))); endfor ; endfor ; \stopMPcode \stop

Re: [NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
path b). > > Thanks for your help. > > Fabrice > > > > \starttext > > \startMPcode > > > > path circle, p, q, b; > > > > circle = fullcircle xscaled 6cm yscaled 3.5cm; > > p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm)..

Re: [NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Taco Hoekwater
> On 23 Jul 2020, at 11:48, Fabrice Couvreur > wrote: > > Hello, > I have a little problem with coloring an area (path b). > Thanks for your help. > Fabrice > > \starttext > \startMPcode > > path circle, p, q, b; > > circle = fullcircle xs

[NTG-context] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
Hello, I have a little problem with coloring an area (path b). Thanks for your help. Fabrice \starttext \startMPcode path circle, p, q, b; circle = fullcircle xscaled 6cm yscaled 3.5cm; p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point 6 of circle); q = (subpath(0,2

Re: [NTG-context] METAPOST subpath rounding issue

2020-05-09 Thread Bruce Horrocks
finity of >>> cutFirstPart)) >>>or ((ypart point 0 of cutSecondPart) <> (ypart point infinity of >>> cutFirstPart)): >>>resultConn := cutFirstPart--cutSecondPart; >>> else: >>>resultConn := cutFirstPart & cu

[NTG-context] Text size with lmt_text [ ]

2020-04-22 Thread Fabrice Couvreur
and color parameters while I did not succeed using textext (). My problem is the size of the letters which is too small. Thank you. Fabrice \usecolors[xwi] \definecolor [prune] [r=1.29,g=.20,b=.83] \starttext \startMPcode vardef card(expr s, c) = image( draw fullsquare xyscaled (2cm,4cm

Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Wolfgang Schuster
corners with outlinetext. For example, this doesn't work. \startMPcode      draw outlinetext.f          ("\frameletter{A}")          (withcolor darkred withpen pencircle scaled 1/10)           rotated 5 xsized 2cm ; \stopMPcode Take a look at the log-file and you should see a

Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Fabrice Couvreur
x27;t work. \startMPcode draw outlinetext.f ("\frameletter{A}") (withcolor darkred withpen pencircle scaled 1/10) rotated 5 xsized 2cm ; \stopMPcode Fabrice Le lun. 20 avr. 2020 à 10:36, Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> a é

Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Wolfgang Schuster
Rudolf Bahr schrieb am 20.04.2020 um 10:23: On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote: Fabrice Couvreur schrieb am 19.04.2020 um 22:55: Hi, I try to reproduce the figure as faithfully as possible. I tried for the rounded corners to put the key corner = round, but it does

Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Rudolf Bahr
On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote: > Fabrice Couvreur schrieb am 19.04.2020 um 22:55: > > Hi, > > I try to reproduce the figure as faithfully as possible. I tried for the > > rounded corners to put the key corner = round, but it does not work. > > 1. To create a new

Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Wolfgang Schuster
Fabrice Couvreur schrieb am 19.04.2020 um 22:55: Hi, I try to reproduce the figure as faithfully as possible. I tried for the rounded corners to put the key corner = round, but it does not work. 1. To create a new framed-instance you need \defineframe, \setupframed isn't enough to set the val

[NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-19 Thread Fabrice Couvreur
] \startMPcode draw outlinetext.f ("\framed[frameletter]{A}") (withcolor darkred withpen pencircle scaled 1/10) rotated 5 xsized 2cm ; draw outlinetext.f ("\framed[frameletter]{L}") (withcolor green withpen p

Re: [NTG-context] Colors in lmt_surface and luametafun

2020-04-17 Thread Hans Hagen
On 4/17/2020 3:33 PM, Otared Kavian wrote: Hi Hans, On page 36 of luametafun.pdf there is the following example of using lmt_surface: \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "s

[NTG-context] Colors in lmt_surface and luametafun

2020-04-17 Thread Otared Kavian
Hi Hans, On page 36 of luametafun.pdf there is the following example of using lmt_surface: \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "sin(x*x) - cos(y*y)",

Re: [NTG-context] \startMPcode and \startMPpage

2020-04-16 Thread Jeong Dal
Dear Hans, Thank you for the reply. Since \startMPcode … \stopMPcode form is used in the manual, I think that it is OK to use it for all cases. Thank you again. Best regards, Dalyoung > 2020. 4. 17. 오전 5:01, Hans Hagen 작성: > > On 4/16/2020 8:36 PM, Jeong Dal wrote: >

Re: [NTG-context] \startMPcode and \startMPpage

2020-04-16 Thread Hans Hagen
On 4/16/2020 8:36 PM, Jeong Dal wrote: Hi, The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode. The error message is \textfont0 is undefined (character 63) l.6 \setstrut\strut $A$ If I remove “$” from the code

[NTG-context] \startMPcode and \startMPpage

2020-04-16 Thread Jeong Dal
Hi, The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode. The error message is \textfont0 is undefined (character 63) l.6 \setstrut\strut $A$ If I remove “$” from the code, it is also working in \startMPcode

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-12 Thread Jeong Dal
endfor ; >endfor ; >) withcolor getparameter "color" ; > >for n = 0 upto 4 : >start := n * A ; >for r = 0 upto n : > now := start + r * right * dx ; >

Re: [NTG-context] running lua in metafun and in ConTeXt

2020-04-12 Thread Hans Hagen
"options" "labels" : dotlabel.top(textext(lua.MP.lmt_WhateverShape(n,r)),now) ; fi ; endfor; endfor; popparameters ; ) enddef ; \stopMPextensions \starttext \startMPcode draw WhateverShape [ angle = 30,

[NTG-context] mp strings

2020-04-10 Thread Hans Hagen
ation of these permits passing and processing strings as-they-are. Just in case the Gerbens among us need it. Hans example = \startTEXpage \def\foo{x} \framed{\startMPcode interim catcoderegime := vrbcatcoderegime ; draw te

Re: [NTG-context] Background color of a framedtext that covers floats

2020-04-08 Thread Pablo Rodriguez
On 4/8/20 11:32 AM, Fabrice Couvreur wrote: > [...] > \startframedtext[width=max,background=color,backgroundcolor=fondpaille] >      \starthanging[location=right] >          {\startMPcode >           draw unitsquare scaled 2cm ; >           \stopMPcode} >      \input tuft

Re: [NTG-context] Background color of a framedtext that covers floats

2020-04-08 Thread Fabrice Couvreur
Hi Pablo, Here a sample. Fabrice \useMPlibrary[dum] \definecolor[fondpaille][c=0,m=0,y=0.2,k=0] \starttext \startframedtext[width=max,background=color,backgroundcolor=fondpaille] \starthanging[location=right] {\startMPcode draw unitsquare scaled 2cm

Re: [NTG-context] Nodes module for commutative diagrams etc

2020-03-29 Thread Wolfgang Schuster
, Matthias \starttext \startMPcode path p ; p := fullsquare scaled 3cm ; nodepath = p ; draw node(0,"\node{$G(X)$}") ; draw node(1,"\node{$G(Y)$}") ; draw node(2,"\node{$F(Y)$}") ; draw node(3,"\node{$F(X)$}") ; drawarrow fromto.bot(0,0,1, "\nod

[NTG-context] Nodes module for commutative diagrams etc

2020-03-29 Thread Weber, Matthias
Dear list, I need to typeset a handful of simple commutative diagrams like the one below, and I found the nodes manual by Alan that has exactly what I want. But what is the incantation to load the module, or am I missing something else? Thanks, Matthias \starttext \startMPcode path p ; p

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

2020-03-29 Thread Gerben Wierda
ession >>>> replace at my disposal. >>>> I might be able to change al “ instances into something else by walking >>>> through the string and building a new one. >>> >>> Your example uses " before Bar and not “ which is the problem.

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

2020-03-29 Thread Wolfgang Schuster
Does btex .. etex help or can't you change the strings and replace the quotation marks before you pass them to MetaPost? \starttext \startMPcode draw textext.urt("One"); draw btex "Two" etex shifted (0,15); label.urt("Three",(0,3

Re: [NTG-context] startcombination place reference left of images instead below

2020-03-24 Thread Christoph Hintermüller
cetable[title={some caption},reference={fig:somefig}] > \startitemize[a][stopper=)] > \starttabulate > \NI \startMPcode input heap ; \stopMPcode \NC\NR > \stoptabulate > \stopitemize > \stopplacetable > > \stoptext > > Without the

Re: [NTG-context] startcombination place reference left of images instead below

2020-03-24 Thread Christoph Hintermüller
> \startitemize[a][stopper=)] > \starttabulate > \NI \startMPcode input heap ; \stopMPcode \NC\NR > \stoptabulate > \stopitemize > \stopplacetable > > \stoptext > > Without the actual error message it's hard to tell what's wrong but

Re: [NTG-context] Issue with rendering arrows in lmtx

2020-03-17 Thread Jan-Erik Hägglöf
gt;> wrote: >> >> Hi All! >> >> When I invoke this command >> >> \startMPcode >> picture p ; p := lmt_svg [ filename ="pil.svg" ]; >> draw p; >> \stopMPcode >> >> I get weird results, the arrowhead points in wrong direc

Re: [NTG-context] Issue with rendering arrows in lmtx

2020-03-17 Thread Taco Hoekwater
> On 17 Mar 2020, at 15:51, Jan-Erik Hägglöf wrote: > > Hi All! > > When I invoke this command > > \startMPcode > picture p ; p := lmt_svg [ filename ="pil.svg" ]; > draw p; > \stopMPcode > > I get weird results, the arrowhead points in wron

Re: [NTG-context] Issue with rendering arrows in lmtx

2020-03-17 Thread mf
Il 17/03/20 15:51, Jan-Erik Hägglöf ha scritto: Hi All! When I invoke this command \startMPcode picture p ; p := lmt_svg [ filename ="pil.svg" ]; draw p; \stopMPcode I get weird results, the arrowhead points in wrong direction and is very tiny compared to the size it was mea

[NTG-context] Issue with rendering arrows in lmtx

2020-03-17 Thread Jan-Erik Hägglöf
Hi All! When I invoke this command \startMPcode picture p ; p := lmt_svg [ filename ="pil.svg" ]; draw p; \stopMPcode I get weird results, the arrowhead points in wrong direction and is very tiny compared to the size it was meant to have. Here is the .svg code from the saved fil

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

2020-03-03 Thread Fabrice Couvreur
ice > > \starttext > \startMPcode > > def match (expr alpha, pos) = > numeric l; > l = 4.6cm; > picture pic; > pic = image ( > fill unitsquare xscaled 4cm yscaled 0.2cm withcolor yellow ; > fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm

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

2020-02-26 Thread Fabrice Couvreur
Hi Wolfgang, I would like the same result as the code with TikZ. Thank you. Fabrice \usemodule[tikz] \starttext \startMPcode fill fullcircle xscaled 1cm yscaled 0.88cm shaded withshademethod "circular" withshadefactor 0.75 withshadecolors (white,red); \stopMPcode \startt

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Marcus Vinicius Mesquita
etapost log> > metapost log>: > metapost log> <*> ... :=(12cm, -1cm)--(11cm, -1cm); path D ; D : > metapost log> > =(4cm, -1cm)--(3cm, -1cm)... > metapost log> > > And the code is as follows > > \startMPcode > path A ; A :=(0cm

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Hans Hagen
m, -1cm)--(11cm, -1cm); path D ; D : metapost log    >  =(4cm, -1cm)--(3cm, -1cm)... metapost log    > And the code is as follows \startMPcode path A ; A :=(0cm, -1cm)--(1cm, -1cm); path B ; B :=(13.5cm, -1cm)--(14.5cm, -1cm); path C ; C :=(12cm, -1c

Re: [NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Jan-Erik Hägglöf
> >> unknown path D > metapost log> ! Isolated expression. > metapost log> > metapost log>: > metapost log> <*> ... :=(12cm, -1cm)--(11cm, -1cm); path D ; D : > metapost log>

[NTG-context] Error in MetaFun LMTX

2020-02-25 Thread Jan-Erik Hägglöf
=(4cm, -1cm)--(3cm, -1cm)... metapost log> And the code is as follows \startMPcode path A ; A :=(0cm, -1cm)--(1cm, -1cm); path B ; B :=(13.5cm, -1cm)--(14.5cm, -1cm); path C ; C :=(12cm, -1cm)--(11cm, -1cm); path D ; D : =(4cm, -1cm)--(3cm, -1c

Re: [NTG-context] Shading

2020-02-25 Thread Wolfgang Schuster
se your code isn't the same as the example in the manual. \starttext \startMPcode fill fullcircle scaled 4cm shaded withshademethod "circular" ; \stopMPcode \stoptext > \starttext > \startMPcode > fill fullcircle scaled 4cm shaded withshademethod &

[NTG-context] Shading

2020-02-25 Thread Fabrice Couvreur
Hi, In the Metafun documentation on page 410, there is a shaded bullet "fill fullcircle shaded cshade". I tried to reproduce the same effect, but it is not exactly the same result. Thank you. Fabrice \starttext \startMPcode fill fullcircle scaled 4cm shaded withshademethod

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 = "sampl

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

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" ] ; >>> \stop

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

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 [

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

2020-02-18 Thread Hans Hagen
On 2/18/2020 12:18 PM, mf wrote: Hello list, I tried this: \starttext \startMPcode picture p ; p := lmt_svg [ filename = "sample.svg" ] ; draw p ; color black_rgb ; black_rgb := ( 0, 0, 0 ) ; color red_rgb   ; red_rgb   := ( 1, 0, 0 ) ; remapcolor( black_rgb, red_rgb ) ; recolor

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

2020-02-18 Thread mf
Hello list, I tried this: \starttext \startMPcode picture p ; p := lmt_svg [ filename = "sample.svg" ] ; draw p ; color black_rgb ; black_rgb := ( 0, 0, 0 ) ; color red_rgb ; red_rgb := ( 1, 0, 0 ) ; remapcolor( black_rgb, red_rgb ) ; recolor p ; draw p shifted ( bbwidth(p

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

2020-02-15 Thread Hans Hagen
; draw (origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle) rotated alpha withcolor blue; \startMPcode   def match (expr alpha, pos) =     fill unitsquare xscaled 4cm  yscaled 0.2cm rotated alpha shifted pos     withcolor yellow ;     fill

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

2020-02-15 Thread Fabrice Couvreur
Hi Henri, Why does the blue path not rotate 90 with the draw command but rotate with the fill command ? \startMPcode def match (expr alpha, pos) = fill unitsquare xscaled 4cm yscaled 0.2cm rotated alpha shifted pos withcolor yellow ; fill origin -- (4cm,0) -- (4.1cm,-0.05cm

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

2020-02-14 Thread Fabrice Couvreur
Hi, Hi, I have corrected for the dimensions of the ellipse but I cannot achieve the same effect for the red color. Thank you. Fabrice \startMPcode def match (expr pos) = fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow; fill origin -- (4cm,0) -- (4.1cm,-0.05cm

Re: [NTG-context] Label in externalfigures

2020-02-14 Thread Jan-Erik Hägglöf
Now finally after consulting the luametafun and the MetaFun manual I’ve found what I was looking for:The code:\startMPcode picture p; p := lmt_svg [ filename = "steguppgift.svg", width = 400 ] ;draw p;path linje ; linje := (15,-330) -- (280,-90); % adding a missing line in the .svg fil

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

2020-02-14 Thread Fabrice Couvreur
] \starttext \startMPcode def match (expr pos) = fill unitsquare xscaled 4cm yscaled 0.2cm shifted pos withcolor yellow; fill origin -- (4cm,0) -- (4.1cm,-0.05cm) -- (0.1cm,-0.05cm) -- cycle withcolor(.6yellow + black); draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm

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

Re: [NTG-context] Label in externalfigures

2020-02-13 Thread Jan-Erik Hägglöf
I’ve tested this but it appears outside, not as an layer over the picture. \startMPcode draw lmt_svg [ filename = "steguppgift.svg", height = 5cm, width = 10cm, ] ; label(\sometxt{5,0m},(63.936298,129.563995)); label(\sometxt{37°},(95.652702

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 : >> >> \startMPcod

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

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 : &g

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