takluyver / bookbook

Tools to use a collection of notebooks as 'chapters'
MIT License
99 stars 24 forks source link

Notebook links not converted correctly #4

Closed ketch closed 7 years ago

ketch commented 7 years ago

I'm having trouble with the treatment of links to notebooks in latex output. No matter what I do, running bookbook just converts them to hyperlinks (\href).

If I make a test markdown file with a link like

[link](01-notebook.ipynb)

and run

pandoc --filter ./filter_links.py -f markdown -t latex test.md

it works fine; I get Section \ref{sec:01-notebook} as expected. I've also tried patching nbconvert by pasting bookbook's filter_links.py code into nbconvert's version, and then running nbconvert on a notebook with links; that works correctly.

It seems to me like the convert_link code in bookbook simply never gets called. Do you have a working example so that I could verify whether the problem is with my setup?

ketch commented 7 years ago

I wonder if https://github.com/jupyter/nbconvert/commit/178ce3d31c92d06a4294634f12c8cc393db37216 or https://github.com/jupyter/nbconvert/commit/6ee0ebb386ae1e8b1ebaf56f7d38bbbabbb70de4 could possibly have broken this?

takluyver commented 7 years ago

Yep, I think one of those changes in nbconvert has indeed broken bookbook. Specifically, I think it's a change to the template that makes it no longer use the Jinja filter bookbook overrides.

ketch commented 7 years ago

I've tried patching it but so far without success.

takluyver commented 7 years ago

Have a go with that. You may need to update the pandocfilters package.

ketch commented 7 years ago

Thanks for the help. Somehow it still does not work for me. It must be a problem with my setup, because the test also fails on my system.

ketch commented 7 years ago

I got things working, as noted in my comment on https://github.com/takluyver/bookbook/issues/5. Thanks again, and many thanks for creating this! It has been very useful. In case you're interested, the project I'm using it for is here (it's somewhat of a mess at the moment):

https://github.com/clawpack/riemann_book

takluyver commented 7 years ago

Great, thanks for helping to track down bugs in experimental code :-)