[metapost] What is the best approach for writing LaTeX specific commands in metapost

Vafa Khalighi vafakhlgh at gmail.com
Tue Mar 1 08:00:47 CET 2011


As an example, when I run mpost -tex=latex vafa.mp, I get this error:

)fatal: Command failed: latex mpf0LcjR.tex; see mpxerr.log
>> mpdefs.mp
>> mpdefs.mpx
! Unable to make mpx file.
l.6 newBox.a(btex
                  apples\strut etex);

but if I delete \selectlanguage{farsi} from vafa.mp and the run mpost
-tex=latex vafa.mp, there is no problem.

Then I come and add the deleted \selectlanguage{farsi} to vafa.mp and run
mpost -tex=latex and strangely this time, there is no problem. Why?


-- 
If some one say: "You divide ten into two parts: multiply the one by itself;
it will be equal to the other taken eighty-one times." Computation: You say,
ten less thing, multiplied by itself, is a hundred plus a square less twenty
things, and this is equal to eighty-one things. Separate the twenty things
from a hundred and a square, and add them to eighty-one. It will then be a
hundred plus a square, which is equal to a hundred and one roots. Halve the
roots; the moiety is fifty and a half. Multiply this by itself, it is two
thousand five hundred and fifty and a quarter. Subtract from this one
hundred; the remainder is two thousand four hundred and fifty and a quarter.
Extract the root from this; it is forty-nine and a half. Subtract this from
the moiety of the roots, which is fifty and a half. There remains one, and
this is one of the two parts.

*Muḥammad ibn Mūsā al-Khwārizmī*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20110301/1633e367/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vafa.mp
Type: application/octet-stream
Size: 549 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20110301/1633e367/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpdefs.mp
Type: application/octet-stream
Size: 461 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20110301/1633e367/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vafa.log
Type: text/x-log
Size: 936 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20110301/1633e367/attachment-0001.bin>


More information about the metapost mailing list