EPS problem

Toon Verstraelen <Toon.Verstraelen@...1023...> writes:

I tried to use the PS backend of matplotlib 0.87.2 to create EPS
figures, but I got the error at the bottom of this email.

[...]

! LaTeX Error: Something's wrong--perhaps a missing \item.

There is probably something in the text strings you are plotting that
LaTeX doesn't like. You need to post an example of the script that
produces the error so we can debug it.

···

--
Jouni

Hi,

Thanks for all the replies, It helped me finding the the cause of the problem rather quickly. I did a special trick with the title, that is not accepted by the PS backend:

pylab.title("\begin{center} First line \\ Next line \end{center}")

I poked a bit in the code, and it seems that the version 0.87.2 does not offer real good alternative for this trick. When making the following modification in text.py, one can obtain the intended double title:

         if self.is_math_text():
             tmp = self._text.split("\n\n")
             lines = []
             for line1 in tmp:
                 if len(line1.strip()) > 0:
                     for line2 in line1.split(r"\\"):
                         lines.append(line2.strip())

Using this patch, I just have to use this code for a centered double title:

pylab.title("First line \\ Next line")

This works well and gives the same result independent of the backend that is being used. Is the proposed patch a good idea?

regards,

Toon

Jouni K Seppanen wrote:

···

Toon Verstraelen <Toon.Verstraelen@...1023...> writes:

I tried to use the PS backend of matplotlib 0.87.2 to create EPS
figures, but I got the error at the bottom of this email.

[...]

! LaTeX Error: Something's wrong--perhaps a missing \item.

There is probably something in the text strings you are plotting that
LaTeX doesn't like. You need to post an example of the script that
produces the error so we can debug it.