I used to use an extension in classic mode to embed my table of contents such that when I export the notebook as a PDF, the TOC remains linked to the internal sections. In Jupyter Lab, I see the TOC on the left but there doesn't seem to be a way to get it into the notebook? I feel like there must be a shortcut I'm missing; re-coding the entire thing manually defeats the purpose I'd like to use jupyter for.
I tried:
- The most recent solution appear to be: https://github.com/ipython-contrib/jupyter_contrib_nbextensions, but I continue to get an error when I try to install the nbextension or the wrapper nbconfigurator.
jupyter contrib nbextension install --user
usage: jupyter-contrib [-h] [--debug] [--show-config] [--show-config-json] [--generate-config] [-y]
[--log-level JupyterContribApp.log_level] [--config JupyterContribApp.config_file]
[extra_args ...]
jupyter-contrib: error: argument --user: expected one argument
I think there's an issue between downloading nbextensions and getting it installed with its associated JavaScript and CSS files, but I'm not sure where to go from here.
Old things I tried that appear deprecated:
- Using the usual extension- it doesn't work with Jupyter Lab.
- Reverting back to classic mode manually using /tree instead of /lab, but the extension won't show up
- Per one answer here, using
contentsbut that doesn't appear to work. - Per How can I get the option 'Export Notebook to Html_toc' on the 'Export Notebook as...' menu in Jupyter Lab?, I tried forcing nbextensions in, but with the latest updates it seems like this is broken.
jupyter_contrib_nbextensionsis not for current Jupyter. Unless you are using NbClassic, it's no longer an approach that should be considered. So it is no longer the 'usual' extension and should not be considered such. Please mention versions in posts as Colonel's answer touches on Jupyter Notebook 7+ being a completely different beast. v7+ is built on JupyterLab components.