-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipynb2pdf-without-code.sh
More file actions
21 lines (14 loc) · 1.04 KB
/
ipynb2pdf-without-code.sh
File metadata and controls
21 lines (14 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
infile=$1
# This will export the notebook and suppress all input code from
# the PDF
# This works, but it's all or nothing
#jupyter nbconvert EthicaTelemetryInvestigationPart2.ipynb --to=pdf --TemplateExporter.exclude_input=True
# This works for removing entire cells
# jupyter nbconvert EthicaTelemetryInvestigationPart2.ipynb --to=pdf --TagRemovePreprocessor.remove_cell_tags='{"hide_cell",}'
# This works, hides cell inputs but still shows the outputs
# jupyter nbconvert EthicaTelemetryInvestigationPart2.ipynb --to=pdf --TagRemovePreprocessor.remove_input_tags='{"hide_input"}'
# This works too, hides all outputs but leaves the code visible
# jupyter nbconvert EthicaTelemetryInvestigationPart2.ipynb --to=pdf --TagRemovePreprocessor.remove_all_outputs_tags='{"hide_input"}'
# Putting it all together, this should do all three
jupyter nbconvert $infile --to=pdf --TagRemovePreprocessor.remove_all_outputs_tags='{"hide_output"}' --TagRemovePreprocessor.remove_input_tags='{"hide_input"}' --TagRemovePreprocessor.remove_cell_tags='{"hide_cell",}'