I would like to use TeX to typeset Søren Kierkegaard's complete works, which are available online here. It includes a collection of notes in a separate XML file which I would like to add to the document as side notes if possible. This question deals with how one can automatically convert an entire website into LaTeX, but as is also mentioned in the answer, these solutions are far from perfect. What I need is not really a program that automatically converts everything into TeX. Rather, I need a program where I can specify manually specify which LaTeX command each HTML tag must be converted into. For instance, the note reference

<span id="r132"><a class="k" name="r132" href="kom.xml#k132" onclick="return blank('kom',this.href,430)" style="display: inline;">*</a></span>

should be automatically converted into


(cf. this question). Does there exist some software that can convert HTML tags into LaTeX commands in this way?


I made an initial comment that XSLT is well suited to this, but particularly easy here as there is already XSLT matching all the elements and generating HTML, so you just need to make a version that writes TeX instead.

so for example


looks like html as you view it but it is XML converted to XSLT (using the browser's built in XSLT 1 engine) but you could use a command line XSLT system to convert it to html files. View source shows you the XSLT is


which is a series of templates matching the XML elements and generating HTML, you just need a similar set of templates that generates latex.

XSLT is off topic for this site but stack overflow has an active XSLT tag if you need more help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.