In an org-mode table, I want to write 2^3, but exporting to html turns it into 23.

I prefer not to use inline verbatim, and I would like to not have a space between the ^ and the other text.

Is there a keyword I can use or some inline pseudo-latex like \vert? Finally, if there is a keyword I can use, where are these keywords listed so I can look up the next one?

  • org-export-with-sub-superscripts
    – rpluim
    Commented Jun 9, 2020 at 13:50

1 Answer 1


As @rpluim mentions in a comment, setting org-export-with-sub-superscripts to nil would disable the special handling of ^ and _ for subscripts and superscripts. There is one more variable that is relevant (when org-export-with-sub-superscripts is t) and that is org-use-sub-superscripts which can be set to t or nil - or it can be set to the value {}.

I find the most flexible way to deal with this is to leave org-export-with-sub-superscripts to its default t value and instead of fiddling with the value of org-use-sub-superscripts using lisp in the init file or with file local variables, I use the in-file #+OPTIONS: settings. If I write text in a file that uses underscores or carets that I don't want interpreted as subscripts or superscripts, I add this at the top of the file:

#+OPTIONS: ^:{}

(don't forget to hit C-c C-c on that line after you add it: that will make sure it will take effect in this session - otherwise, you'll have to close and reopen the file). That allows me to write

#+OPTIONS: ^:{}

* foo

a^b a_b a^{b} a_{b}

and have the first two exported literally and the last two exported in super/sub-script form. The expectation here is that I would not want to export a^{b} literally because it is not something that would occur at all commonly. That has been my experience: I have never had any need for any other setting (and if I had, I would change the #+OPTIONS: setting in that file only to read #+OPTIONS: ^:nil and forget about it).

There are many settings that you can add to an #+OPTIONS: line: it's a fairly flexible way to treat a particular file differently depending on its peculiar needs.


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.