I need a simple markup that would allow me to include chunks of code and images, and be able to produce .doc
(or .rtf
) and .pdf
documents. A bit (or maybe a lot) like the StackExchange markup, but with conversion to PDF and Word documents. I am producing a lot of documentation for the statistical analyses I am doing, and this documentation is then passed on to scientists who work predominantly with Word. Requirements:
- basic markup (document structure, bold, italic)
- chunks of code or preformatted text (syntax highlighting a plus)
- including external images in the viewer
- export to PDF and Word DOC/DOCX/RTF (HTML a plus)
I am considering writing a few LaTeX based Perl scripts for myself, but maybe there is software like that already out there?
You might want to look at rst (ReStructuredText). This is a markup language much used for python documentation. There are many tools that can work with rst and convert it into many formats.
One tool is sphinx which can convert to html, latex->pdf, rtf, and man pages.
But there is e.g. also the docutils package, which has tools to convert the rst file into many formats:
You are most probably interested in rst2latex, which can then be compiled to pdf. Or you can use this software to do this in a single step: rst2pdf.
And you might want to use rst2odt, which produces the libreoffice/openoffice version of a word document which can then be converted by these to doc format.
Sphinx is a tool initially used to create documentation for Python programming language. It is written in Python and has a lot of Python-specific features, but generally can be used to create any kind of "narrative" documentation with (optionally) table of contents, cross-references, search, syntax highlighting for code blocks and many other useful features.
It uses reStructuredText as input format, which is quite similar to Stack Exchange markup, only has more features.
Sphinx can generate one long HTML document, a whole "website" containing many pages or a PDF "book". I'm not sure about .doc format but I think you can just open HTML in MS Word and save it as .doc