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

make_pdf.py cannot find riemann.tex #240

Open
burakbayramli opened this issue Jan 11, 2022 · 6 comments
Open

make_pdf.py cannot find riemann.tex #240

burakbayramli opened this issue Jan 11, 2022 · 6 comments

Comments

@burakbayramli
Copy link

burakbayramli commented Jan 11, 2022

Hi, when I try to generate a PDF, it runs almost until the end but I get the error below,

...
[NbConvertApp] Writing 777704 bytes to build_pdf/13-Euler_approximate.ipynb
[NbConvertApp] Converting notebook build_pdf/14-FV_compare.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python
[NbConvertApp] Writing 497763 bytes to build_pdf/14-FV_compare.ipynb
INFO:__main__:Combined 15 files
INFO:__main__:Converting to latex
    value = self._validate(obj, dynamic_default())
  File "/home/user/Documents/env3/lib/python3.6/site-packages/nbconvert/preprocessors/svg2pdf.py", line 59, in _inkscape_version_default
    stderr=subprocess.PIPE)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'inkscape': 'inkscape'
Traceback (most recent call last):
  File "../files_for_latex_pdf/fix_latex_file.py", line 8, in <module>
    lines = open(fname,'r').read()
FileNotFoundError: [Errno 2] No such file or directory: 'riemann.tex'
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `riemann'.

If I'm not mistaken the code is supposed to create a riemann.tex but it is also trying to read it before it creates it? Is there a bootstrap riemann.tex file that I need?

Apart from this error, I am able to run the notebooks on their own without any problems (except, partially, the claw code, it generates the graph but doesn't animate)

Thanks,

@ketch
Copy link
Member

ketch commented Jan 11, 2022

Sorry, I think the software requirements for making this work are not well documented and now even I don't recall everything that is required. But I think you need to install Inkscape:

FileNotFoundError: [Errno 2] No such file or directory: 'inkscape': 'inkscape'

nbconvert uses inkscape to do some image conversion (svg to pdf).

@maojrs
Copy link
Contributor

maojrs commented Jan 11, 2022

Indeed, it seems you are running into an error when running fix_latex_file.py, which assumes riemann.tex has already been created, but riemann.tex is not being created in the first place. I think nbconvert might have an inkscape dependency, so I agree with @ketch , to try to install inkscape.

If you elaborate more on not being able to run the claw code in the notebooks, maybe we can help also with that.

@burakbayramli
Copy link
Author

@ketch @maojrs Thanks for your answers, I install inkspace that error went away.

Now I have a different one, it says can't find riemann.tplx this file exists under build_pdf but it is not picked up for some reason. I copied it one level up, still same problem.

    return self._load_template(name, self.make_globals(globals))
  File "/home/user/Documents/env3/lib/python3.6/site-packages/jinja2/environment.py", line 857, in _load_template
    template = self.loader.load(self, name, globals)
  File "/home/user/Documents/env3/lib/python3.6/site-packages/jinja2/loaders.py", line 429, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: riemann.tplx
Traceback (most recent call last):
  File "../files_for_latex_pdf/fix_latex_file.py", line 8, in <module>
    lines = open(fname,'r').read()
FileNotFoundError: [Errno 2] No such file or directory: 'riemann.tex'
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)

@rjleveque
Copy link
Member

We didn't document the pdf build process very well in part because we didn't intend for users to build the pdf -- if you want the hard copy you should really buy the SIAM book (or perhaps access the ebook through your library), since they kindly gave us permission to share the notebooks and html files free of charge, but not the pdf.

Also it was quite a complicated procedure to get things fixed up to the format they needed for typesetting, and many of the changes we made were done by hand and/or ended up on a private branch. It was also rather fragile in terms of some of the underlying software changing, so I'm not sure we could reproduce the pdf file ourselves at this point. Sorry!

@burakbayramli
Copy link
Author

Dr. Leveque, thanks for the response. I managed to generate .tex from Jupyter UI for every ipynb, ran pdlatex on them and collated the PDFs. For different type of output I printed to PDF on notebooks themselves; this will work fine. Thanks for making such a great book available.

@rjleveque
Copy link
Member

Yes, that's a good way to get a pdf out of the notebooks, glad to hear it gave something useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants