8

How do you escape the + to not mean strikethrough in a single file? For example, when typing

use += 1 instead of ++

how can this not-be-strikethrough'ed?

Escaping the + with \ as in \+ works well, but it is not by-file.

5
  • Do you need to export this file into another format (html, tex etc), or do you just want to turn off the 'strikethrough' markup in the org buffer?
    – Tyler
    Jun 17, 2015 at 12:57
  • @Tyler: just the markup. Does the question need clarification?
    – serv-inc
    Jun 17, 2015 at 12:58
  • Probably not, it looks like @fredtantini has an answer!
    – Tyler
    Jun 17, 2015 at 12:59
  • 2
    Often when writing code in an Org file, I wrap it in "=", even if the string has equals signs in it. (So in your case I would write "use =+== 1 instead of =++=".) This bypasses any formatting rules that might be inside the text, and makes it into a nice monospace font when exported.
    – Archenoth
    Jun 17, 2015 at 18:22
  • @Archenoth: That is much more readable than escaping the + via \. Thanks.
    – serv-inc
    Jun 17, 2015 at 18:26

1 Answer 1

15

This behaviour is defined in the org-emphasis-alist variable.

To disable all markup, just write on your first line:

-*- org-emphasis-alist: nil -*-

To disable only the strike-through:

-*- org-emphasis-alist: (("*" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim) ("+" (:strike-through nil))); -*-

You can also use the syntax:

# Local Variables:
# org-emphasis-alist: (("*" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim) ("+" (:strike-through nil)))
# End:

(See Specifying file variable)

(("*" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim)) without the ("+" (:strike-through nil)) may work too.

Doing so, when you may have a warning when opening the file or reverting the buffer. Please refer to safe file variable.

To disable the warning, when doing M-x customize-variable safe-local-variable-values click on INS, and add:

Key: org-emphasis-alist
Value: (("" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim))

Then Apply or Apply and Save.

0

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.