# Double superscript error in fractions

I'm basically new to LaTex and still learning, and while I'm trying to write this fraction:

$\frac{x}{sin({b_{2}})} = \frac{{A_{b}}{B_{a}}}{sin(C’’)}$


I get error: double superscript. I tried putting brackets in diffrent combinations but so far none have worked. Any ideas how can I make it work?

Edit: When I put into a separate file, like that:

    \documentclass[b5paper,11pt,twoside,titlepage]{article}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

\begin{document}
$\frac{x}{\sin{b_2}} = \frac{{A_b}{B_a}}{\sin{C’’}}$ \\
\end{document}


it works fine. But in the file I still get an error:

! Double superscript.
l.225 ...{b_2}} = \frac{{A_b}{B_a}}{\sin{C’’}}
\)
I treat x^1^2' essentially like x^1{}^2'.


And I should add the error appears as if it was in next line to the one with problematic code.

Edit 2: I repaired it. Apparently I used a fancy version of ' when I was pasting part of my code form source. After putting a normal '' there everything was fine.

• I don't get an error. Please turn this into a minimal working example (document class and begin/end document). Also, the error code (mysterious though it may be) is useful information. Please copy and paste it. (And you generally shouldn't put {} around things unless they need it: sin({b_{2}}) should be \sin(b_2).) – Teepeemm Dec 22 '16 at 22:20
• I too am not getting any errors. As a side note use \sin instead of sin. – Dan Dec 22 '16 at 22:25

The minimal example doesn't show errors, but no prime appears either.

In the second example, you have \usepackage[utf8]{inputenc} and you get the error, together with

LaTeX Warning: Command \textquoteright invalid in math mode


You have to use an undirected quote for getting a prime in math mode.

$\frac{x}{\sin b_2} = \frac{A_bB_a}{\sin C''}$


By the way, you don't need braces after \sin, nor around A_b and B_b.

• Thank you. I figured it out maybe a few seconds before I saw your comment. – Shinigami Dec 22 '16 at 22:57

It's your input that is causing the problem; separate the "text right quote ’" with {} in order to avoid the error. However, there are other options:

\documentclass{article}

\usepackage[utf8]{inputenc}

\begin{document}
$A''$ % <----- preferred

$B’{}’$

$C^{\prime\prime}$

\end{document}

• Thank you, that was exatcly it (though I figured it ou seconds before I saw you comment) – Shinigami Dec 22 '16 at 22:56
• ’{}’ is wrong anyway, because it produces warnings and the wrong spacing; also ^\prime{}^\prime is likewise wrong and should be ^{\prime\prime}. – egreg Dec 22 '16 at 23:03