I am looking for a mathematics workbook like Sympy live shell that you can do plots in, that has a TeX or LaTeX output.

  • 2
    Hi, welcome. What exactly do you mean by "LaTeX output"? – Torbjørn T. Feb 27 '17 at 19:56
  • the best example I can give is this: live.sympy.org The sympy live shell will calculate a python input and produce the output rendered in LaTex. Sage math can output raw LaTex, I was curious if there was a way to make it output rendered LaTex. – Anon Feb 27 '17 at 20:18
  • 1
    Now I'm just more confused. By "raw LaTeX", do you mean code? And the output from Sage you're talking about; output of what, exactly? You were talking about plots, do you mean just any plot that can be used in LaTeX (which could just be a .pdf file, or .png file), or do you want code using e.g. the pgfplots or pstricks package that will render to a plot? – Torbjørn T. Feb 27 '17 at 20:24
  • by "raw LaTeX" I mean code, for example: f(x) = x^2 latex( f) would produce: x \ {\mapsto}\ x^{2}. by plots I mean for example the plot of $x^{2}$ and its derivative – Anon Feb 27 '17 at 20:36

If you're familiar with the Sage Cloud and Python, just use that. You'll have access to all the goodies of sympy, and you can save the plots as for example PDF files, that can be used in a LaTeX document with \includegraphics.

For example if you have

import matplotlib.pyplot as plt
import numpy as np
import sympy as sp
fig,ax = plt.subplots(figsize=(3,2))

in a Sage worksheet and run that, you will get test.pdf in the project folder, that can then be downloaded, and used in a LaTeX file as


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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