spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
450 stars 130 forks source link

LaTeX Warning: Hyper reference `markdown-cells:' undefined #664

Closed mgeier closed 1 year ago

mgeier commented 2 years ago

LaTeX Warning: Hyper reference `markdown-cells:' on page 28 undefined on input line 2460.

LaTeX Warning: Reference `markdown-cells:' on page 28 undefined on input line 2 460.

I don't know where this comes from, but I'll search for markdown-cells. I don't know if the final colon is part of the reference or not?

Yes the colon is part of the reference but there is no target with this name. This originates in

    "It's also possible to create a\n",
    "[link to the beginning of the current page](#),\n",
    "by simply using a `#` character:\n",
    "\n",

from markdown-cells.ipynb. I guess nbconvert creates the mark-up? I see there exists two related labels in the tex mark-up:

\section{Markdown Cells}
\label{\detokenize{markdown-cells:Markdown-Cells}}\label{\detokenize{markdown-cells::doc}}

so it should be either one of them I guess. Assuming "current page" in this context is web page for HTML output and in the LaTeX output it should go to start of included notebook? (not sure).


This looks more like some upstream issue (nbconvert?) but I am not sure as I don't have clear view of toolchain.

A LaTeX-hacker approach would be to modify \nbsphinxstartnotebook macro to add some \phantomsection and a \label using the name of notebook file followed by a colon... this would at least fix this one.

Originally posted by @jfbu in https://github.com/spatialaudio/nbsphinx/issues/657#issuecomment-1206375696