Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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:

  • rst2html
  • rst2xml
  • rst2latex
  • rst2odt
  • rst2s5
  • rst2man

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                       <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\n                </div>\n            </div>\n\n            <div id=\"copyright\">\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\n            </div>\n            <div id=\"svnrev\">\n                rev 2016.2.5.3240\n            </div>\n                <div id=\"additional-notices\">\n                    Ubuntu and Canonical are registered trademarks of Canonical Ltd.\n                </div>\n            \n        </div>\n    </div>\n    <noscript>\n        <div id=\"noscript-warning\">Ask Ubu"], "copyright__copyright__copyright": ["ormat, which is quite similar to Stack Exchange markup, only has more features.\n\nSphinx 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\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}