# Superscript and subscript

I want to write a superscript and a subscript at the same place.Every time I do it, it is a superscript then a space followed by the subscript. How do I stack it vertically?

• Welcome to TeX SX! Could you post a minimal , yet complete, code illustrating the problem? – Bernard Jun 11 at 15:59
• Please also clarify what you mean by "at the same place". E.g., should the superscript and subscript terms be stacked vertically? – Mico Jun 11 at 16:02
• @Mico Yes, the superscript and the subscript are to be stacked vertically. – bbc Jun 11 at 16:27
• Are you possibly inputting things of the form `A\textsubscript{B}\textsuperscript{C}`? If so, you shouldn't. You should employ math instead of text mode and write `\$A_B^C\$`. Here, `\$` serves to enter and exit inline math mode. – Mico Jun 11 at 18:07
• Thank you @Mico. It worked. – bbc Jun 12 at 1:13

I presume you are in math mode and I assume you want to have both superscript and subscript horizontally aligned next to the symbol you are super-/subscripting. You can achieve this like this: `\$A_b^c\$`. Note that the order is irrelevant, `\$A^c_b\$` looks identical. You can group symbols using curly brackets like so: `\${A_b}^c\$` or `\$A_{b^c}\$`.
• The last one has a typo. It should be `\$A_{B^C}\$ produces...` (the `_` is outside the `{...}`. – Phelype Oleinik Jun 11 at 16:39