TeXnology Inc.
Home     Macro Writing     Design     Data Visualization     E-Publishing     Jupyter!     Innovations     Samples     PNNL     LaTeX Training     About     Contact    

Publishing Jupyter Notebooks in LaTeX

Jupyter is a free, open-source, interactive tool known as a computational notebook, which researchers can use to combine software code, computational output, explanatory text and multimedia resources in a single document.

To give you a sense of its impact, Jupyter was awarded the 2017 ACM Software Systems Award--a prestigious honor it shares with Java, Unix, and the Web.

"One analysis of the code-sharing site GitHub counted more than 2.5 million public Jupyter notebooks in September 2018, up from 200,000 or so in 2015." www.nature.com

Publishing Jupyter Notebooks in LaTeX

  1. Using the nbconvert command with Jupyter provides an easy way of converting the notebook to a variety of formats, most notably HTML and LaTeX.

  2. Under the hood, nbconvert uses Jinja templates to specify how the notebooks should be formatted. These templates can be fully customized, allowing one to use nbconvert
    to create notebook conversions in different formats and styles.

  3. Once we've decided which elements to print in the book and which to leave out, we can develop a template that will provide the desired results.

  4. After running nbconvert we now have a LaTeX file, but for it to be publication ready, we
    need to format it nicely. This involves determining what fonts/colors/design is desirable, supplying the appropriate LaTeX code and finally running pdflatex to build the book.

Sample Notebook to Published Book
Click on image below to see `Look Inside' of book. "The Jupyter Notebook can combine narrative, code, and graphics -- the ideal combination for teaching anything programming related. That's why Andreas Müller chose to write his book, Introduction to Machine Learning with Python, in a Jupyter notebook."

Cover of Introduction to Machine Learning, produced from Jupyter Notebooks
                           Notebook to Publication Ready PDF
Click on the image below to see sample pages from a Jupyter Notebook by Tirthajyoti Sarkar, PhD., translated with nbconvert to LaTeX, with the resulting .tex file reformatted by TeXnology, using the Tufte Handout document style.
See Tirthajyoti's Notebook on GitHub at Set_Algebra_With_Python.ipynb

Image of sample page of Jupyter notebook conversion to pdf,
     by TeXnology. Click for full pdf of sample pages.


   Jupyter Notebook:

    Article -- Introduction to The Jupyter Notebook by the Jupyter Team

    Video -- Jupyter Notebook Tutorial, from Fullstack Academy

    Article -- Jupyter Notebook The Definitive Guide, by Datacamp

    Article -- Jupyter Notebook for Beginners: A Tutorial


     Easy, interactive, markdown tutorial

     Good quick reference
    Within Markdown cells, you can include mathematics in a straightforward way, using standard LaTeX notation: $...$ for inline mathematics and $$...$$ for displayed mathematics.

    The markup is passed to HTML using MathJaX, and to LaTeX in its native form. Importantly -- Markdown coding allows the document to be translated to
    both HTML and LaTeX for distribution of your document both on-line and in print.
   JupyterLab -- The Next Generation Jupyter Web Interface:

     Video description of features in the new interface for Jupiter Notebooks

New Developments


     From Project Jupyter: JupyterLab is ready for users
  • Drag-and-drop to reorder notebook cells and copy them between notebooks.
  • Run code blocks interactively from text files (.py, .R, .md, .tex, etc.).
  • Link a code console to a notebook kernel to explore code interactively without cluttering up the notebook with temporary scratch work.
  • Edit popular file formats with live preview, such as Markdown, JSON, CSV, and more.
   Jupyter and Galaxy integration:

     PLOS Computational Biology: Easing entry barriers into complex data analyses for
     biomedical researchers.

     Nature blog: Jupyter joins the Galaxy

   Jupyter and Gene Pattern integration:

     Video describing Gene Pattern working with Jupyter


We can convert your Jupyter Notebook to publishable PDF.

Can we help in other ways as well?

Please get in touch to discuss your project!

Amy Hendrickson
617 738-8029