MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica and LyX - Graphics and equations

  • To: mathgroup at
  • Subject: [mg95786] Re: [mg95711] Mathematica and LyX - Graphics and equations
  • From: Curtis Osterhoudt <cfo at>
  • Date: Tue, 27 Jan 2009 06:59:08 -0500 (EST)
  • Organization: LANL
  • References: <>
  • Reply-to: cfo at

On Sunday 25 January 2009 04:53:43 TL wrote:

> 1) What is the best way to export graphics from Mathematica? I currently 
> use eps format, but there seems to be a weird bug with it - I'm not sure 
> whether it's a Mathematica or LyX or LaTeX issue - for example I have 2 
> vectors in my graphic and the head of the last one drawn is not 
> displayed in the final PDF version of my document. I found a workaround 
> for it by drawing objects twice in the graphic that way if some parts of 
> the object is missing it wouldn't matter since the one underneath will 
> be fine.


> Thanks once again to all of you who took their time to reply
> TL

   I don't see that you mention which OS you use Mathematica and LyX on; the following is what I use on linux and Windows, though it may work just as well on OS X.

     I usually produce my graphics in Mathematica, and then use XFig to edit them (people familiar with XFig will probably shake their heads and shrug a little, as it's sometimes a beastly little program to use -- *but* it is the only one I have found which can easily do what I want to do). My steps are:

     1. Produce the graphic in Mathematica. 
     2. Export said graphic (usually as .pdf).
     3. using linux, run "pstoedit -f xfig the_exported_graphic.pdf    the_new_graphic.fig"    (this converts the .pdf into the .fig format). I think equivalent programs exist for Windows, but I haven't figured it out yet.
     4. Edit as necessary, the .fig file using XFig (or JFig in Windows). XFig has the nice property that it can embed _proper_ LaTeX code into the figure, which eventually gets typeset by LyX. This means that all the fonts and so forth will look _right_ in the final document.
     5. Include the .fig file in the LyX document ( Insert -> File -> External Material, then under "Template" choose xfig ). LyX should show a proper graphics preview, with a fully typeset figure.

    It's an involved process, though I'm very used to it now. I even have a Mathematica package which will take an XFig file, change axes to proper weights, change the fonts the way I like them, and so on. 

     Best of luck. I am quite happy with Mathematica, I love LyX, and XFig has met my needs heretofore. Hopefully something analogous will obtain for you.


Curtis Osterhoudt
cfo at
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments

  • Prev by Date: Re: Partial derviatives in mathematica
  • Next by Date: Re: Partial derviatives in mathematica
  • Previous by thread: Mathematica and LyX - Graphics and equations
  • Next by thread: Re: Mathematica and LyX - Graphics and equations