1

Matlab has Matlab2Tikz while open for Mathematica2Tikz, more here. How can I export graphs such as Harary graphs from Mathematica to LaTex?

Example graph generated in Mathematica without finding support to export to LaTex.

enter image description here

hhh
  • 8,743
  • just export the eps plot from mathematica and use \includegraphics what did you try? what error message did you get? – David Carlisle Jan 31 '16 at 23:57
  • @DavidCarlisle there is no Tikz copying or similarly simple alternative? – hhh Feb 01 '16 at 00:07
  • apparently not if the question on the mathematica site is to be believed, but that would be a mathematica question so off site here really. you need to export something from mathematica, tikz or an image or whatever. what you can export from mathematica is off topic here once you have something then how you include it into latex is on topic. (calling conversion to tikz and re-plottng the image in tex macros "simple" compared to just including the mathematoca drawn image seems a strange choice of words:-) – David Carlisle Feb 01 '16 at 00:12
  • obviously those particular graphs which are just a few lines could be specified in latex without needing mathematica at all, but in general if your plots are using mathematica functionality including the image is a reasonable approach. – David Carlisle Feb 01 '16 at 00:14

1 Answers1

1

It can be done using wolframscript and latexalpha2wlua.sty

See https://tex.stackexchange.com/a/579254/161015 for a complete answer.

hh

\documentclass[12pt,a4paper]{article}

\RequirePackage[cache]{latexalpha2wlua} % option cache (faster on the second run) or nocache (recalculate always)

\begin{document}

\begin{figure} \wolframgraphics{Table[HararyGraph[i, 8, PlotLabel -> Subscript[H, i, 8]], {i, 2, 4}]}{HararyGraph} % default: pdf output \includegraphics{HararyGraph.pdf} \caption{Plot of HararyGraph from pdf} \centering \end{figure}

\end{document}

Simon Dispa
  • 39,141