-
MathType
-
WirisQuizzes
-
Nubric
-
CalcMe
-
MathPlayer
-
Store FAQ
-
MathFlow
-
BF FAQ
-
Miscellaneous
-
Wiris Integrations
Create a piecewise function with MathType Web
Reading time: 2minThis tutorial shows you how to create a function with different expressions for different conditions. You will use the piecewise function template to keep the brace, expressions, and conditions together.
By the end, you will have a formatted piecewise function with two parts.

See it in action
Before you begin
Prerequisites
- You should know how to create an equation and use toolbar templates. For practice with templates, see Build a trigonometric expression with MathType Web.
Requirements
- Access to MathType Web with the piecewise function template available. The toolbar may look different depending on the integration.
Step 1 — Type the left side of the function
Entering the function name and equals sign first places the piecewise structure in the correct position.
- Open MathType.
- Type the left side of the function, including its argument and equals sign, as shown in the example.
- Leave the cursor after the equals sign.

Checkpoint: You should see the left side of the function, ready for the brace and its two lines.
Step 2 — Fill in the piecewise function template
The template provides the brace and separate slots needed to pair each expression with its condition.
- Insert the piecewise function template after the equals sign.
- Enter the first expression and its condition in the first row.
- Move to the second row and enter its expression and condition. You can click a slot or use the right and down arrow keys to move through the template.
- Use ≥ from the General tab where the condition requires it.


Checkpoint: You should see two expressions and their conditions under one brace.
Step 3 — Format the conditions and insert the function
Words such as "if" should appear as regular text, while mathematical variables retain their mathematical formatting.
- Select the first occurrence of
if. - Use the Automatic italic control in the General tab to make the word appear as regular text.
- Repeat for the second occurrence of
if. - Check the function, then click Accept, OK, or the equivalent button to insert it.

Checkpoint: You should see the completed function in your application, with both occurrences of "if" displayed as regular text.
You're done
You now have a piecewise function with two formatted expressions and conditions. Next, you can:
- Add another row using the Contextual tab if your function has more than two parts.
- Align equations with the Contextual tab to practice another multiline structure.
- Explore MathType's templates and formatting controls.
Troubleshooting
If the brace does not span both lines
Use the piecewise function template instead of typing a brace as an ordinary character.
If an expression appears beside the wrong condition
Click the intended template slot before entering it. Use the arrow keys to check your position within the structure.
If "if" appears italic
Select the complete word and apply the formatting described in Step 3.