sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

attachments are not included when printing ipynb to pdf using the first option in our menu (which uses latex) #6720

Open williamstein opened 1 year ago

williamstein commented 1 year ago
  1. Make a simple notebook with a single markdown cell with an image attachment (e.g., like I want to attach to this ticket, but github won't let me. Jerks. But it's easy to make such a notebook).
  2. Try to print using the first option for print to pdf in the file menu.
  3. The image is broken.

WORKAROUND: Use any of the other print to pdf options in the menu, which use nbconvert. They work.

williamstein commented 2 months ago

Right now adding attachments is broken, so I added the attachment using jupyterlab, then opened the notebook in cocalc jupyter. It shows the image just fine, but indeed print to pdf fails:

image

So indeed this bug is still very much a problem.

williamstein commented 2 months ago

Now images (which are just blob links) are not included when printing to PDF via any of the four methods. So definitely not fixed.

williamstein commented 2 months ago

Now images (which are just blob links) are not included when printing to PDF via any of the four methods.

This was just a side effect of working on my dev server, which has extra layers of security.

Uploaded images print via ALL methods except the first option which is actually "nbconvert via latex".

williamstein commented 2 months ago

I think the solution here is to download all images locally, convert any svg's to png (or pdf or?), and modify the markdown to include the images is ![]() instead of img src. Then nbconvert fully works and even handles the svg's.

williamstein commented 2 months ago

In any case I changed the button to say that images aren't supported for this conversion method. Much more importantly, I fixed a different bug that was preventing latex printing from working properly with our fully supported default print method.

I do think this is well worth addressing, but via the following approach:

It's useful anyways to avoid depending on cocalc.com images.