Introduction to using Jupyter to write accessible mathematics

Introduction to using Jupyter to write accessible mathematicsΒΆ

In these pages I hope to provide a user-friendly guide to how to produce accessible notes for mathematics/statistics content. By accessible, the focus is to some extent on those who are visually-impaired, as the resulting notes will work with screen-readers and be zoomable, but there are further benefits. Many readers will know that in the UK accessibility legisltaion brought in in 2018 is particularly challenging for mathematics, as screen-readers struggle with mathematical notation that is rendered in PDFs, but the go-to tool for most mathematicians for decades has been PDFs produced through LaTeX. Many people have worked hard over the last few years to explore different solutions to this problem. A common approach now is to produce notes as HTML webpages, where the mathematics is rendered using MathJax, which can be parsed by screen-readers.

In this guide I will be walking through how you can produce HTML mathematics notes using Jupyter Notebook and Jupyter Book. You may well know that Jupyter Notebook is an open-source, web-browser based environment for writing code, primarily in Python, but also Julia and R. As we will see, it also allows us to write content using Markdown, a language for creating formatted text. This then allows us to produce nice HTML content. Jupyter Book is a separate open-source application that can be downloaded and installed, and can be seen as an extension that will make our content much fancier. I assume little or no prior knowledge of either software in this guide, however.

Note

At the risk of staing the obvious, there are alternative approaches to generating HTML mathematics notes. Thse include RMarkdown, Chirun, the lwarp LaTeX extension, and many more. As I shall hopefully demonstrate, however, I think using Jupyter Notbook and Jupyter Book provide a particularly nice set of tools for the task.

I will talk through all the stages of producing mathematical notes, but the basic process is:

  1. Write your notes in a Jupyter Notebook file using Markdown.

    • Simpler method: Download the file as an HTML file.

    • Advanced method: Use Jupyter Book to build a suite of HTML files.

  2. Fine somewhere to host your webpages.

Note

Before I get stuck in, a quick disclaimer: I do not pretend to be any sort of expert here, and was certainly not involved in the development of any of the tools I mention. I am simply someone who was looking to find a way to create accessible mathematics notes without too much head-scratching needed, and will now try to explain the way I did it.