Reactormonk
Reactormonk

Reputation: 21730

How to get literal forward slashes in org-mode?

In text, can I make org-mode ignore forward slashes somehow? Phonetics uses /s/ to denote a certain level of analysis.

Upvotes: 3

Views: 695

Answers (3)

Nate
Nate

Reputation: 11

If you like the standard emphasis functionality of the forward slashes in org-mode, you could also just define a new environment. I put something like the following in the preamble whenever I do phonetics/phonology typesetting:

\newcommand\uRep[1]{$/$\textipa{#1}$/$}

Upvotes: 1

camdez
camdez

Reputation: 1644

I assume that you do not want the text to appear emphasized in the buffer, nor in the output. This is a slightly more complex answer which will achieve that result:

There is a variable defined by Org-mode called org-emphasis-alist which defines the different emphasis modes, what their plain-text syntaxes are, and how they are exported to HTML. You can achieve the result you want by changing the value of this variable before Org-mode has been loaded. That last part is critical so note it well—Org-mode reads the value of org-emphasis-alist when it is loaded and uses that value to generate a regular expression for highlighting ("font-lock") purposes.

Here are two routes to that:

  1. Add the following lines to your .emacs file above the lines that load Org-mode:

    (setq org-emphasis-alist
      `(("*" bold "<b>" "</b>")
        ;; ("/" italic "<i>" "</i>")
        ("_" underline "<span style=\"text-decoration:underline;\">" "</span>")
        ("=" org-code "<code>" "</code>" verbatim)
        ("~" org-verbatim "<code>" "</code>" verbatim)
        ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
         "<del>" "</del>")))
    

    (Notice the commented out line.)

  2. Make the change through Emacs' customization facility:

    1. M-x customize RET
    2. In the search box enter Org Emphasis and click Search.
    3. Click the down arrow next to Org Emphasis Alist to reveal its value.
    4. Find and click the second DEL button—corresponding to the italic list item.
    5. Click the Save for future sessions button at the top of the buffer.

Upvotes: 2

Jonathan Leech-Pepin
Jonathan Leech-Pepin

Reputation: 7884

You can use

#+OPTIONS: *:nil

to turn off text-emphasis (bold,italics,underline). This will however only work on export itself, the emphasis will still be visible.

See the manual for other export options.

Upvotes: 1

Related Questions