Pick Your Markup Language


Someone recently asked me if they needed to use Markdown, or any other markup language, to work in plain text. I don’t think you need to, but using a markup language can be a boon.

How? Markup languages are great if you want to add structure to what you’re working on, or if you need to convert your plain text files to another format.

There’s a markup language out there that will suit just about everyone’s needs. Let’s take a look at a few of them.

Markdown

Markdown has become a favourite geeks, productivity hackers, and bloggers everywhere. It’s easy to learn and use, and is very flexible.

Markdown uses keyboard symbols to add formatting to text — for example, surrounding text with single asterisks makes that text italic. Writing with Markdown doesn’t get in the way of the flow of your typing.

A number of blogging platforms, content management systems, and text editors support Markdown. You can use Pandoc to convert files formatted with Markdown to other markup languages or to formats like Word, ODT, or PDF.

HTML

HTML was my second markup language, and the first one I really used professionally (to develop online help systems in the mid- to late-1990s). Aside from Markdown, it’s the one I’ve used most frequently.

HTML is best known as the language used to format web pages, and has been around for quite a while. Although HTML has grown since its early days, the core markup is fairly easy to learn.

The language consists of a set of tags surrounded by angle brackets. The tags tell a web browser how to format something on a page — for example, <p></p> tells a browser that the text between the tags is a paragraph.

HTML is easy to learn, although it’s not as easy as Markdown. That said, you don’t need to learn all of HTML’s tags to use it effectively.

LaTeX

LaTeX was my first markup language and while it has a soft spot in my heart, LaTex caused me no end of headaches when I started using it in the early 1990s.

Its main use is to typeset academic work, especially manuscripts in the areas of math and science. And it does a beautiful job of that, too. Over the years, LaTeX has become a lot more varied and flexible.

The basic layouts — for articles, reports, and books — are rather plain but usable. LaTeX’s document classes and packages offer some beautiful formats for your documents. Beware, though: the learning curve for this markup language is steep. If you’re willing to tackle that curve, there are a number of things you can do with LaTeX.

DocBook XML

If you’re looking for a markup language for many occasions, then DocBook XML might be what you’re looking for. Created for technical writers, DocBook XML has everything you need write and format manuals and online help.

DocBook isn’t limited to manuals. You can also write and typeset articles and books, as well as create websites and presentation slides.

You might find the 400+ tags in DocBook to be intimidating. It isn’t. You don’t need to learn them all — for the most part, you’ll only need to know a couple of dozen of those tags to use DocBook effectively. On the other hand, setting up the tools to process DocBook files can be difficult.

A Pair of Other Markup Languages Worth Mentioning

First, txt2tags. It’s not really a markup language. txt2tags is more of a converter that uses very simple markup to convert a file to a number of other formats, like HTML, LaTeX, and DocBook. The markup that txt2tags uses is easy to learn, and it does conversions in a flash.

reStructuredText is used for technical documentation by the community around the Python scripting language. The markup is quite minimal, and used only a handful of keyboard symbols. You can easily read a document formatted with reStructuredText and understand what the markup does.

AsciiDoc was created as a response to the complexity of DocBook XML. Used for creating documentation, articles, books (electronic and print), slides, and even web pages, AsciiDoc uses a very Markdown-like set of keyboard symbols to format text. While it takes a little longer to learn than Markdown, AsciiDoc is very flexible and has a powerful set of tools to convert your documents to other formats.

And if none of the markup languages that I discuss in this article are for you, check out this comparison of document markup languages at Wikipedia.