Unicode superscript fails with LaTeX

Anonymous avatarAnonymous created an issue

I have a block of Python code that contains Unicode superscript characters:

>>> x = ufloat_fromstr("20(1)×10⁻²")

I need the Sphinx document to be output both in HTML and LaTeX. However, LaTeX complains that the superscript minus cannot be used:

! Package inputenc Error: Unicode char \u8: not set up for use with LaTeX.

Is there a simple solution to this problem?

I thought about using :raw:, but I understand it cannot be nested inside the code block. I thought about using XeLaTeX instead of the default Sphinx pdflatex (because XeLaTeX can use OpenType fonts instead of the 256-character LaTeX fonts), but this entails writing an extension, right?… which I would like to avoid, so that my documentation can be distributed easily…

Comments (0)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.