This a little library to extract Jupyter Notebook (.ipynb) cells.
The basics of this programm are described here by its original author. This is an adaptation due to deprecation or change in versions.
The cell extraction works by adding the tag #latex:tag_0
to the cell. Cells with the same tag will be exported to the same directory. In case there is no tag, the cell wont be exported.
Once the programm is executed, a couple of directorys will be created inside the parent dir. The important one is: filtered_cells
and images
. It will create also a format.tex
file which needs to be copyed inside your main.tex
. The filtered cells can be copyed and pasted to wherever you need them to be added. The next image shows a little example of the exported cells:
You need to install it:
pip install jupyter-cell-extractor
And run the next command in a cell or script:
from jupyter_cell_extractor import cell_extractor
cell = cell_extractor("your_book_name.ipynb")
cell.export_cells()
In case you want to use your own .tplx file, the option will be added in the future
You can use a different style for the cells by changing the .tplx
template. In this library I'm using this one
- Better the code
- Add more functionalities
Contributions are welcomed!!