Message Boards Message Boards


Export Graphics for Latex

Posted 8 years ago
4 Replies
4 Total Likes

I have to write scientific article with latex.

I must import some graphics from a Mathematica Notebook. What is the better way to do?

Does anybody know good references with explanations about it?


4 Replies

If you have Latin Modern fonts on your system you get a better result with

funs = {Sin[x], Normal[Sin[x] + O[x]^8]}; g = 
 Plot[Evaluate[funs], {x, 0, 2 Pi}, AxesLabel -> {"x", "Sin"}, 
  PlotLegends -> {Style[TraditionalForm[Sin[x]], 
     FontFamily -> "Latin Modern Roman"], 
    Style[Normal[Sin[x] + O[x]^8], 
     FontFamily -> "Latin Modern Roman"]}, 
  BaseStyle -> {FontSize -> 10, FontFamily -> "Latin Modern Roman"}, 
  Frame -> True]

Otherwise try with the Times font family.

POSTED BY: Gianluca Gorni


I produce the graphics using "Export" command as pdf format and I use "\includegraphics" to put the file in my LATEX's document.

funs = {Sin[x], Normal[Sin[x] + O[x]^8]}; g = Plot[Evaluate[funs], {x, 0, 2 Pi}, AxesLabel -> {"x", "Sin"}, PlotLegends -> funs, BaseStyle -> {FontSize -> 10}, Frame -> True] Export[NotebookDirectory[] <> "figure.pdf", Show[g]]

But I don't like the quality of the labels, legends, axes, ... and I have many problems (in the example the axeslabel is no correct,...).



You can also consider selecting the cell in Mathematica and then going to File > Save Selection As or File > Print Selection. In the second one, you can print to a PDF (I have found that this second option is the best way of getting a multiple-page PDF, but you may not need that for your figure). The first option is useful because it provides many other formats.

In LaTeX you can use \includegraphics to put the file in your document. This function is included in the graphix package, if I recall correctly.


POSTED BY: Otto Linsuain


is this a Latex or a Mathematica question? If you have a graphic in Mathematica, it is quite straight forward to export to a number of different formats, e.g.




generates files you can embed into Latex documents. It is quite straight forward to google how to embed pdfs into Latex.



POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract