doconce icon indicating copy to clipboard operation
doconce copied to clipboard

ipynb2doconce missing sympy latex and matplotlib figures

Open nagordon opened this issue 8 years ago • 4 comments

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.

nagordon avatar Sep 26 '16 12:09 nagordon

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

hplgit avatar Sep 26 '16 15:09 hplgit

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 avatar Oct 02 '16 13:10 KGHustad

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.

KGHustad avatar Oct 10 '16 22:10 KGHustad

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.

utsekaj42 avatar Nov 10 '17 13:11 utsekaj42