EPS with TeX

Hi,

I am trying to use a text label with a new line in the middle and then save
the figure to .eps

text(0.5, 0.5, r'a \\ b')
savefig('test.eps')

This results in:

RuntimeError: LaTeX was not able to process your file:
Here is the full report generated by LaTeX:

This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
(/tmp/tmpkRUaxb.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang,
noh
yphenation, basque, bulgarian, coptic, welsh, czech, slovak, german,
ngerman, d
anish, esperanto, spanish, catalan, galician, estonian, finnish, french,
greek,
monogreek, ancientgreek, croatian, hungarian, interlingua, ibycus,
indonesian,
icelandic, italian, latin, mongolian, dutch, norsk, polish, portuguese,
romani
an, russian, slovenian, uppersorbian, serbian, swedish, turkish, ukenglish,
ukr
ainian, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/type1cm/type1cm.sty)
(/usr/share/texmf/tex/latex/psnfss/helvet.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty))
(/usr/share/texmf/tex/latex/psnfss/courier.sty)
(/usr/share/texmf/tex/latex/base/textcomp.sty
(/usr/share/texmf/tex/latex/base/ts1enc.def))
(/usr/share/texmf/tex/latex/geometry/geometry.sty

Package geometry Warning: Over-specification in `h'-direction.
    `width' (614.295pt) is ignored.

Package geometry Warning: Over-specification in `v'-direction.
    `height' (794.96999pt) is ignored.

) (/usr/share/texmf/tex/latex/psfrag/psfrag.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def)))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty)
(/usr/share/texmf/tex/latex/graphics/color.sty
(/usr/lib/texmf/tex/latex/config/color.cfg)
(/usr/share/texmf/tex/latex/graphics/dvipsnam.def))
No file tmpkRUaxb.aux.
(/usr/share/texmf/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1pnc.fd) <tmpkRUaxb.eps>

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

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.31 \includegraphics*[angle=0]{tmpkRUaxb.eps}

[1] (./tmpkRUaxb.aux) )
(see the transcript file for additional information)
Output written on tmpkRUaxb.dvi (1 page, 2980 bytes).
Transcript written on tmpkRUaxb.log.

Is it a problem that it is using pdftex instead of pslatex?

Can anyone offer any assistance? Cheers.

Python 2.5.2
IPython 0.8.2
backend : GTKAgg

···

--
View this message in context: http://www.nabble.com/EPS-with-TeX-tp24934313p24934313.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Yes.

···

On Wed, Aug 12, 2009 at 7:13 AM, D2Hitman<j.m.girven@...831...> wrote:

Hi,

I am trying to use a text label with a new line in the middle and then save
the figure to .eps

text(0.5, 0.5, r'a \\ b')
savefig('test.eps')

This results in:

RuntimeError: LaTeX was not able to process your file:
Here is the full report generated by LaTeX:

This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
(/tmp/tmpkRUaxb.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang,
noh
yphenation, basque, bulgarian, coptic, welsh, czech, slovak, german,
ngerman, d
anish, esperanto, spanish, catalan, galician, estonian, finnish, french,
greek,
monogreek, ancientgreek, croatian, hungarian, interlingua, ibycus,
indonesian,
icelandic, italian, latin, mongolian, dutch, norsk, polish, portuguese,
romani
an, russian, slovenian, uppersorbian, serbian, swedish, turkish, ukenglish,
ukr
ainian, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/type1cm/type1cm.sty)
(/usr/share/texmf/tex/latex/psnfss/helvet.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty))
(/usr/share/texmf/tex/latex/psnfss/courier.sty)
(/usr/share/texmf/tex/latex/base/textcomp.sty
(/usr/share/texmf/tex/latex/base/ts1enc.def))
(/usr/share/texmf/tex/latex/geometry/geometry.sty

Package geometry Warning: Over-specification in `h'-direction.
`width' (614.295pt) is ignored.

Package geometry Warning: Over-specification in `v'-direction.
`height' (794.96999pt) is ignored.

) (/usr/share/texmf/tex/latex/psfrag/psfrag.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def)))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty)
(/usr/share/texmf/tex/latex/graphics/color.sty
(/usr/lib/texmf/tex/latex/config/color.cfg)
(/usr/share/texmf/tex/latex/graphics/dvipsnam.def))
No file tmpkRUaxb.aux.
(/usr/share/texmf/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1pnc.fd) <tmpkRUaxb.eps>

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

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.31 \includegraphics*[angle=0]{tmpkRUaxb.eps}

[1] (./tmpkRUaxb.aux) )
(see the transcript file for additional information)
Output written on tmpkRUaxb.dvi (1 page, 2980 bytes).
Transcript written on tmpkRUaxb.log.

Is it a problem that it is using pdftex instead of pslatex?

Darren Dale wrote:

Is it a problem that it is using pdftex instead of pslatex?

Yes.

i don't think so.

the example

from matplotlib.pyplot import *
text(0.5, 0.5, r'a \\ b')
savefig('test.eps')

runs without error here -- and latex is calling pdftex:

$ latex -v
pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)
kpathsea version 3.5.6
Copyright 2007 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Kpathsea is copyright 2007 Karl Berry and Olaf Weber.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX using libpoppler copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX using libpoppler source.
Primary author of pdfTeX using libpoppler: Peter Breitenlohner
(eTeX)/Han The Thanh (pdfTeX).
Kpathsea written by Karl Berry, Olaf Weber, and others.

Compiled with libpng 1.2.27; using libpng 1.2.27
Compiled with zlib 1.2.3.3; using zlib 1.2.3.3
Compiled with libpoppler version 0.10.5

could the OP perhaps post some more information?

sebastian.

···

On Wed, Aug 12, 2009 at 7:13 AM, D2Hitman<j.m.girven@...831...> wrote:

Ok, I shouldn't have posted before my first cup of coffee. Thank you
for correcting me.

Darren

···

On Wed, Aug 12, 2009 at 7:32 AM, Sebastian Busch<webmaster@...2599...> wrote:

Darren Dale wrote:

On Wed, Aug 12, 2009 at 7:13 AM, D2Hitman<j.m.girven@...831...> wrote:

Is it a problem that it is using pdftex instead of pslatex?

Yes.

i don't think so.

the example

from matplotlib.pyplot import *
text(0.5, 0.5, r'a \\ b')
savefig('test.eps')

runs without error here -- and latex is calling pdftex:

Darren Dale wrote:

the example

from matplotlib.pyplot import *
text(0.5, 0.5, r'a \\ b')
savefig('test.eps')

runs without error here -- and latex is calling pdftex:

... cup of coffee. ...

the example was not fair though as it wasn't using latex... this one is now:

from matplotlib import rcParams
params = {'backend': 'ps',
          'text.usetex': True,
          'ps.usedistiller': 'xpdf',
          }
rcParams.update(params)

from matplotlib.pyplot import *

text(0.5, 0.5, r'a \newline{} b')
savefig('test.eps')

it does not crash (the version with '\\' does) but does not produce a
line break, either...

best,
sebastian.

finally...

Sebastian Busch wrote:

...
it does not crash (the version with '\\' does) but does not produce a
line break, either...

text(0.5, 0.5, 'a \n b')

works.

Darren Dale-3 wrote:

Is it a problem that it is using pdftex instead of pslatex?

Yes.

I am trying a few things in matplotlibrc, but cannot change from pdftex...

Is there something obvious i am missing? If so what?

Cheers.

···

--
View this message in context: http://www.nabble.com/EPS-with-TeX-tp24934313p24934897.html
Sent from the matplotlib - users mailing list archive at Nabble.com.