Skip to main content

Section 3 HTML

Use Case.

Create new documents in HTML, which is generally the most accessible format. These options are also good for authoring documents in which you’d like to have an HTML version for posting, and a PDF version for printing.

Time Commitment.

Minimal to significant. This will vary based on the platform used, so we address this separately in each subsection below.

Subsection 3.1 PreTeXt

Time Commitment.

Moderate to significant. For basic documents like syllabi or notes with only text and math, there is a moderate commitment to learning the initial setup and syntax (which is XML). To learn more of the capabilities of PreTeXt would be a significant time commitment.
The main benefit of PreTeXt is that it allows you to author your document once, and then build your output in a variety of formats, including HTML (for posting an accessible version) and PDF (for printing). A common use case would be to use PreTeXt to author guided notes for class, in which an accessible version can be posted on Canvas and a PDF version can be printed for class.
There is a detailed PreTeXt guide
 1 
pretextbook.org/doc/guide/html/guide-toc.html
and an annotated sample article
 2 
pretextbook.org/examples/sample-article/annotated/frontmatter.html
, which are great references to access when you want to learn more. To get started quickly with a basic document, you can follow the directions in the Getting Started Tutorial
 3 
pretextbook.org/doc/guide/html/tutorial.html
. You can create, edit, and publish documents all through Github with no need for local installations.
There are multiple themes
 4 
pretextbook.org/doc/guide/html/online-style.html
you can use, depending on what type of document you are creating. PreTeXt can also integrate with many other tools to make your document more interactive, including Sage and Desmos. You can find a complete list, with examples, starting in Chapter 14
 5 
pretextbook.org/examples/sample-article/annotated/section-interactive-authored.html
of the annotated sample article.

Subsection 3.2 Quarto

Time Commitment.

Moderate to significant.
Quarto
 6 
quarto.org/
shares the same benefit as PreTeXt in that you can write your document once and use it to produce an output in multiple formats. I have not used Quarto, but I’m told the syntax feels like a mashup between LaTeX and Markdown. For some, this may be a reason to prefer this over PreTeXt. If you use it and find a good workflow, please share it so we can post it here.

Subsection 3.3 LaTeXML

Time Commitment.

Minimal to moderate. This will depend on what packages are in use in your .tex file.
LaTeXML
 7 
math.nist.gov/~BMiller/LaTeXML/
accepts a .tex file and outputs an HTML file. This is what is currently being used by arXiv
 8 
arxiv.org/
to provide HTML versions of submitted papers.
This requires a local installation
 9 
math.nist.gov/~BMiller/LaTeXML/get.html
, and can be run using a single command
 10 
math.nist.gov/~BMiller/LaTeXML/ussage.html
from your computer’s terminal.
Once installed, open your computer’s terminal and navigate to the folder location of the .tex file you would like to convert (call it mydoc.tex). Then run latexmlc --dest=mydoc.html mydoc, which should create mydoc.html in the same folder.