[NTG-context] new error in Context-Metapost

2016-02-17 Thread Meer, Hans van der
Some code that worked ok but hasn't been used for some time, now gives an error: missing $. It is working fine in ConTeXt, but putting it inside an MPpage goes wrong. Here a minimal example, the output of the ConTeXt run and the error on the MPpage run. Has something changed I missed? Hans van

[NTG-context] Primitive angle (Metapost)

2016-02-08 Thread Fabrice Couvreur
Hello, I want to reproduce this figure. ​ In the example below, it seemed to me that he had to write dir(180-angle(1,0.5)), but not. \starttext \startMPcode path p ; p := (3.5cm,-1.5cm)--(0cm,0.25cm)--1.2cm*dir(180-angle(1,0.5)) ; draw p dashed evenly withcolor 0.625white; draw p

[NTG-context] MetaPost and externalfigure() REQUEST FOR COMMENTS

2016-01-10 Thread Alan BRASLAU
Hello, INTRODUCTION MetaPost, in fact Metafun, has extensions to include external figures as well as typeset text. For example: \startMPcode draw externalfigure("cow") ; \stopMPcode would be the equivalent to the ConTeXt command. \externalfigure [cow] However, for historical reaso

Re: [NTG-context] MetaPost Question

2015-12-07 Thread Context NTG
I guess the code I am looking for is the below to hatch the cut-out section. How can I load the MetaPost hatching package in Context minimals so it understands the hatchfill command? Thanks Jeroen \startMPinclusions input hatching; \stopMPinclusions \starttext \placefigure[here,force

[NTG-context] MetaPost Question

2015-12-06 Thread Context NTG
I am trying to graph a cylinder. Is there a way to draw a more elliptic top/bottom. This one seems some flattened at the top and bottom. I would like to hatch the mid elliptic that is collored grey now. Is there a way to do this. Thanks Jeroen \placefigure [here,force] [fig:tubing] {Tubular

Re: [NTG-context] MetaPost Question

2015-12-06 Thread Alan BRASLAU
Please change your mailing name and address. In order to draw 3D perspective diagrams in MetaPost, you will need to transform 3D paths to a 2D projection. There are many methods to accomplish this, and there are several MP modules that have been written to address this issue. One fairly simple

[NTG-context] ePub and Metapost

2015-10-20 Thread Fabrice Couvreur
Hi, Is it possible to produce a epub file from a file containing a figure made with Metapost ? Thanks, Fabrice Envoyé de mon iPad___ If your question is of interest to others as well, please add an entry

Re: [NTG-context] Calculating a value in metapost, and using it in ConTeXt

2015-05-26 Thread Kate F
On 27 May 2015 at 00:18, Hans Hagen pra...@wxs.nl wrote: On 5/26/2015 9:17 PM, Kate F wrote: Hello, Is it possible to calculate the position of something in Metapost, and to export that value to TeX such that I can use it in setups and things? it depends on what you want to calculate

[NTG-context] Calculating a value in metapost, and using it in ConTeXt

2015-05-26 Thread Kate F
Hello, Is it possible to calculate the position of something in Metapost, and to export that value to TeX such that I can use it in setups and things? I thought perhaps I could \def inside btex..etex. Here's a minimal example trying to illustrate the idea: \startuniqueMPgraphic{canon} path

Re: [NTG-context] Calculating a value in metapost, and using it in ConTeXt

2015-05-26 Thread Hans Hagen
On 5/26/2015 9:17 PM, Kate F wrote: Hello, Is it possible to calculate the position of something in Metapost, and to export that value to TeX such that I can use it in setups and things? it depends on what you want to calculate \startMPcalculation path p, q; h := PaperHeight; w

Re: [NTG-context] [metapost] Stroke Font

2015-05-17 Thread Wolfgang Schuster
Am 17.05.2015 um 22:54 schrieb Troy Henderson thend...@gmail.com: I updated pstoedit, and it functions as expected. This is not a MetaPost question but rather a ConTeXt question: How do I use Arev Bold (Sans) in ConTeXt? Use the DejaVu fonts which are like Arev Sans a extended version

[NTG-context] MetaPost, specifiy max width of a text?

2015-03-18 Thread Norbert Melzer
Hi there! Is there a way to specify the with of a text so that the text gets wrapped? Something simalar to the following TikZ-Example (wrapped in ConTeXt): ```tex \usemodule[tikz] \starttext \starttikzpicture \draw (0, 0) node[text width=2.5cm,align=center] {Start new Game};

Re: [NTG-context] MetaPost, specifiy max width of a text?

2015-03-18 Thread Hans Hagen
On 3/18/2015 8:25 AM, Norbert Melzer wrote: Hi there! Is there a way to specify the with of a text so that the text gets wrapped? Something simalar to the following TikZ-Example (wrapped in ConTeXt): ```tex \usemodule[tikz] \starttext \starttikzpicture \draw (0, 0) node[text

Re: [NTG-context] MetaPost, specifiy max width of a text?

2015-03-18 Thread Alan BRASLAU
On Wed, 18 Mar 2015 08:25:50 +0100 Norbert Melzer timmel...@gmail.com wrote: \starttext   \startMPcode     draw Start new Game infont defaultfont scaled defaultscale;   \stopMPcode \stoptext draw textext(\framed[frame=off,width=2.5cm,align=middle]{Start new Game}); Alan

Re: [NTG-context] Update text variables inside metapost

2015-03-08 Thread Hans Hagen
On 3/8/2015 12:57 AM, Aditya Mahajan wrote: On Sat, 7 Mar 2015, DesdeChaves wrote: Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1

[NTG-context] Update text variables inside metapost

2015-03-07 Thread DesdeChaves
Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1}{text2}{text3}, 2. and four \Bolha[size=4cm]{text1}{text2}{text3}, but text1, text2

Re: [NTG-context] Update text variables inside metapost

2015-03-07 Thread DesdeChaves
Aditaya, thanks for the clarification. Now it works perfectly. Jorge 2015-03-07 23:57 GMT+00:00 Aditya Mahajan adit...@umich.edu: On Sat, 7 Mar 2015, DesdeChaves wrote: Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code

Re: [NTG-context] Update text variables inside metapost

2015-03-07 Thread Aditya Mahajan
On Sat, 7 Mar 2015, DesdeChaves wrote: Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1}{text2}{text3}, 2. and four \Bolha[size=4cm

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-17 Thread Fabrice
Hi John, That's what I thought, some macros work indifferently in Metafun or Metapost, others not. Thank you for the interest in my question. Fabrice ___ If your question is of interest to others as well, please add

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-17 Thread John Kitzmiller
On Feb 16, 2015, at 3:21 PM, Fabrice Couvreur wrote: This does not work with : labeloffset := 2mm; On Feb 09, 2015, Hans Hagen wrote: \startMPpage[offset=2pt] path p, q, r ; pair z ; p := unitsquare scaled 4cm ; z := point 3.6 of p ; q := z--urcorner p ; r := q

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-16 Thread Fabrice
Hi, This does not work with : labeloffset := 2mm; Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl /

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-15 Thread John Kitzmiller
On Feb 15, 2015, at 6:00 AM, Fabrice couvreur.fabr...@wanadoo.fr mailto:couvreur.fabr...@wanadoo.fr wrote: Thank you for this new example. Try the mpost variable lableoffset := ? to adjust. This does not seem to workwith lableoffset := 2mm. Fabrice I spelled it wrong, sorry! It is

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-11 Thread John Kitzmiller
; draw p ; \stopMPpage (I have not yet found why the striped path q goes out of position. Looking at mp-tool may help.) I just noticed that the position of labels is not quite the same when using macros and macro Metafun Metapost: I think the labels are too near to the corners

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-10 Thread Fabrice
Hi John, Thank you for that other solution with Metapost. I am in front of learning Metapost and Metafun, I'm still far from mastering! Fabrice ___ If your question is of interest to others as well, please add

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-10 Thread Fabrice
Metafun Metapost: I think the labels are too near to the corners of the square with the macro Metafun. thank you, Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread Hans Hagen
On 2/9/2015 7:22 PM, Fabrice wrote: Hi Hans, Great, but I did not know the macro numberstriped. Is it a Metapostor Metafun macro? yes - Hans Hagen | PRAGMA ADE Ridderstraat

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread Hans Hagen
On 2/9/2015 3:30 PM, Fabrice Couvreur wrote: Hi, How hatched trapezoid MBCD? Best regards, Fabrice \starttext \startMPcode path p ; p=unitsquare scaled 4cm ; draw p ; pair z ; z=point 3.6 of p ; draw z--urcorner p ; label.llft(btex B etex,llcorner p) ; label.lrt(btex C etex,lrcorner p) ;

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread Fabrice
Hi Hans, Great, but I did not know the macro numberstriped. Is it a Metapostor Metafun macro? Fabrice ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist :

[NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread Fabrice Couvreur
Hi, How hatched trapezoid MBCD ? Best regards, Fabrice \starttext \startMPcode path p ; p=unitsquare scaled 4cm ; draw p ; pair z ; z=point 3.6 of p ; draw z--urcorner p ; label.llft(btex B etex,llcorner p) ; label.lrt(btex C etex,lrcorner p) ; label.ulft(btex A etex,ulcorner p) ; label.urt(btex

Re: [NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread John Kitzmiller
On Feb 9, 2015, at 1:46 PM, Fabrice couvreur.fabr...@wanadoo.fr mailto:couvreur.fabr...@wanadoo.fr wrote: Great, but I did not know the macro numberstriped. Is it a Metapost or Metafun macro? It is a MetaFun macro in mp-tool, afaik. The idea of filling a path is sometimes clipping

[NTG-context] Code that run in Metapost but not in starMPcode enviroment

2015-02-01 Thread Akira Kakuto
What is wrong with this code? Interestingly it seems to work in mkii, probably because mkii calls external metafun: context --pdftex --passon=--shell-escape test.tex test.pdf is attached. Best, Akira test.pdf Description: Adobe PDF document

Re: [NTG-context] Code that run in Metapost but not in starMPcode enviroment

2015-02-01 Thread Hans Hagen
On 2/1/2015 12:29 PM, DesdeChaves wrote: I'm trying to draw some random arrows using Metapost. For that I use a piece of code from fpast that in found at stackexchange http://tex.stackexchange.com/questions/179745/generating-random-arrows-in-tikz/180111#180111 Unfortunately this code does

Re: [NTG-context] Code that run in Metapost but not in starMPcode enviroment

2015-02-01 Thread Akira Kakuto
Interestingly it seems to work in mkii, probably because mkii calls external metafun: Sorry, I didn't notice explanation by Hans. Best, Akira ___ If your question is of interest to others as well, please add an

[NTG-context] Code that run in Metapost but not in starMPcode enviroment

2015-02-01 Thread DesdeChaves
I'm trying to draw some random arrows using Metapost. For that I use a piece of code from fpast that in found at stackexchange http://tex.stackexchange.com/questions/179745/generating-random-arrows-in-tikz/180111#180111 Unfortunately this code does not work in context (request for a solution http

Re: [NTG-context] Code that run in Metapost but not in starMPcode enviroment

2015-02-01 Thread Hans Hagen
On 2/1/2015 3:31 PM, Akira Kakuto wrote: Interestingly it seems to work in mkii, probably because mkii calls external metafun: Sorry, I didn't notice explanation by Hans. The problem with variables in metapost is that they are global by default (unless 'save'd in a group or vardef

Re: [NTG-context] Positioning an arrow between two values (Metapost)

2015-01-21 Thread Fabrice
Hi Troy, Thank you, this macro is very nice ; it matches what I want to do even if I would like a smaller space between the arrow and labels. Best regards, Fabrice ___ If your question is of interest to others as

Re: [NTG-context] Positioning an arrow between two values (Metapost)

2015-01-20 Thread Troy Henderson
\starttext \startMPcode u:=1cm ; path p, q ; p=fullsquare scaled u ; q=fullsquare scaled u shifted (4u,-2u) ; draw p ; draw q ; drawarrow center p--center q ; label(btex $5$ etex,center p) ; label(btex $-2 $ etex,center q) ; \stopMPcode \stoptext How about something like below.

[NTG-context] Positioning an arrow between two values (Metapost)

2015-01-17 Thread Fabrice Couvreur
Hi, I went from PSTricks to Metapost (Metafun) gradually. For positioning arrows between two values in an array of variations, I used a command like this \ ncline {A}{B}, which avoids fumbling. Can we do the same with Metapost ? The idea would be to convert the value into a path or an image, much

Re: [NTG-context] Pass a lua table to metapost

2014-12-09 Thread Hans Hagen
On 12/8/2014 4:48 PM, Mojca Miklavec wrote: On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread Hans Hagen
On 12/7/2014 8:25 PM, DesdeChaves wrote: I would like to pass the lua table keys and values to metapost. In the keys i have information about the paths names and in the values i have information about the label that should be draw in the center of each path (unitsquare). In my code (see attach

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread DesdeChaves
GMT+00:00 Hans Hagen pra...@wxs.nl: On 12/7/2014 8:25 PM, DesdeChaves wrote: I would like to pass the lua table keys and values to metapost. In the keys i have information about the paths names and in the values i have information about the label that should be draw in the center of each

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread Hans Hagen
On 12/8/2014 12:27 PM, DesdeChaves wrote: Thanks, but I'm not able to run this code in my system.. I'm working in ConTeXt ver: 2014.12.06 14:20 MKIV beta fmt: 2014.12.8 int: english/english and the error message is: runscript ! Isolated expression. so your luatex is too old

Re: [NTG-context] MP/Lua binding (was: Pass a lua table to metapost)

2014-12-08 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello Hans, it's possible to ask values from within mp: \starttext \startluacode document.variables = { labels = { one, two, three, } } \stopluacode \startMPpage numeric dx, dy; dx = 4.4cm; dy = 0.53cm; path b[]; for i=1 upto

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread DesdeChaves
I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong:

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread Hans Hagen
On 12/8/2014 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong:

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread Mojca Miklavec
On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread DesdeChaves
Sorry for the noise. My LuaTeX version is 0.79.1. I'm using MacOSX This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 2014-12-08 15:48 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com: On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals.

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread DesdeChaves
MacOSX intel 2014-12-08 16:03 GMT+00:00 DesdeChaves desdecha...@gmail.com: Sorry for the noise. My LuaTeX version is 0.79.1. I'm using MacOSX This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 2014-12-08 15:48 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com : On

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread DesdeChaves
After the update to new ConTeXT minimals -- luatex beta-0.79.2 (rev 5084) -- the code runs perfectly. Thanks to all. Jorge 2014-12-08 16:05 GMT+00:00 DesdeChaves desdecha...@gmail.com: MacOSX intel 2014-12-08 16:03 GMT+00:00 DesdeChaves desdecha...@gmail.com: Sorry for the noise. My

Re: [NTG-context] Pass a lua table to metapost

2014-12-08 Thread Herbert Voss
Am 08.12.2014 um 19:24 schrieb DesdeChaves: After the update to new ConTeXT minimals -- luatex beta-0.79.2 (rev 5084) -- the code runs perfectly. hm, after updating (Linux) I have still 79.1: voss@shania:~/Links/opt/context/tex/texmf-linux-64/bin ./luatex -v This is LuaTeX, Version

[NTG-context] Pass a lua table to metapost

2014-12-07 Thread DesdeChaves
I would like to pass the lua table keys and values to metapost. In the keys i have information about the paths names and in the values i have information about the label that should be draw in the center of each path (unitsquare). In my code (see attach) the table in question

[NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Fabrice Couvreur
Hi, With the book Metafun I created a marker with metapost. How to add a counter ? Best regards, Fabrice \startuseMPgraphic{itemize:fuzzy} numeric u; u:=0.5cm; save p; path p; p := fullcircle xyscaled (u,u) randomized 2pt; pickup pencircle scaled 1pt; fill p withcolor green; draw p withcolor blue

Re: [NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Alan BRASLAU
On Mon, 10 Nov 2014 19:18:20 +0100 Fabrice Couvreur fabrice1.couvr...@gmail.com wrote: Hi, With the book Metafun I created a marker with metapost. How to add a counter ? Best regards, Fabrice The puzzler is for you to understand why I only increment by 1/2 ;-) Perhaps someone else can

Re: [NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Wolfgang Schuster
Am 10.11.2014 um 19:18 schrieb Fabrice Couvreur fabrice1.couvr...@gmail.com: Hi, With the book Metafun I created a marker with metapost. How to add a counter ? Best regards, Fabrice \startuseMPgraphic{itemize:fuzzy} numeric u; u:=0.5cm; save p; path p; p := fullcircle xyscaled (u,u

Re: [NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Alan BRASLAU
On Mon, 10 Nov 2014 19:53:30 +0100 Wolfgang Schuster schuster.wolfg...@gmail.com wrote: You can use the visualcounter module, the documentation is included in the package or you download it from the github [1] page. [1] https://github.com/adityam/visualcounter Indeed as also used in the

Re: [NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Aditya Mahajan
On Mon, 10 Nov 2014, Wolfgang Schuster wrote: Am 10.11.2014 um 19:18 schrieb Fabrice Couvreur fabrice1.couvr...@gmail.com: Hi, With the book Metafun I created a marker with metapost. How to add a counter ? Best regards, Fabrice \startuseMPgraphic{itemize:fuzzy} numeric u; u:=0.5cm; save p

Re: [NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Fabrice
Hi, Thank you for all your suggestions, especially for the beautiful work of adityam. In fact, you do a fantastic job all. Fabrice ___ If your question is of interest to others as well, please add an entry to the

[NTG-context] Metapost/Metafun: textext

2014-10-15 Thread Willi Egger
, a solution could be found. Hans, thank you so much! I have created a section on the wiki, where the problem is shown and the solution is given. In order to illustrate the whole thing I placed also a full example. http://wiki.contextgarden.net/MetaPost

Re: [NTG-context] Strange behavior with Metapost

2014-05-28 Thread Fabrice
Hello, Firstly, thank you for your reply. However, I would like some further explanation please. If I understand, but I'm not sure at all, calculating (xmax-xmin) / 10 gives the number of points to draw the curve. However, in my example, xmax = 4 and xmin = -2, so (xmax-xmin) / 10 = 0.6. My

[NTG-context] Strange behavior with Metapost

2014-05-27 Thread Fabrice Couvreur
Hello, Why curve drawn is not that expected ? Fabrice \starttext \startMPcode input hvdm; l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0; defineDefaultArrow (l, r, alfa, beta, gamma); numeric xmin, xmax, ymin, ymax; xmin :=-2; xmax := 4; ymax :=5 ;ymin:=-1; u := 1cm;

Re: [NTG-context] Strange behavior with Metapost

2014-05-27 Thread Hans Hagen
On 5/27/2014 10:19 PM, Fabrice Couvreur wrote: Hello, Why curve drawn is not that expected ? Fabrice use /20 \starttext \startMPcode input hvdm; l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0; defineDefaultArrow (l, r, alfa, beta, gamma); numeric xmin, xmax, ymin,

Re: [NTG-context] Strange behavior with Metapost

2014-05-27 Thread Fabrice
It works. But how to choose not to avoid this problem (/10 or /20 or ) ? Another little problem: if I use setbounds currentpicture to boundingbox (((xmin,ymin) --(xmax,ymax)) scaled u) ; the images are not adjusted to the BoundingBox. So I'm back to my original idea. Fabrice

Re: [NTG-context] Strange behavior with Metapost

2014-05-27 Thread Hans Hagen
On 5/28/2014 12:09 AM, Fabrice wrote: It works. But how to choose not to avoid this problem (/10 or /20 or ) ? well, you can guess the amount of steps ... but the 1000 you had originally was way too much -

Re: [NTG-context] Edit the arrows default Metapost

2014-05-23 Thread Fabrice
Hi, Thank you Hans. I saw on the net a macro created by Hans van der Meer (hvdm.mp). Do you have an example of its use? Fabrice ___ If your question is of interest to others as well, please add an entry to the

[NTG-context] Edit the arrows default Metapost

2014-05-22 Thread Fabrice Couvreur
Hello, Is it possible to change the appearance Metafun arrows default to make them resemble those of PSTricks that I find most beautiful. Regards, Fabrice ___ If your question is of interest to others as well, please

Re: [NTG-context] Edit the arrows default Metapost

2014-05-22 Thread Hans Hagen
On 5/23/2014 12:42 AM, Fabrice Couvreur wrote: Hello, Is it possible to change the appearance Metafun arrows default to make them resemble those of PSTricks that I find most beautiful. you can mess with some of the parametersm like ahlength and ahangle or just define your own heads Hans

[NTG-context] Metapost and Metafun

2014-05-21 Thread Fabrice Couvreur
Hi, As PSTricks (which I prefer) is not yet well integrated, I decided to learn Metapost starting with a simple code. \starttext \startMPcode numeric xmin, xmax, ymin, ymax; xmin := -2.5; xmax := 2.5; ymax :=2.5 ;ymin:=-2.5; u := 2cm; vardef f(expr x) = -x*x+1 enddef; xinc := 0.001; path pts_f

Re: [NTG-context] Metapost and Metafun

2014-05-21 Thread Hans Hagen
On 5/21/2014 7:55 PM, Fabrice Couvreur wrote: Hi, As PSTricks (which I prefer) is not yet well integrated, I decided to learn Metapost starting with a simple code. \starttext \startMPcode numeric xmin, xmax, ymin, ymax; xmin := -2.5; xmax := 2.5; ymax :=2.5 ;ymin:=-2.5; u := 2cm; vardef f(expr

Re: [NTG-context] Metapost and Metafun

2014-05-21 Thread Fabrice
Hi Hans, Thank you for the code that is cleaner and certainly less long! Fabrice PS : What do you mean by: define 'improve' .. anyway: A step of 0.001 is not needed here and gives a*pretty large path*. ___ If

Re: [NTG-context] [Metapost] Using mkIV and metapost to produce SVG

2014-05-06 Thread Hans Hagen
On 5/5/2014 1:54 PM, ralf.waldvo...@pta.de wrote: Dear all, I would like to produce an svg file from a Metapost input file using some of ConTeXt's typesetting features (esp. using System OTF Fonts) using something like: \startbuffer[buffer:dummy] \start \startcolor[white

[NTG-context] [Metapost] Using mkIV and metapost to produce SVG

2014-05-06 Thread ralf . waldvogel
Dear all, as I have seen on the mailing list digest, my original (HTML) mail has been scrambled. Sorry for that. Here the repost: I would like to produce an svg file from a Metapost input file using some of ConTeXt's typesetting features (esp. using System OTF Fonts) using something like

[NTG-context] [Metapost] Using mkIV and metapost to produce SVG

2014-05-05 Thread ralf . waldvogel
Dear all,I would like to produce an svg file from a Metapost input file using some of ConTeXt's typesetting features (esp. using System OTF Fonts) using something like:\startbuffer[buffer:dummy] \start\startcolor[white]\framed[align=middle,width=28mm,frame=off]{ \SansBodyBold

[NTG-context] Metapost: I only need a little bit padding

2014-04-05 Thread Jan Heinen
I want to have a rectangle (box) with a word in it (i.g. Headline). And all should be rotated 90°. Below I found a solution I am quite happy with. How can I get a little bit more padding around the text in the box? You can copy the example to http://live.contextgarden.net/ - it is running:

Re: [NTG-context] Metapost: I only need a little bit padding

2014-04-05 Thread Peter Rolf
Hi Jan, Am 05.04.2014 15:48, schrieb Jan Heinen: \startuseMPgraphic{rotatedHeadline} % Text Headline in a box which is rotated draw btex {\strut\tfd Headline} etex; setbounds currentpicture to boundingbox currentpicture enlarged 2mm; The following code is based on the boundingbox, so just

[NTG-context] label in Metapost

2014-04-03 Thread Jan Heinen
Ten years ago I made a book with ConText and some Metapost. I made a circle and wrote the number into it: \startuseMPgraphic{Pagenumber} defaultfont := pxb; defaultscale := 1.5; fill fullcircle scaled 36pt withcolor .75white; numeric i; string pagex; i := PageNumber; pagenum = decimal i; label

[NTG-context] Strange output from linear_shade (METAPOST)

2014-02-14 Thread DesdeChaves
I need to create some graphics to teach energy. One of the illustrations is about the sound energy that I represent using linear_shade function. In the following example the first illustration is represented correctly, but the second call of the function SoundEnergy implies the loss of gradient.

[NTG-context] [metapost] troubles with labels

2013-12-29 Thread Pol Stra
Dear all, with this minimalist content of metapost file: ``` beginfig(1); dotlabel.ulft(A, origin); endfig; end. ``` And this conteXt file: ``` \starttext \startMPrun input mymp.mp; \stopMPrun \externalfigure[mprun.21][width=5cm] \stoptext ``` The resulting pdf file contains no figure

Re: [NTG-context] [metapost] troubles with labels

2013-12-29 Thread Hans Hagen
On 12/29/2013 12:07 PM, Pol Stra wrote: Dear all, with this minimalist content of metapost file: ``` beginfig(1); dotlabel.ulft(A, origin); endfig; end. ``` And this conteXt file: ``` \starttext \startMPrun input mymp.mp; \stopMPrun \externalfigure[mprun.21][width=5cm] \stoptext

Re: [NTG-context] Request for metapost

2013-12-25 Thread Peter Rolf
Also thanks from my side. Just what I needed for further tests (graphics with multiple paths). Peter Am 22.12.2013 19:10, schrieb Hans Hagen: \starttext % \enabletrackers[metapost.variables] \startMPcode numeric n[] ; for i=1 upto 10: n[i] := 1/i ; endfor ; pathp[] ;

Re: [NTG-context] Statistical module for Metapost

2013-12-24 Thread Hans Hagen
On 12/23/2013 7:55 PM, DesdeChaves wrote: I'm trying play with the statistical package** for metapost from Anthony Phan. I found this strange problem: This code runs fine: \startMPcode label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode Also, this code run fine

Re: [NTG-context] Statistical module for Metapost

2013-12-24 Thread DesdeChaves
Thanks a lot. Merry Christmas Jorge 2013/12/24 Hans Hagen pra...@wxs.nl On 12/23/2013 7:55 PM, DesdeChaves wrote: I'm trying play with the statistical package** for metapost from Anthony Phan. I found this strange problem: This code runs fine: \startMPcode label.bot(btex Metapost

Re: [NTG-context] Request for metapost

2013-12-23 Thread DesdeChaves
Thanks very much for your support. Jorge 2013/12/22 Hans Hagen pra...@wxs.nl On 12/22/2013 3:57 PM, Hans Hagen wrote: On 12/21/2013 12:50 PM, DesdeChaves wrote: I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet

Re: [NTG-context] Request for metapost

2013-12-23 Thread Hans Hagen
On 12/23/2013 4:52 PM, DesdeChaves wrote: Three ways to generate poisson data. Thanks for Hans Hagen, Alan Braslou and Anthony Phan. as you use swig you can also put your library in root/tex/texmf-linux-64/bin/lib/luatex/lua/swiglib/randist/core.so and then (given that you've run mtxrun

[NTG-context] Statistical module for Metapost

2013-12-23 Thread DesdeChaves
I'm trying play with the statistical package** for metapost from Anthony Phan. I found this strange problem: This code runs fine: \startMPcode label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode Also, this code run fine: \startMPcode input mps-core.mp; draw fullcircle scaled

Re: [NTG-context] Request for metapost

2013-12-22 Thread Hans Hagen
On 12/21/2013 12:50 PM, DesdeChaves wrote: I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet variable can't pass. It will be very usefull if metapost can send a array to context. \startMPcode numeric x[]; for i = 1 upto 10

Re: [NTG-context] Request for metapost

2013-12-22 Thread Hans Hagen
On 12/22/2013 3:57 PM, Hans Hagen wrote: On 12/21/2013 12:50 PM, DesdeChaves wrote: I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet variable can't pass. It will be very usefull if metapost can send a array to context

[NTG-context] Request for metapost

2013-12-21 Thread DesdeChaves
I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet variable can't pass. It will be very usefull if metapost can send a array to context. \startMPcode numeric x[]; for i = 1 upto 10: x[i]:=random; endfor passvariable(array,x

[NTG-context] functions and paths in metapost

2013-10-14 Thread Jean Magnan de Bornier
Hello all, Is it possible to define a path in metapost-metafun using function? In the metafun manual (chapter on Functions) the examples shown are all of the type draw function I wonder if it is possible to define a path with a function (picture after draw doesn't allow that afaik)? tia

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-14 Thread Magnus J
Thanks for the code, the stretching is ok (can be hand-tuned) but I find the positioning a bit odd. Look at the additions to your example: -- \starttext \useMPlibrary[txt] \startsetups text-a \startuseMPgraphic{followtokens} path RotPath ; RotPath := reverse

Re: [NTG-context] functions and paths in metapost

2013-10-14 Thread Hans Hagen
On 10/14/2013 2:38 PM, Jean Magnan de Bornier wrote: Hello all, Is it possible to define a path in metapost-metafun using function? In the metafun manual (chapter on Functions) the examples shown are all of the type draw function I wonder if it is possible to define a path with a function

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-14 Thread Marco Patzer
On 2013–10–14 Marco Patzer wrote: On 2013–10–13 Hans Hagen wrote: inbetween the arcs, that should alsó be drawn). The text should not be stretched but center on the top, flowing evenly distributed on each side. This link will give you an idea:

[NTG-context] Calling \followtokens from with in metapost

2013-10-13 Thread Magnus J
Hello list, How can I call the \followtokens macro (or a similar solution) from within metapost? Specifically, I want to integrate text between the semi-circle arcs in a rainbow-like structure (with the text placed inbetween the arcs, that should alsó be drawn). The text should not be stretched

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-13 Thread Hans Hagen
On 10/13/2013 9:59 AM, Magnus J wrote: Hello list, How can I call the \followtokens macro (or a similar solution) from within metapost? Specifically, I want to integrate text between the semi-circle arcs in a rainbow-like structure (with the text placed inbetween the arcs, that should alsó

Re: [NTG-context] Calling \followtokens from with in metapost

2013-10-13 Thread Marco Patzer
On 2013–10–13 Hans Hagen wrote: inbetween the arcs, that should alsó be drawn). The text should not be stretched but center on the top, flowing evenly distributed on each side. This link will give you an idea:

Re: [NTG-context] MetaPost label direction prefix

2013-08-25 Thread Hans Hagen
; The minimal example works with your version, but the old MetaPost code does not. The def variant works fine with both. ok 2) Replace startplaincompatibity → startplaincompatibility stopplaincompatibity → stopplaincompatibility ok, best check the next beta well (i might have missed

Re: [NTG-context] MetaPost label direction prefix

2013-08-24 Thread Marco Patzer
, but the old MetaPost code does not. The def variant works fine with both. 2) Replace startplaincompatibity → startplaincompatibility stopplaincompatibity → stopplaincompatibility 3) This one is truly optional and just a suggestion for a better interface. Although it's nice to have the grouping

[NTG-context] MetaPost label direction prefix

2013-08-23 Thread Marco Patzer
on traditional MetaPost. Is this prefix required? It breaks old code and required a branch in every new project. And I don't really see a reason for this incompatibility. Here is an example defining a new direction “foo”: \starttext \startMPcode label(first, origin); %% MkIV %% pair

Re: [NTG-context] MetaPost label direction prefix

2013-08-23 Thread Hans Hagen
. And likewise, code using the mpfun_ prefix fails on traditional MetaPost. So is anyone using mkiv still using MkII? Is this prefix required? It breaks old code and required a branch in every new project. And I don't really see a reason for this incompatibility. Here is an example defining a new direction

Re: [NTG-context] MetaPost label direction prefix

2013-08-23 Thread Marco Patzer
; label.foo(second, origin); \stopMPcode \stoptext I wasn't aware of users defining extra ones. I'll add this: Probably not many users will tinker with custom label directions, but MetaPost package authors do. Some packages like piechartmp¹ internally use laboff.foo and the mpfun_ prefix

Re: [NTG-context] MetaPost label direction prefix

2013-08-23 Thread Hans Hagen
) ; labxf.foo := labyf.foo := 1 ; label.foo(second, origin); \stopMPcode \stoptext I wasn't aware of users defining extra ones. I'll add this: Probably not many users will tinker with custom label directions, but MetaPost package authors do. Some packages like piechartmp¹ internally use laboff.foo

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