How to get a plot from Mathematica to Latex (in laymens)

In summary, the conversation discusses how to get a graph or plot from Mathematica into WinEdit. It is explained that copying and pasting does not work and the solution is to save the picture as a separate file and include it in the LaTeX document. The process of inserting the image in LaTeX is also mentioned, and the option of using LyX, a program that simplifies the use of LaTeX, is suggested.
  • #1
DeanDeanDean
2
0
OK.

Could somebody please tell me how to get a graph/plot from Mathematica into WinEdit.

I've seached on the internet and it all talks about source codes and a lot of other stuff I don't understand.

Copy and paste does not seem to be an option!

Could some one exlpain to how to do it? I'm desparate.

Thanks.
 
Physics news on Phys.org
  • #2
No, copy/paste only works in programs like Word, not in markup languages like LaTeX (or HTML, for that matter).

You need to save the picture as a separate file, and include that in your LaTeX document.
In Mathematica, you can right-click the image and click "Save graphic as...", if you have Mathematica > 7.
I suggest saving it as either .eps or .pdf, if you use latex(+dvips+pspdf) or pdflatex respectively. The most convenient place will be in the same folder where your .tex document is, or for example in an "images" subfolder.

In LaTeX, you can then insert the image, see for example this link.
 
  • #3
I don't mean to disparage the OP, but have you considered LyX instead of writing LaTeX source? It still won't be as 'easy' as Word / OpenOffice / Wordperfect / Pages, but it may be more your speed (if you don't have any scripting / programming experience or inclination / time to learn).
http://www.lyx.org/

Note that you still need to save images, but you just do mouse clicks to import the image, rather than coding.
 
  • #4
I'd second the recommendation for considering LyX*; it's an intermediate step between WYSIWYG users and those of us who speak LaTeX fluently.



*I've gotten friends started on the path to LaTeX by this route; it seems to have worked well for them.
 
  • #5


Sure, I'd be happy to help. Getting a plot from Mathematica into Latex is actually quite simple. First, you'll want to save your plot as a graphic file in Mathematica. This can be done by right-clicking on the plot and selecting "Save Graphic As". Make sure to choose a file type that is compatible with Latex, such as PNG or EPS.

Next, you'll need to insert the graphic into your Latex document. This can be done using the \includegraphics command and specifying the file path for your saved plot. You may need to use the graphicx package in your Latex document to use this command.

Finally, make sure to compile your Latex document to see the plot in your final document. You may need to play around with the size and placement of the plot in your Latex code to get it exactly how you want it.

I hope this helps! If you have any further questions, don't hesitate to ask. Good luck!
 

Related to How to get a plot from Mathematica to Latex (in laymens)

1. How do I export a plot from Mathematica to Latex?

To export a plot from Mathematica to Latex, you can use the "Export" function and specify the file format as "EPS" or "PDF". This will create a file that can be easily inserted into your Latex document.

2. Can I customize the appearance of the exported plot?

Yes, you can customize the appearance of the exported plot by using the options available in the "Export" function. For example, you can specify the image size, resolution, and font size to match your Latex document.

3. How do I include the exported plot in my Latex document?

To include the exported plot in your Latex document, you can use the "includegraphics" command and specify the path to the exported file. Make sure to also include the necessary Latex packages for graphics, such as "graphicx".

4. Can I edit the exported plot in Latex?

No, the exported plot from Mathematica is a static image and cannot be edited in Latex. However, you can make changes to the plot in Mathematica and export it again to update the plot in your Latex document.

5. Are there any other ways to get a plot from Mathematica to Latex?

Yes, you can also use the "Save As" function in Mathematica and save the plot as a "Tex" file. This will create a Latex code that you can directly copy and paste into your Latex document. However, this method may not give you as much customization options as the "Export" function.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
21
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
987
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top