# Mathematical symbols in Mathematica and Stack Exchange

How may I transfer mathematical text (with symbols, etc.) from Wolfram Mathematica into Stack Exchange?

• AFAIK, Mathematica has a TeX output filter available – Hagen von Eitzen Sep 19 '20 at 18:18
• This belongs on Meta – gen-ℤ ready to perish Sep 19 '20 at 22:47

Try TeXForm[] in Mathematica.

TeXForm[Integrate[f(x), {x,-7,\[Pi]}]]


which outputs

\int_{-7}^{\pi } f(x) \, dx


$$\int_{-7}^{\pi } f(x) \, dx$$


yields $$\int_{-7}^{\pi } f(x) \, dx$$. (footnote 1) Between double dollar signs, $$\int_{-7}^{\pi } f(x) \, dx \text{.}$$

It's not perfect, and you may want to tweak the results, but it is an 80+% solution.

(footnote 1) There are several style faults in the form of integrals produced by Mathematica. I would always style the given integral as \int_{-7}^{\pi } \; f(x) \, \mathrm{d}x, "$$\int_{-7}^{\pi } \; f(x) \, \mathrm{d}x$$", but there are plenty of sources that can't be bothered to ensure the limits of integration and integrand don't collide and don't correctly render operators in an upright font.

• $+1$. Every day we learn something new !!!. – Felix Marin Sep 19 '20 at 18:23
• Upright font for dx is the continental European convention, italic font is the US convention. – GEdgar Sep 20 '20 at 16:48
• thanks; I was using wrong input format for TeXForm function. This clears that up, I think. – Jim farned Sep 22 '20 at 16:10
• I often find myself simply right-clicking on the expression of interest and choose "Copy as LaTeX" from the context menu: s3.amazonaws.com/resources.gomodus.com/nb/latex.jpg – Andrey Mitin Oct 4 '20 at 19:05