Question: What is the quickest and best way to export a plot image from Mathematica to a $\LaTeX$ Editor? Is there something quicker than exporting it to an image and then including it in the $\LaTeX$ document?

Answer: 
I usually `Export` to hi-res PNG bitmaps for ease of use (there are a number of discussions on how best to export high-quality images on this forum. Take a peek at the right column of this page under "Related"). Personally I like notebooks that do not need any mouse-clicking or any other user interaction to produce output which makes reruns that much more comfortable and and most of all reproducible.

For ease of use when dealing with many different graphics I prepare a notebook for each of these and also generate the LaTeX code for insertion in my document. The graphics get their name from the notebook so you can easily spawn different versions by renaming the notebook. 

```
plot = Plot[Sin[x], {x, 0, 10}]

```

![Mathematica graphics](https://i.stack.imgur.com/k2n5e.png)

```
(*gfxname = StringTake[FileNameSplit[NotebookFileName[]][[-1]], {1, -4}]*)

```

EDIT: more concise and portable:

```
gfxname = FileBaseName[NotebookFileName[]]

```

> 
> "2012-05-04\_Plot\_Export"
> 
> 
> 

```
Export[gfxname <> ".png", plot];

StringReplace["\\begin{figure}[!htb]\\centering
 \\includegraphics[width=1\\textwidth]{XXX}
 \\caption{Put your caption here.} 
 \\label{fig:XXX}
 \\end{figure}
 ", "XXX" -> gfxname]

```

The resulting output can be copied as plaintext or you might even splice it directly into your document (although this is a bit much for casual use).

```tex
\begin{figure}[!htb]\centering
\includegraphics[width=1\textwidth]{2012-05-04_Plot_Export}
\caption{Put your caption here.} 
\label{fig:2012-05-04_Plot_Export}
\end{figure}

```
I just figured out the following workaround imitating the psfrag convenience while avoiding intense programming or additional software:

1. Create a new PlotTheme as described [here](https://mathematica.stackexchange.com/questions/54545/is-it-possible-to-define-a-new-plottheme?newreg=152b31896aa843649f4693beeb69c7a1). It should contain the Latex fonts i.e. `FontFamily->"CMU Serif"`, the font size of the document to be created, i.e. `FontSize->11` and the final size of the plot via `ImageSize->425`. The latter is necessary for reproducible font sizes. My result looks like this:

```
Themes`AddThemeRules["Export",
DefaultPlotStyle->Thread@Directive[ColorData[97,"ColorList"], Thick],
Frame ->True, Background -> None, LabelStyle -> {FontSize->11,           
FontFamily -> "CMU Serif"}, ImageSize -> 425, PlotMarkers -> {Automatic, Small}];

```
2. Use the new PlotTheme on the figure like so: `Plot[...,PlotTheme->"MyTheme"]` and export as EPS
3. Import into Latex with size of 100%.

I ended up creating a small version with 212pt Image Size and a larger for full-page plots of 425pt. Also, I made a package to have them ready at every session.
This imitates psfrag in the way that if the document font size or -style changes, the plots can be redrawn quickly by simply changing the custom themes and exporting again. 

This is not a proper solution to the problem, but an easy workaround, which should be sufficient for most cases. It might not be enough for a journal article, though:

[![](https://i.stack.imgur.com/506tX.png)](https://i.stack.imgur.com/506tX.png)

In general it is a shame that Mathematica cannot separate graphics and text upon export. Matlab and most other Software packages have much better latex export functionalities. Maybe it is just a marketing thing - making it hard to avoid the Mathematica style. In any case a much-needed feature for v11!