10

I am using org-mode, and the document I am writing has a table name whose name looks like this: tab_weekly_report. When I export the document to HTML, I expect the name to exported as tab_weekly_report, but org-mode treats _ specially (as a markup character). How can I avoid this?

6

org-mode exports _ as subscripts and ^ as superscripts

The default export behavior can be customized using the menus Org -> Customize -> Browse Org Group. To update the default behavior for subscripts & superscripts, choose:

  • [-]-\ Group Org Export
    • [-]-\ Group Org Export General
      • — Option Org Export With Sub Superscripts

Org Export With Sub Superscripts Examples

Examples

  1. Interpret them - Default

    • Underscore_subscript becomes Underscoresubscript
    • Hat^superscript becomes Hatsuperscript
  2. Curly brackets only

    • Underscore_WithCurlyBrackets_{subscript} becomes Underscore_WithCurlyBracketssubscript
    • Hat^WithCurlyBrackets^{superscript} becomes Hat^WithCurlyBracketssuperscript
  3. Do not interpret them

    • Underscore_subscript becomes Underscore_subscript
    • Hat^superscript becomes Hat^superscript
    • Underscore_WithCurlyBrackets_{subscript} becomes Underscore_WithCurlyBrackets_{subscript}
    • Hat^WithCurlyBrackets^{superscript} becomes Hat^WithCurlyBrackets^{superscript}

Note: If you don't want to mess around with settings, the quick and easy solution is to disable superscripts and subscripts by setting export option for ^ to nil.

  • To disable superscripts and subscripts, add the following lines to your org file:

    #+OPTIONS: ^:nil
    
  • 1
    AFAIK, there is no _ option. The ^ option is called org-export-with-sub-superscripts internally, indicating that it affects both. – NickD Mar 11 at 16:50
  • @NickD - Thanks for catching nonexistent _ option! I’ve removed it from answer. – Melioratus Mar 11 at 17:17
17

Add the following at the beginning of your file.

#+OPTIONS: ^:nil

It should do the trick. If it doesn't, I'd check org-symbols: http://orgmode.org/worg/org-symbols.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.