I&#x27;m a big LaTeX fan, but the core typesetting engine is pretty heavily focused on print layout, so you&#x27;d have to restrict your macro subset to produce clean XML reliably. (You&#x27;d also have to see if you can produce JATS, the standard XML dialect for journal articles.)<p>I don&#x27;t know of any good alternatives. LaTeX succeeded because of its excellent extensibility, so the core can be used to produce almost anything. I&#x27;d like to find similarly extensible tools that can cleanly produce XML as well as PDF. Maybe Pollen (<a href="http:&#x2F;&#x2F;docs.racket-lang.org&#x2F;pollen&#x2F;" rel="nofollow">http:&#x2F;&#x2F;docs.racket-lang.org&#x2F;pollen&#x2F;</a>) will be one.<p>There&#x27;s also Scholarly Markdown (<a href="http:&#x2F;&#x2F;scholarlymarkdown.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;scholarlymarkdown.com&#x2F;</a>), but I suspect Markdown&#x27;s lack of easy extensibility will doom it, since you&#x27;d have to write documents that fit narrowly into the features they provide. (What if you want a &quot;remark&quot; environment and they don&#x27;t provide it?) reStructuredText is also an option, since it&#x27;s built for extension, but it&#x27;s not very well-known outside of Python circles.