tex_demo problem

Hi,

I've been testing my matplotlib 0.86.2 installation on Fedora Core 4 and hit a problem I can't solve. If I do "python tex_demo.py" in the examples directory it seems to hang up. A quick "ps faxw" and a bit of digging shows that the problem is that on my installation of tetex, TeX isn't recognizing \rmfamily:

freyer:~/.matplotlib/tex.cache> tex 0885e19fbc15d1bc2b5e1d3ac6018bee.tex
This is TeX, Version 3.141592 (Web2C 7.5.4)
(./0885e19fbc15d1bc2b5e1d3ac6018bee.tex
! Undefined control sequence.
l.5 {\rmfamily
               \TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi...

? x

What is the problem here? I searched the mailing list and no one else seems to be having this trouble, so obviously it's my fault, but I can't quite figure out how.

I wonder what \rmfamily is doing there, I don't see it in my copy of
tex_demo.py. It works ok for me even if I add \rmfamily if I have
text.tex.engine=latex in matplotlibrc, and fails if I have it set to tex. I
I'm guessing this is the source of your trouble.

Darren

P.S. I'm not able to run tex_demo at all if I use the tex backend instead of
latex. I see that some changes were made to the font commands in
texmanage.get_tex_command, have these changes been tested with the tex
backend?

···

On Tuesday 24 January 2006 16:36, Stephen Walton wrote:

Hi,

I've been testing my matplotlib 0.86.2 installation on Fedora Core 4 and
hit a problem I can't solve. If I do "python tex_demo.py" in the
examples directory it seems to hang up. A quick "ps faxw" and a bit of
digging shows that the problem is that on my installation of tetex, TeX

isn't recognizing \rmfamily:
> freyer:~/.matplotlib/tex.cache> tex 0885e19fbc15d1bc2b5e1d3ac6018bee.tex
> This is TeX, Version 3.141592 (Web2C 7.5.4)
> (./0885e19fbc15d1bc2b5e1d3ac6018bee.tex
> ! Undefined control sequence.
> l.5 {\rmfamily
> \TeX\ is Number
> $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi...
>
> ? x

What is the problem here? I searched the mailing list and no one else
seems to be having this trouble, so obviously it's my fault, but I can't
quite figure out how.

Darren Dale wrote:

I wonder what \rmfamily is doing there, I don't see it in my copy of
tex_demo.py. It works ok for me even if I add \rmfamily if I have
text.tex.engine=latex in matplotlibrc, and fails if I have it set to tex. I
I'm guessing this is the source of your trouble.

It comes from TexManager.get_tex_command() at my recommendation.

P.S. I'm not able to run tex_demo at all if I use the tex backend instead of
latex. I see that some changes were made to the font commands in
texmanage.get_tex_command, have these changes been tested with the tex
backend?

Apparrently not. We should change those \??family commands to whatever the
appopriate PlainTeX commands are.

···

--
Robert Kern
robert.kern@...287...

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
  -- Richard Harter

Darren Dale wrote:

It works ok for me even if I add \rmfamily if I have text.tex.engine=latex in matplotlibrc, and fails if I have it set to tex.

Thanks, Darren, that turned out to be the problem, although I did not have a text.tex.engine directive in my matplotlibrc file and assumed it defaulted to latex. Apparently it defaults to tex. John is right in his followup: if the ??family directives are going to be used, then latex needs to be the default tex engine.

Steve

I moved the font command stuff to make it work with latex and hide it from
tex. I do not know how to use sans-serif fonts with plain tex, and havent
figured out how to do so while supporting italics, boldface, etc, so
sans-serif remains unsupported for now with the tex backend.

(My personal opinion is that if someone wants to print "my text" in sans-serif
fonts with latex, they should do '{\sffamily my text}' just like they would
in a regular latex document. Just my two cents.)

Darren

···

On Tuesday 24 January 2006 18:19, Robert Kern wrote:

Darren Dale wrote:
> I wonder what \rmfamily is doing there, I don't see it in my copy of
> tex_demo.py. It works ok for me even if I add \rmfamily if I have
> text.tex.engine=latex in matplotlibrc, and fails if I have it set to tex.
> I I'm guessing this is the source of your trouble.

It comes from TexManager.get_tex_command() at my recommendation.

> P.S. I'm not able to run tex_demo at all if I use the tex backend instead
> of latex. I see that some changes were made to the font commands in
> texmanage.get_tex_command, have these changes been tested with the tex
> backend?

Apparrently not. We should change those \??family commands to whatever the
appopriate PlainTeX commands are.

TeX is the default, because it is a little bit faster than LaTeX (about 30%
for the small files generated by mpl). I personally use the latex backend, I
am more familiar with that set of commands.

Darren

···

On Tuesday 24 January 2006 18:54, Stephen Walton wrote:

Darren Dale wrote:
>It works ok for me even if I add \rmfamily if I have
>text.tex.engine=latex in matplotlibrc, and fails if I have it set to tex.

Thanks, Darren, that turned out to be the problem, although I did not
have a text.tex.engine directive in my matplotlibrc file and assumed it
defaulted to latex. Apparently it defaults to tex. John is right in
his followup: if the ??family directives are going to be used, then
latex needs to be the default tex engine.