Skip to content

Commit 06113d3

Browse files
committed
Merge branch 'main' of github.com:rambasnet/Python-Object-Oriented-Programming
2 parents 0ac5e8e + 2b602dd commit 06113d3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ Once Python 3 and Jupyter Notebook are installed, open a terminal change the wor
7878
```
7979

8080
This will start a Jupyter session in your browser. Start from the `notebbooks/OO-Table-of-Contents.ipynb`
81+
82+
#### Generating PDFs of notebooks on Linux system
83+
84+
- Open a terminal and run the following command. The corresponding pdf files of all the notebooks (*.ipynb) will be generated and stored in .pdfs folder.
85+
86+
```bash
87+
bash generatepdfs.sh
88+
```

generatepdfs.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#! /bin/bash
2+
3+
# Script to convert jupyter notebooks to PDF files. The pdfs are saved in ./pdfs folder
4+
5+
sudo apt update
6+
sudo apt install -y pandoc texlive texlive-xetex > /dev/null
7+
8+
files=$(find . -name '*.ipynb')
9+
for f in $files; do
10+
echo Converting: $f
11+
jupyter nbconvert --log-level=0 --output-dir='./pdfs' --to pdf $f > /dev/null
12+
done

0 commit comments

Comments
 (0)