2
$\begingroup$

Suppose I have a function defined:

g[z_]:=Sum[Sin[z/k!],{k,0,infinity}]

And I want to export the following Latex based on only the function definition

$$\sum_{k=0}^\infty \sin\left(\frac{z}{k!}\right)$$

Is it possible to do this in Mathematica? If so, how? Ideally it would work for any arbitrary function, or at least as often as possible.

$\endgroup$
1

2 Answers 2

2
$\begingroup$

You can use

g[z_] := Sum[Sin[z/k!], {k, 0, Infinity}]
g[z] // TeXForm

output is

\sum _{k=0}^{\infty } \sin \left(\frac{z}{k!}\right).

However $g(z)$ will be simplified, for example g[z_] := z+z will yield $2z$. If you want to avoid that just use g[z_] := Holdform[z+z].

$\endgroup$
1
$\begingroup$

The simplest way to do it select the equation and copy it as latex. It can be pasted in the latex editor as an equation. A picture is attached for references enter image description here

$\endgroup$
2
  • $\begingroup$ This helps, but I need this process automated since I'll be doing it for several hundred equations. $\endgroup$ Apr 8, 2021 at 22:11
  • $\begingroup$ You can also use TeXForm[] command available in Mathematica to get the Latex code of the equation. $\endgroup$ Apr 10, 2021 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.