3
$\begingroup$

$x^-3$

$x^15$

$x^1^5$

This sucks. What am I doing wrong?

$\endgroup$

2 Answers 2

6
$\begingroup$

Use {...} to input more than 1 character.

$3^{15}$ will be given by 3^{15}

$\endgroup$
7
$\begingroup$

L.Dutch already told you to use curly braces ({}) around the number. So you'd write x^{15} to get $x^{15}$.

This applies more generally as well. For example, \sqrt xy will render as $$\sqrt xy$$ but \sqrt{xy} renders as $$\sqrt{xy}$$ and correspondingly \sqrt \sin xy gives you $$\sqrt \sin xy$$ which is probably not what you meant, while \sqrt{\sin{xy}} becomes $$\sqrt{\sin{xy}}$$

As a general rule, any time you need to group multiple symbols in LaTeX (which Mathjax uses), those symbols need to be surrounded by {}.

$\endgroup$
3
  • $\begingroup$ Thanks. Out of curiosity, what did happen to my third example? $x^1^5$ I like the box, but how did I create it? $\endgroup$ Commented Apr 20, 2019 at 19:06
  • 1
    $\begingroup$ @TheDyingOfLight It's probably related to the "Double exponent: use braces to clarify" I see in the edit preview. Which is basically just telling you to do it the way you've now been shown. :-) $\endgroup$
    – user Mod
    Commented Apr 20, 2019 at 19:17
  • 1
    $\begingroup$ @TheDyingOfLight You can create a box by surrounding an expression with \boxed{}: e.g. $\boxed{x^{15}}$. $\endgroup$
    – Laurel
    Commented Apr 25, 2019 at 2:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .