Mathematicians and other technical scientists often write their papers in \(\mathrm{\LaTeX}\). The most common output format for \(\mathrm{\TeX}\)-based documents is PDF, which can be shared easily via email, and printed out into a physical copy. While PDF excels as a format for physical documents, the experience of reading a technical paper on a computer can be significantly improved. Those who read on a tablet or computer are aware of the fact that PDFs lack basic interactive features, such as text reflow, navigation history, and easy reference viewing.

By contrast, modern web technologies allow us to display content custom to our needs. \(\mathrm{Disco\TeX}\) can compile \(\mathrm{\TeX}\) into well-designed webpages. There are two parts to this project:

  1. Compiling a \(\mathrm{\TeX}\) file into a human-readable HTML document, and
  2. Using web-based tools, to turn this HTML document into an interactive webpage which is pleasurable to read.

This demonstration is intended to showcase both of these functionalities. This entire HTML page was generated by the \(\mathrm{Disco\TeX}\) compiler, from this \(\mathrm{\TeX}\) source file. If you view the source code, you'll see that the auto-generated HTML makes heavy use of custom tags in order to make it easy to read. We use AngularJS to turn this HTML into a pretty and interactive webpage.

Readability
Readability of the generated HTML is a high priority for \(\mathrm{Disco\TeX}\). We want the user to have the option to add their own HTML after generation, in case they wish to include content that is not possible in a static PDF document. That means div-spam and other spaghetti-code should be hidden from the user. We use AngularJS to interpret custom HTML tags that make the source code as readable as the \(\mathrm{\LaTeX}\) that generated it.
Usability
To be useful, \(\mathrm{Disco\TeX}\) needs to be unobtrusive. Users should be able to write \(\mathrm{\TeX}\) as they normally would, and just compile their document with \(\mathrm{Disco\TeX}\). Viewers of websites should not have to download any special tools.
Speed
Compilation of \(\mathrm{\TeX}\) to HTML should be fast and unobtrusive. While we have not done exhaustive benchmarking yet, compilation is significantly faster than pdflatex. This document compiles to readable HTML in approximately 30 milliseconds (Google Chrome, v41). A project testing document, which would generate a 13-page PDF, compiles in approximately 50 milliseconds.
Extensibility
One of the most useful features of \(\mathrm{\TeX}\) is its extensibility. Users can add their own macros, and include their own packages. The \(\mathrm{Disco\TeX}\) compiler is built to be extensible. \(\mathrm{Disco\TeX}\) provides a simple yet powerful API to add packages to the engine. You can read more about how to write packages for \(\mathrm{Disco\TeX}\) by reading the manual (it doesn't exist yet, but will soon).

Inline and centered mathematics are rendered with MathJax. The equation environment renders to HTML just as it would in a PDF. The equation

e^{i\pi} = -1.

was generated by the following \(\mathrm{\TeX}\).

\begin{equation}\label{eq:euler}
    e^{i\pi} = -1.\tag{$\heartsuit$}
\end{equation}

The \(\mathrm{Disco\TeX}\) compiler takes this code and generates the following custom HTML tag:

<dt-equation label="eq:euler" tag="$\heartsuit$">
    e^{i\pi} = -1.
</dt-equation>

The <dt-equation> tag can be used with or without the label and tag attributes, in the same way you would use the \label and \tag commands in \(\mathrm{\LaTeX}\).

You can reference this equation with <dt-eqref> tag. Equation references illustrate a small part of how \(\mathrm{Disco\TeX}\) makes \(\mathrm{\TeX}\) more interactive. Click on the reference to see the magic in action. With this functionality, the reader no longer has to lose their place in order to recall an equation.

Bibliography items are stored in a JSON database, mimicking the \(\mathrm{Bib\TeX}\) format. You can place them in the dt-bibliography tag with the dt-bibitem element.

The dt-cite element provides a clickable link and a tooltip on mouseover. For more information, refer to .

\(\mathrm{Disco\TeX}\) allows for theorem panels via the dt-theoremlike element, which can be extended and customized:

Proofs can be written with the <dt-proof> tag. The collapsible attribute dictates whether a user can close the proof, or not. If the proof is peripheral, use the start-collapsed attribute to set it to be hidden initially. If the name attribute is set, it uses that insetad of "Proof." Note that perious are not automatically added

There are infinitely many prime numbers.

This theorem is very well known, and so there's no reason why it needs to be displayed. If a user really wants, they can uncollapse the proof.

Suppose there were only finitely many prime numbers \(p_1,\dots,p_n\), and let \(N=\prod_{i=1}^n p_i+1\). We know that \(N\) must be divisible by some prime number, but cannot be divisible by any of the \(p_i\). This is a contradiction.

The \(\mathrm{\TeX}\) command we use for this is \dtcollapse. The compilation engine compiles this to

<dt-proof collapsible start-collapsed>...</dt-proof>

On the other hand, some proofs are too important to let the user collapse them.

This proof is left as an exercise for the reader.

Packages
\(\mathrm{\TeX}\) is highly extensible. There are literally thousands of available packages. We cannot hope to implement all of them, but several of the most used ones are high on our priority list. Specifically, we hope to implement amscd, beamer, and tikz in the near future. We intend to provide a rich API for package implementation, so that users can implement the packages they use most.
Themes
Don't like our stylistic choices? No matter, \(\mathrm{Disco\TeX}\) will be completely themeable via CSS. We will provide several standard themes, along with instructions on how to add your own.
Google Scholar
Provide some data to look up the correct citation, and have \(\mathrm{Disco\TeX}\) look it up with Google Scholar. This feature will probably not compile in your standard \(\mathrm{\TeX}\) compiler.