I have upgraded from MiKTeX 2.8 to 2.9. All the label commands that earlier worked in Metapost are not working anymore. I am using MiKTeX in conjunction with TeXnicCenter. The MetaPost version apparently is 1.803 (MiKTeX 2.9). I am compiling the MP file separately using mpost.exe, the build process used for compiling MP files is highlighted below.

The way mpost.exe is called from TeXnicCenter

Example code for MP file is


draw (0,0)--(2cm,3cm);
draw thelabel.lft(btex $m$ etex,(0,0));


The output status from compilation is as follows:

--------------------Output Profile: Metapost--------------------
Metapost> This is MetaPost, version 1.803 (MiKTeX 2.9)
Metapost> (mpost.mp (C:/Program Files (x86)/MiKTeX 2.9/metapost/base/plain.mp
Metapost> Preloading the plain mem file, version 1.004) )
Metapost> (C:/Vishnu/Miscellaneous/Metapost/Label problem/trial1.mp

Further each time compilation is carried out new files are created like mp880129.tex, mp80530.tex with the following content

\gdef\stopmpxshipout{\egroup  \dimen0=\ht0 \advance\dimen0\dp0
\dimen1=\ht0 \dimen2=\dp0
\ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2 
\else \vrule width1sp height1sp depth0sp\relax
\ht0=0pt \dp0=0pt \box0 \egroup}
\mpxshipout% line 4 C:/Vishnu/Miscellaneous/Metapost/Label problem/trial1.mp

I request some help to resolve this issue. I have been unable to find a solution for too long now.

  • Try mpost --debug and paste the result. Also, try to compile from command line tex mp880129 and see if it works (it should generate a .dvi file) – JLDiaz May 23 '14 at 22:26
  • The result generated using mpost --debug is as follows: – Vishnu May 23 '14 at 22:52
  • The result generated using mpost --debug is as follows: This is Metapost, version 1.803 (MiKTeX 2.9) (mpost.mp (C:/Program Files (x86)/MiKTeX 2.9/metapost/base/plain.mp Preloading the plain mem file, version 1.004)) (<working dir>/trial1.mpmakempx debug: <working dir>/trial1.mp: running command tex --parse-first-line --interaction=nonstopmode mp885472.tex makempx debug: C:/Vishnu/Miscellaneous/Metapost/Label problem/trial1.mp: 00203108 = fopen(C:/Program Files (x86)/MiKTeX 2.9/fonts/tfm/public/cm/cmmi10.tfm,"rb") [1]) The file still fails to compile properly. – Vishnu May 23 '14 at 22:57
  • Does the file C:/Program Files (x86)/MiKTeX 2.9/fonts/tfm/public/cm/cmmi10.tfm exist? Can you successfully run tex --parse-first-line --interaction=nonstopmode mp885472.tex? – JLDiaz May 23 '14 at 23:04
  • JLDiaz - Yes the file C:/Program Files (x86)/MiKTeX 2.9/fonts/tfm/public/cm/cmmi10.tfm exists. I can also successfully run the above command, however only the letter m (i.e. the label) is created in mp885472.dvi there is no sign of the line. The line isn't visible in resulting fig.1 file. – Vishnu May 23 '14 at 23:10

I had the same problem. The solution of the problem is:

  1. Start -> All Programs -> MikTex 2.9 -> Maintenance (Admin) -> Settings (Admin)
  2. Select "Formats". The following window appears enter image description here
  3. Click "New" and the following window appears enter image description here
  4. Do the following

    (a) Format key: put whatever you want (for example, latex_metapost_btex)

    (b) Format name: latex

    (c) Input file name: latex.ini

    (d) Output file name: (nothing, as it is)

    (e) Preloaded format: (nothing, as it is)

    (f) Description: what you want

    (g) Uncheck "Exclude this format when updating all format files"

    (h) Click "OK"

  5. In the previous window, select the line of the new format (for example, latex_metapost_btex) and click "Build", then click "OK"

Now the "btex etex" command works with a minor problem. Specifically, at the end of each label the symbol % is added. To solve the problem do the following:

  • Put in the preamble of your code the command \def\%{}
  • Of course, now you cannot use the symbol % for your labels. If you need to do this, put in the preamble of your code the command \newcommand{\pct}{\char"25} and use it for your labels.



I have been able to work around the problem caused by MiKTeX 2.9. I have completely uninstalled MiKTeX 2.9 and installed TeX Live 2013 (I got the idea from Troy Henderson's webpage: http://www.tlhiv.org/mppreview/ which clearly states that it uses "MetaPost version 1.9 (TeX Live 2014/dev) (kpathsea version 6.2.0dev)"). However, I still face problems trying to integrate it with TeXnicCenter. I still need to execute Metapost files from command line invoking the command mpost filename.mp. But the command line option works without any hitches. I am able to incorporate all labels without any problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.