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.

When I use \\ it breaks the frac layout. Now I come up with the following solution:

$$\frac{{O\vdash e_1:T_1 \atop O[T_1/x]\vdash e_2:T_2}}{O\vdash (let\ ((x e_1))\ e_2):T_2}$$

But it gives two lines with smaller font, and I need all 3 of them to be equal-sized.

UPDATED:

Also it will be needed to place more than two (three or four) lines into the numerator of a frac.

share|improve this question
2  
$$ is obsolete use \[\] instead, see tex.stackexchange.com/questions/503/why-is-preferable-to. –  canaaerus Feb 7 '13 at 19:11
1  
See also How to break a long expression in the denominator of a fraction? My recommendation: Don't do it! –  Hendrik Vogt Feb 7 '13 at 20:10
add comment

2 Answers

up vote 7 down vote accepted

you can use the aligned sub-environment from amsmath"

\[
\frac{\begin{aligned}
      O&\vdash e_1:T_1 \\ O[T_1/x]&\vdash e_2:T_2
      \end{aligned}}%
  {O\vdash (let\ ((x e_1))\ e_2):T_2}
\]

(your question ended abruptly, so there may have been more specifications that i wasn't aware of.)

if you wish these lines to be centered, then use gathered rather than aligned (and omit the &s).

both aligned and gathered can accommodate any number of lines, even more than four, although it seems to me that this probably gets too complicated.

remember that the baseline is still relative to the math axis (which is coincident with the fraction rule), so all extra lines will continue to rise above the rest of the displayed expression, and if that part of the expression is in parentheses, the parentheses will be unattractively empty below the line.

share|improve this answer
1  
Instead of this, splitfrac command from mathtools is here for the occasion. \frac{\splitfrac{}{}}{}. And \splitdfrac{}{} if you want it in displaymath. –  Manuel Feb 7 '13 at 19:41
    
How to align them by centre, instead of right border? –  Necto Feb 7 '13 at 19:49
add comment

Package mathtools provides a proper command, I will give an example soon

[Update}

Here goes the unswer posted by Manuel: \splitfrac{〈numer〉}{〈denom〉} is what you are wanting to. Then:

\[
   \frac{\splitfrac{O \vdash e_1 : T_1}{O[T_1/x] \vdash e_2 : T_2}}
   {O \vdash (let\ ((x e_1)) \ e_2) : T_2} 
\]
share|improve this answer
2  
\splitfrac{〈numer〉}{〈denom〉} is what you are wanting to. Then: \[ \frac{\splitfrac{O \vdash e_1 : T_1}{O[T_1/x] \vdash e_2 : T_2}}{O \vdash (let\ ((x e_1)) \ e_2) : T_2} \] should be the correct way. –  Manuel Feb 7 '13 at 19:40
2  
Please incorporate @Manuel's suggestion as part of your answer. –  Werner Feb 7 '13 at 19:59
add 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.