Wiris

Documentation / MathType

  • Demos
  • Visit our website
  • Downloads
  • Contact us
  • MathType

    • WirisQuizzes

      • Nubric

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • MathType
                      • Using MathType
                      • MathType Web
                      • Introductory tutorials

                      Create a piecewise function with MathType Web

                      Reading time: 2min

                      This 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.

                      Example of a piecewise function with two expressions and conditions

                      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.

                      1. Open MathType.
                      2. Type the left side of the function, including its argument and equals sign, as shown in the example.
                      3. Leave the cursor after the equals sign.

                      Left side of the piecewise function entered in MathType

                      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.

                      1. Insert the piecewise function template after the equals sign.
                      2. Enter the first expression and its condition in the first row.
                      3. 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.
                      4. Use ≥ from the General tab where the condition requires it.

                      Piecewise function template with a brace and slots for expressions and conditions

                      Piecewise function filled in before formatting the word if

                      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.

                      1. Select the first occurrence of if.
                      2. Use the Automatic italic control in the General tab to make the word appear as regular text.
                      3. Repeat for the second occurrence of if.
                      4. Check the function, then click Accept, OK, or the equivalent button to insert it.

                      Automatic italic control used while formatting text in the piecewise function

                      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.

                      Was this article helpful?

                      Give feedback about this article

                      Create a piecewise function with MathType Web

                      See it in action Before you begin Prerequisites Requirements Step 1 — Type the left side of the function Step 2 — Fill in the piecewise function template Step 3 — Format the conditions and insert the function You're done Troubleshooting If the brace does not span both lines If an expression appears beside the wrong condition If "if" appears italic

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Nubric

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand