Hi all,

About a week ago I've reported a problem with using MetaPost in Slink.
I was unable to generate the figures with PostScript fonts, because the
MetaPost failed. Now I've found the reason of this problems, and a working
(but dirty) workaround.
The problem is that the "dvitomp" returns the "2" exit code, when processing
the "dvi" file with postscript fonts. It generates the warning messages:
DVItoMP warning: Checksum mismatch for ptmr8r 
DVItoMP warning: Checksum mismatch for psyr 
DVItoMP warning: Checksum mismatch for ptmri8r 
(Which is correct), but then exits with status "2", which causes the "makempx"
script to fail.

The workaround is to disable the diagnostics of dvitomp execution in the
makempx script. Below I attached the changes, I had to make:

157,171c157
<   if $WHATEVER_TO_MPX $INFILE $MPXFILE >$ERRLOG; then
<     : # success
<   else 
<     # failure
<     mv -f $INFILE $INERROR
<     test $mode = troff && mv -f mpx$$.i $TROFF_INERR
<     echo "$0: Command failed: $WHATEVER_TO_MPX $INERROR $MPXFILE" >&2
<     # Better to remove $MPXFILE if something went wrong rather than
<     # leaving behind an unfinished or unusable version since $NEWER
<     # might think that all is fine if $MPXFILE exists.
<     rm -f $MPXFILE
<     cat $ERRLOG >&2
<     exit 3
<   fi
< 
---
>   $WHATEVER_TO_MPX $INFILE $MPXFILE >$ERRLOG;

As you can see, it is the VERY DIRTY trick, but it works. Now I can add 
at the begining of my MetaPost file the following preamble:

verbatimtex \documentclass[polish]{article}
\usepackage{babel}
\usepackage{pslatex}
\usepackage[latin2]{inputenc}
\usepackage[T1]{fontenc}
        \begin{document}

And get the correct figures, ready to include in the LaTeX document.
However this solution is not satisfactory. (Because if dvitomp fails
because of other problem than font chksum error, one may get 
corrupted figures). So if someone finds a better solution, please let me know...
BTW. What is the reason of these awfull " Checksum mismatch for..." messages?
 
-- 
                        Wojciech Zabolotny
                        http://www.ise.pw.edu.pl/~wzab

http://www.debian.org  Use Linux - an OS without "trojan horses" inside

Reply via email to