[OS X TeX] metapost question

Jean-Claude DE SOZA jeanclaudedesoza at wanadoo.fr
Fri Dec 14 11:35:17 EST 2007


Le 14 déc. 07 à 12:19, Bruce Kellogg a écrit :

> Any suggestions on what to do would be appreciated.
> I do all my processing using pdftex, and in the
> TeXShop Preferences Misc pane there is checked mptopdf.
> I do not really understand these options, should I check mpost?
>
> Bruce Kellogg

Bruce,
I use pdflatex.
I run Metapost with mpost in TeXShop because it is easier for me to  
manage errors in the MetaPost file with this engine.
My preamble in the picture.mp is the following :
verbatimtex
    %&latex
    \documentclass[]{article}
    \usepackage{mathrsfs}
    \begin{document}
    etex;
    beginfig(1)
    .............
    endfig;
    end
The mp file produces a file whose name is picture.1 that I include in  
my LaTeX file where I don't forget to add this two lines in the  
preamble :
\usepackage{graphicx}
\DeclareGraphicsRule{*}{mps}{*}{}

Sometimes I run MetaPost directly in the LaTeX file using the emp  
package. Here is some parts of my LaTeX file :

%  ----- in the preamble for inserting MetaPost code ----%
	\usepackage{ifpdf}
	\usepackage[]{emp}
	\ifpdf
   	\DeclareGraphicsRule{*}{mps}{*}{}
	\fi
%  ---- end Preamble ----%

%----  Beginning of MetaPost Picture Source----%
	\begin{empfile}
	\begin{empdef}[fig1](8cm,8cm)
	% --- Metapost Code --- %
		beginfig(1)
		...........
		endfig;
		end;
	% --- End of MetaPost Code ---%
	\end{empdef}
	\end{empfile}
%----  End of MetaPost Picture ----%

%----  integration of the MetaPost Picture----%
	\immediate \write18{mpost -tex=latex \jobname}
	\begin{figure}[ht]
	\begin{center}
  	 \empuse{fig1}
	\end{center}
	\end{figure}
%----  end ----%

Jean-Claude DE SOZA



More information about the MacOSX-TeX mailing list