Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I hear that LuaTeX provides access to internals of TeX.

  • Is it possible to modify the output routine with LuaTeX so that HTML is produced instead of DVI or PDF?
  • If possible, are there any projects aiming at this?
share|improve this question
The answers to your questions are: yes and yes. To be precise: ConTeXt MkIV (which is built on top of LuaTeX) can produce (X)HTML natively from ConTeXt source. I'm not aware of any LaTeX package to do such a thing, though. –  mbork Feb 21 '14 at 15:19
ConTeXt outputs XML. Most browswers display this XML, which can be styled using CSS, without problems. See Converting ConTeXt document to HTML for a demonstration. –  Marco Feb 21 '14 at 15:24
To add to what @Marco and @ mbork pointed out in their comments: Context does indeed produce XML out of the box, but it does not actuall need to “modify the output routine”. (That’s actually pretty obvious since HTML doesn’t have the concept of a page like TeX does.) Instead, the relevant structural commands are extended to tag regions of text by means of Luatex attributes, which doesn’t even require much effort since most user-level commands are derived from generic ones. –  phg Feb 21 '14 at 18:04
@phg Thanks. Could you turn your comment into an answer so that I can accept it? I'm also interested in the strategy. –  krnk Feb 23 '14 at 2:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.