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?
4 Answers
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
- [-]-\ Group Org Export General
Org Export With Sub Superscripts Examples
Examples
Interpret them - Default
- Underscore_subscript becomes Underscoresubscript
- Hat^superscript becomes Hatsuperscript
Curly brackets only
- Underscore_WithCurlyBrackets_{subscript} becomes Underscore_WithCurlyBracketssubscript
- Hat^WithCurlyBrackets^{superscript} becomes Hat^WithCurlyBracketssuperscript
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
^
tonil
.
To disable superscripts and subscripts, add the following lines to your org file:
#+OPTIONS: ^:nil
-
2AFAIK, there is no
_
option. The^
option is calledorg-export-with-sub-superscripts
internally, indicating that it affects both.– NickDMar 11, 2019 at 16:50 -
1@NickD - Thanks for catching nonexistent
_
option! I’ve removed it from answer. Mar 11, 2019 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
-
1
By default the underscore "_" and caret "^" characters are treated as markers of subscripts and superscripts when exporting with org-mode or pandoc. To export them as they are you can add the line
#+OPTIONS: ^:{}
to your org file and then use either org-mode or pandoc to export. If you are using pandoc-mode make sure the region to be exported also include this line before the underscore and caret characters.