Andrew Hays | 3 Feb 2010 19:39
Favicon
Gravatar

Using Metapost on Ubuntu 9.10

For some reason under Ubuntu 9.10 (x86 and x64), MetaPost refuses to render any images that contain text. If you open the file for Image.1, it opens evince and it hangs indefinitely. I can create images perfectly fine and render this as long as there is no text. Am I missing any specific font packages or something that I should be using? I know that it works under Windows. I also know that on a different machine I had a while back (running Ubuntu 8.04, I believe), I had it working then.

Am I missing anything? Has anyone else had this problem and knows how to fix it?  I appreciate any and all available help.
------------------
http://andrewhays.net
http://ashays.livejournal.com

--
http://tug.org/metapost/
Taco Hoekwater | 4 Feb 2010 11:18
Gravatar

Re: Using Metapost on Ubuntu 9.10


Andrew Hays wrote:
> For some reason under Ubuntu 9.10 (x86 and x64), MetaPost refuses to
> render any images that contain text. If you open the file for Image.1,
> it opens evince and it hangs indefinitely. I can create images perfectly
> fine and render this as long as there is no text. Am I missing any
> specific font packages or something that I should be using? I know that
> it works under Windows. I also know that on a different machine I had a
> while back (running Ubuntu 8.04, I believe), I had it working then.

A print of the metapost terminal or log messages would be helpful.

Best wishes,
Taco
--
http://tug.org/metapost/

Andrew Hays | 4 Feb 2010 16:34
Favicon
Gravatar

Re: Using Metapost on Ubuntu 9.10

I solved the problem by setting prologues := 3.  Why is it that that works, though?  I found this solution through another use on the mailing list.

----------------------------------------
Sent via Android
http://andrewhays.net
http://ashays.livejournal.com

On Feb 4, 2010 4:18 AM, "Taco Hoekwater" <taco <at> elvenkind.com> wrote:



Andrew Hays wrote:
> For some reason under Ubuntu 9.10 (x86 and x64), MetaPost refuses to
> render...

A print of the metapost terminal or log messages would be helpful.

Best wishes,
Taco
--
http://tug.org/metapost/
Franck Pastor | 4 Feb 2010 16:47
Picon

Re: Using Metapost on Ubuntu 9.10


Le 4 févr. 10 à 16:04, Andrew Hays a écrit :

> Both of these solutions work.  Why is that?  The mptopdf solution I  
> can see working, but what about the prologues := 3?
> ------------------
> http://andrewhays.net
> http://ashays.livejournal.com

Setting "prologues" to 3 makes MetaPost embed the fonts (or a relevant  
subset of them) in the resulting eps file, making it standalone. It is  
a rather recent feature.

See the MetaPost "User's Manual", pp 26--27. http://www.tug.org/docs/metapost/mpman.pdf

Franck Pastor

>
>
> On Wed, Feb 3, 2010 at 11:19 PM, Franck Pastor  
> <franck.pastor <at> mac.com> wrote:
>
> Le 3 févr. 10 à 19:39, Andrew Hays a écrit :
>
> For some reason under Ubuntu 9.10 (x86 and x64), MetaPost refuses to  
> render any images that contain text. If you open the file for Image. 
> 1, it opens evince and it hangs indefinitely. I can create images  
> perfectly fine and render this as long as there is no text. Am I  
> missing any specific font packages or something that I should be  
> using? I know that it works under Windows. I also know that on a  
> different machine I had a while back (running Ubuntu 8.04, I  
> believe), I had it working then.
>
> Am I missing anything? Has anyone else had this problem and knows  
> how to fix it?  I appreciate any and all available help.
> ------------------
> http://andrewhays.net
> http://ashays.livejournal.com
> --
> http://tug.org/metapost/
>
> What if you add
>
>       prologues := 3;
>
> at the beginning of your mp file?
>
> Or you may use mptopdf instead of mpost at the command line.
>
> Franck Pastor
>
>
>

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

Franck Pastor | 15 Feb 2010 22:41
Picon

mptopdf and outputtemplate don't get along well

Hello list,

Recently I discover  the new template mechanism  in MetaPost which  
makes use of the variable "outputtemplate". Since I always wanted to  
get rid of these strange "foo.1", "foo.2" file names, I heartily  
welcomed this new feature. However, it appears that the mptopdf script  
doesn't like it. For example, suppose I want to run a "foo.mp"  
metapost file, like this:

outputtemplate := "%j-%c.mps";
beginfig(1);
	draw unitsquare scaled 1cm;
endfig
end

then I observe this:

1) If I enter "mptopdf foo.mp", no pdf version of the picture is  
produced at all, only foo-1.mps.

2) If I enter now "mptopdf foo-1.mps", it works, but the pdf has got a  
somewhat ugly name: "foo-1-mps.pdf" (I expected "foo-1.pdf", as it is  
the case without outputtemplate setting).

Are these problems bugs, or features? I use MetaPost 1.208 and mptopdf  
1.3.3, from TeX Live 2009 (MacTeX).

Franck Pastor

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

Aditya Mahajan | 24 Feb 2010 21:25
Picon

Processing comma separated values

Hi,

What is the canonical way of processing a list of comma separated values 
in metapost. I want to write a helper macro for the boxes package so that

boxsep(a,b,c) = p ;

expands to

b.w - a.e = c.w - b.e = p ;

and

boxsep(a,b,c,d) = p ;

expands to

b.w - a.e = c.w - b.e = d.w - c.e = p ;

and so on. Any hints on how to write such a macro.

Thanks,
Aditya

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

Taco Hoekwater | 26 Feb 2010 08:32
Gravatar

Re: Processing comma separated values

Aditya Mahajan wrote:
> Hi,
> 
> What is the canonical way of processing a list of comma separated values 
> in metapost. I want to write a helper macro for the boxes package so that

I do not have time to write a full answer, but the way to
process a list of argument values is something like this:

def boxsep (text a) =
    forsuffixes _a=a:
	 show _a;
    endfor
enddef;

Best wishes,
Taco
--
http://tug.org/metapost/

Aditya Mahajan | 26 Feb 2010 17:37
Picon

Re: Processing comma separated values

On Fri, 26 Feb 2010, Taco Hoekwater wrote:

> Aditya Mahajan wrote:
>> What is the canonical way of processing a list of comma separated values in 
>> metapost. I want to write a helper macro for the boxes package so that
>
> I do not have time to write a full answer, but the way to
> process a list of argument values is something like this:
>
> def boxsep (text a) =
>   forsuffixes _a=a:
> 	 show _a;
>   endfor
> enddef;

Thanks. Dan Luecking posted a solution offlist that works perfectly.

def boxsep (suffix A,B) (text T) =
   def _prev_suffix = B enddef;
   B.w - A.e
   forsuffixes _S = T:
     = _S.w - _prev_suffix.e
     hide (def _prev_suffix = _S enddef;)
   endfor
enddef;

I had to read the metapost manual carefully to understand why it works.

To metapost,

boxset(a,b)(c,d) is the same as boxset(a,b,c,d).

Thanks you Dan and Taco.

Aditya

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

Dan Luecking | 26 Feb 2010 20:56
Picon
Favicon

Re: Processing comma separated values

At 01:32 AM 2/26/2010, Taco Hoekwater wrote:
>Aditya Mahajan wrote:
>>Hi,
>>What is the canonical way of processing a list of comma separated 
>>values in metapost. I want to write a helper macro for the boxes 
>>package so that
[...]

>>boxsep(a,b,c,d) = p ;
>>
>>expands to
>>
>>b.w - a.e = c.w - b.e = d.w - c.e = p ;
>
>I do not have time to write a full answer, but the way to
>process a list of argument values is something like this:
>
>def boxsep (text a) =
>    forsuffixes _a=a:
>         show _a;
>    endfor
>enddef;

I have already exchanged email with Aditya Mahajan,
but forgot to "Reply All" to include the list. The
results of our exchange were the following two examples:

%This works only for pair variables (which was the given case):
def boxsep (suffix A)(text T) =
   def _prev_suffix = A enddef;
   pair _dummy_pair;
   forsuffixes _S = T:
     _S.w - _prev_suffix.e = _dummy_pair;
     def _prev_suffix = _S enddef;
   endfor
   _dummy_pair
enddef

% This can generate equations for any list of two or
% more variables of the same type (for which subtraction
% makes sense):
def boxsep (suffix A,B) (text T) =
   def _prev_suffix = B enddef;
   B.w - A.e
   forsuffixes _S = T:
     = _S.w - _prev_suffix.e
     hide (def _prev_suffix = _S enddef;)
   endfor
enddef;

The main problem was to remember the previous suffix
so as to subtract it from the current one.

Best wishes,
Dan

Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas
http://www-cs-faculty.stanford.edu/~knuth/iaq.html 

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

Dan Luecking | 26 Feb 2010 23:00
Picon
Favicon

Seeking mp.web

Hello:

I am looking for a copy of John Hobby's mp.web (if such exists).
I'm doing a little research into the history of MP.

There is a file by that name in the obsolete tree of CTAN, but
it is completely empty.

Regards,
Dan

Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas
http://www-cs-faculty.stanford.edu/~knuth/iaq.html 

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


Gmane