# How do I specify 8^(a - b) in math mode

$8^(a - b)$ produces only a superscripted (; the rest of the power is not superscripted.

How can I superscript the whole (a-b) portion?

-
Please read any introduction to (La)TeX. The FAQ is a good starting point. – Martin Schröder Jan 27 '12 at 15:40

Put braces around the entire part that you want superscripted:

$8^{(a - b)}$


Note that from the mathematical point of view, the parentheses () are superfluous here and can be omitted:

$8^{a-b}$

-

To always get it right you can define a command probably like

  \newcommand{\mpower}[2]{\ensuremath{#1^{#2}}}


For example:

  \mpower{8}{(a-b)}

-
In my opinion, such macro is un-useful. I always find the \ensuremath command mis-leading, because you should know if you are in math-mode or not. If any, I define \newcommand{\upp}[1]{^{(#1)}} and use it 8\upp{a-b} ("upp" as "up--parenthesis") – yo' Jan 27 '12 at 17:56
I would in this case write the power as \smash{(}a+b\smash{)} because ()'s in powers have a tendency to affect line spacing if used in the normal text. – daleif Jan 27 '12 at 18:16
The \ensuremath I only use it as a safety precaution. It is the first time I am seeing the \smash command. My answer, in no way is the best, but it may be an alternative to the norm, I guess..... – azetina Jan 27 '12 at 19:00