All Projects → poulter7 → Ipynb Tex

poulter7 / Ipynb Tex

Include Jupyter notebook cells in TeX documents

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ipynb Tex

Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (+86.01%)
Mutual labels:  latex, jupyter
Cocalc
CoCalc: Collaborative Calculation in the Cloud
Stars: ✭ 888 (+520.98%)
Mutual labels:  latex, jupyter
Nb pdf template
A more accurate representation of jupyter notebooks when converting to pdfs.
Stars: ✭ 109 (-23.78%)
Mutual labels:  latex, jupyter
Bithesis
📖 Unofficial LaTeX templates for your bachelor graduation thesis (and more) here at BIT.
Stars: ✭ 132 (-7.69%)
Mutual labels:  latex
Fastdoc
Create publication-quality books from Jupyter notebooks
Stars: ✭ 134 (-6.29%)
Mutual labels:  jupyter
Paper
Lightning Network Paper
Stars: ✭ 136 (-4.9%)
Mutual labels:  latex
Nuaathesis
LaTeX document class for NUAA, supporting bachelor/master/PH.D thesis in Chinese/English/Japanese. 南航本科、硕士、博士学位论文 LaTeX 模板
Stars: ✭ 142 (-0.7%)
Mutual labels:  latex
Mathocr
A scientific document recognition system
Stars: ✭ 130 (-9.09%)
Mutual labels:  latex
Texme
Self-rendering Markdown + LaTeX documents
Stars: ✭ 1,970 (+1277.62%)
Mutual labels:  latex
Dapper Invoice
A billable-time invoice featuring style over substance
Stars: ✭ 135 (-5.59%)
Mutual labels:  latex
Pandoc Markdown Template
Markdown templates for Pandoc
Stars: ✭ 135 (-5.59%)
Mutual labels:  latex
Dvisvgm
A fast DVI, EPS, and PDF to SVG converter
Stars: ✭ 134 (-6.29%)
Mutual labels:  latex
Latex Cheatsheet
Template for a compact LaTeX Cheatsheet I made some years ago.
Stars: ✭ 136 (-4.9%)
Mutual labels:  latex
Hedgehog Lab
Run, compile and execute JavaScript for Scientific Computing and Data Visualization TOTALLY TOTALLY TOTALLY in your BROWSER! An open source scientific computing environment for JavaScript TOTALLY in your browser, matrix operations with GPU acceleration, TeX support, data visualization and symbolic computation.
Stars: ✭ 1,797 (+1156.64%)
Mutual labels:  latex
Docker Alpine Texlive Ja
Minimal TeX Live image for Japanese based on alpine
Stars: ✭ 140 (-2.1%)
Mutual labels:  latex
Pandoc Action Example
using the pandoc document converter on GitHub Actions
Stars: ✭ 131 (-8.39%)
Mutual labels:  latex
Practical Machine Learning With Python
Master the essential skills needed to recognize and solve complex real-world problems with Machine Learning and Deep Learning by leveraging the highly popular Python Machine Learning Eco-system.
Stars: ✭ 1,868 (+1206.29%)
Mutual labels:  jupyter
Nbgallery
Enterprise Jupyter notebook sharing and collaboration app
Stars: ✭ 135 (-5.59%)
Mutual labels:  jupyter
Jupyterlab
JupyterLab computational environment.
Stars: ✭ 11,659 (+8053.15%)
Mutual labels:  jupyter
Magic Latex Buffer
Magical syntax highlighting for LaTeX-mode buffers
Stars: ✭ 135 (-5.59%)
Mutual labels:  latex

ipynb-tex.sty Build Status

ipynb-tex is a simple style sheet which allows you to extract tagged cells out of a Jupyter notebook and include them in a TeX document

overview Rather than save output or copies of source code to insert into TeX docs, ipynb-tex always inserts the latest cells from your notebooks directly into TeX files.

Installation

In your main document directory, just make a symlink to the ipynb-tex.sty file.

ln -s /path/to/ipynb-tex/ipynb-tex.sty

Include cells in your .tex document

Command Description
\ipynbsource{notebook}[tag] Include the source from all cells sharing the tag "example".
\ipynboutput{notebook}[tag] Include the output from all cells sharing the tag "example".
\ipynb{notebook}[tag] Include the source and output from all cells sharing the tag "example".
\ipynbimage{notebook}[tag] Include an image
\ipynbtex{notebook}[tag] Include raw TeX output

Compile LaTeX

ipynb-tex uses PythonTeX to execute the cell extraction code. So, just as with PythonTeX, you'll need to execute pythontex as part of your document build. Also include --shell-escape to allow external functions to be called correctly.

pdflatex --shell-escape document.tex    #scan the document, figure out what Python needs to be executed
pythontex --rerun=always document       #executes the Python found in the document
pdflatex --shell-escape document.tex    #include any valid TeX printed from the Python execution
pdflatex --shell-escape document.tex    #ensure any included references are correctly handled

Tagging cells in a notebook

Toggle the toolbar UI

toggle toolbar ui

Tag a cell

tag a cell

Modifying this plugin

This repo comes with a ready to go version of ipynb-tex.sty, but if you want to make changes and rebuild it just run ./build, which merges ipynb-tex-template.sty and extract_cells.py to create ipynb-tex.sty.

There are no package dependencies required to run this script, but to execute the sample you'll need to include a set of dependencies.

pip install -r requirements.txt

Running Tests

pip install nose
nosetests

Todo

  • Remove the need to "rerun=always", by registering the [filename].ipynb as a dependency while pythontex is running.
  • Export cells only once, by making an in-memory variable which tags a file as already processed, to avoid repeated work.
  • Add a \ipynbdirectory which serves as the base path for all notebooks, so if you're compiling a doc with lots, no need to keep including the path
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].