Hello,

I've had a strange problem regarding a PyX plot last week. I don't know if
it's the fault of PyX, but I want to report the problem anyhow.

When I try to include a PDF created by PyX in a LaTeX document using
\includegraphics, pdflatex aborts.

The PDF is created by this code (the code is attached: plot.py: the output is
also attached: plot.pdf):

  1 from pyx import *
  2
  3 text.set(text.LatexRunner)
  4 text.preamble(r"\usepackage{mathabx}")
  5
  6 c = canvas.canvas()
  7 c.text(0,0, r"$\widebar{X}$")
  8 c.writePDFfile()

I load the mathabx package, create a canvas and write \widebar{X} to the
canvas. PyX creates a PDF which looks fine to me in several PDF viewers
(okular, evince, xpdf). However, I get the warning:

"We are about to extract font information for the Type 1 font 'TeX-mathx10'
from its pfb file. This is bad practice (and it's slow). You should use an afm
file instead."

If I now try to include this PDF in a LaTeX document (see attachement
text.tex), pdflatex crashes and prints the error:

"<plot.pdf, id=1, 11.07693pt x 10.43765pt> <use plot.pdf> [1{/var/lib/texmf/font
s/map/pdftex/updmap/pdftex.map} <./plot.pdfInternal Error (0): Call to Object
where the object was type 2, not the expected type 1

I've solved my problem by not using \widebar. But I don't know if this is a
problem of mathabx, of PyX or pdflatex. Unfortunately, I don't know how one
can check if a PDF file is valid.

I use PyX 0.14 and pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) on
Debian 8.4.

Best whishes,

--Michael

Attachment: plot.pdf
Description: Adobe PDF document

from pyx import *

text.set(text.LatexRunner)
text.preamble(r"\usepackage{mathabx}")

c = canvas.canvas()
c.text(0,0, r"$\widebar{X}$")
c.writePDFfile()
\documentclass{scrbook}

\usepackage{graphicx}

\begin{document}

\includegraphics{plot.pdf}

\end{document}
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to