Accessible LaTeX Mathematics (Short Version)


  Home   CV   Articles   arXiv   Google Scholar   ResearchGate   GitHub   ORCID   MathSciNet   LinkedIn   Financial Simulator
This page shows a simple example of making LaTeX accessible for visually impaired people via HTML and MathJax.

Test Pages:     Various formatting     Part of my article     The page constructed below

Below is an example. Assume we have a TeX file:

\documentclass[12pt]{article}
\usepackage{amssymb, amsfonts, amsmath}
\begin{document}
Hello, world!

\section{Simple Example}
This is an inline formula: $\alpha = 2, \mathcal A = 3$, and this is a display formula:
$$(x+y)\cdot(x-y) = x^2 - y^2$$
We can make {\it italic} and {\bf boldface.}

\subsection{Integration}
Another display math:
$$
\int_0^1x\,\mathrm{d}x = \frac12.
$$

\subsubsection{Goals}

Students should know:
\begin{enumerate}
\item How to count numbers
\item How to add and subtract
\item How to multiply and divide
\end{enumerate}

\end{document}


Save an run it in a LaTeX editor. You will get PDF output. But it is impossible to make screen readers understand math formulas.

A solution is to run the body of this code (between \begin{document} and \end{document}) through free online converter Pandoc. Click on Try Pandoc Online and copy-paste the LaTeX code above in the left window, choosing 'LaTeX' in the drop-down box. choose 'HTML 5' in the corresponding drop-down box on the right, and click 'Convert.' Then you will get some HTML code, with the same list, boldface, italic, sections done as headings, math formulas, etc.
<p>Hello, world!</p> <h1 id="simple-example">Simple Example</h1> <p>This is an inline formula: <span class="math inline">\(\alpha = 2, \mathcal A = 3\)</span>, and this is a display formula: <span class="math display">\[(x+y)\cdot(x-y) = x^2 - y^2\]</span> We can make <span><em>italic</em></span> and <span><strong>boldface.</strong></span></p> <h2 id="integration">Integration</h2> <p>Another display math: <span class="math display">\[\int_0^1x\,\mathrm{d}x = \frac12.\]</span></p> <h3 id="goals">Goals</h3> <p>Students should know:</p> <ol> <li><p>How to count numbers</p></li> <li><p>How to add and subtract</p></li> <li><p>How to multiply and divide</p></li> </ol>
We use MathJax, a script converting LaTeX to screen-readable and viewable form inside browsers. Add the following MathJax script to the top:
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"> </script>
and get Test Page. This page is readable by screen readers, including math. Click on 'View Page Source' for this test page and see this HTML script, preceded by the MathJax line.