Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

export notebook output to html

I've spent some hours looking for and trying out many different methods to achieve this, but it seems there is no simple way to get the whole output from an evaluated to html. Should I create a feature request ?

Here is what I've tried:

  • make one single pretty_print command and then using the MathML interface extract the code: works but it is impossible to do line breaks (they appear only as vertical displacements and the text then continues from the same horizontal position), and anyway it is not always easy to have all the output in one pretty_print statement
  • print to Latex: the code generated requires some fine tuning and then I would have to convert it to html anyway
  • copy the page source from the sagemath output: there is just too much clutter coming with it and the code obtained is not really MathML
  • put the %html comment at the beggining of the cell
  • etc.

So in the end I used the simple technique of copying and pasting individually each output from my cell's print commands into my html document and inserting the MathML from each pretty_print box's context menu one by one...

Is there a simpler way to generate a block of html from the entire content of an evaluated sagemath cell ?

If it can help I can post my Sagemath worksheet. Thanks and Regards, -Louis