# Why doesn't LaTeX use unicode characters for subscripts and superscripts in the context of math?

I'm very new to LaTeX but have found it to be enjoyable to work with. Lately I've been focusing on how to get output that will copy/paste well from PDF with special characters. Currently, XeLaTeX with the Fontspec package seems to do the job rather nicely. However, I notice that subscripts and superscripts within the context of math, when copy/pasted, result in the unicode character for the full-sized glyph rather than the unicode character for the sub or super script. Why is that?

• Aside from any other considerations (such as requiring a font that supports them), there are only a very limited number of Unicode superscripts and subscripts. You'd end up with a mixture of sub/super-script glyphs for the supported ones and full-sized glyphs for the unsupported characters. – Nicola Talbot Apr 30 '18 at 19:34
• You are too modern for TeX that's probably why :) – percusse Apr 30 '18 at 23:23
• PDF is not designed for copying from. That you get anything close at all is always a miracle. – ShreevatsaR Apr 30 '18 at 23:42

Unicode superscripts are handy for small in-text superscripts such as x² but they mostly would get in the way in math typesetting where you need to position superscripts at different heights depending on the size of the base, or the presence of a subscript, and you want the formatting of x^2 to be consistent with that of x^{(x+\sqrt{y})} which is difficult to achieve if "simple" cases are set by the font machinery using Unicode superscript characters from the base fonts and "complicated" cases are set by the math layout engine using a script sized font.
• can't you improve that: there is still one comma (even two! I am disappointed) in your paragraph, which allowed me to take my breath midway :) – user4686 May 1 '18 at 9:44
• @RobertBrowder actually I would draw the opposite conclusion from this answer. If you write x^2 or \operatorname{power}(x,2) the 2 is the same thing, the fact that one notation raises it in a smaller font is purely a visual artefact. That said it is more natural to use the same (standard) 2 in the encoding of both if you want to use the same Unicode character for the same semantic data. – David Carlisle May 3 '18 at 13:12