Search code examples
restructuredtext

In reStructuredText, how do I use emphasis and superscript at the same time?


The following piece of reStructuredText does not give the result I expect.

*:sup:`superscript`*

Expected result: superscript

Actual result: :sup:`superscript`

The reason why it is happening is clear (reST text roles cannot be nested), however how can I obtain the expected result?


Solution

  • As specified in a FAQ, this is not currently possible without using the raw directive or without using a custom, ad-hoc directive.