Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

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

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

2 Answers 2

up vote 22 down vote accepted

Put braces around the entire part that you want superscripted:

$8^{(a - b)}$
share|improve this answer

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

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

For example:

  \mpower{8}{(a-b)}
share|improve this answer
1  
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") –  tohecz Jan 27 '12 at 17:56
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.