Comments (5)
You're right - it gets unwieldy past a certain depth.
It's probably a lot more effort, but I like how sphinx handles this by having a maxdepth
parameter. So in this case, it could be an optional argument, with the default set at a reasonable H2 or H3 ?
from notebook-as-pdf.
Level 2 headings are now included (see aaa8565).
from notebook-as-pdf.
RE above, I've also opened an issue in the jupyterbook repo about possibly integrating this export method there.
Use-case
Below are two PDF exports from an example jupyter book that is not mine (ThreatHunter Playbook):
from notebook-as-pdf.
What do you think of including (only) h1
and h2
tags?
The reason i am hesitant to add "all headings" is that I don't enjoy the pdf table-of-contents UX when you have lots of levels of "folding". It makes it super hard to see things and read the titles without making the TOC part of the UI wider.
Another option I just thought of is to not use the "nesting" feature of a PDF TOC but instead prefix the headings with something like
(nothing) for h1
, · for h2
, ·· for h3
, etc. So an ASCII character to indicate "nesting" level.
from notebook-as-pdf.
Amazing! Nice work!
from notebook-as-pdf.
Related Issues (20)
- Embedding local images via markdown doesn't work HOT 10
- nbconvert failed: module 'asyncio' has no attribute 'run' HOT 2
- nbconvert v6.0.3 issue HOT 9
- Page width as config option HOT 1
- When rendering many notebooks some have a visible MathJax overlay HOT 6
- Nbconvert executes notebook twice using PDFviaHTML HOT 3
- Custom CSS styles as config option
- KeyError: 'template_paths' on M1 Mac, Big Sur 11.2 HOT 6
- Custom page height? HOT 2
- nbconvert failed: Navigation Timeout Exceeded: 30000 ms exceeded. HOT 1
- Question: Can we just have one single page for the pdf? HOT 4
- Image results are not shown in the PDF if `%matplotlib` magic commands are used HOT 2
- PDF is just one long page? HOT 1
- nbconvert failed: module 'asyncio' has no attribute 'run' HOT 1
- Text outside code cells is selected backwards
- Question: how to enable notebook-as-pdf for multiple user in jupyterhub
- Landscape mode HOT 1
- PdfFileWriter is deprecated and was removed in PyPDF2 3.0.0. Use PdfWriter instead. HOT 4
- Convert many notebooks into unique pdf
- Option to save pdf not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notebook-as-pdf.