How can I superscript the ® symbol in Sphinx/RestructuredText?
This does not work, I get a superscripted |reg| instead.
bigNameBrand\ :sup:`|reg|`
Found a workaround by creating custom roles.
In conf.py:
def supsub_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
node = docutils.nodes.superscript()
node2 = docutils.nodes.substitution_reference(refname=text)
node += [node2]
return [node],[]
def setup(app):
app.add_role('supsub', supsub_role)
and then:
.. |regsup| replace:: :supsub:`reg`
then you can use |regsup| to get the superscript registered trademark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With