From andrej.kupecky at gmail.com Sat Sep 7 12:22:10 2013 From: andrej.kupecky at gmail.com (Peter Zeman) Date: Sat, 7 Sep 2013 12:22:10 +0200 Subject: [metapost] mpost: list of all output file names Message-ID: Hello. I'm writing a program, which needs to know the name of each output file produced from compiling a MetaPost soucre file. Is there a way to force 'mpost' to print all output file names and not just the name of the first one and the last one? Another option would be to collect all outputtemplates, create regular expression and search the directory, but I would like to avoid this if possible. Is there a way the get the list of all output file names? Thank you for your answers! Peter Zeman From dabell at bikerider.com Sun Sep 8 20:31:11 2013 From: dabell at bikerider.com (Dan T. Abell) Date: Sun, 8 Sep 2013 12:31:11 -0600 Subject: [metapost] mpost: list of all output file names In-Reply-To: References: Message-ID: <62F4B633-7E0C-4EB1-B83C-2D9838311E19@bikerider.com> I do this in a bash script, so ... epsfiles=`/usr/bin/find . -type f -newer $jobname.mp -name "${jobname}*[0-9]*.eps"` Of course that may not be sufficiently general for you .... What sort of program are you writing? -Dan On 7 Sep 2013, at 04:22, Peter Zeman wrote: > Hello. > > I'm writing a program, which needs to know the name of each output > file produced from compiling a MetaPost soucre file. > > Is there a way to force 'mpost' to print all output file names and not > just the name of the first one and the last one? > > Another option would be to collect all outputtemplates, create regular > expression and search the directory, but I would like to avoid this if > possible. > > Is there a way the get the list of all output file names? > > Thank you for your answers! > > Peter Zeman > -- > http://tug.org/metapost/ From andrej.kupecky at gmail.com Mon Sep 9 12:04:17 2013 From: andrej.kupecky at gmail.com (Peter Zeman) Date: Mon, 9 Sep 2013 12:04:17 +0200 Subject: [metapost] mpost: list of all output file names In-Reply-To: <62F4B633-7E0C-4EB1-B83C-2D9838311E19@bikerider.com> References: <62F4B633-7E0C-4EB1-B83C-2D9838311E19@bikerider.com> Message-ID: Hi. 2013/9/8 Dan T. Abell : > Of course that may not be sufficiently general for you .... Yes, it's not sufficiently general, but I think, that I will make it configurable. > What sort of program are you writing? I'm writing something like an instant previewer, it will be a desktop application. The point is that apart from some existing previewers, you will be able to use whatever text editor you like (it is Vim in my case). When you modify some ".mp" file, the application will detect it and show you how the EPS image you are working on looks like (it uses a python script to create PDF files and then it uses some library to view the pdf files). The application can be theoretically extended to any language you want, for example if you write vector graphics in asymptote, it is no problem. One just needs to write program, which compiles asymtote and produces PDF files. There are some special requirements for such programs. The applications pumps paths to the modified files into the program and expects paths to PDF files produced by the compilation program. In case of some compilation error it expects an error message, which will be displayed. Well, thats basically it. I think it could be real time saver. Maybe in a week or two I can send a link. I am open to any suggestions. Peter Zeman From kakuto at fuk.kindai.ac.jp Tue Sep 10 00:51:18 2013 From: kakuto at fuk.kindai.ac.jp (Akira Kakuto) Date: Tue, 10 Sep 2013 07:51:18 +0900 Subject: [metapost] mpost: list of all output file names Message-ID: <193F760A1C6E480089DBD708CEA8188F@CJ3001517a> Hello, > I'm writing a program, which needs to know the name of each output > file produced from compiling a MetaPost soucre file. Try mpost --recorder source and see an output source.fls. I don't know whether it satisfies your requirement or not. Best regards, Akira KAKUTO From paul.pichaureau at alcandre.net Thu Sep 19 21:40:50 2013 From: paul.pichaureau at alcandre.net (Paul Pichaureau) Date: Thu, 19 Sep 2013 21:40:50 +0200 Subject: [metapost] Tfm generation broken Message-ID: Hi, I think the tfm generation is still broken in metapost 1.802 (I use the last Miktex distribution on windows 8). For example, if you compile the following file "test.mf" fontmaking:=1; designsize := 10; fontdimen5: 5; % xheight end. This is the pl file obtained: (DESIGNSIZE R 10.0) (COMMENT DESIGNSIZE IS IN POINTS) (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) (CHECKSUM O 37700177400) (FONTDIMEN (SLANT R 0.0) (SPACE R 0.0) (STRETCH R 0.0) (SHRINK R 0.0) (XHEIGHT R 0.03125) ) As you can see, the xheight has a completly wrong value. (I'm the developper of the mathdesign fonts, which are completly done with metapost, so this problem is very annoying for me!) -- Paul Pichaureau -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.pichaureau at alcandre.net Thu Sep 19 21:45:24 2013 From: paul.pichaureau at alcandre.net (Paul Pichaureau) Date: Thu, 19 Sep 2013 21:45:24 +0200 Subject: [metapost] Strange behavior of turningnumber Message-ID: Hi (again), I've to say that I'm very impressed by the progress on metapost. The new numbersystem feature is a big improvement ! Anyway, in mpost 1.802, I've find this strange behavior of turningnumber: z1 = (50,50); z2 = (100,50); z3= (100,100); z4 = (50,100); path p,q; p = (z1---z2..z3---z4--cycle); % p counterclockwise q = (reverse p); show (turningnumber p); show (turningnumber q); end. The turningnumber of p is 1, but the turningnumber of q is 0 -- Paul Pichaureau -------------- next part -------------- An HTML attachment was scrubbed... URL: From taco at elvenkind.com Fri Sep 20 16:44:05 2013 From: taco at elvenkind.com (Taco Hoekwater) Date: Fri, 20 Sep 2013 16:44:05 +0200 Subject: [metapost] Strange behavior of turningnumber In-Reply-To: References: Message-ID: <523C5F35.1040908@elvenkind.com> On 09/19/2013 09:45 PM, Paul Pichaureau wrote: > Hi (again), > > I've to say that I'm very impressed by the progress on metapost. The new > numbersystem feature is a big improvement ! Thanks! > Anyway, in mpost 1.802, I've find this strange behavior of turningnumber: No time right now, so: http://tracker.luatex.org/view.php?id=854 Best wishes, Taco From taco at elvenkind.com Fri Sep 20 17:02:23 2013 From: taco at elvenkind.com (Taco Hoekwater) Date: Fri, 20 Sep 2013 17:02:23 +0200 Subject: [metapost] Tfm generation broken In-Reply-To: References: Message-ID: <523C637F.5060108@elvenkind.com> On 09/19/2013 09:40 PM, Paul Pichaureau wrote: > Hi, > > I think the tfm generation is still broken in metapost 1.802 (I use the > last Miktex distribution on windows 8). > > For example, if you compile the following file "test.mf" > > > fontmaking:=1; > > designsize := 10; > fontdimen5: 5; % xheight > > end. > > This is the pl file obtained: > > (DESIGNSIZE R 10.0) > (COMMENT DESIGNSIZE IS IN POINTS) > (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) > (CHECKSUM O 37700177400) > (FONTDIMEN > (SLANT R 0.0) > (SPACE R 0.0) > (STRETCH R 0.0) > (SHRINK R 0.0) > (XHEIGHT R 0.03125) > ) > > As you can see, the xheight has a completly wrong value. This bug was easy to fix: Index: ../../../source/texk/web2c/mplibdir/mp.w =================================================================== --- ../../../source/texk/web2c/mplibdir/mp.w (revision 1923) +++ ../../../source/texk/web2c/mplibdir/mp.w (working copy) @@ -32727,7 +32727,7 @@ mp_number arg1; new_number (arg1); number_clone (arg1, x); - number_multiply_int (x, 16); + number_multiply_int (arg1, 16); make_scaled (x, arg1, internal_value (mp_design_size)); free_number (arg1); } but I created a tracker item just in case: http://tracker.luatex.org/view.php?id=855 Best wishes, Taco From paul.pichaureau at alcandre.net Mon Sep 23 10:30:34 2013 From: paul.pichaureau at alcandre.net (Paul Pichaureau) Date: Mon, 23 Sep 2013 10:30:34 +0200 Subject: [metapost] Tfm generation broken In-Reply-To: <523C637F.5060108@elvenkind.com> References: <523C637F.5060108@elvenkind.com> Message-ID: 2013/9/20 Taco Hoekwater > On 09/19/2013 09:40 PM, Paul Pichaureau wrote: > >> Hi, >> >> I think the tfm generation is still broken in metapost 1.802 (I use the >> last Miktex distribution on windows 8). >> >> For example, if you compile the following file "test.mf" >> >> >> fontmaking:=1; >> >> designsize := 10; >> fontdimen5: 5; % xheight >> >> end. >> >> This is the pl file obtained: >> >> (DESIGNSIZE R 10.0) >> (COMMENT DESIGNSIZE IS IN POINTS) >> (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) >> (CHECKSUM O 37700177400) >> (FONTDIMEN >> (SLANT R 0.0) >> (SPACE R 0.0) >> (STRETCH R 0.0) >> (SHRINK R 0.0) >> (XHEIGHT R 0.03125) >> ) >> >> As you can see, the xheight has a completly wrong value. >> > > This bug was easy to fix: > > Index: ../../../source/texk/web2c/**mplibdir/mp.w > ==============================**==============================**======= > --- ../../../source/texk/web2c/**mplibdir/mp.w (revision 1923) > +++ ../../../source/texk/web2c/**mplibdir/mp.w (working copy) > @@ -32727,7 +32727,7 @@ > mp_number arg1; > new_number (arg1); > number_clone (arg1, x); > - number_multiply_int (x, 16); > + number_multiply_int (arg1, 16); > make_scaled (x, arg1, internal_value (mp_design_size)); > free_number (arg1); > } > > > > but I created a tracker item just in case: > > http://tracker.luatex.org/**view.php?id=855 > I'm sorry I didn't create a tracker for that! Next time I will. Thanks ! > > Best wishes, > Taco > > -- Paul Pichaureau -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.pichaureau at alcandre.net Mon Sep 23 10:48:38 2013 From: paul.pichaureau at alcandre.net (Paul Pichaureau) Date: Mon, 23 Sep 2013 10:48:38 +0200 Subject: [metapost] A small problem with "--numbersystem=double" Message-ID: Hi! This time it's not a bug, but an apparently strange behavior of metapost. The following definition is very basic in computer modern sources : vardef stroke text t = hide(forsuffixes e = l,r: path_.e:=t; endfor;) ((path_.l) .. (reverse (path_.r)) .. cycle) enddef; The following code simulates a pen stroke between two points: pair p[].l, p[].r; p1.l = (0,0); p1.r = (10,10); p2.l = (100,0); p2.r = (100,100); beginfig(1); draw stroke (p1.e+p2.e) -- (p2.e); endfig; end. The preceding code works perfectly fine with mpost, but leads to an error with mpost --numbersystem=double I think the problem came from (p1.e+p2.e) -- (p2.e); where "1e.+" is read by metapost as the begining of a number. It's not a bug, just a point to take in account in future codes. Cheers -- Paul Pichaureau -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.pichaureau at alcandre.net Mon Sep 23 16:10:32 2013 From: paul.pichaureau at alcandre.net (Paul Pichaureau) Date: Mon, 23 Sep 2013 16:10:32 +0200 Subject: [metapost] Tfm generation broken In-Reply-To: References: <523C637F.5060108@elvenkind.com> Message-ID: Hi, I'm the developper of the mathdesign fonts. All of the outlines of these fonts are produced from metapost sources (and then "packaged" as a font by a python script). Right now, I'm completly stuck. I cannot improve the fonts, and some important bugs on mathdesign are yet to be solved. To cut a long story short, I really need that this bug is solved on my system. Do you think it could be possible to do a release of metapost in a short delay ? Of course, it"s not so urgent. I just want to be sure that it will be done soon. Thank you very much! 2013/9/23 Paul Pichaureau > > > > 2013/9/20 Taco Hoekwater > >> On 09/19/2013 09:40 PM, Paul Pichaureau wrote: >> >>> Hi, >>> >>> I think the tfm generation is still broken in metapost 1.802 (I use the >>> last Miktex distribution on windows 8). >>> >>> For example, if you compile the following file "test.mf" >>> >>> >>> fontmaking:=1; >>> >>> designsize := 10; >>> fontdimen5: 5; % xheight >>> >>> end. >>> >>> This is the pl file obtained: >>> >>> (DESIGNSIZE R 10.0) >>> (COMMENT DESIGNSIZE IS IN POINTS) >>> (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) >>> (CHECKSUM O 37700177400) >>> (FONTDIMEN >>> (SLANT R 0.0) >>> (SPACE R 0.0) >>> (STRETCH R 0.0) >>> (SHRINK R 0.0) >>> (XHEIGHT R 0.03125) >>> ) >>> >>> As you can see, the xheight has a completly wrong value. >>> >> >> This bug was easy to fix: >> >> Index: ../../../source/texk/web2c/**mplibdir/mp.w >> ==============================**==============================**======= >> --- ../../../source/texk/web2c/**mplibdir/mp.w (revision 1923) >> +++ ../../../source/texk/web2c/**mplibdir/mp.w (working copy) >> @@ -32727,7 +32727,7 @@ >> mp_number arg1; >> new_number (arg1); >> number_clone (arg1, x); >> - number_multiply_int (x, 16); >> + number_multiply_int (arg1, 16); >> make_scaled (x, arg1, internal_value (mp_design_size)); >> free_number (arg1); >> } >> >> >> >> but I created a tracker item just in case: >> >> http://tracker.luatex.org/**view.php?id=855 >> > > I'm sorry I didn't create a tracker for that! Next time I will. > > Thanks ! > > > >> >> Best wishes, >> Taco >> >> > > > -- > Paul Pichaureau > > -- Paul Pichaureau -------------- next part -------------- An HTML attachment was scrubbed... URL: From metapost at cfraizer.com Mon Sep 23 17:58:03 2013 From: metapost at cfraizer.com (Colin Fraizer) Date: Mon, 23 Sep 2013 11:58:03 -0400 Subject: [metapost] Faster SVG Generation with Metapost? Message-ID: <009b01ceb875$b0965650$11c302f0$@cfraizer.com> [I?m not sure what etiquette exists for cross-posting questions from TeX.SE and here, but I was hoping someone could answer without expending significant effort.] I am generating some diagrams with METAPOST. I need the output in SVG format. My labels are generated by calls to LaTeX via?Tex.mp?and its?TEX?METAPOST definition (also called a macro). My complaint: it is pretty slow to constantly write stuff to a file and fire off an instance of?latex. Is there a faster way to achieve the same result? (As I recall, I can use METAPOST inside a TeX document with the package?luamplib, which is fast, but it generates PDF, not SVG.) Using MetaPost 1.802 (TeX Live 2013/W32TeX). Command: mpost --numbersystem=double --file-line-error --halt-on-error --tex=latex foo.mp Thanks! --Colin Fraizer Indiana, United States Minimal example: prologues:=3; input TEX; outputformat := "svg"; outputtemplate:="%j.%{outputformat}"; string texpre; % texpre = "%&latex" & char(10) & texpre = "\documentclass{article}" & char(10) & "\begin{document} " & char(10); TEXPRE(texpre); TEXPOST("\end{document}"); beginfig(1) draw fullcircle scaled 1in; string l; l = "Foo"; dotlabel.bot(TEX("Label is " & l), origin); endfig; end From taco at elvenkind.com Mon Sep 23 18:09:57 2013 From: taco at elvenkind.com (Taco Hoekwater) Date: Mon, 23 Sep 2013 18:09:57 +0200 Subject: [metapost] Tfm generation broken In-Reply-To: References: <523C637F.5060108@elvenkind.com> Message-ID: <58F8A457-FE3A-4D04-B489-43202E4E108A@elvenkind.com> On Sep 23, 2013, at 4:10 PM, Paul Pichaureau wrote: > Hi, > > I'm the developper of the mathdesign fonts. All of the outlines of these fonts are produced from metapost sources (and then "packaged" as a font by a python script). > > Right now, I'm completly stuck. I cannot improve the fonts, and some important bugs on mathdesign are yet to be solved. > > To cut a long story short, I really need that this bug is solved on my system. Do you think it could be possible to do a release of metapost in a short delay ? You could compile from source of course, but I plan to have a release in about two weeks. Besides this bugfix and a few texlive-related changes, that will also include the 'decimal' number system in an early test version. Best wishes, Taco From laurent.mehats at gmail.com Thu Sep 26 16:46:48 2013 From: laurent.mehats at gmail.com (=?ISO-8859-1?Q?Laurent_M=E9hats?=) Date: Thu, 26 Sep 2013 16:46:48 +0200 Subject: [metapost] mpost: list of all output file names In-Reply-To: References: Message-ID: <524448D8.8030502@gmail.com> Le 07/09/2013 12:22, Peter Zeman a ?crit : > Hello. > > I'm writing a program, which needs to know the name of each output > file produced from compiling a MetaPost soucre file. > > Is there a way to force 'mpost' to print all output file names and not > just the name of the first one and the last one? > > Another option would be to collect all outputtemplates, create regular > expression and search the directory, but I would like to avoid this if > possible. > > Is there a way the get the list of all output file names? > > Thank you for your answers! > > Peter Zeman > -- > http://tug.org/metapost/ > Hello, You may use the "outputfilename" internal string, which is available since MetaPost version 1.800. Here is its description in the announcement. What is new in MetaPost version 1.800: * A new string-valued internal "outputfilename", which is set by "shipout" to the value of the just created file name. Until the first shipout has occurred, it is the empty string. "shipout" is usually called by "shipit" which itself is called by "endfig". So you may add a command using "outputfilename" after each "endfig". Example: --%<-- test1.mp outputtemplate:="%j-%c.mps"; for idx=0 upto 4: beginfig(idx) draw origin; endfig; message outputfilename; endfor end; --%<-- test1.mp Both "endfig" and "shipit" are defined in plain.mp: def shipit = shipout currentpicture enddef; def endfig = scantokens extra_endfig; shipit; endgroup enddef; So you may also redefine "shipit" or "endfig" to take "outputfilename" into account. Example: --%<-- test2.mp outputtemplate:="%j-%c.mps"; def shipit = shipout currentpicture; message outputfilename; enddef; for idx=0 upto 4: beginfig(idx) draw origin; endfig; endfor end; --%<-- test2.mp Then to get a list of all output file names, you may redefine "shipit" to build it or to write it to a file. Example: --%<-- test3.mp outputtemplate:="%j-%c.mps"; string list, listfile; list:=""; listfile:="list.txt"; def shipit = shipout currentpicture; list:=list&outputfilename&" "; write outputfilename to listfile; enddef; for idx=0 upto 4: beginfig(idx) draw origin; endfig; endfor message list; end; --%<-- test3.mp Regards, Laurent M?hats From laurent.mehats at gmail.com Thu Sep 26 16:46:48 2013 From: laurent.mehats at gmail.com (=?ISO-8859-1?Q?Laurent_M=E9hats?=) Date: Thu, 26 Sep 2013 16:46:48 +0200 Subject: [metapost] mpost: list of all output file names In-Reply-To: References: Message-ID: <524448D8.8030502@gmail.com> Le 07/09/2013 12:22, Peter Zeman a ?crit : > Hello. > > I'm writing a program, which needs to know the name of each output > file produced from compiling a MetaPost soucre file. > > Is there a way to force 'mpost' to print all output file names and not > just the name of the first one and the last one? > > Another option would be to collect all outputtemplates, create regular > expression and search the directory, but I would like to avoid this if > possible. > > Is there a way the get the list of all output file names? > > Thank you for your answers! > > Peter Zeman > -- > http://tug.org/metapost/ > Hello, You may use the "outputfilename" internal string, which is available since MetaPost version 1.800. Here is its description in the announcement. What is new in MetaPost version 1.800: * A new string-valued internal "outputfilename", which is set by "shipout" to the value of the just created file name. Until the first shipout has occurred, it is the empty string. "shipout" is usually called by "shipit" which itself is called by "endfig". So you may add a command using "outputfilename" after each "endfig". Example: --%<-- test1.mp outputtemplate:="%j-%c.mps"; for idx=0 upto 4: beginfig(idx) draw origin; endfig; message outputfilename; endfor end; --%<-- test1.mp Both "endfig" and "shipit" are defined in plain.mp: def shipit = shipout currentpicture enddef; def endfig = scantokens extra_endfig; shipit; endgroup enddef; So you may also redefine "shipit" or "endfig" to take "outputfilename" into account. Example: --%<-- test2.mp outputtemplate:="%j-%c.mps"; def shipit = shipout currentpicture; message outputfilename; enddef; for idx=0 upto 4: beginfig(idx) draw origin; endfig; endfor end; --%<-- test2.mp Then to get a list of all output file names, you may redefine "shipit" to build it or to write it to a file. Example: --%<-- test3.mp outputtemplate:="%j-%c.mps"; string list, listfile; list:=""; listfile:="list.txt"; def shipit = shipout currentpicture; list:=list&outputfilename&" "; write outputfilename to listfile; enddef; for idx=0 upto 4: beginfig(idx) draw origin; endfig; endfor message list; end; --%<-- test3.mp Regards, Laurent M?hats From dirk.laurie at gmail.com Thu Sep 26 18:11:29 2013 From: dirk.laurie at gmail.com (Dirk Laurie) Date: Thu, 26 Sep 2013 18:11:29 +0200 Subject: [metapost] Asymptote Message-ID: The authors of the vector graphics language Asymptote state: "It was inspired by an earlier drawing program (with a weaker syntax and capabilities) called MetaPost." They don't say, but it can hardly be a coincidence, that ASMPTOTE is an anagram of METAPOST. Would that snide remark, assuming it was true for MetaPost 1.2 or whatever it was when Asymptote split off four years ago, still be plausible for MetaPost 1.8? From samjnaa at gmail.com Thu Sep 26 18:38:25 2013 From: samjnaa at gmail.com (Shriramana Sharma) Date: Thu, 26 Sep 2013 22:08:25 +0530 Subject: [metapost] Asymptote In-Reply-To: References: Message-ID: On Thu, Sep 26, 2013 at 9:41 PM, Dirk Laurie wrote: > > Would that snide remark, assuming it was true for MetaPost 1.2 > or whatever it was when Asymptote split off four years ago, still > be plausible for MetaPost 1.8? AFAIK Asy was written from scratch and there was no code forking. MP is written in (this highly unweildy language called) WEBC whereas Asy is in C++. And I don't see why you would call that a snide remark. I personally shifted to Asy once I discovered it and have been able to write much more complex programs in it than I would have been able to write in the macro-based language that is MetaPost... -- Shriramana Sharma ???????????? ????????????