Take the 2-minute tour ×

R and LaTeX (...) can be easily combined using Sweave or knitr.

Is there any possibility to accomplish the same with DocBook?

share|improve this question
DocBooK looks like an XML document, so I don't see the relationship with Latex. So the question maybe is How can I use the XML package to generate dockbook? –  agstudy Mar 5 '13 at 10:58
Is it necessary that what you write be in DocBook or just that your output be in DocBook? –  sebastian-c Mar 5 '13 at 12:39
add comment

2 Answers

Isn't the answer to every "how do I convert markup format A to markup format B?" question simply "pandoc"?

Not sure of the exact workflow, but you'd write R-flavour markdown, knit it, then pandoc to convert to docbook.

Writing a new O'Reilly book? I know they luuurrve the docbook!

share|improve this answer
add comment

Knitr and Sweave do not provide DocBook as a backend. Googling for r docbook did not yield much, other than a question on R-help in 2008 that asked exactly what you did. You could have a look at how knitr uses markdown, and port those ideas to docbook. This is probably doable, but a lot of work.

share|improve this answer
XML is plain text, so it is possible to process it with knitr; you will have to redefine the parser and renderer, though. I would prefer writing in Markdown and convert it to DocBook with Pandoc instead since DocBook looks too verbose in my eyes. I do not know much about it so I might be biased. –  Yihui Mar 5 '13 at 20:45
add comment

Your Answer


