You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
425 B
Bash
16 lines
425 B
Bash
# First convert the notebook into a HTML page
|
|
|
|
nb_path=$1
|
|
empty_string=""
|
|
nb_path_without_ext=$(echo "$nb_path" | sed "s/.ipynb/$empty_string/")
|
|
|
|
jupyter nbconvert --to html $nb_path
|
|
|
|
# Then convert the HTML into a PDF with Weasyprint
|
|
|
|
weasyprint -s notebook-to-pdf.css $nb_path_without_ext.html $nb_path_without_ext.pdf
|
|
|
|
# Then convert the PDF into a booklet PDF
|
|
|
|
pdfbook2 $nb_path_without_ext.pdf --no-crop --paper a4paper
|