When we edit, we’re literally building a standard ePub3 file, which natively uses XHTML as its document representation. The pipeline then produces alternative versions of the same file. We could work in LaTeX, but it would reduce our contributor count (more people know XHTML than LaTeX) and we’d need to transform it anyway, with the potential of introducing new bugs.