I'm looking at writing a book with code samples, hints, and other stuff, and was wondering what type of word processor would be recommended for writing a book that's 50+ pages (including code samples) when all finished. For a good example see an O'Reilly book.

For writing my outline and forward I used open office word.

  • I'm wondering if there's one specially designed for this, or not.
    – i am me
    Commented Dec 18, 2015 at 6:38
  • Do you have any requirements for source or output formats? Commented Dec 18, 2015 at 14:19
  • not as of yet, but that can always be done later.
    – i am me
    Commented Dec 18, 2015 at 21:57

2 Answers 2


You haven't specified any preferences for format (source or output), and that's going to be relevant. If it's up to you, for your source I recommend a text (not binary-format) markup language -- HTML, XML, LaTeX, or similar. A text source works well with source control, works with grep/find/search, and supports meaningful diff. All of these (assuming a reasonable XML DTD or schema like DocBook) support all the basic formatting you'll need for a programming book, including code blocks and cross-references. If you're formatting for the web then your HTML source is also your output (done!); for LaTeX or XML source or if you need to format for print (PDF), you'll need to run some sort of generator to turn your source into output.

Once you've decided on the format you can move on to choosing a tool. While WYSIWYG tools like Word and Open Office allow you to export various formats, choosing a tool that lets you write in your preferred format to begin with will be easier to manage. There are two basic categories of options:

  • Your favorite text editor, if you are fluent in the format to begin with. It's actually quite reasonable to write HTML directly in emacs, for example. (You probably only need to learn 10-20 tags.) Downside: no syntax-checking; you can write invalid markup and the tool won't care.

  • I'm not aware of LaTeX-aware editors. For HTML and XML, there are tools that help you with the syntax and make it hard or impossible to use invalid tags. Options range from inexpensive (Notepad++) to lower-cost (Oxygen) to higher-cost (Flare) to expensive (Arbortext anything). This Wikipedia page compares features among a bunch of XML editors.

As noted earlier, for LaTeX or XML source you'll need to run a program to turn your source into an output format before you can inspect the results.


A common text editor/publishing platform within the (academic) computer scoience community is Latex.

  • I already write code, what I'm looking for is an actual processor.
    – i am me
    Commented Dec 18, 2015 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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