Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escaping characters in Emacs org-mode

Tags:

emacs

org-mode

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?

like image 822
Amelio Vazquez-Reina Avatar asked Oct 04 '12 23:10

Amelio Vazquez-Reina


People also ask

How do you escape characters?

Use the backslash character to escape a single character or symbol. Only the character immediately following the backslash is escaped.

What are escaping characters in Linux?

Escape characters. Escape characters are used to remove the special meaning from a single character. A non-quoted backslash, \, is used as an escape character in Bash. It preserves the literal value of the next character that follows, with the exception of newline.

How do you escape the special characters in Splunk?

Characters and escape sequences that must be escaped To escape a double quotation mark ( " ), use the sequence \" to search for a literal double quotation mark. To escape a backslash character ( \ ), use the sequence \\ to search for a backslash.


4 Answers

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).

like image 126
Juancho Avatar answered Oct 04 '22 23:10

Juancho


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).

like image 39
Ray Avatar answered Oct 04 '22 23:10

Ray


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.

like image 29
Stuart Hickinbottom Avatar answered Oct 04 '22 23:10

Stuart Hickinbottom


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.)

like image 20
joerngr Avatar answered Oct 04 '22 23:10

joerngr