#13 TeX error with PyX-0.4.1

closed
nobody
None
5
2012-10-16
2003-10-04
Anonymous
No

I run Python 2.1.3, TeX (Web2C 7.3.7) 3.14159 and
kpathsea version 3.3.7 under Debian GNU/Linux 3.0.

If i run any of the examples which output some text I get
the following error message:sieck@acertm:~$ python
/usr/lib/python2.1/site-packages/PyX/examples/hello.py
Traceback (most recent call last):
File
"/usr/lib/python2.1/site-packages/PyX/examples/hello.py",
line 4, in ?
c.text(0, 0, "Hello, world!")
File "/home/sieck/packages/PyX-0.4.1/pyx/canvas.py",
line 767, in text
File "/home/sieck/packages/PyX-0.4.1/pyx/text.py",
line 2283, in text
File "/home/sieck/packages/PyX-0.4.1/pyx/text.py",
line 2271, in _text
File "/home/sieck/packages/PyX-0.4.1/pyx/text.py",
line 1950, in execute
File "/home/sieck/packages/PyX-0.4.1/pyx/text.py",
line 2070, in execute
pyx.text.TexResultError: TeX didn't respond as expected
within the timeout period
(5 seconds).
The expression passed to TeX was:
\scrollmode
\raiseerror%
\def\PyX{P\kern-.3em\lower.5ex\hbox{Y}\kern-.18em X}%
\gdef\PyXHAlign{0}%
\newbox\PyXBox%
\newbox\PyXBoxHAligned%
\newdimen\PyXDimenHAlignLT%
\newdimen\PyXDimenHAlignRT%
\newbox\PyXBoxVAlign%
\newdimen\PyXDimenVAlign%
\newbox\PyXBoxVBox%
\newdimen\PyXDimenVBox%
\long\def\ProcessPyXBox#1#2{%
\setbox\PyXBox=\hbox{{#1}}%
\PyXDimenHAlignLT=\PyXHAlign\wd\PyXBox%
\PyXDimenHAlignRT=\wd\PyXBox%
\advance\PyXDimenHAlignRT by -\PyXDimenHAlignLT%
\gdef\PyXHAlign{0}%

\immediate\write16{PyXBox:page=#2,lt=\the\PyXDimenHAlignLT,rt=\the\PyXDimenHAlig
nRT,ht=\the\ht\PyXBox,dp=\the\dp\PyXBox:}%

\setbox\PyXBoxHAligned=\hbox{\kern-\PyXDimenHAlignLT\box\PyXBox}%
\ht\PyXBoxHAligned0pt%

{\count0=80\count1=121\count2=88\count3=#2\shipout\box\PyXBoxHAligned}}%

\def\PyXInput#1{\immediate\write16{PyXInputMarker:executeid=#1:}}%
\PyXInput{1}%
After parsing the return message from TeX, the
following was left:
This is TeX, Version 3.14159 (Web2C 7.3.7)
! I can't find file `@473.0'.
<*> @473.0

Please type another input file name: ! I can't find
file `\scrollmode'.
(cut after 5 lines, increase errordebug for more output)

end of output

Any ideas?

Alexander Sieck

alexander dot sieck at web dot de

start of output

Discussion

  • Andre Wobst

    Andre Wobst - 2003-10-06

    Logged In: YES
    user_id=405853

    I could not yet reproduce your problem. It would be really
    nice if you could do some tests in order to better trace
    down the problem.

    First of all, I'm wondering that you've installed the
    examples systemwide (this would not be the case when you run
    "python setup.py install" in the pyx directory --- which is
    the suggested way to install pyx). The PyX directory in
    /usr/lib/pythonx.x/site-packages should not contain
    uppercase characters. You can already see some strange
    behavior that pyx in taken not from
    /usr/lib/pythonx.x/site-packages/pyx but from somewhere in
    your home directory. I expect this to be due to your way of
    installing pyx. Could you first of all try to fix this and
    the tell me, if the problem remains ...

    By the way, I should note that pyx indeed tries to create a
    temporary file handed over to TeX. This file has a temporary
    name and is removed after TeX should have read it. The file
    is created in the local directory (all these things are
    build in order to come over some TeX limitations). However,
    since the creation of the file should have been done at that
    point your problem occures (otherwise you should have got
    some exception earlier), you might be able to see that file
    (you might need to turn off the atexit call to cleen the
    temporary files in text.py). On the other hand, TeX said in
    the example above, that it could not read that very file.
    Still, very strange ...

     
  • Nobody/Anonymous

    Logged In: NO

    Hello,

    since I couldn't find the distutils for Python2.1
    "python setup.py install" failed with
    "No module distutils.core". Therefore, I extracted
    PyX-0.4.1.tar directly to ../lib/python2.1/site-packages.
    With this I could produce the example box.eps, but the
    examples with text-output produced the message given
    above.
    In the meantime I learned that since Python1.6 the
    distutils module is in python2.x-dev and installed
    it. Then I run "python setup.py install" and removed
    the PyX directory in site-packages. This solved the
    problem mentioned above.

    Unfortunately, now something is wrong with the TeX fonts:
    === start of output ===
    sieck@acertm:~/packages/PyX-0.4.1/examples$ python hello.py
    Traceback (most recent call last):
    File "hello.py", line 6, in ?
    c.writetofile("hello")
    File "/usr/lib/python2.1/site-packages/pyx/canvas.py",
    line 936, in writetofile
    for pritem in self.prolog():
    File "/usr/lib/python2.1/site-packages/pyx/canvas.py",
    line 661, in prolog
    result.extend(cmd.prolog())
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    1780, in prolog
    return result + self.texrunner.prolog(self.dvinumber,
    self.page)
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    2086, in prolog
    self.getdvi()
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    2080, in getdvi
    self.dvifiles.append(DVIFile(dvifilename,
    debug=self.dvidebug))
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    685, in init
    self.readfile()
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    1087, in readfile
    state = self._read_page()
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    1045, in _read_page
    file.read(file.readuchar()+file.readuchar()))
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    773, in definefont
    self.fonts[num] = Font(fontname, c, q, d, self.tfmconv,
    self.debug > 1)
    File "/usr/lib/python2.1/site-packages/pyx/text.py", line
    516, in init
    raise RuntimeError("no information for font '%s' found
    in font mapping file, aborting" % name)
    RuntimeError: no information for font 'cmr10' found in
    font mapping file, aborting
    === end of output ===

    "libkpathsea-dev - kpathsea.a and include files for teTeX"
    is installed.
    The environment variables in /etc/texmf/texmf.cnf seem to be
    in agreement
    with the documentation.
    A file cmr10.tfm does exist:
    sieck@acertm:~$ find /usr/share/texmf -name cmr10*
    /usr/share/texmf/fonts/tfm/public/cm/cmr10.tfm
    /usr/share/texmf/fonts/source/public/cm/cmr10.mf

    I can use LaTeX separately without problems, e.g. article.cls
    and german.sty and the fonts are found.

    I am not sure whether the problem is caused by my environment
    or by PyX.

    Regards
    Alexander

     
  • Andre Wobst

    Andre Wobst - 2003-10-08

    Logged In: YES
    user_id=405853

    It's nice to see that you could get distutils working. You
    are totally right about the python-dev package you need to
    install for that.

    It's quite likely that you are missing just one last point
    now: You need the TeX-Fonts in Type1 format (a scalable font
    format from Adobe available in a direct PostScript version
    (called .pfa) and a packed version of it (called .pfb) --
    the later are usually distributed and PyX needs it). This is
    nice to have for tex&dvips as well, since you are not stick
    to the metafont pk-version of the fonts anymore (which has
    some advantages, e.g. in pdf creation and other things). The
    type1-Fonts are available in the debian package tetex-extra.
    Just install this package to get the files like cmr10.pfb
    ... then try again.

    HTH, Andre

     
  • Nobody/Anonymous

    Logged In: NO

    Hello,

    it still doesn't work. I have installed tetex-extra:
    sieck@acertm:~/packages/PyX-0.4.1/examples$ find
    /usr/share/texmf -name cmr10*
    /usr/share/texmf/fonts/type1/bluesky/cm/cmr10.pfb
    /usr/share/texmf/fonts/tfm/public/cm/cmr10.tfm
    /usr/share/texmf/fonts/source/public/cm/cmr10.mf
    sieck@acertm:~/packages/PyX-0.4.1/examples$ ls
    /usr/share/texmf/fonts/type1/
    adobe bitstrea bluesky hoekwater public urw

    But for all examples with text-output, e.g. hello.py,
    I still get the error:

    RuntimeError: no information for font 'cmr10' found in font
    mapping file

    When I did run make in /PyX-0.4.1/manual/ the first time,
    there was a message about some files that couldn't be
    created, a request to rerun it and finally the same error
    as above.
    After the rerun it finished without this error message
    and manual.dvi was created.

    Are there any environment variables I have to set or does
    one need to initialize the Type1 fonts?
    I rebooted after installing tetex-extra, to initialize tetex or
    kpathsea, but this didn't help.
    In the docu I only found a hint to mktexls-r, but this is only
    to speed kpathsea up, right?

    Regards
    Alexander

     
  • Andre Wobst

    Andre Wobst - 2003-10-09
     
  • Andre Wobst

    Andre Wobst - 2003-10-09

    Logged In: YES
    user_id=405853

    I see. Point is, that the package installs the fonts but
    does not automatically include them in the file psfonts.map
    (used by dvips for example). This file contains some
    information about the available PostScript-Fonts. When you
    request cmr10 for example, there should be such an entry in
    the psfonts.map file. (Run "kpsewhich psfonts.map" to find
    this mapping file; it should be located at
    /usr/share/texmf/dvips/config/psfonts.map.) Although there
    are mapping files for the Computer Modern Roman fonts
    available in your debian distribution (stable, isn't it),
    they do not contain proper encoding information. Instead of
    using those information from
    /usr/share/texmf/dvips/bluesky/psfonts.cmr, you should
    better extract the enclosing font information. You should be
    able to run test.py in the test directory after extraction.
    You can then install this psfonts.map and *.enc files in the
    appropriate texmf directory to make it globally available.
    You can either install it into something like
    /usr/local/share/texmf/dvips/psfonts or in your home
    directory ~/texmf/dvips/psfonts. See "kpsewhich texmf.cnf"
    about your TeX related search path configuration.

    HTH, Andre

     
  • Nobody/Anonymous

    Logged In: NO

    Hello,

    as described in the header of
    /usr/share/texmf/dvips/config/psfonts.map
    the file psfonts.map is created by the script
    /usr/share/texmf/dvips/config/updmap
    Changing
    type1_default=false
    #type1_default=true
    to
    # type1_default=false
    type1_default=true
    in this script and running it added the missing lines like
    cmr10 CMR10 <cmr10.pfb
    to psfonts.map .

    Now all PyX examples work.
    The meaning of the encoding files *.enc
    you mentioned and what you mean by
    "you should better extract the enclosing font information"
    is not clear to me yet.

    Thanks for your quick response.

    Alexander

     
  • Andre Wobst

    Andre Wobst - 2003-10-13

    Logged In: YES
    user_id=405853

    Fine that its working now. Concerning the encoding files: We
    had some problems with some fonts a few weeks ago (shortly
    before releasing PyX 0.4). A signature of this problem was
    the missing integral glyph in the integral graph example.
    However I could produce this example without a font
    reencoding now. I'm kind of confused (I've tried to
    reproduce our old problem, but I coudn't). Jrg, do you
    remember what the problem was and wasn't it solved by some
    reencoding?

    Andre

     
  • Jörg Lehmann

    Jörg Lehmann - 2003-10-13

    Logged In: YES
    user_id=390410

    Andr, wasn't that the bug in our usage of writet1.c, where we
    haven't reset the value of the global fontencoding variable
    before
    using the routine for the standard encoded fonts?

     
  • Andre Wobst

    Andre Wobst - 2003-10-14

    Logged In: YES
    user_id=405853

    Jrg, yes, you're totally right. I mixed it up with the
    encoding of the standard TeX fonts as they are included in
    recent versions of teTeX (there might still be cases where
    the encoding modification becomes important, but it seems to
    be not the case in common usage as teTeX didn't had the
    reencoding for a long time as well). Thus, Alexander, you
    are fine with your updated psfonts.map created by updmap. I
    think we're done. Closing.
    Andre

     

Log in to post a comment.