question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to build pdf with pdflatex when notebook is in a subdirectory

See original GitHub issue

Describe the bug

Given the template project, when “notebooks.ipynb” is moved to a subdirectory and _toc updated accordingly, the PDF failed to build due to the output image being not found by Latex.

Latex error message:

'LaTeX Warning: File `{_build/jupyter_execute/notebooks_2_0}.png' not found on input line 385.'

Note that the output image is properly generated by the notebook, but in the proper sub-directory: _build/jupyter_execute/examples/notebooks_2_0.png

Building the HTML works as expected.

To Reproduce

  • Start from the basic example jupyter-book create mynewbook/
  • Move the notebooks.ipynb into a subdirectory:
cd mynewbook; mkdir examples; move notebooks.ipynb examples
  • Adjust _toc accordingly:
- file: content
  sections:
    - file: markdown
    - file: examples/notebooks
  • jb build --builder pdflatex newbook will trigger the error

Expected behavior

The image file path in the generate latex source files should mirror the execution structure such that the generated images are found, and the PDF should be generated w/o errors.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
jmsheacommented, Feb 11, 2022

@AakashGfude I have confirmed that my issue is different and have created a new issue that includes details and a minimal example: https://github.com/executablebooks/jupyter-book/issues/1636

1reaction
jmsheacommented, Feb 11, 2022

@AakashGfude Thanks for your help! I believe you are correct. As an experiment, I copied a few of my directories and ran with --builder pidflatex, and it didn’t give me any more errors. The Chapters were numbered incorrectly (every section labeled 0.x instead of just x), but at least I can compile. Now the problem is that it is not easy for me to flatten my hierarchy because I have multiple files with the same names in the subdirectories. But I can roll some Python to get it done until that issue is fixed.

I’ll try to find the right issue to post to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick build hangs, pdf file is empty! - LaTeX Stack Exchange
tex files, now I get the error that the input files cannot be found, although it works in my main folder, strange thing....
Read more >
python - No template sub-directory with name 'lab' found in the ...
I have tried googling the error, the closest thing I have found so far is this which is similar but unanswered and not...
Read more >
How to Convert Jupyter Notebooks into PDFs
The good thing about downloading LaTeX is that it makes your analysis looks like a research paper, which is very legit. Run nbconvert...
Read more >
Common Mistakes that cause Automated Processing to Fail
Double subscript/superscript " errors; PDF conversion failure in papers with complex section structure; arXiv system attempts processing with PDFLaTeX for ...
Read more >
Problem during submission of revised manuscript
1. Please verify that all associated TeX related files ( . · 2. Please verify that files are not referenced in sub-directories/subfolders, otherwise...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found