[OS X TeX] mfpic and conversion MP to PDF

Maarten Sneep maarten.sneep at xs4all.nl
Thu Mar 16 15:36:03 EST 2006


On 15 Mar 2006, at 23:00, ¿istein ANDERSEN wrote:

>> Export the metapost figures, run through mpost, use mptopdf to  
>> create the equivalent pdf figures, and include those instead.
>
> This works as long as any text is handled by mpost, which is not a  
> problem for me. This method also prevents the figures (i.e. the  
> mfpic code creating them) from being an integrated part of the (La) 
> TeX document. Again, this is not a concern in my case, so this  
> solves my initial problem.

OK, mfpic probably assumes metafont rather than metapost, right? I  
use metapost, and my experience with mf is very limited. I prefer to  
have external files anyway, so I see having external files as a benefit.

If you call metapost as:
     mpost -tex=latex file.mp
then the latex format will be used for setting text (so you can use  
whatever you're (well, I'm at least) used to).

A small sample may help others,

Maarten

%% begin file
input graph;

def GraphWidth = (106mm) enddef ;
def GraphHeight = (68mm) enddef ;

verbatimtex
%&latex
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lucidabr}
\begin{document}
etex

prologues := 2 ;

beginfig(0) ;
	numeric scalefactor; scalefactor := 1.2cm;
	numeric theangle;    theangle := -32;
	pair pntone, pnttwo ;
	pntone := (0,scalefactor); pnttwo := pntone rotated theangle;
	
	draw (-1.1*scalefactor,0) -- (1.1*scalefactor,0)
		withpen pencircle scaled 0.5pt withcolor black;
	
	draw (0,-1.1*scalefactor) -- (0,1.1*scalefactor)
		withpen pencircle scaled 0.5pt withcolor black;
	
	drawarrow (0, -0.5*scalefactor) -- (0,0.5*scalefactor)
		withpen pencircle scaled 1.5pt withcolor black;
	
	draw origin -- (0,1.1*scalefactor) rotated theangle withpen  
pencircle scaled 0.5pt withcolor black;
	drawarrow for i=0 step -4 until theangle+4:
		(pntone rotated i) ..
	endfor pnttwo withpen pencircle scaled 0.5pt withcolor black;
	draw btex $z$ etex shifted (-2.5mm, 11mm) ;
	draw btex $\mathbf{p}$ etex shifted (1mm, -3mm);
	draw btex $\vartheta'$ etex rotated 10 shifted (0,8mm) rotated -10;
endfig ;

verbatimtex
\end{document}
etex
end
%% end file------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list