hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
311 stars 60 forks source link

ipynb2doconce missing sympy latex and matplotlib figures #85

Open nagordon opened 7 years ago

nagordon commented 7 years ago

I think this is more of a feature request, but the ipynb2doconce command does not capture latex output from sympy equations or matplotlib figures in jupyter notebooks. Thanks.

hplgit commented 7 years ago

Unfortunately, I will not be able to add this feature now. But feel free to contribute.

KGHustad commented 7 years ago

I like the idea. Perhaps including output from IPython/Jupyter notebooks should be optional? For my own use, I cannot think of a scenario where I would not want to include all the output, but I still feel there should be an option which allowed for just including the input. There is also the issue with how one distinguishes between input and output (such as printed results), and how this is going to fit in with how a DocOnce document is structured.

I made a quick modification to allow for inclusion of SymPy LaTeX, which seems to work perfectly well. Will probably push this soon. EDIT: Pushed to a new branch of my fork, see https://github.com/KGHustad/doconce/tree/ipynb2doconce_sympy_latex . Will push to master when I have had more time to test it.

I will have a look at matplotlib figures later.

KGHustad commented 7 years ago

ipynb2doconce includes LaTeX output as of 1b3d50c .

Exporting the matplotlib figures in a way that preserves quality is going to be harder as they appear to be stored only in as a low-res png.

utsekaj42 commented 6 years ago

According to this

from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png', 'pdf')

This allows one to at least generate pdfs of the figures in the notebook when downloading as latex.