Unicode provides subscripts and superscripts, so I can do this:

And this:


However, combining these two I get:

x²₅ or x₅²

Which looks badly.

Any chance to get the superscript directly on top of the subscript in Unicode?

For clarity, this is what I'd like to achieve:

enter image description here

  • 1
    No. You need to use a math formatting program.
    – DavidPostill
    Dec 25 '18 at 13:42
  • @DavidPostill Too bad :(
    – gaazkam
    Dec 25 '18 at 13:45
  • Out of interest what are you using the notation to mean? "x²₅ or x₅²" would ordinarily mean different things. Other than chemical elements I can't readily recall seeing that notation?
    – pbhj
    Dec 25 '18 at 16:28
  • @pbhj It occurs often wherever people have reason to make up such a notation. For example the superscript if put in parenthesis could be the nth derivation and the subscript the mth part of a vector. Or whatever.
    – Nobody
    Dec 25 '18 at 19:07
  • @pbhj My particular use case: x is a vector of unknowns in a system of linear equations. So we have: a_1*x_1^5+b_1*x_1^4+...etc, etc
    – gaazkam
    Dec 25 '18 at 22:36

Your issue is not with Unicode but with the font you use. Technically, every font could use negative kerning to move subsequent super- and subscripts on top of each other. One font that does this is Linux Libertine (if you put the subscript first):

your example rendered with Linux Libertine

On the other hand, this is quite rare. Even STIX, which is specifically designed with mathematical typesetting in mind, does not have this feature.

  • 4
    Does it also work for x₅₅²²? Dec 25 '18 at 20:35
  • 1
    While I believe there are fonts which do this, it doesn’t seem like correct behavior. The superscript and subscript characters are neither combining characters nor modifier characters, as far as I know.
    – VGR
    Dec 25 '18 at 21:38
  • @VGR: Well, from some point of view, you are not combining with or modifying another character this way. You just use space more efficiently.
    – Wrzlprmft
    Dec 26 '18 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.