# Metapost labels do not work with MiKTeX 2.9

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.

Example code for MP file is

beginfig(1);

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

endfig;
end;


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> (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\mpxshipout{\shipout\hbox\bgroup
\setbox0=\hbox\bgroup}
\dimen1=\ht0 \dimen2=\dp0
\setbox0=\hbox\bgroup
\box0
\ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2
\else \vrule width1sp height1sp depth0sp\relax
\fi\egroup
\ht0=0pt \dp0=0pt \box0 \egroup}
\mpxshipout% line 4 C:/Vishnu/Miscellaneous/Metapost/Label problem/trial1.mp
$m$%
\stopmpxshipout
\end{document}


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
3. Click "New" and the following window appears
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.

Giorgos

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.