From nvitacolonna at gmail.com Wed Jul 1 15:52:59 2009 From: nvitacolonna at gmail.com (Nicola) Date: Wed, 01 Jul 2009 15:52:59 +0200 Subject: [metapost] On simulating def with vardef References: Message-ID: In article , Nicola wrote: > Hi, > I used to think that a vardef behaves like a primary because its > replacement text is surrounded by begingroup/endgroup. But, recently, I > have tried this: > > def foo = x enddef; > foo := 1; % Ok, sets x=1 > > vardef foovar = endgroup gobbled true x gobble begingroup enddef; > foovar := 2; % Not ok: ! Improper `:=' will be changed to `='. > > I conclude that the replacement text of a vardef macro is treated as a > primary in any case. Is it correct? Is there a way to have a vardef in > the left hand side of an assignment in some circumstances? > > For those who are care, what I would like to achieve is something like: > > vardef suffixof prefixof @# = > endgroup gobbled true @# gobble begingroup > enddef; > vardef prefixof x@# = > endgroup gobbled true suffixof #@.@ gobble begingroup > enddef; > > so that > > prefixof x.a := 0; > > would set x=0 (I know that I can use 'str', but I would like to know if > this is possible without it). > > Thanks, > Nicola > > -- > http://tug.org/metapost/ Ok, I've found a solution by myself. The problem is that begingroup endgroup gobbled true expands into an (empty) secondary. So, I cannot see any way in which a vardef macro name can (directly) appear as a lhs of an assignment. Therefore, my solution introduces a def: vardef suffixof prefixof @# = endgroup @# gobble begingroup enddef; vardef prefixof x@# = endgroup gobble suffixof #@.@ gobble begingroup enddef; def assignprefix suffix s = gobble prefixof s enddef; So, now assignprefix x.a := 0; indeed works and it sets x=0 (and so does assignprefix x.a[1].c := 0, or whatever). Well, for me it was a funny challenge. Nicola From taco at elvenkind.com Wed Jul 8 13:34:22 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Wed, 08 Jul 2009 13:34:22 +0200 Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: <20090707124257.06b2954f@gmx.li> References: <20090707124257.06b2954f@gmx.li> Message-ID: <4A54843E.4030606@elvenkind.com> Hi all, I need a bit of help. Does anybody recall what the old pascal metapost did if you gave it this input (file attached): $ mpost try.tmp 1.203/1.204 is absolutely wrong (it does not generate the mpx file correctly) but it also generates try.tmp.log and try.tmp.1 My question is: how I should handle filename extensions like the above (and also after 'input' like in the example below). Best wishes, Taco Daniel Oehry wrote: > latexmp does not work correctly anymore. The following example exits > with an error: > > input latexmp ; > beginfig(1); > label(textext("test"),origin) ; > endfig; > > end > > This is MetaPost, version 1.203 (kpathsea version 5.0.0) > (./test.mp > (/usr/local/texlive/2009/texmf-dist/metapost/latexmp/latexmp.mp) > (./ltx-test.tmp >>> ltx-test.mp >>> ltx-test.mpx > ! Unable to make mpx file. > l.7 latexmp_picture[1]:= btex > test etex ; > Transcript written on test.log. > > > I looked at this and found out that everything works as expected if I > change the name of the temporary-file in "latexmp.mp" at line 21 from > > "ltx-" & jobname & ".tmp" ; > > to > > "ltx-" & jobname & ".mp" ; > > This seems very strange to me. Should this be changed in latexmp.mp or > is it an error in mpost? > > Daniel -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: try.tmp URL: From B_Jackowski at GUST.org.pl Wed Jul 8 15:16:55 2009 From: B_Jackowski at GUST.org.pl (Boguslaw Jackowski) Date: Wed, 8 Jul 2009 15:16:55 +0200 (CEST) Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: <4A54843E.4030606@elvenkind.com> References: <20090707124257.06b2954f@gmx.li> <4A54843E.4030606@elvenkind.com> Message-ID: > I need a bit of help. Does anybody recall what the old pascal > metapost did if you gave it this input (file attached): > > $ mpost try.tmp Enclosed are results for MetaPost, Version 0.641 (Web2c 7.5.2). Seems to work neatly... Good luck -- Jacko -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL ---------------------------------------------------------------- Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- From taco at elvenkind.com Wed Jul 8 15:18:38 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Wed, 08 Jul 2009 15:18:38 +0200 Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: References: <20090707124257.06b2954f@gmx.li> <4A54843E.4030606@elvenkind.com> Message-ID: <4A549CAE.30304@elvenkind.com> Boguslaw Jackowski wrote: > >> I need a bit of help. Does anybody recall what the old pascal >> metapost did if you gave it this input (file attached): >> >> $ mpost try.tmp > > Enclosed are results for MetaPost, Version 0.641 (Web2c 7.5.2). > Seems to work neatly... Attachments missing? Best wishes, Taco From taco at elvenkind.com Wed Jul 8 18:50:45 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Wed, 08 Jul 2009 18:50:45 +0200 Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: <4A54843E.4030606@elvenkind.com> References: <20090707124257.06b2954f@gmx.li> <4A54843E.4030606@elvenkind.com> Message-ID: <4A54CE65.1060802@elvenkind.com> Hi, Taco Hoekwater wrote: > > Hi all, > > I need a bit of help. Does anybody recall what the old pascal > metapost did if you gave it this input (file attached): > > $ mpost try.tmp > My (first) attempt at a fix for this bug is in the metapost source repository's 'trunk' now. It would be really nice if someone would try to compile the trunk and see if I 'did it right'. svn checkout http://foundry.supelec.fr/svn/metapost/trunk user=anonymous, password= Best wishes, Taco From Oehry.Daniel at lg-vaduz.li Wed Jul 8 20:05:11 2009 From: Oehry.Daniel at lg-vaduz.li (Daniel Oehry LG) Date: Wed, 8 Jul 2009 20:05:11 +0200 Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: <4A54CE65.1060802@elvenkind.com> References: <20090707124257.06b2954f@gmx.li> <4A54843E.4030606@elvenkind.com> <4A54CE65.1060802@elvenkind.com> Message-ID: <20090708200511.1323b1f2@lg-vaduz.li> On Wed, 08 Jul 2009 18:50:45 +0200 Taco Hoekwater wrote: > My (first) attempt at a fix for this bug is in the metapost source > repository's 'trunk' now. It would be really nice if someone would > try to compile the trunk and see if I 'did it right'. I compiled it and replaced my mpost. Now my files (using latexmp and other stuff) run through mpost without any problems! Daniel From B_Jackowski at GUST.org.pl Thu Jul 9 09:13:15 2009 From: B_Jackowski at GUST.org.pl (Boguslaw Jackowski) Date: Thu, 9 Jul 2009 09:13:15 +0200 (CEST) Subject: [metapost] [tex-live] pretest: latexmp does not work anymore In-Reply-To: <4A549CAE.30304@elvenkind.com> References: <20090707124257.06b2954f@gmx.li> <4A54843E.4030606@elvenkind.com> <4A549CAE.30304@elvenkind.com> Message-ID: > Attachments missing? Yes, missing... :-\ Sorry. Now enclosing (just because "ordnung muss sein" ;-) Cheers -- Jacko -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL ---------------------------------------------------------------- Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -------------- next part -------------- A non-text attachment was scrubbed... Name: Taco_test.zip Type: application/zip Size: 1983 bytes Desc: URL: From taco at elvenkind.com Mon Jul 13 11:11:06 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Mon, 13 Jul 2009 11:11:06 +0200 Subject: [metapost] MetaPost 1.205 announcement Message-ID: <4A5AFA2A.4010506@elvenkind.com> The MetaPost team is happy to announce a new release of MetaPost: ---------------------------------------------------------------------- MetaPost 1.205 ---------------------------------------------------------------------- The standalone distribution package and a win32 binary can be downloaded immediately from http://foundry.supelec.fr/gf/project/metapost/ This release will also be available from CTAN soon, and it will be included in the next TeXLive. The source package should compile normally on all systems that are capable of compiling a modern web2c-based TeX distribution. The win32 binary is intended for texlive or a similar web2c-based installation, this executable will *not* work for miktex. Of course, we welcome any comments (either good or bad) that you may have. Simply replying to this message is fine, but see the bottom of the message for a more formal way to report bugs and feature requests. ---------------------------------------------------------------------- What is new in MetaPost version 1.205: ---------------------------------------------------------------------- * Metapost did not handle well files with extensions other than .mp. ---------------------------------------------------------------------- Legal notice / license / bug reports ---------------------------------------------------------------------- MetaPost is a system for producing graphics developed by John Hobby at AT&T, based on Donald Knuth's Metafont. The MetaPost home page is http://tug.org/metapost. MetaPost is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The MetaPost development project is currently hosted at Supelec, http://foundry.supelec.fr/gf/project/metapost; please report bugs and request enhancements through there if possible. Alternatively, you can reach us through the mailing list as well. Have fun! Taco Hoekwater, for the MetaPost team, July 13, 2009. From christophe.poulain at melusine.eu.org Tue Jul 21 16:16:04 2009 From: christophe.poulain at melusine.eu.org (Christophe Poulain) Date: Tue, 21 Jul 2009 16:16:04 +0200 Subject: [metapost] Bug ? Message-ID: <20090721161604.2d700d7a@debian> Hi, with the code and Metapost 1.204 >8>8>8>8>8>8>8>8>8 verbatimtex %&latex \documentclass{article} \usepackage{fourier} \begin{document} etex beginfig(1); label(btex \eurologo etex,(10,10)); endfig; end beginfig(2); label(btex \textgreek{\euro} etex,(10,10)); endfig; >8>8>8>8>8>8>8>8 why Metapost search to compile the fig number 2 and make an error (error who is true because the command \textgreek is unknown) Greetings, Christophe Poulain. From taco at elvenkind.com Tue Jul 21 17:41:37 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Tue, 21 Jul 2009 17:41:37 +0200 Subject: [metapost] Bug ? In-Reply-To: <20090721161604.2d700d7a@debian> References: <20090721161604.2d700d7a@debian> Message-ID: <4A65E1B1.50006@elvenkind.com> Hi Christophe, Christophe Poulain wrote: > Hi, > > with the code and Metapost 1.204 > >> 8>8>8>8>8>8>8>8>8 > verbatimtex > %&latex > \documentclass{article} > \usepackage{fourier} > \begin{document} > etex > > beginfig(1); > label(btex \eurologo etex,(10,10)); > endfig; > end > beginfig(2); > label(btex \textgreek{\euro} etex,(10,10)); > endfig; >> 8>8>8>8>8>8>8>8 > > why Metapost search to compile the fig number 2 and make an error > (error who is true because the command \textgreek is unknown) If I understand you correctly you want metapost to ignore the latex error that your input causes? Why would that make sense? If latex fails, then your figure is broken? Best wishes, Taco From petiard.francois at free.fr Tue Jul 21 18:46:37 2009 From: petiard.francois at free.fr (=?ISO-8859-1?Q?P=E9tiard_Fran=E7ois?=) Date: Tue, 21 Jul 2009 18:46:37 +0200 Subject: [metapost] Bug ? In-Reply-To: <4A65E1B1.50006@elvenkind.com> References: <20090721161604.2d700d7a@debian> <4A65E1B1.50006@elvenkind.com> Message-ID: <4A65F0ED.1090104@free.fr> Le 21/07/2009 17:41, Taco Hoekwater a ?crit : > Hi Christophe, > > Christophe Poulain wrote: >> Hi, >> >> with the code and Metapost 1.204 >> >>> 8>8>8>8>8>8>8>8>8 >> verbatimtex >> %&latex >> \documentclass{article} >> \usepackage{fourier} >> \begin{document} >> etex >> >> beginfig(1); >> label(btex \eurologo etex,(10,10)); >> endfig; >> end >> beginfig(2); >> label(btex \textgreek{\euro} etex,(10,10)); >> endfig; >>> 8>8>8>8>8>8>8>8 >> why Metapost search to compile the fig number 2 and make an error >> (error who is true because the command \textgreek is unknown) > > If I understand you correctly you want metapost to ignore the > latex error that your input causes? Why would that make sense? > If latex fails, then your figure is broken? If I understand Christophe, the question is : "why MetaPost doesn't stop at the command end and try to compile the fig 2 ?" Fran?ois From taco at elvenkind.com Tue Jul 21 18:58:57 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Tue, 21 Jul 2009 18:58:57 +0200 Subject: [metapost] Bug ? In-Reply-To: <4A65F0ED.1090104@free.fr> References: <20090721161604.2d700d7a@debian> <4A65E1B1.50006@elvenkind.com> <4A65F0ED.1090104@free.fr> Message-ID: <4A65F3D1.6030602@elvenkind.com> P?tiard Fran?ois wrote: >>> why Metapost search to compile the fig number 2 and make an error >>> (error who is true because the command \textgreek is unknown) >> >> If I understand you correctly you want metapost to ignore the >> latex error that your input causes? Why would that make sense? >> If latex fails, then your figure is broken? > > If I understand Christophe, the question is : "why MetaPost doesn't stop > at the command end and try to compile the fig 2 ?" Ah. Because all the btex.. etex label processing for the whole file takes place before anything else happens (otherwise each of the labels would need its own private latex run). Best wishes, Taco From christophe.poulain at melusine.eu.org Tue Jul 21 20:54:44 2009 From: christophe.poulain at melusine.eu.org (Christophe Poulain) Date: Tue, 21 Jul 2009 20:54:44 +0200 Subject: [metapost] Bug ? In-Reply-To: <4A65F3D1.6030602@elvenkind.com> References: <20090721161604.2d700d7a@debian> <4A65E1B1.50006@elvenkind.com> <4A65F0ED.1090104@free.fr> <4A65F3D1.6030602@elvenkind.com> Message-ID: <20090721205444.60ba5cad@debian> Le Tue, 21 Jul 2009 18:58:57 +0200, Taco Hoekwater a ?crit : > P?tiard Fran?ois wrote: > >>> why Metapost search to compile the fig number 2 and make an error > >>> (error who is true because the command \textgreek is unknown) > >> > >> If I understand you correctly you want metapost to ignore the > >> latex error that your input causes? Why would that make sense? > >> If latex fails, then your figure is broken? > > > > If I understand Christophe, the question is : "why MetaPost doesn't > > stop at the command end and try to compile the fig 2 ?" > > Ah. Because all the btex.. etex label processing for the whole file > takes place before anything else happens (otherwise each of the labels > would need its own private latex run). OK, it's very clear :) I've to do so :-) > > Best wishes, > Taco > -- > http://tug.org/metapost/ Greetings, Christophe Poulain. From montovall at gmail.com Tue Jul 21 23:28:25 2009 From: montovall at gmail.com (Miguel) Date: Tue, 21 Jul 2009 18:28:25 -0300 Subject: [metapost] Problems with labels Message-ID: <1248211705.3771.3.camel@localhost.localdomain> Hi, I am trying to put labels in a graphics, but It is impossible to do it. I was looking in the list of the metapost, and I found a possible solution. I have to use the version 1.00 . Well the version of my metapost is 0.641 and I have been trying to get a new version but until today this tasks has been impossible to finish. If somebody can give tips about the installation of this metapost's version in my fedora 8 I will appreciate it Thanks From taco at elvenkind.com Fri Jul 24 09:50:30 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Fri, 24 Jul 2009 09:50:30 +0200 Subject: [metapost] Problems with labels In-Reply-To: <1248211705.3771.3.camel@localhost.localdomain> References: <1248211705.3771.3.camel@localhost.localdomain> Message-ID: <4A6967C6.6090501@elvenkind.com> Hi Miguel, Miguel wrote: > Hi, I am trying to put labels in a graphics, but It is impossible to do > it. I was looking in the list of the metapost, and I found a possible > solution. I have to use the version 1.00 . Well the version of my > metapost is 0.641 and I have been trying to get a new version but until > today this tasks has been impossible to finish. If somebody can give > tips about the installation of this metapost's version in my fedora 8 I > will appreciate it Technically, updating metapost is a simple matter of copying a new executable over the old executable. But if you care about your package manager, you probably do not want to do that, and I have no idea whether there are updated packages for metapost for FC8 available. However, if you have structural problems especially with labels, then the problem may not be with metapost, but with your tex installation. Therefore my suggestion is to post a small example and the failure message / log to this list before you do anything else. Best wishes, Taco From mojca.miklavec.lists at gmail.com Fri Jul 24 09:53:48 2009 From: mojca.miklavec.lists at gmail.com (Mojca Miklavec) Date: Fri, 24 Jul 2009 09:53:48 +0200 Subject: [metapost] Problems with labels In-Reply-To: <1248211705.3771.3.camel@localhost.localdomain> References: <1248211705.3771.3.camel@localhost.localdomain> Message-ID: <6faad9f00907240053u296757b5v888551d6d9f44617@mail.gmail.com> On Tue, Jul 21, 2009 at 23:28, Miguel wrote: > Hi, I am trying to put ?labels in a graphics, but It is impossible to do > it. I was looking in the list of the metapost, and I found a possible > solution. I have to use the version 1.00 . Well the version of my > metapost is 0.641 and I have been trying to get a new version but until > today this tasks has been impossible to finish. If somebody can give > tips about the installation of this metapost's version in my fedora 8 I > will appreciate it I would suggest you to install minimal (or some reasonably small) TeX Live scheme http://www.tug.org/texlive/acquire.html http://mirror.ctan.org/systems/texlive/tlnet/2008/install-tl-unx.tar.gz That's probably the easiest way and won't interfere with your current TeX installation. You could replace the old binary with a new one (as Taco wrote), but I also suspect that the problem lies somewhere else. It's impossible to guess what unless you provide more details. Mojca From champion at broadinstitute.org Thu Jul 30 19:02:03 2009 From: champion at broadinstitute.org (Mia Champion) Date: Thu, 30 Jul 2009 13:02:03 -0400 Subject: [metapost] Attn: Taco References: f305f8270901080616o10aa66cdpb4c87400fd3d377b@mail.gmail.com Message-ID: <4A71D20B.6070005@broadinstitute.org> Hi, I am not at all familiar with the metapost language and have an output file from a program that I am using for genome analysis (see below). In order for the data to be linked into other output files from the program, the metapost script below must be converted into individual pdf files. I have tried a couple of different metapost converters online just to see what the output would look like and keep getting errors that quit the conversion and seem to have general trouble with the code. I would really appreciate it if a metapost expert could give me advice regarding this code and what might be the best conversion program to use in order to generate pdf image files (the image outputs are phylogenetic trees). Thanks so much, Mia beginfig(1) u:=1in; pair p[]; pair mid[]; p0 = (0.000000u,0.000000u); p1 = (0.875000u,2.333333u); p2 = (1.750000u,0.000000u); p3 = (2.625000u,4.666667u); p4 = (3.500000u,0.000000u); p5 = (4.375000u,2.333333u); p6 = (5.250000u,0.000000u); p7 = (3.500000u,7.000000u); p8 = (7.000000u,0.000000u); % draw line draw p[0] -- ( xpart p[0], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[0]); xpart mid[0] = xpart(p[0]); ypart mid[0] = (ypart(p[0])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[0]); label.rt( btex $\lambda=0.001700$ etex, mid[0] + (0,-0.150000u)); draw p[1] -- ( xpart p[1], ypart p[3] ) -- p[3] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[1]); xpart mid[1] = xpart(p[1]); ypart mid[1] = (ypart(p[1])+ypart(p[3]))/2; label.rt( btex $l = 81$ etex, mid[1]); label.rt( btex $\lambda=0.001700$ etex, mid[1] + (0,-0.150000u)); draw p[2] -- ( xpart p[2], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[2]); xpart mid[2] = xpart(p[2]); ypart mid[2] = (ypart(p[2])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[2]); label.rt( btex $\lambda=0.001700$ etex, mid[2] + (0,-0.150000u)); draw p[3] -- ( xpart p[3], ypart p[7] ) -- p[7] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[3]); xpart mid[3] = xpart(p[3]); ypart mid[3] = (ypart(p[3])+ypart(p[7]))/2; label.rt( btex $l = 6$ etex, mid[3]); label.rt( btex $\lambda=0.001700$ etex, mid[3] + (0,-0.150000u)); draw p[4] -- ( xpart p[4], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[4]); xpart mid[4] = xpart(p[4]); ypart mid[4] = (ypart(p[4])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[4]); label.rt( btex $\lambda=0.001700$ etex, mid[4] + (0,-0.150000u)); draw p[5] -- ( xpart p[5], ypart p[3] ) -- p[3] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[5]); xpart mid[5] = xpart(p[5]); ypart mid[5] = (ypart(p[5])+ypart(p[3]))/2; label.rt( btex $l = 70$ etex, mid[5]); label.rt( btex $\lambda=0.001700$ etex, mid[5] + (0,-0.150000u)); draw p[6] -- ( xpart p[6], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[6]); xpart mid[6] = xpart(p[6]); ypart mid[6] = (ypart(p[6])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[6]); label.rt( btex $\lambda=0.001700$ etex, mid[6] + (0,-0.150000u)); draw p[7] -- ( p[7] + (0,0.333333u) ); label.urt( btex 1 \small{(0.015, 0.186)} etex, p[7]); draw p[8] -- ( xpart p[8], ypart p[7] ) -- p[7] ; label.urt( btex 0 etex, p[8]); xpart mid[8] = xpart(p[8]); ypart mid[8] = (ypart(p[8])+ypart(p[7]))/2; label.rt( btex $l = 93$ etex, mid[8]); label.rt( btex $\lambda=0.001700$ etex, mid[8] + (0,-0.150000u)); % add name labeloffset := 10; dotlabel.bot(btex chimp etex, p[0]); labeloffset := 10; dotlabel.bot(btex human etex, p[2]); labeloffset := 10; dotlabel.bot(btex mouse etex, p[4]); labeloffset := 10; dotlabel.bot(btex rat etex, p[6]); labeloffset := 10; dotlabel.bot(btex dog etex, p[8]); % Mark duplication % annotation label( btex etex, (0.1u, 7.700000u)); label( btex ENSF00000002057 etex, (0.1u, 7.500000u)); label(btex Max p-value = 0.000 etex, (0.1u, 7.300000u)); endfig; beginfig(2) u:=1in; pair p[]; pair mid[]; p0 = (0.000000u,0.000000u); p1 = (0.875000u,2.333333u); p2 = (1.750000u,0.000000u); p3 = (2.625000u,4.666667u); From champion at broadinstitute.org Thu Jul 30 19:07:28 2009 From: champion at broadinstitute.org (Mia Champion) Date: Thu, 30 Jul 2009 13:07:28 -0400 Subject: [metapost] trouble with metapost conversion to pdf image Message-ID: <4A71D350.8000008@broadinstitute.org> Hi, I am not at all familiar with the metapost language and have an output file from a program that I am using for genome analysis (see below). In order for the data to be linked into other output files from the program, the metapost script below must be converted into individual pdf files. I have tried a couple of different metapost converters online just to see what the output would look like and keep getting errors that quit the conversion and seem to have general trouble with the code. I would really appreciate it if a metapost expert could give me advice regarding this code and what might be the best conversion program to use in order to generate pdf image files (the image outputs are phylogenetic trees). Thanks so much, Mia beginfig(1) u:=1in; pair p[]; pair mid[]; p0 = (0.000000u,0.000000u); p1 = (0.875000u,2.333333u); p2 = (1.750000u,0.000000u); p3 = (2.625000u,4.666667u); p4 = (3.500000u,0.000000u); p5 = (4.375000u,2.333333u); p6 = (5.250000u,0.000000u); p7 = (3.500000u,7.000000u); p8 = (7.000000u,0.000000u); % draw line draw p[0] -- ( xpart p[0], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[0]); xpart mid[0] = xpart(p[0]); ypart mid[0] = (ypart(p[0])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[0]); label.rt( btex $\lambda=0.001700$ etex, mid[0] + (0,-0.150000u)); draw p[1] -- ( xpart p[1], ypart p[3] ) -- p[3] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[1]); xpart mid[1] = xpart(p[1]); ypart mid[1] = (ypart(p[1])+ypart(p[3]))/2; label.rt( btex $l = 81$ etex, mid[1]); label.rt( btex $\lambda=0.001700$ etex, mid[1] + (0,-0.150000u)); draw p[2] -- ( xpart p[2], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[2]); xpart mid[2] = xpart(p[2]); ypart mid[2] = (ypart(p[2])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[2]); label.rt( btex $\lambda=0.001700$ etex, mid[2] + (0,-0.150000u)); draw p[3] -- ( xpart p[3], ypart p[7] ) -- p[7] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[3]); xpart mid[3] = xpart(p[3]); ypart mid[3] = (ypart(p[3])+ypart(p[7]))/2; label.rt( btex $l = 6$ etex, mid[3]); label.rt( btex $\lambda=0.001700$ etex, mid[3] + (0,-0.150000u)); draw p[4] -- ( xpart p[4], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[4]); xpart mid[4] = xpart(p[4]); ypart mid[4] = (ypart(p[4])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[4]); label.rt( btex $\lambda=0.001700$ etex, mid[4] + (0,-0.150000u)); draw p[5] -- ( xpart p[5], ypart p[3] ) -- p[3] ; label.urt( btex 0 \small{(0.500, 0.500)} etex, p[5]); xpart mid[5] = xpart(p[5]); ypart mid[5] = (ypart(p[5])+ypart(p[3]))/2; label.rt( btex $l = 70$ etex, mid[5]); label.rt( btex $\lambda=0.001700$ etex, mid[5] + (0,-0.150000u)); draw p[6] -- ( xpart p[6], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[6]); xpart mid[6] = xpart(p[6]); ypart mid[6] = (ypart(p[6])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[6]); label.rt( btex $\lambda=0.001700$ etex, mid[6] + (0,-0.150000u)); draw p[7] -- ( p[7] + (0,0.333333u) ); label.urt( btex 1 \small{(0.015, 0.186)} etex, p[7]); draw p[8] -- ( xpart p[8], ypart p[7] ) -- p[7] ; label.urt( btex 0 etex, p[8]); xpart mid[8] = xpart(p[8]); ypart mid[8] = (ypart(p[8])+ypart(p[7]))/2; label.rt( btex $l = 93$ etex, mid[8]); label.rt( btex $\lambda=0.001700$ etex, mid[8] + (0,-0.150000u)); % add name labeloffset := 10; dotlabel.bot(btex chimp etex, p[0]); labeloffset := 10; dotlabel.bot(btex human etex, p[2]); labeloffset := 10; dotlabel.bot(btex mouse etex, p[4]); labeloffset := 10; dotlabel.bot(btex rat etex, p[6]); labeloffset := 10; dotlabel.bot(btex dog etex, p[8]); % Mark duplication % annotation label( btex etex, (0.1u, 7.700000u)); label( btex ENSF00000002057 etex, (0.1u, 7.500000u)); label(btex Max p-value = 0.000 etex, (0.1u, 7.300000u)); endfig; beginfig(2) u:=1in; pair p[]; pair mid[]; p0 = (0.000000u,0.000000u); p1 = (0.875000u,2.333333u); p2 = (1.750000u,0.000000u); p3 = (2.625000u,4.666667u); From nvitacolonna at gmail.com Fri Jul 31 08:27:34 2009 From: nvitacolonna at gmail.com (Nicola) Date: Fri, 31 Jul 2009 08:27:34 +0200 Subject: [metapost] Attn: Taco References: <4A71D20B.6070005@broadinstitute.org> Message-ID: In article <4A71D20B.6070005 at broadinstitute.org>, Mia Champion wrote: > Hi, > > I am not at all familiar with the metapost language and have an output > file from a program that I am using for genome analysis (see below). > In order for the data to be linked into other output files from the > program, the metapost script below must be converted into individual pdf > files. > I have tried a couple of different metapost converters online just to > see what the output would look like and keep getting errors that quit > the conversion and seem to > have general trouble with the code. I would really appreciate it if a > metapost expert could give me advice regarding this code and what might > be the best conversion > program to use in order to generate pdf image files (the image outputs > are phylogenetic trees). > > Thanks so much, > > Mia Try prefixing your code by: verbatimtex %&latex \documentclass{article} \begin{document} etex Nicola From mojca.miklavec.lists at gmail.com Fri Jul 31 09:22:39 2009 From: mojca.miklavec.lists at gmail.com (Mojca Miklavec) Date: Fri, 31 Jul 2009 09:22:39 +0200 Subject: [metapost] Attn: Taco In-Reply-To: References: <4A71D20B.6070005@broadinstitute.org> Message-ID: <6faad9f00907310022k4d5faeecpae33e6b3b3054edb@mail.gmail.com> On Fri, Jul 31, 2009 at 08:27, Nicola wrote: > ?Mia Champion wrote: > >> Hi, >> >> I am not at all familiar with the metapost language and have an output >> file from a program that I am using for genome analysis (see below). >> In order for the data to be linked into other output files from the >> program, the metapost script below must be converted into individual pdf >> files. >> I have tried a couple of different metapost converters online just to >> see what the output would look like and keep getting errors that quit >> the conversion and seem to >> have general trouble with the code. ?I would really appreciate it if a >> metapost expert could give me advice regarding this code and what might >> be the best conversion >> program to use in order to generate pdf image files (the image outputs >> are phylogenetic trees). >> >> Thanks so much, >> >> Mia > > Try prefixing your code by: > > verbatimtex > %&latex > \documentclass{article} > \begin{document} > etex Or, if these images are generated automatically, create a new file (for exaple "tree.mp") with the following contents: verbatimtex %&latex \documentclass{article} \begin{document} etex input originalfile.mp; You can then use mptopdf yourfile.mp for conversion. I have no idea why http://www.tlhiv.org/mppreview/ fails to generate proper ouput, it might be that \documentclass{minimal} that he uses by default and you cannot change it doesn't support the command \small used in your code. I hope that you have deliberately cutted the end of script (it ends in the middle and would not compile as such unless you have cutted it). File must end with endfigure; end. Try to install TeX Live (MikTeX is user friendly, but it stopped supporting mptopdf more than one year ago). You need to have Perl installed, but if you are analyzing genomes I don't doubt you have it installed already. Mojca -------------- If you just want a preview, paste the following code to http://www.tlhiv.org/mppreview/ (note that I have removed beginning and end of file + removed the command \small): u:=1in; pair p[]; pair mid[]; p0 = (0.000000u,0.000000u); p1 = (0.875000u,2.333333u); p2 = (1.750000u,0.000000u); p3 = (2.625000u,4.666667u); p4 = (3.500000u,0.000000u); p5 = (4.375000u,2.333333u); p6 = (5.250000u,0.000000u); p7 = (3.500000u,7.000000u); p8 = (7.000000u,0.000000u); % draw line draw p[0] -- ( xpart p[0], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[0]); xpart mid[0] = xpart(p[0]); ypart mid[0] = (ypart(p[0])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[0]); label.rt( btex $\lambda=0.001700$ etex, mid[0] + (0,-0.150000u)); draw p[1] -- ( xpart p[1], ypart p[3] ) -- p[3] ; label.urt( btex 0 {(0.500, 0.500)} etex, p[1]); xpart mid[1] = xpart(p[1]); ypart mid[1] = (ypart(p[1])+ypart(p[3]))/2; label.rt( btex $l = 81$ etex, mid[1]); label.rt( btex $\lambda=0.001700$ etex, mid[1] + (0,-0.150000u)); draw p[2] -- ( xpart p[2], ypart p[1] ) -- p[1] ; label.urt( btex 0 etex, p[2]); xpart mid[2] = xpart(p[2]); ypart mid[2] = (ypart(p[2])+ypart(p[1]))/2; label.rt( btex $l = 6$ etex, mid[2]); label.rt( btex $\lambda=0.001700$ etex, mid[2] + (0,-0.150000u)); draw p[3] -- ( xpart p[3], ypart p[7] ) -- p[7] ; label.urt( btex 0 {(0.500, 0.500)} etex, p[3]); xpart mid[3] = xpart(p[3]); ypart mid[3] = (ypart(p[3])+ypart(p[7]))/2; label.rt( btex $l = 6$ etex, mid[3]); label.rt( btex $\lambda=0.001700$ etex, mid[3] + (0,-0.150000u)); draw p[4] -- ( xpart p[4], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[4]); xpart mid[4] = xpart(p[4]); ypart mid[4] = (ypart(p[4])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[4]); label.rt( btex $\lambda=0.001700$ etex, mid[4] + (0,-0.150000u)); draw p[5] -- ( xpart p[5], ypart p[3] ) -- p[3] ; label.urt( btex 0 {(0.500, 0.500)} etex, p[5]); xpart mid[5] = xpart(p[5]); ypart mid[5] = (ypart(p[5])+ypart(p[3]))/2; label.rt( btex $l = 70$ etex, mid[5]); label.rt( btex $\lambda=0.001700$ etex, mid[5] + (0,-0.150000u)); draw p[6] -- ( xpart p[6], ypart p[5] ) -- p[5] ; label.urt( btex 0 etex, p[6]); xpart mid[6] = xpart(p[6]); ypart mid[6] = (ypart(p[6])+ypart(p[5]))/2; label.rt( btex $l = 17$ etex, mid[6]); label.rt( btex $\lambda=0.001700$ etex, mid[6] + (0,-0.150000u)); draw p[7] -- ( p[7] + (0,0.333333u) ); label.urt( btex 1 {(0.015, 0.186)} etex, p[7]); draw p[8] -- ( xpart p[8], ypart p[7] ) -- p[7] ; label.urt( btex 0 etex, p[8]); xpart mid[8] = xpart(p[8]); ypart mid[8] = (ypart(p[8])+ypart(p[7]))/2; label.rt( btex $l = 93$ etex, mid[8]); label.rt( btex $\lambda=0.001700$ etex, mid[8] + (0,-0.150000u)); % add name labeloffset := 10; dotlabel.bot(btex chimp etex, p[0]); labeloffset := 10; dotlabel.bot(btex human etex, p[2]); labeloffset := 10; dotlabel.bot(btex mouse etex, p[4]); labeloffset := 10; dotlabel.bot(btex rat etex, p[6]); labeloffset := 10; dotlabel.bot(btex dog etex, p[8]); % Mark duplication % annotation label( btex etex, (0.1u, 7.700000u)); label( btex ENSF00000002057 etex, (0.1u, 7.500000u)); label(btex Max p-value = 0.000 etex, (0.1u, 7.300000u)); From taco at elvenkind.com Fri Jul 31 11:57:48 2009 From: taco at elvenkind.com (Taco Hoekwater) Date: Fri, 31 Jul 2009 11:57:48 +0200 Subject: [metapost] MetaPost 1.206 announcement Message-ID: <4A72C01C.6010606@elvenkind.com> The MetaPost team is happy to announce a new release of MetaPost: ---------------------------------------------------------------------- MetaPost 1.206 ---------------------------------------------------------------------- The standalone distribution package and a win32 binary can be downloaded immediately from http://foundry.supelec.fr/gf/project/metapost/ This release will also be available from CTAN soon, and it will be included in the next TeXLive. The source package should compile normally on all systems that are capable of compiling a modern web2c-based TeX distribution. The win32 binary is intended for texlive or a similar web2c-based installation, this executable will *not* work for miktex. Of course, we welcome any comments (either good or bad) that you may have. Simply replying to this message is fine, but see the bottom of the message for a more formal way to report bugs and feature requests. ---------------------------------------------------------------------- What is new in MetaPost version 1.206 ---------------------------------------------------------------------- * Many of the commands in the MP language cause strings in the string pool to be printed to new strings that are also built up in the string pool. This could cause crashes when the new string wouldn't fit in the memory allocated. * Failure to initialize the jobname in the MP_options struct could cause crashes in library mode. ---------------------------------------------------------------------- Legal notice / license / bug reports ---------------------------------------------------------------------- MetaPost is a system for producing graphics developed by John Hobby at AT&T, based on Donald Knuth's Metafont. The MetaPost home page is http://tug.org/metapost. MetaPost is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The MetaPost development project is currently hosted at Supelec, http://foundry.supelec.fr/gf/project/metapost; please report bugs and request enhancements through there if possible. Alternatively, you can reach us through the mailing list as well. Have fun! Taco Hoekwater, for the MetaPost team, July 31, 2009.