1

I have the following code:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
    $$\hat{x}_n(t)=\left\{ \begin{array}{cc}
    1 & -1\leq 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.

1 Answer 1

1

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 & -1\leq 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}
2
  • 1
    Thanks, just a question, what does the \, does?
    – TeemoJg
    Oct 27, 2020 at 19:02
  • 2
    @J.Rodriguez it is a thin space to keep the , and . punctuation away from the formulae. Personally I wouldn't use punctuation here but styles vary. Oct 27, 2020 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .