takluyver / bookbook

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

References not converted to latex when template extends report.tplx #5

Closed ketch closed 7 years ago

ketch commented 7 years ago

If one uses bookbook.latex with a template that starts with

((*- extends 'report.tplx' -*))

then cross references are not properly converted to latex; they are simply formatted as hyperlinks with \href{}. This seems to be caused by the following section of nbconvert/templates/latex/report.tplx:

((* block markdowncell scoped *))
((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'latex', extra_args=["--chapters"]) )))
((* endblock markdowncell *))
ketch commented 7 years ago

As a hacky workaround, I've copied filter_links.py to my book directory and set

((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'latex', extra_args=["--chapters",'--filter', './filter_links.py']) )))

in my template.

takluyver commented 7 years ago

Aha, I hadn't noticed that report.tplx overrides the markdowncell definition. That probably means there's a bug in nbconvert as well.

takluyver commented 7 years ago

This should work with the development version of nbconvert, or 5.2 when we release it.