1

I'm using PyX 0.12.1 to produce an EPS document for printing. I'm following the example in the documentation for changing the font, and have the following:

from pyx import *
text.set("Latex")
text.preamble(r"\renewcommand{\familydefault}{\sfdefault}")
height = 37 * unit.mm
c = canvas.canvas()
c.text(0, 15*unit.mm, "Hello, World!", [text.parbox(height), text.halign.boxcenter, text.halign.flushcenter])

When testing from my PC, this works as expected, however when running from the server, it generates a RuntimeError: preamble calls disabled due to previous text calls exception.

What is causing this, and why does it not happen on my PC?

Foxocube
  • 710
  • 9
  • 32
  • Maybe LaTeX can not be started properly. Can you run LaTeX on the command line on a minimal file? Also it might be that you installed LaTeX on the server, but it is not collable from within your Python script, maybe due to a missing path in the PATH environment variable. If all this is working properly, please get PyX to dump the commands passed to LaTeX by `text.set("Latex", texdebug="pyxlatex")`, which will create a file `pyxlatex.tex`. Try to run it using latex on the command line ... – wobsta Nov 26 '15 at 08:20
  • @wobsta I finally solved the issue by installing the texlive-fonts-extra package – Foxocube Nov 26 '15 at 09:42

0 Answers0