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.

I like to change a/b to be

a
- 
b

how to do that?

share|improve this question
    
yes,I only can use / now. –  sam Jun 18 '11 at 13:34
5  
See my answer below. But really, since you ask this very elementary question, I guess you do not have access to any form of documentation? You need to remedy that. LaTeX is too complex to use without documentation. –  Harald Hanche-Olsen Jun 18 '11 at 13:36
    
Or have a look at this one: en.wikibooks.org/wiki/LaTeX –  Harald Hanche-Olsen Jun 18 '11 at 13:42
add comment

2 Answers

\frac{a}{b}, in math mode of course.

share|improve this answer
add comment

For fractions use $\frac{a}{b}$, like Harald Hanche-Olsen said. For inline-math I still like fractions that use / because a \frac is often too tall. Here is a definition for a nicer fraction that uses /:

\def\nicefrac#1#2{\leavevmode%
    \raise.5ex\hbox{\small #1}%
    \kern-.1em/\kern-.15em%
    \lower.25ex\hbox{\small #2}}

It is used like this:

\nicefrac{a}{b}
share|improve this answer
    
The nicefrac package, or the units package, also offer a \nicefrac command. –  Gonzalo Medina Jun 18 '11 at 13:46
5  
The xfrac package seems to be the better choice. –  Thorsten Donig Jun 18 '11 at 13:51
    
Is this kind of command can be used on MathJaX? Because I can't try success on Statistical Analysis board. –  sam Jun 18 '11 at 13:52
    
You can also use $\dfrac{a}{b}$ if you want a larger fraction in inline math mode. –  Peter Grill Jun 18 '11 at 14:51
1  
@Peter: using \dfrac in inline math is not very good because it changes the space between lines and by default LaTeX uses smaller fractions in inline math just to avoid this. –  Spike Jun 18 '11 at 15:16
show 1 more comment

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.