Code vs. Verbatim in Org Mode

If you do even a little writing in Org mode, you’ve almost certainly needed to occasionally typeset a word or sequence of words in a typewriter font. This, at least for me, comes up in two ways:

  1. I want to typeset something that would normally be part of a code buffer
  2. I want to typeset something like a file name or extension

To a first approximation, the distinction doesn’t really matter because they both end up as a typewriter font. But the two categories are different and Org distinguishes between them. For code items, you’re suppose to use a tilde:

~(setq variable value)~

For the other category—unhelpfully labeled “verbatim”—you’re supposed to use =:

On startup, Emacs reads the configuration file =init.el=.

It’s a great distinction but one that I, and probably many other people, ignore. I always use = for the simple reason that it’s easier to type than ~. After all, they’re typeset the same way so why bother trying figure out the correct one to use when = is easier anyway?

Still, in the back of my mind there’s a little voice that keeps saying, “What if it’s like Y2K? What if one day there’s an exporter that typesets them differently?” It seems like an unlikely, theoretical problem but then so did Y2k. Early programmers waved away the problem with the same sort of rationalizations that I’m using to ignore the difference between = and ~.

Some folks are more forward looking. Grant Rettke, for example, has a system that he adheres to and has even documented. His post, Choosing Between Code and Verbatim Markup In Org Mode, lays out his system and specifies which terms get the verbatim markup and which get the code markup. If you want to do the right thing, his post is a good place to start. Or you could be like me and suffer the consequences when the hammer falls.

This entry was posted in General and tagged , . Bookmark the permalink.