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?


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


  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
  • 2
    AFAIK, there is no _ option. The ^ option is called org-export-with-sub-superscripts internally, indicating that it affects both.
    – NickD
    Mar 11 '19 at 16:50
  • @NickD - Thanks for catching nonexistent _ option! I’ve removed it from answer.
    – Melioratus
    Mar 11 '19 at 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


Somewhat hard to find, but you can just use foo \under foo or foo\under{}foo.

  • 2
    Brilliant! thanks.
    – Uria Mor
    Jul 5 '20 at 18:24
  • 1
    This should be the best (most upvoted) answer
    – Ajned
    Mar 30 at 8:45

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.