TransWikia.com

Size of fractions and spaces in arrays

TeX - LaTeX Asked by TeemoJg on April 27, 2021

I have the following code:

documentclass[12pt]{article}
usepackage{amsmath}
begin{document}
    $$hat{x}_n(t)=left{ begin{array}{cc}
    1 & -1leq t leq -frac{1}{n+1}  
    -(n+1) t & -frac{1}{n+1} leq t leq frac{1}{n+1} 
    -1 & frac{1}{n+1} leq t leq 1. 
    end{array}right.$$
end{document}

This looks like this:

enter image description here

The problem is that the size of the fractions is too small, if I try to change it using dfrac, the size is too big and they end up overlapping, because the spaces between each line are the same. Is there an easy way to change this? Thanks.

One Answer

The dcases environment of the mathtools package -- a superset of the amsmath package -- would seem right for the job at hand.

enter image description here

documentclass{article}
usepackage{mathtools}
begin{document}
[
hat{x}_n(t)=
begin{dcases}
    1 & -1leq t leq -frac{1}{n+1} ,, 
    -(n+1) t & -frac{1}{n+1} leq t leq frac{1}{n+1} ,, 
    -1 & frac{1}{n+1} leq t leq 1 , . 
end{dcases}
]
end{document}

Correct answer by Mico on April 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP