SciPy 2023

Scientific and technical publishing with Python and Quarto
07-13, 15:00–15:30 (America/Chicago), Amphitheater 204

In research and data science, effective communication requires weaving together narrative text and code to produce elegantly formatted output. By embedding executable Python code blocks inside markdown, the open-source publishing platform, Quarto, works with Jupyter and VS Code to enable you to create these fully reproducible documents and reports with the format and styling you need. In this talk I’ll share how to get started and a few of my favorite things in Quarto including creating a manuscript, presentation and website in HTML, PDF and Word from a single source file, and creating lessons, reports, and Confluence documents.


Research and data science isn’t just experiments and code, it’s also communicating about our results, creating reports, sharing analyses, and teaching. To communicate effectively, we need to weave together narrative text and code to produce elegantly formatted, interactive output. Not only does it need to look great, but it needs to be reproducible, accessible, easily editable, diffable, version controlled and output in a variety of formats, such as PDF, HTML and MS Word. Jupyter has already made so much of this possible! The open-source publishing platform, Quarto, combines with Jupyter, or is a VS Code extension, so that we can easily use the output format and the styling that’s needed for any situation. You can author documents as plain text markdown or Jupyter notebooks with scientific markdown, including equations (LaTeX support!), citations, cross references, figure panels, callouts, advanced layouts, and more.

Quarto (https://quarto.org/) is a markdown format that adds executable Python code blocks and build on top of Pandoc to produce a variety of output documents. This allows you to create fully reproducible documents and reports—the Python code required to produce your output is part of the document itself, and is automatically re-run whenever the document is rendered. This means you can create documents as plain text markdown or Jupyter notebooks that can be easily rendered into presentations, websites and manuscripts in a variety of journal formats. You can also engage readers by adding interactive data exploration to your documents using Jupyter Widgets, htmlwidgets for R, Observable JS, and Shiny.

In this talk, I’ll discuss how to author these dynamic, computational documents with Quarto and Python, showing how to get started and highlighting a few of my favorite things. I’ll walk through how to use a single source document to target multiple formats - transforming a simple document into a presentation, a scientific manuscript, a website, a blog, and a book in a variety of formats including HTML, PDF and MS Word. I’ll share workflows for creating and automating reports, an approach to creating online lessons, and finally how to publish Jupyter notebooks within existing content management systems like Hugo, Docusaurus, and Confluence, so that you can get started creating whatever content you need.

Tracy Teal is the Open Source Program Director at Posit. Previously, she was a co-founder of Data Carpentry and the Executive Director of The Carpentries. She developed open source bioinformatics software as an assistant professor at Michigan State University and holds a PhD in computation and neural systems from California Institute of Technology. Tracy is involved in the open source software and reproducible research communities, including serving on advisory committees for NumFOCUS, pyOpenSci, EarthLab and carbonplan, and has been working with open source communities, developing curriculum, and teaching people how to work with data and code as a developer, instructor and project leader throughout her career.