1

I want my pdf cases to look like that

look i want

When I try to do it myself, I have this effect:

My pdf

Here is my latex code:

\begin{equation*}
g(x)=
\begin{cases}
\frac{x}{x-1} & \textrm{dla}\quad x<-1, \\
2\sin{\pi x} & \textrm{dla}\quad x \in \langle -1,3), \\
\frac{3x+1}{8x} & \textrm{dla}\quad x \in \langle 3,6 \rangle , \\
4x^3 & \textrm{dla}\quad x>6.
\end{cases}
\end{equation*}

Please fix my code

2 Answers2

2

Edit: now is considered @Barbara Beeton comment.

Not with cases but array works fine:

enter image description here

\documentclass[margin=3mm, varwidth]{standalone}
\usepackage{amsmath}

\begin{document} [ g(x)= \left{\begin{array}{clc} \frac{x}{x-1} & \textrm{dla} & x<-1, \ 2\sin{\pi x} & \textrm{dla} & x \in \langle -1,3), \ \frac{3x+1}{8x} & \textrm{dla} & x \in \langle 3,6 \rangle , \ 4x^3 & \textrm{dla} & x>6. \end{array}\right. ] \end{document}

If you like to have bigger vertical space between lined, add afte \] command \renewcommand\arraystretch{1.2}. Then r5esult is:

enter image description here

Zarko
  • 296,517
0

I found this answer helpful. You just add \hfill on the left and right side side of the content you want to be centered. Here is a MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation} g(x)= \begin{cases} \hfill \frac{x}{x-1}\hfill & \textrm{dla}\quad \hfill x<-1,\hfill \ \hfill 2\sin{\pi x}\hfill & \textrm{dla}\quad \hfill x \in \langle -1,3),\hfill \ \hfill \frac{3x+1}{8x}\hfill & \textrm{dla}\quad \hfill x \in \langle 3,6 \rangle ,\hfill \ \hfill 4x^3\hfill & \textrm{dla}\quad \hfill x>6.\hfill \end{cases} \end{equation}

\end{document}

Here is the output:

enter image description here

Vebjorn
  • 1,778