You can create math expressions to enter into your Form by clicking on Create Math Expressions in the Add-on.

Screen Shot 2014-10-22 at 8.45.17 PM.png

Once the sidebar opens up, type in the Question Title, the Help text and then enter in your expression into the Enter LaTeX textbox. I have supplied Prebuilt formatting and expressions to help with the LaTeX syntax. The LaTeX Preview will show a live version of the rendering of your expression. 

When you have created your desired expression click the Insert button to create your Form question. g(Math) will add your question to the bottom of the Form as an image item. It will also create a text item for the respondent to enter their response.

Common Errors, Troubleshooting, and Tips

There are a few things to watch out for that are limitations of g(Math) for Forms. 

  • You cannot use g(Math) to create options for a Multiple Choice directly (image items are not allowed as options for multiple choice questions). You can create the multiple choice yourself in the question and then change the text item response into a multiple choice question. 
  • Another issue that is frequently encountered is when a long expression is entered into the Enter LaTeX box. When the expression is too long the LaTeX Preview image can scroll off the right of the Sidebar. You can manually scroll over to see the entire image.

    If your expression is very long, it will not insert into the Form even though it will render in the sidebar. . This is due to a restriction with the Google URLFetch API that limits the URL length to 2000 bytes. This should only impact expressions that are about 3/4 of a page of expressions (much, much longer than the previous allotment). You can split your expression into two (or more) images and put them side by side to create the same effect as 1 complete image expression as a workaround.

  • If your LaTeX is not complete the api will return an error that looks like the image below in the Preview box. You just need to complete the LaTeX to have the error go away. In the below example, once I complete the \frac{}{}, then the error image goes away. This is not an ideal situation, but a trade-off I was willing to make to have a more complete Expressions API.

Screen Shot 2016-02-13 at 11.42.50 PM.png