Wiris

Documentation / CalcMe

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • Nubric

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • CalcMe

                      Algorithm lines in CalcMe

                      Reading time: 3min

                      A brand new way to define variables and create algorithms is available in CalcMe. The purpose of this page is to outline what this new feature offers, the problems it aims to solve, and the expected user interaction.

                      calc.algorithm_line_example.calc.png

                      Problems intended to be solved

                      After a thorough analysis of the CalcMe user experience, we identified several minor issues that could be improved through algorithm line development. The main problems this new feature intends to address are:

                      • It's not possible to copy and paste multiple lines in CalcMe. From now on, it will be possible to easily reuse parts of an algorithm.
                      • It's hard to remember all the commands by heart. The new autocompletion option will help you find the appropriate function at each moment.
                      • CalcMe experiences performance issues during intermediate-length sessions due to the many instances of MathType editors that need to be used. You won't face this problem anymore by generating the algorithms with the provided plain text.
                      • It's not possible to add comments inside multiple-line structures. Besides, it's also impossible to quickly switch a line from being commented out to active.

                      Expected user interaction

                      A new button in the toolbar allows you to instantiate a code editor. That button enables the algorithm line feature for the current line, where you can enter your algorithms directly.

                      toolbar_button.png

                      User-created functions and constants (such as those represented by r(), create_random_matrix(m,n) and A) get their styling once the code editor loses focus to avoid the performance impact of updating the grammar with every keystroke.

                      On the other hand, variables defined inside a code editor are available in subsequent standard CalcMe lines for operations or value checking. Additionally, multiple code editors can be created on a page, and each can access the variables of the others.

                      calc.interaction_example.calc.png

                      Algorithms already written in the CalcMe sheet

                      If you had an algorithm already written in the CalcMe sheet, you could automatically convert it to the code editor. There is a new button in the toolbar allowing you to do so.

                      sheet_to_algorithm.gif

                      Thus, you will be able to translate those old algorithms that gave you performance problems into the code line box.

                      About the syntax

                      The syntax used in the code editors is Omega, the internal language of the Wiris CAS kernel. Even though it's very similar to the syntax used in standard CalcMe lines, several actions help you get the correct syntax.

                      • Clicking a button from the CalcMe menu while inside a code editor will enter its Omega equivalent expression:

                        syntax_menu.png

                       

                      • Using the function name autocompletion mode through the shortcut Ctrl + Space (Cmd + Shift + Space in macOS):

                        syntax_autocompletion.png

                       

                      Comment syntax

                      As mentioned above, it's possible to use the comment syntax within the code editor. You can use the symbol # to mark a line as a comment and the sequence /# to start a comment block (you can close it using the symbol #/).

                      syntax_comment.png

                      Search and Replace commands

                      As a brand new feature of the CalcMe code editor, it's possible to find and replace text if you're working with a lot of text and need to search and replace a word or a phrase.

                      calcme_replace.gif

                      You can find below the corresponding shortcuts:

                      Action Shortcut
                      Start searching Ctrl+F
                      Find next Ctrl+G
                      Find previous Ctrl+Shift+G
                      Replace Ctrl+Shift+F
                      Replace all Ctrl+Shift+R

                      This feature only works inside the code editor. Thus, it's important to set the cursor inside the corresponding text field.

                       

                      String substitution command

                      If you want to use the string_substitution() command within a mathematical expression, you will have to keep using the CalcMe sheet accordingly. It's a limitation of the current editor, and, although it's not ideal, the formulas won't be displayed properly if they are included through the code editor.

                      calc.string_substitution_example.calc.png

                      Algebraic expressions

                      There are several notation considerations you need to take into account if you want to create an algebraic expression through the code editor. As you can see in the screenshot below, CalcMe will interpret expressions that begin with an alphabetic character as identifiers (in blue), such as reserved words.

                      calcme_identifiers.png

                      This behavior can involve some validation problems in a WirisQuizzes question context, given that E·13≠E13.

                      calcme_comparison.png

                      Thus, to avoid these situations, there are two workarounds you can use interchangeably. We recommend using the first one, as you can keep generating the algorithm within the code editor, but both are equally possible.

                      • Insert the dot operation product between all alphabetical characters and numbers.

                        calcme_expression.png
                      • Define such expressions inside CalcMe.

                        calcme_expression_2.png

                      Was this article helpful?

                      Give feedback about this article

                      Algorithm lines in CalcMe

                      Problems intended to be solved Expected user interaction Algorithms already written in the CalcMe sheet About the syntax Comment syntax Search and Replace commands String substitution command Algebraic expressions

                      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