15 Dec 2013 12:30

### Bug in MetaPost

Hello!

I've already written that (2012/03/24), but there is no change...

I'm on Windows 7, MiKTeX 2.9 (64 bits), MetaPost 1.803.

Here is my file test.mp:

%%%%%%%%%%%%%%%%%%%%%%%%%%
prologues:=3;
outputtemplate:="%j.eps";
beginfig(0)
label(btex $-\infty$ etex,(0,20));%%%%%%% 1
label(btex $\null-\infty$ etex,(0,0));%%% 2
label(btex $-\!\infty$ etex,(0,-20));%%%% 3
label(btex $-\,\infty$ etex,(0,-40));%%%% 4
label(btex $-\,\!\infty$ etex,(0,-60));%% 5
label(btex $+\infty$ etex,(0,-80));%%%%%% 6
endfig;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%

When I make:

mpost -debug test.mp

I obtain a curious file test.eps (see the labels 1 and 5).

Is there a chance to see that bug repaired ?



26 Sep 2013 18:11

### Asymptote

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?
--
http://tug.org/metapost/


23 Sep 2013 17:58

### Faster SVG Generation with Metapost?

[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}";



23 Sep 2013 10:48

### A small problem with "--numbersystem=double"

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

--
http://tug.org/metapost/
20 Sep 2013 16:44

### Re: Strange behavior of turningnumber

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
--
http://tug.org/metapost/


19 Sep 2013 21:45

### Strange behavior of turningnumber

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

--
http://tug.org/metapost/
19 Sep 2013 21:40

### Tfm generation broken

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

--
http://tug.org/metapost/
7 Sep 2013 12:22

### mpost: list of all output file names

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?

Peter Zeman
--
http://tug.org/metapost/


30 Jul 2013 22:24

### Metapost btex etex problem

Hello,

I have a problem with the use of btex ... etex in MetaPost figures. Searching already for quite a while I found
a lot of similar issues but unfortunately without a  solution.

The installation I am using is a recent installed TeX Live 2013 on Windows 8 (64bit) .  I used the
install-tl-advanced.bat for installation (including "full scheme").

I want to  compile the following (reduced) example mpsimple.mp:

verbatimtex
%&pdflatex
\documentclass[12pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
etex
beginfig(1)
draw (0,0)--(5cm,0) withpen pencircle scaled 1pt;
label.rt(btex $A$ etex, (5cm, 0cm));
endfig;
end;
%% End

Trying to compile with "mpost  - -debug mpsimple.mp" I obtain the following message (compiling without -
-debug or "mpost -tex=pdflatex mpsimple.mp"
yields the same problem):

C:\tmp>mpost --debug mpsimple.mp
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mpost.mp (c:/rt/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.004) ) (./mpsimple.mpmakempx debug: ./mpsimple.mp: running
command etex --parse
-first-line --interaction=nonstopmode mpa04972.tex
makempx debug: ./mpsimple.mp: renaming mpa04972.tex to mpxerr.tex
makempx debug: ./mpsimple.mp: renaming mpa04972.log to mpxerr.log
fatal: Command failed: etex --parse-first-line --interaction=nonstopmode mpa04972.tex; see
mpxerr.logmakempx fatal: ./mp
simple.mp: Command failed: etex --parse-first-line --interaction=nonstopmode mpa04972.tex; see mpxerr.log

>> mpsimple.mp
>> mpsimple.mpx
! ! Unable to make mpx file.
l.10   label.rt(btex
$A$ etex, (5cm, 1cm));
Transcript written on mpsimple.log.

There is no mpxerr.log file. The file mpa04972.tex contains:

%&pdflatex
\documentclass[12pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}

\gdef\mpxshipout{\shipout\hbox\bgroup
\setbox0=\hbox\bgroup}
\dimen1=\ht0 \dimen2=\dp0
\setbox0=\hbox\bgroup
\box0
\ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2
\else \vrule width1sp height1sp depth0sp\relax
\fi\egroup
\ht0=0pt \dp0=0pt \box0 \egroup}
\mpxshipout% line 10 ./mpsimple.mp
$A$%
\stopmpxshipout
\end{document}

If I try to " etex --parse-first-line mpa04972.tex" or "pdflatex mpa04972.tex", everything looks fine:

C:\tmp>etex --parse-first-line mpa04972.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
restricted \write18 enabled.
entering extended mode
(./mpa04972.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/size12.clo))
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/inputenc.sty
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/latin1.def))
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/fontenc.sty
(c:/rt/texlive/2013/texmf-dist/tex/latex/base/t1enc.def))
No file mpa04972.aux.
[1{c:/rt/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mpa04972.aux) )<c:/rt/texlive/2013/texmf-dist/fonts/type1/public/amsfonts/cm
/cmmi12.pfb>
Output written on mpa04972.pdf (1 page, 8363 bytes).
Transcript written on mpa04972.log.

The resulting mpa04972.pdf contains the letter A with a vertical bar on the right hand side of the A.

I don't have a clue. Can anybody please give me a hint? Any help would be appreciated.

Ralf

--
http://tug.org/metapost/


23 Jul 2013 16:10

### A query about metafont/post's capabilities (for CNC)

I've recently become interested in CNC, and have been considering using METAPOST in a CNC work-flow (I
think I can use pstoedit to convert .pdf (or .mp) files to G-Code).

Is it reasonable for me to expect that I will be able to learn how to program a function / module / program
which, given a filled region will create a continuous, as-smooth-as-possible, spiraling path which
will completely fill the area w/ a circular pen of a given size and a certain minimum overlap (and which can
either start from the center of the region and move out, or work its way from the outside in)? Bonus points if
it's also able to accommodate holes.

Or is this already an explicit capability of METAPOST and I haven't gotten to it in the manual yet?

If not, what other tool should I be looking at?

Thanks!

William

--

--
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

--
http://tug.org/metapost/


22 Jul 2013 13:50

### running metapost via lualatex

I've upgraded to 2013's w32tex (thanks Akira!) and so have what I'd consider a convenient metapost
environment for the first time since my NeXT Cube quit booting up.

I'm working my way through the Metapost manual --- is there anything in there which shouldn't work?

My first effort to change the default font (using the command in the manual) didn't work --- should it have?

William

--

--