# [OS X TeX] TeXShop and Metapost: labels can't be typesetted with LaTeX

Franck Pastor pastor at fusl.ac.be
Tue Sep 26 12:33:21 EDT 2006

Hello,

I am using Metapost (mainly via the package "mfpic", but also the
Metapost language itself) for my pictures, and as TeXShop supports
Metapost, I thought I could use it to write my programs and run them.
But I have a problem. Metapost uses internally Plain TeX by default
to typeset labels in a figure, and I would like to make it use LaTeX

For example, this little program (let's call it "example.mp") is
supposed to use LaTeX to typeset its label (hence the
"verbatimtex...etex" block):

verbatimtex
\documentclass{article}
\begin{document}
etex
beginfig(1);
z0 = (0,0);
z1 = (sqrt(5)*cm,0);
draw z0--z1;
label.bot(btex $\sqrt{5}$ etex, 1/2[z0,z1]);
endfig;
end;

In the Terminal, with the command line, you have only to enter

mpost -tex=latex example.mp

to obtain your figure, with the square root of 5. But via TeXShop, as
it is, it's not possible, you don't obtain anything...

After some research, I managed to find this small file, inside
TeXShop itself:

/Applications/TeXShop.app/Contents/Resources/metapostwrap

I don't know exactly what it does, but I took the risk to change the
following lines :

mpost --interaction=nonstopmode  "${filename:r}.mp" mpost "${filename:r}.mp"

into

mpost --interaction=nonstopmode -tex=latex "${filename:r}.mp" mpost -tex=latex "${filename:r}.mp"

and with this change, I can execute my file conveniently.

My questions: is there another (simpler) way to do that in TeXShop?
If not, would it be possible to have a panel of choices in the
preferences of TeXShop, offering us the choice between Plain TeX
(default) and LaTeX for typesetting labels when using the Metapost
program? Something to be placed in the "Misc" section, for example,
alongside with the choice of mptopdf or mpost to run Metapost. That
would prevent us to do the changes ourselves in the "metapostwrap"
files, which is a bit tedious at each update of TeXShop.

Many thanks for having managed to read this! I hope it's not too

Franck Pastor

------------------------- 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/