I just need this format for writing power sets properly but its not formating correctly
1 Answers
It's not clear what you were trying to do.
The usual advice for TeX is to write base^{exponent}, putting braces around the exponent. Everyone fairly quickly discovers that you can leave off the braces if the exponent is a single token (they also discover other times you can leave off the braces that I won't talk about). And as soon as someone needs to type {, they find out they should precede it with a backslash.
This leads us to what you probably tried: $2^\{a\}$. The problem is that the ^ is followed by three tokens: {, a, and }. This means that the ^ only exponentiates the first token that it finds, leading to your output. But if you want to exponentiate more than one token, you need to enclose them in { and }. Otherwise, you would be expecting TeX to discover when the exponentiation should end. This leads you to the commented suggestion: $2^{\{a\}}$.
\documentclass{article}
\begin{document}
$ 2^a \quad 2^{a} \quad 2^\{a\} \quad 2^{\{a\}} $
\end{document}
- 6,708



$2^{\{a\}}$, perhaps, assuming you really want visible braces. – Steven B. Segletes Oct 08 '20 at 02:422^{a}would not yield braces. One way that would give the output you showed is2^\{a\}, which is fixed the way that @ StevenB.Segletes suggests. – Teepeemm Oct 08 '20 at 02:57