10
votes

Say I want to escape characters in org-mode, e.g. _ so that org-mode renders the following:

* _TARGET_

In my set up (which I think is the default one) org-mode underlines the word as opposed to rendering _TARGET_

More generally, where can I find information about how to escape characters in Emacs org-mode?

4

4 Answers

9
votes

With a current Emacs and org-mode you might try

* \under{}TARGET\under{}

If that is not automagically displayed as * _TARGET_ just try C-c C-x \, that should toggle the display of those codings between coding characters and coded character.

(In principle the same as I explained here.)

7
votes

The code and verbatim markup will render the text inside as-is, without interpretation. Therefore, =_TARGET_= will probably work as you intend (you'll also get a different monospace typeface for that word).

3
votes

Alternatively, use the normal shell backslash to escape the characters you want to avoid Org-mode interpreting as markup:

* \_TARGET\_

The backslash characters are visible in your Emacs buffer, but are hidden when exporting - e.g. to HTML or PDF-via-LaTeX.

This escaping works in many other situations, e.g. SR\_1234 to render as SR_1234 during export rather than as a subscript.

3
votes

If you want to break org to interpret some syntax you are using, you will have to ways to do that.

  1. Using escape char. _ is \under and * is \ast, so you can write like this \ast \under{}TARGET\under;
  2. Another way is to use zero width space, its code is 200B, so you can use C-x 8 RET 200b RET to insert a zero width space to break the interpreting.

They work on the latest org on the responding time (latest 9.2).