# How to make an input for a Piecewise by Palettes?

How to make the input using the { as it is shown in the top of the question? I mean, how can make the array?

By default in the "special character section" appears an option 2x2 (Typographic composition section) there are shortcuts for expanding the rows and columns but they do not work correctly. And I am working on Mac so shortcuts do not work either.

I know that it is possible to solve this by typing in this way:

f[x_] = Piecewise[{{-1, x <= -1}, {x, -1 < x < 0}, {x^2, x >= 0}}]


But, I am asking for input as it is shown on top by using the option in the red circle and adding the 3dr row.

• Related (but specifically not a duplicate): mathematica.stackexchange.com/questions/198665/… – Carl Lange May 19 at 22:07
• You want to type the escape key, then pw, and then the escape key again, or [\Piecewise] - check the Details and the Basic Examples for the Piecewise function: reference.wolfram.com/language/ref/Piecewise.html – Carl Lange May 19 at 22:09
• Thank you. Non exactly. I want to use the "Typographic Composition" Palette. but when I use that option, only appears a 2x2 array. I do not know how to expand the array. – Haizum Skallah May 19 at 22:13
• Then, you'll need to type control-return for each case, as the documentation I linked to explains. Unfortunately it doesn't seem to be easily done using that palette. – Carl Lange May 19 at 22:14
• I don't understand what you mean in your question when you say "I am working on Mac so shortcuts do not work either". Shortcuts work for me, and I am working on a Mac. – Carl Lange May 19 at 22:29

Piecewise[{{-1, x <= 0}, {x, x >= 0}}]

$$\begin{cases} -1 & x\leq 0 \\ x & x\geq 0 \end{cases}$$
Then you can copy and paste it into your function definition and throw away your initial bootstrapping Piecewise. You can edit the rows in place, and add more rows by placing the cursor in the row above where you want a new one and use CTRL-Enter, or use the menu "Insert->Table/Matrix->Add Row"