[NTG-context] MetaPost circular_shade Command

2012-05-02 Thread Troy Henderson
The command circular_shade(fullcircle scaled 4in,0,white,red); in MetaPost does not act as I think it should. It performs a gradient fill starting at the center of the circle by filling this center in white (which is expected), and changing the color as the radius/diameter changes (which

[NTG-context] Font for MetaPost graphics

2012-05-02 Thread Marco
The wiki claims setting up an MPenvironment is enough to change the font in MetaPost graphics: \startMPenvironment%[global] \switchtobodyfont [sans] \stopMPenvironment \starttext This should be serif. \startMPcode draw textext(This should be in sans

Re: [NTG-context] Font for MetaPost graphics

2012-05-02 Thread Aditya Mahajan
On Thu, 3 May 2012, Marco wrote: The wiki claims setting up an MPenvironment is enough to change the font in MetaPost graphics: \startMPenvironment%[global] \switchtobodyfont [sans] \stopMPenvironment \starttext This should be serif. \startMPcode draw

Re: [NTG-context] MetaPost circular_shade Command

2012-05-02 Thread Troy Henderson
It seems that I should do something like fill fullcircle scaled 4in withshade define_circular_shade(origin,origin,0 ,2in,white,red); Sorry for the premature question. Troy ___ If your question is of interest to

Re: [NTG-context] Font for MetaPost graphics

2012-05-02 Thread Marco
On 2012-05-02 Aditya Mahajan adit...@umich.edu wrote: Metapost now runs as a library. All the text is first typeset by ConTeXt and metapost only knows the bounding box of the labels. You can try (untested): \starttext This is serif \switchtobodyfont[sans] \startMPcode draw

Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-05-01 Thread Peter Rolf
Hi Mari, Am 30.04.2012 23:40, schrieb Mari Voipio: On Mon, Apr 23, 2012 at 20:34, Mari Voipio mari.voi...@iki.fi wrote: a) I need to be able to stack four of these on top of each other and then four mirrored ones next to them OK, I really was being stupid - I had already managed to do a

Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-04-30 Thread Mari Voipio
On Mon, Apr 23, 2012 at 20:34, Mari Voipio mari.voi...@iki.fi wrote: a) I need to be able to stack four of these on top of each other and then four mirrored ones next to them OK, I really was being stupid - I had already managed to do a shift inside a single 'block', somehow I just didn't see

[NTG-context] Commands with arguments with MetaPost

2012-04-25 Thread Troy Henderson
I would like to be able to do something like this \def\foo#1{ \startMPcode fill (0,0)--(598,0)--(598,50)--(0,50)--cycle withcolor green; label.rt(btex #1 etex),(50,25); \stopMPcode } and then use this in my ConTeXt document by \foo{Some text} However, my syntax seems to

Re: [NTG-context] Commands with arguments with MetaPost

2012-04-25 Thread Alan BRASLAU
On Wed, 25 Apr 2012 11:15:10 -0500 Troy Henderson thend...@gmail.com wrote: I would like to be able to do something like this \def\foo#1{ \startMPcode fill (0,0)--(598,0)--(598,50)--(0,50)--cycle withcolor green; label.rt(btex #1 etex),(50,25); \stopMPcode } and

Re: [NTG-context] Commands with arguments with MetaPost

2012-04-25 Thread Rogers, Michael K
On Apr 25, 2012, at 12:15 PM, Troy Henderson wrote: I would like to be able to do something like this \def\foo#1{ \startMPcode fill (0,0)--(598,0)--(598,50)--(0,50)--cycle withcolor green; label.rt(btex #1 etex),(50,25); \stopMPcode } Looks like a misplaced

[NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-04-23 Thread Mari Voipio
manually either by pen or computer, and I just do not fancy doing 40+ patterns by hand in Inkscape, especially as my pattern recipe book keeps expanding and I'm planning on that, too. I think Metapost could be the solution, because I need simple shapes and sometimes complicated but well-regulated paths

Re: [NTG-context] Metapost/Metafun Q: using variables and building blocks?

2012-04-23 Thread Hans Hagen
in the field before me - but they did it all manually either by pen or computer, and I just do not fancy doing 40+ patterns by hand in Inkscape, especially as my pattern recipe book keeps expanding and I'm planning on that, too. I think Metapost could be the solution, because I need simple shapes

[NTG-context] metapost fonts

2012-03-17 Thread Matej Barič
Hello, In a document I'm writing I'm using urw-garamond font successfully. However I also use metaUML library for metapost where I'd like to have helvetica (or nimbus, heros, etc.). For latin modern sans, I can use this: string metauml_defaultFont; metauml_defaultFont:=ec-lmss10

Re: [NTG-context] metapost fonts

2012-03-17 Thread Mojca Miklavec
On Fri, Mar 16, 2012 at 10:17, Matej Barič wrote: Hello, In a document I'm writing I'm using urw-garamond font successfully. However I also use metaUML library for metapost where I'd like to have helvetica (or nimbus, heros, etc.). For latin modern sans, I can use this: string

[NTG-context] MetaFun: MetaPost example works with `mpost` but not embedded in ConTeXt: `! Redundant equation.`

2011-12-11 Thread Paul Menzel
Dear ConTeXt folks, looking for graphics example and therefore searching the list I found the answer from David Arnold in the ntg-context list thread »OT: looking for metapost/fun examples« [1]. It is for plain MetaPost and works fine with `mpost` after making sure to remove the line breaks

Re: [NTG-context] MetaFun: MetaPost example works with `mpost` but not embedded in ConTeXt: `! Redundant equation.`

2011-12-11 Thread Marco
On 2011-12-11 Paul Menzel paulepan...@users.sourceforge.net wrote: […] I then copied it into `\{start,stop}useMPgraphic`, removed the `end ;` and `{begin,end}fig` and replaced `{e,b}tex` by `textext()` but still get the following error. I didn't check you code (try to make a

Re: [NTG-context] `\{start, stop}MPpage`: MetaPost figure does not fit canvas(?) in resulting PDF file

2011-12-09 Thread Hans Hagen
On 7-12-2011 20:36, Paul Menzel wrote: Dear ConTeXt folks, using the following example \starttext \startMPpage draw (0,0)--(10,10)--(15,5)--(20,10); draw (0,0)--(0,10)--(10,10)--(10,5)--(15,5)--(15,10)--(20,10) withcolor blue; \stopMPpage

[NTG-context] `\{start, stop}MPpage`: MetaPost figure does not fit canvas(?) in resulting PDF file

2011-12-07 Thread Paul Menzel
Dear ConTeXt folks, using the following example \starttext \startMPpage draw (0,0)--(10,10)--(15,5)--(20,10); draw (0,0)--(0,10)--(10,10)--(10,5)--(15,5)--(15,10)--(20,10) withcolor blue; \stopMPpage \stoptext it looks like the bottom is not

Re: [NTG-context] Escaping a special character in a MetaPost figure within a ConTeXt document fails

2011-12-01 Thread Raymond LeClair
Thanks for the reply! Found I needed to use \letterbackslash\letterhash for this to work. Does that make sense? On Nov 30, 2011, at 10:37 AM, Aditya Mahajan wrote: Try: using \letterhash instead of \# or \startasciimode \def \FrontMatterTitle {

[NTG-context] metapost question

2011-12-01 Thread Hans van der Meer
In MetaPost: After putting something in a picture, one can draw its boundaries with draw boundingbox thepicture. Is it possible to obtain at that point the dimensions of this boudingbox in order to do some calculations with them? Hans van der Meer

Re: [NTG-context] metapost question

2011-12-01 Thread Peter Rolf
Am 01.12.2011 23:25, schrieb Hans van der Meer: In MetaPost: After putting something in a picture, one can draw its boundaries with draw boundingbox thepicture. Is it possible to obtain at that point the dimensions of this boudingbox in order to do some calculations with them? urcorner

[NTG-context] Escaping a special character in a MetaPost figure within a ConTeXt document fails

2011-11-30 Thread Raymond LeClair
I have escaped the '#' character in the usual way, using a backslash, as '\#' in a btex...etex picture as part of a MetaPost figure created within a ConTeXt document, but the escaped character still causes the ConTeXt processing to fail. Here is an example... \pdfminorversion=5

Re: [NTG-context] Escaping a special character in a MetaPost figure within a ConTeXt document fails

2011-11-30 Thread Aditya Mahajan
Try: using \letterhash instead of \# or \startasciimode \def \FrontMatterTitle { \startreusableMPgraphic{frontmattertitle:\overlaywidth:\overlayheight} matter_paper_width := 4.25in; matter_paper_height := 6.875in; front_left_margin := 0.3889in; top_margin :=

[NTG-context] Math in metapost

2011-11-30 Thread Hans van der Meer
I would like to put some math in metapost pictures. For the moment I am using textext for the typesetting in my metapost macro: pic := textext(\setbox0=\hbox{\color[textcolor]labeltext}\dp0=0pt\box0); picture pic will be placed in the metapost figure. Simple math like $p=2$ works fine

Re: [NTG-context] Math in metapost

2011-11-30 Thread Otared Kavian
. I put my test file in which some maths is used in a MetaPost graphic here: http://dl.dropbox.com/u/4316076/test-graphique.tex http://dl.dropbox.com/u/4316076/test-graphique.pdf Best regards: OK On 30 nov. 2011, at 20:59, Hans van der Meer wrote: I would like to put some math

Re: [NTG-context] Math in metapost

2011-11-30 Thread Hans Hagen
On 30-11-2011 20:59, Hans van der Meer wrote: I would like to put some math in metapost pictures. For the moment I am using textext for the typesetting in my metapost macro: pic := textext(\setbox0=\hbox{\color[textcolor]labeltext}\dp0=0pt\box0); picture pic will be placed in the metapost

[NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Christian
\input chapter3.mkiv \stoptext % EOF I generate the PDF with 'context mainfile.mkiv' So far for the structure. Now my problem: metapostgraphics.mkiv contains several (4) metapost graphics with \startuseMPgraphics{nameX} ... \stopuseMPgraphics. In chapter2.mkiv I want to use them with \useMPgraphics

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Hans Hagen
\input chapter1.mkiv \input chapter2.mkiv \input chapter3.mkiv \stoptext % EOF I generate the PDF with 'context mainfile.mkiv' So far for the structure. Now my problem: metapostgraphics.mkiv contains several (4) metapost graphics with \startuseMPgraphics{nameX} ... \stopuseMPgraphics. In chapter2.mkiv

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Aditya Mahajan
It only works if I put the exact same MP-code between \startMPcode \stopMPcode directly in the chapter2.mkiv What is wrong here? Am I missing something? Did I get the input mechanism all wrong? What happens if you make a simple file with the 4 \useMPgraphics in it .. does that one process?

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Christian
Betreff: Re: [NTG-context] Metapost graphics in separate file, help needed It only works if I put the exact same MP-code between \startMPcode \stopMPcode directly in the chapter2.mkiv What is wrong here? Am I missing something? Did I get the input mechanism all wrong? What happens

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Hans Hagen
On 23-11-2011 20:32, Aditya Mahajan wrote: It only works if I put the exact same MP-code between \startMPcode \stopMPcode directly in the chapter2.mkiv What is wrong here? Am I missing something? Did I get the input mechanism all wrong? What happens if you make a simple file with the 4

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Christian
, 23. November 2011 20:59 An: mailing list for ConTeXt users Betreff: Re: [NTG-context] Metapost graphics in separate file, help needed On 23-11-2011 20:32, Aditya Mahajan wrote: It only works if I put the exact same MP-code between \startMPcode \stopMPcode directly in the chapter2.mkiv

Re: [NTG-context] Metapost graphics in separate file, help needed

2011-11-23 Thread Hans Hagen
On 23-11-2011 20:50, Christian wrote: How do I clear the cache to force recalculation of the MP-graphics? fyi: There is no cache in mkiv as mp is run internally, which is why it is so fast (and in mkii caching is clever enough to determine a change). Hans

Re: [NTG-context] Arrows and boxes in metapost.

2011-11-17 Thread Hans Hagen
On 14-11-2011 20:31, Christian wrote: Hello, I need a simple graphic that shows some boxes (frames) with text in it and has some arrows pointing to and from these boxes. (examples 267 and 268 on this page [1]) I was hoping to do this in MetaPost. Earlier this year this question went un

[NTG-context] Arrows and boxes in metapost.

2011-11-14 Thread Christian
Hello, I need a simple graphic that shows some boxes (frames) with text in it and has some arrows pointing to and from these boxes. (examples 267 and 268 on this page [1]) I was hoping to do this in MetaPost. Earlier this year this question went un-answered on this list: How to use boxit

Re: [NTG-context] macro string in metapost

2011-11-02 Thread Hans Hagen
On 1-11-2011 23:21, Meer, H. van der wrote: The goal is to make the following string in metapost: string s; where s must become \MPcolor{Blue}. and ultimately execute this at the right moment with: scantokens s; The following makes s = MPcolor{Blue}: s := MPcolor char oct134 char oct173

[NTG-context] macro string in metapost

2011-11-01 Thread Meer, H. van der
The goal is to make the following string in metapost: string s; where s must become \MPcolor{Blue}. and ultimately execute this at the right moment with: scantokens s; The following makes s = MPcolor{Blue}: s := MPcolor char oct134 char oct173 Blue char oct134 char oct175; But I seem

Re: [NTG-context] MetaPost: Confusion with `function()` and `xyscaled`

2011-10-23 Thread Paul Menzel
the above because the numbers got too big and MetaPost complained. 1 = 1pt = 65536sp […] Thanks, Paul signature.asc Description: This is a digitally signed message part ___ If your question is of interest to others

Re: [NTG-context] MetaPost: Confusion with `function()` and `xyscaled`

2011-10-23 Thread Peter Rolf
the above because the numbers got too big and MetaPost complained. My fault. In the meantime I have checked it and 'sp' is not a predefined constant in MP (couldn't find it in the manual). Also never used it in MP. 1 = 1pt = 65536sp […] Thanks, Paul

Re: [NTG-context] MetaPost: Confusion with `function()` and `xyscaled`

2011-10-23 Thread Hans Hagen
On 23-10-2011 17:17, Peter Rolf wrote: If I want to test the bounding box of a graphic, I normally use a small debugging macro (last code line of nearly all of my graphics). It simply draws a small red frame at the bounding box borders. You can use the 'Measuring Tool' in Acrobat (also Reader?)

[NTG-context] metapost question

2011-10-21 Thread Hans van der Meer
I cannot find the answer to the following question in Knuth's Metafont book. The following definition with a trailing text argument: def mydef (expr a, b, c) text modifier = if modifier = empty: else: fi enddef; How can I do the switch on an empty or nonempty modifier

Re: [NTG-context] metapost question

2011-10-21 Thread Peter Rolf
Am 21.10.2011 15:05, schrieb Hans van der Meer: I cannot find the answer to the following question in Knuth's Metafont book. The following definition with a trailing text argument: def mydef (expr a, b, c) text modifier = if modifier = empty: Have you already tried if

Re: [NTG-context] MetaPost: Confusion with `function()` and `xyscaled`

2011-10-21 Thread Paul Menzel
Dear Peter, thank you for your answer. Am Freitag, den 21.10.2011, 17:02 +0200 schrieb Peter Rolf: I agree, this is confusing on the first sight. But scaling is not meant as 'scaling to' a dimension. In fact is is just a simple multiplication. The reason why it seems to work this way with

Re: [NTG-context] metapost question

2011-10-21 Thread Meer, H. van der
= empty: Have you already tried if modifier = : else: fi enddef; I tried it now, but it doesn't work. Something like if(TEXT4) =:;fi in the error log. No, Metapost is not happy with this construct. How can I do the switch on an empty or nonempty modifier

Re: [NTG-context] MetaPost: Confusion with `function()` and `xyscaled`

2011-10-21 Thread Peter Rolf
Am 21.10.2011 17:26, schrieb Paul Menzel: Dear Peter, thank you for your answer. Am Freitag, den 21.10.2011, 17:02 +0200 schrieb Peter Rolf: I agree, this is confusing on the first sight. But scaling is not meant as 'scaling to' a dimension. In fact is is just a simple multiplication.

Re: [NTG-context] metapost question

2011-10-21 Thread Nicola
” of MetaPost code. I must do the switch, because fill modifier with an empty modifier gives horrible results. Usage would be calls like: mydef(1,2,3) withcolor green; % with modifier text mydef(1,2,3); % without modifier text This is the best I could think of: vardef emptytext?@# text t

Re: [NTG-context] metapost question

2011-10-21 Thread Meer, H. van der
Peter, Thanks for trying to help. Because I solved the problem in another way you might be interested or even benefit from it. The underlying problem was drawing a border around a picture of given dimensions. The border being either colored or left uncolored. The border color should come from

[NTG-context] Metapost error

2011-10-19 Thread Lutz Haseloff
; ; metapost error: unknown, no error, terminal or log messages metapost terminal: [1] Thanks for any help Lutz ___ If your question is of interest to others as well, please add an entry to the Wiki

Re: [NTG-context] Metapost error

2011-10-19 Thread luigi scarso
                  ; * ...re hacker.jpg xscaled 30mm yscaled 20mm ;                                                   ; metapost         error: unknown, no error, terminal or log messages metapost         terminal: [1] Thanks for any help Lutz hm, strange, it seems that externalfigure is redefined This is ok

Re: [NTG-context] Metapost error

2011-10-19 Thread Lutz Haseloff
                  ; * ...re hacker.jpg xscaled 30mm yscaled 20mm ;                                                   ; metapost         error: unknown, no error, terminal or log messages metapost         terminal: [1] Thanks for any help Lutz

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-13 Thread Hans Hagen
On 13-10-2011 02:30, Mojca Miklavec wrote: Of course the user would have to make a conscious decision by enabling this “beta” release. And of course the user makes a conscious decision to either compile from trunk if he wants the latest and greatest bugs and new features or to wait patiently

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-13 Thread Alan Braslau
On Thu, Oct 13, 2011 at 02:30:07AM +0200, Mojca Miklavec wrote: MetaPost doesn't know erf and other obscure functions Metapost could possibly be extended to provide all of the functions in the standard math library. In fact, it would be nice if there be some hook to `link' to additional

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-13 Thread luigi scarso
On Thu, Oct 13, 2011 at 9:59 AM, Alan Braslau alan.bras...@cea.fr wrote: On Thu, Oct 13, 2011 at 02:30:07AM +0200, Mojca Miklavec wrote: MetaPost doesn't know erf and other obscure functions Metapost could possibly be extended to provide all of the functions in the standard math library

Re: [NTG-context] Setting style and color attributes of label in metapost

2011-10-13 Thread Wolfgang Schuster
Am 25.09.2011 um 02:43 schrieb Aditya Mahajan: I am writing a module which uses metapost in the background for drawing. I wanted to create an interface for setting the style and color of metapost labels but using \doset...attributes is not working. Here is an example: \definenamespace

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-12 Thread luigi scarso
On Wed, Oct 12, 2011 at 12:45 AM, Paul Menzel paulepan...@users.sourceforge.net wrote: Dear ConTeXt folks, I finally chose MetaPost/MetaFun [1] because of the native integration with ConTeXt and hopefully easy font handling. I want to use that throughout my document. Of course I hit

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-12 Thread Paul Menzel
Dear Alan, Am Mittwoch, den 12.10.2011, 07:36 +0200 schrieb Alan Braslau: Metapost can now perform calculations in double precision floating point. At this time, it is in the svn version and does not work yet as such integrated in ConTeXt (through mplib). Taco promises this for soon

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-12 Thread Mojca Miklavec
On Thu, Oct 13, 2011 at 00:13, Paul Menzel wrote: Am Mittwoch, den 12.10.2011, 07:36 +0200 schrieb Alan Braslau: Metapost can now perform calculations in double precision floating point. At this time, it is in the svn version and does not work yet as such integrated in ConTeXt (through mplib

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-12 Thread Paul Menzel
Am Donnerstag, den 13.10.2011, 00:28 +0200 schrieb Mojca Miklavec: On Thu, Oct 13, 2011 at 00:13, Paul Menzel wrote: Am Mittwoch, den 12.10.2011, 07:36 +0200 schrieb Alan Braslau: Metapost can now perform calculations in double precision floating point. At this time, it is in the svn

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-12 Thread Mojca Miklavec
On Thu, Oct 13, 2011 at 01:19, Paul Menzel wrote: Am Donnerstag, den 13.10.2011, 00:28 +0200 schrieb Mojca Miklavec: On Thu, Oct 13, 2011 at 00:13, Paul Menzel wrote: Am Mittwoch, den 12.10.2011, 07:36 +0200 schrieb Alan Braslau: Metapost can now perform calculations in double precision

[NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-11 Thread Paul Menzel
Dear ConTeXt folks, I finally chose MetaPost/MetaFun [1] because of the native integration with ConTeXt and hopefully easy font handling. I want to use that throughout my document. Of course I hit the first problem. Wanting to draw a “simple” function f like f(x) = e^x, seems hard to accomplish

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-11 Thread Paul Menzel
Dear ConTeXt folks, Am Mittwoch, den 12.10.2011, 00:45 +0200 schrieb Paul Menzel: Dear ConTeXt folks, I finally chose MetaPost/MetaFun [1] because of the native integration with ConTeXt and hopefully easy font handling. I want to use that throughout my document. Of course I hit

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-11 Thread Mojca Miklavec
On Wed, Oct 12, 2011 at 00:45, Paul Menzel wrote: Dear ConTeXt folks, I finally chose MetaPost/MetaFun [1] because of the native integration with ConTeXt and hopefully easy font handling. I want to use that throughout my document. Of course I hit the first problem. Wanting to draw a “simple

Re: [NTG-context] Plotting a graph of a function f, like f(x) = e^x, with MetaPost

2011-10-11 Thread Alan Braslau
Paul, Metapost can now perform calculations in double precision floating point. At this time, it is in the svn version and does not work yet as such integrated in ConTeXt (through mplib). Taco promises this for soon... The graph package is pretty clever, and I am working on proposals on how

[NTG-context] metapost not adding picture

2011-10-09 Thread Meer, H. van der
I have this question on the implementation of metapost. The following program ends in an error: \startMPpage picture v; draw origin--(1cm,1cm); v = currentpicture; clearit; draw (1cm,0)--(0,1cm); currentpicture := currentpicture + v; \stopMPpage The error is: ! Not implemented: (picture

Re: [NTG-context] metapost not adding picture

2011-10-09 Thread Peter Rolf
Am 09.10.2011 22:01, schrieb Meer, H. van der: I have this question on the implementation of metapost. The following program ends in an error: \startMPpage picture v; draw origin--(1cm,1cm); v = currentpicture; clearit; draw (1cm,0)--(0,1cm); currentpicture := currentpicture + v; use

[NTG-context] nocolor in MetaPost

2011-10-05 Thread Hans van der Meer
Is there a value that can be given to a color variable in MetaPost that might function as some sort of no color. Thus something like NULL in the programming language C. Hans van der Meer ___ If your question

Re: [NTG-context] nocolor in MetaPost

2011-10-05 Thread Hans Hagen
On 5-10-2011 19:56, Hans van der Meer wrote: Is there a value that can be given to a color variable in MetaPost that might function as some sort of no color. Thus something like NULL in the programming language C. not that I know

Re: [NTG-context] nocolor in MetaPost

2011-10-05 Thread Alan Braslau
On Wed, Oct 05, 2011 at 08:46:22PM +0200, Hans Hagen wrote: On 5-10-2011 19:56, Hans van der Meer wrote: Is there a value that can be given to a color variable in MetaPost that might function as some sort of no color. Thus something like NULL in the programming language C. not that I

Re: [NTG-context] metapost to pdf on the fly

2011-10-03 Thread Meer, H. van der
would like to generate metapost figures in separate pdf-files (in some convenient directory, they are reused elsewhere). This as part of a project structure. I know that on a separate run such a pdf can be generated with: context figurefile running on input \input some-metapost-inclusions

Re: [NTG-context] metapost to pdf on the fly

2011-10-03 Thread Wolfgang Schuster
Am 03.10.2011 um 09:05 schrieb Meer, H. van der: I am afraid I don't completely understand this. Doing: \startbuffer[fig-1] \startMPcode draw origin-(20,0) .. origin+(0,20) .. origin+(20,0) .. origin+(0,-20) .. cycle withcolor darkgreen; label(textext(Test),origin); \stopMPcode

Re: [NTG-context] metapost to pdf on the fly

2011-10-03 Thread Meer, H. van der
Thanks, this works indeed. But I hoped to be able to produce in this manner at one stroke a series of separate figures, each in its own pdf file. Or is this an impossible action? Hans van der Meer On 3 okt. 2011, at 09:09, Wolfgang Schuster wrote: Am 03.10.2011 um 09:05 schrieb Meer, H.

Re: [NTG-context] metapost to pdf on the fly

2011-10-03 Thread Mojca Miklavec
On Mon, Oct 3, 2011 at 10:12, Meer, H. van der wrote: Thanks, this works indeed. But I hoped to be able to produce in this manner at one stroke a series of separate figures, each in its own pdf file. Or is this an impossible action? Then create file.mp with beginfig(1); ... metapost code

[NTG-context] metapost to pdf on the fly

2011-09-29 Thread Meer, H. van der
I would like to generate metapost figures in separate pdf-files (in some convenient directory, they are reused elsewhere). This as part of a project structure. I know that on a separate run such a pdf can be generated with: context figurefile running on input \input some-metapost-inclusions

Re: [NTG-context] metapost to pdf on the fly

2011-09-29 Thread Aditya Mahajan
On Thu, 29 Sep 2011, Meer, H. van der wrote: I would like to generate metapost figures in separate pdf-files (in some convenient directory, they are reused elsewhere). This as part of a project structure. I know that on a separate run such a pdf can be generated with: context figurefile

[NTG-context] Setting style and color attributes of label in metapost

2011-09-24 Thread Aditya Mahajan
I am writing a module which uses metapost in the background for drawing. I wanted to create an interface for setting the style and color of metapost labels but using \doset...attributes is not working. Here is an example: \definenamespace [test] [style=yes, name=test, command=yes

[NTG-context] MetaPost visibly drawing at 0pt

2011-09-19 Thread Meer, H. van der
I used to put an invisible frame around figures in MetaPost by setting a pen scaled at 0pt. That left no trace, but defined the area. However I (now) see a thin line drawn by code: pickup pencircle scaled 0pt; draw origin--(w,h); Did I always mis this or has something

Re: [NTG-context] MetaPost visibly drawing at 0pt

2011-09-19 Thread Peter Rolf
Am 19.09.2011 14:31, schrieb Meer, H. van der: I used to put an invisible frame around figures in MetaPost by setting a pen scaled at 0pt. That left no trace, but defined the area. However I (now) see a thin line drawn by code: pickup pencircle scaled 0pt; draw origin--(w

Re: [NTG-context] metapost question (bug?)

2011-07-22 Thread Peter Rolf
. Thank you -- I forgot about the path operator same here (i had to browse the metapost manual for the operator) :-) (Funny thing, though, that the problem shows up with point 0. I would also think that having two consecutive identical points, although poor style, should not cause problems

[NTG-context] metapost question (bug?)

2011-07-21 Thread Alan Braslau
Hello, I have a question for metapost specialists: I am looking for some sort of effect, built upon a zig-zag line. The first graphic in the minimal example below is as I would expect. The second graphic seems to be drawn without the point at (0,0). (Ignore the asymmetry at the end of the path

Re: [NTG-context] metapost question (bug?)

2011-07-21 Thread luigi scarso
On Thu, Jul 21, 2011 at 4:39 PM, Alan Braslau alan.bras...@cea.fr wrote: Hello, I have a question for metapost specialists: I am looking for some sort of effect, built upon a zig-zag line. The first graphic in the minimal example below is as I would expect. The second graphic seems

Re: [NTG-context] metapost question (bug?)

2011-07-21 Thread Peter Rolf
Am 21.07.2011 16:53, schrieb luigi scarso: On Thu, Jul 21, 2011 at 4:39 PM, Alan Braslau alan.bras...@cea.fr wrote: Hello, I have a question for metapost specialists: I am looking for some sort of effect, built upon a zig-zag line. The first graphic in the minimal example below is as I

Re: [NTG-context] metapost question (bug?)

2011-07-21 Thread Alan Braslau
operator (Funny thing, though, that the problem shows up with point 0. I would also think that having two consecutive identical points, although poor style, should not cause problems as it does.) And yes, the use of an asymmetrical pen is indeed the whole point of this figure -- I am using metapost

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Mojca Miklavec
I'm not able to reproduce the problem, but there is one weird thing (unrelated to your problem): The original file test.mp is copied to test.mp.keep and a new file test.mp is created with a newer timestamp and two additional blank lines at the end. So repeating the compilation hundred times

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Hans Hagen
On 15-7-2011 9:13, Mojca Miklavec wrote: I'm not able to reproduce the problem, but there is one weird thing (unrelated to your problem): The original file test.mp is copied to test.mp.keep and a new file test.mp is created with a newer timestamp and two additional blank lines at the end. So

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Hans Hagen
On 15-7-2011 3:04, luigi scarso wrote: Building the file using texexec --mptex test.mp all three graphics how about context --mp test.mp ? Hans - Hans Hagen | PRAGMA ADE

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Mojca Miklavec
On Fri, Jul 15, 2011 at 09:44, Hans Hagen pra...@wxs.nl wrote: On 15-7-2011 3:04, luigi scarso wrote: Building the file using texexec --mptex test.mp all three graphics how about context --mp test.mp ? context --mp test metapost| loading 'metafun.mp' (experimental metapost version

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread luigi scarso
? context --mp test metapost        | loading 'metafun.mp' (experimental metapost version two)Error in mp.find_file: ...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to call field 'checktexts' (a nil value) metapost        | processing 'test.mp'Error in mp.find_file: ...text

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Hans Hagen
On 15-7-2011 9:47, Mojca Miklavec wrote: On Fri, Jul 15, 2011 at 09:44, Hans Hagenpra...@wxs.nl wrote: On 15-7-2011 3:04, luigi scarso wrote: Building the file using texexec --mptex test.mp all three graphics how about context --mp test.mp ? context --mp test metapost| loading

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Kevin D. Robbins
On Thu, Jul 14, 2011 at 7:04 PM, luigi scarso luigi.sca...@gmail.com wrote: This is one of the preferrred way to deal with metapost in mkiv \starttext \startMPpage numeric u;  u = 1cm;  draw (0,2u)--(0,0)--(4u,0);  pickup pencircle scaled 1pt;  draw (0,0){up}   for i=1 upto 8: ..(i/2,sqrt

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-15 Thread Kevin D. Robbins
On Fri, Jul 15, 2011 at 1:13 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: The original file test.mp is copied to test.mp.keep and a new file test.mp is created with a newer timestamp and two additional blank lines at the end. I hadn't noticed this yesterday, but I see the same

[NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-14 Thread Kevin D. Robbins
Using a fresh install of ConTeXt Minimals today (ConTeXt version 2011.07.14 16:09, luatex version beta-0.70.1-2011051918) I am trying to build the following MetaPost graphics: ---8--- file: test.mp fontmapfile =lm-math.map ; beginfig(1) draw fullcircle scaled 3cm ; endfig ; beginfig(2

Re: [NTG-context] Trouble making basic MetaPost graphics using ConTeXt Minimals

2011-07-14 Thread luigi scarso
On Fri, Jul 15, 2011 at 2:59 AM, Kevin D. Robbins krobb...@alumni.princeton.edu wrote: Using a fresh install of ConTeXt Minimals today (ConTeXt version 2011.07.14 16:09, luatex version beta-0.70.1-2011051918) I am trying to build the following MetaPost graphics: ---8--- file: test.mp

[NTG-context] cmyk in metapost

2011-06-26 Thread Hans van der Meer
I must be doing something wrong. But what? Relevant part of Metapost code: numeric Cb, Cr, Y, T, temp, graycolors; Cb := 0; Cr := 1; Y = 2; T := 3; graycolors := 15; numeric colors[][];for i = 0 upto graycolors: temp := (graycolors - i) / graycolors; colors[i][Cb] := temp; colors

Re: [NTG-context] cmyk in metapost

2011-06-26 Thread Hans Hagen
On 26-6-2011 1:51, Hans van der Meer wrote: I must be doing something wrong. But what? Relevant part of Metapost code: I got the code from the Metafun manual. Beta from ConTeXt ver: 2011.03.28 01:03 MKIV download. Something obvious I am overlooking? cmykcolor is another datatype in mp than

[NTG-context] mtxrun --script metapost and fonts?

2011-05-10 Thread Michal Kvasnička
Hallo. I've got a problem with metapost - pdf translation. Since mptopdf is still broken in the last ConTeXt beta in the minimal distribution, I use mtxrun --script metapost --split. It works well, only it ignores font setting. My code is like this: verbatimtex \definetypeface [times] [rm

Re: [NTG-context] mtxrun --script metapost and fonts?

2011-05-10 Thread Hans Hagen
On 10-5-2011 3:29, Michal Kvasnička wrote: Hallo. I've got a problem with metapost - pdf translation. Since mptopdf is still broken in the last ConTeXt beta in the minimal distribution, I use mtxrun --script metapost --split. It works well, only it ignores font setting. My code is like

[NTG-context] Context and metapost: using \frac

2011-04-26 Thread mat
Hi I am using context to run a metapost graph. I am however unable to insert a label with \frac, since this is not pure Tex but Latex. This seems to be a known problem for metapost: -Seems for metapost only, one should add %latex (http://ryanmlayer.wordpress.com/tag/metapost/). -I saw also

Re: [NTG-context] Context and metapost: using \frac

2011-04-26 Thread Hans Hagen
On 25-4-2011 8:33, mat wrote: Any idea how I should do? Find below minimal example, that does not work on my computer when compiling with context... best use textext ... label.top(textext(1.4)scaled 1.00, (10, 10)); label.top(textext($\sigma_t$)

Re: [NTG-context] Context and metapost: using \frac

2011-04-26 Thread Matthieu Stigler
=1pt] \switchtobodyfont[10pt] % Beginning MetaPost graphic \startMPpage label.top(btex 1.4 etex scaled 1.00, (10, 10)); label.top(btex $\sigma_t$ etex scaled 1.00, (0, 10)); label.top(btex $\displaystyle \frac{\sigma_t}{a}$ etex scaled 1.00, (0, 10)); \stopMPpage \stoptext Error

Re: [NTG-context] Context and metapost: using \frac

2011-04-26 Thread Hans Hagen
On 26-4-2011 12:02, Matthieu Stigler wrote: Dear Hans Thanks for your quick answer! I was however not able to produce the graph with the textext code... Should I actually then use another compiler? I tried with context and texexec (I thought texexec is the compiler for mkiv, right? I'm on linux

<    3   4   5   6   7   8   9   10   11   12   >