Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: nbconvert failed when exporting to PDF #18

Open
troyraen opened this issue Dec 4, 2024 · 8 comments
Open

BUG: nbconvert failed when exporting to PDF #18

troyraen opened this issue Dec 4, 2024 · 8 comments
Labels
bug Something isn't working packages

Comments

@troyraen
Copy link

troyraen commented Dec 4, 2024

I ran a notebook (spectra_generator.md -- did not convert to .ipynb first) and then wanted to export it to some format that would save the output. I clicked:

  • File
  • Save and Export Notebook As
  • PDF

and got the following error:

500 : Internal Server Error
The error was:

nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so. Find further instructions at https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

This was on the 'Standard' server with the 'Default Astrophysics' image.

@troyraen
Copy link
Author

troyraen commented Dec 4, 2024

Maybe this feature is not intended to work on a .md file and so is not really a bug. If so, I'd like to know how to save the executed "notebook" with the output so I can show it to others.

FWIW, when I followed the same steps as above but chose HTML instead of PDF, the .html file downloaded successfully but it does not include the output.

@bsipocz
Copy link
Member

bsipocz commented Dec 4, 2024

I doubt that it's a markdown related issue, the latex dependencies seem to be missing instead (a couple of packages need to be apt-get installed in the image for this to work)

@bsipocz
Copy link
Member

bsipocz commented Dec 4, 2024

@troyraen
Copy link
Author

troyraen commented Dec 4, 2024

I converted the .md to .ipynb and tried again.

I got the same error when exporting to PDF, so the error itself does not seem to be caused by the markdown format (as @bsipocz said).

When exporting to HTML, the output was preserved for the executed .ipynb file (unlike the .md file). So I'd still like to know if it's possible (and if so, how) to export or save the executed .md file with the output preserved. We should document this. If the answer isn't simple, I can move the question to a different issue or take it offline so that this issue can focus on the nbconvert --> PDF failure.

@bsipocz
Copy link
Member

bsipocz commented Dec 4, 2024

I can move the question to a different issue or take it offline

Yeap, that can be a separate issue for the notebook repo, or a card for our project board. (outputs are not saved into the md files by default (that's one of the reasons we like them :) ), but I'm sure there is a way to include them in the HTML dump, but I need to dig around a bit to find a convenient way to do this.

@bsipocz bsipocz added the bug Something isn't working label Dec 4, 2024
@zoghbi-a
Copy link

zoghbi-a commented Dec 4, 2024

Thanks @troyraen for reporting this. In our effort to reduce the size of the images (to speed up its loading), it looks like latex packages were removed.
If you think this is important, we can add it back.

To export html from markdown with output, you can first do: File -> Jupytext -> Pair Notebook with ipynb document, then do the normal html export

@troyraen
Copy link
Author

troyraen commented Dec 4, 2024

Thanks @zoghbi-a, I'll try the Pair Notebook option when I log in again. It's confusing to see the PDF export option listed when it doesn't work, but I don't think that being able to do that is high priority.

@troyraen
Copy link
Author

troyraen commented Dec 8, 2024

Confirming that if I first click 'File -> Jupytext -> Pair Notebook with ipynb document' and then do 'File -> Save and Export Notebook As -> HTML' then the resulting .html file contains the output from the executed .md file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packages
Projects
None yet
Development

No branches or pull requests

3 participants