3

Does anyone know of a way to compile latex files into HTML (as opposed to pdf), in a way such that that commutative diagrams done with xypic are correctly displayed? (EDIT: and moreover that formulae are compiled into MATHML rather than figures?)

Quite decent software exists to compile latex into HTML, for example LaTeXML and lwarp (and several others). However LATEXML seemingly does not support xypic at the moment. Lwarp seemingly does support xymatrix, but I could not find a way to make it work (when it comes to typesetting xypic diagrams).

As an example of how I would like things to work,consider for example this section of the Stacks project (of category theory) https://stacks.math.columbia.edu/tag/0013, whose latex code contains commutative diagrams done with xypic https://github.com/stacks/stacks-project/blob/master/categories.tex

1 Answer 1

4

TeX4ht supports Xymatrix:

\documentclass{article}
 \usepackage[all,cmtip]{xy}
\begin{document}
$$
\xymatrix{
F(x) \ar[r]^{t_x} \ar[d]_{F(\phi)} & G(x) \ar[d]^{G(\phi)} \\
F(y) \ar[r]^{t_y} & G(y) }
$$
\end{document}

Compile using:

make4ht sample.tex "svg,mathm,mathjax"

With these options, you will get math in MathMl format rendered using MathJax, and diagrams in the SVG format.

enter image description here

2
  • Is there a way that make4ht compiles mathematical formulae in MATHML, as opposed to figures? (I edited the question to make this point clearer.) Dec 18, 2021 at 9:58
  • 1
    @JoaoFariaMartins see my updated answer. you can have MathML for math expressions, but diagrams can be only as pictures.
    – michal.h21
    Dec 18, 2021 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .