1

I'd like to show math in my survey. Has anybody done this before and can explain a way how to achieve this?

I have not found any helpful information on this in the SurveyJS documentation or elsewhere.

kassbohm
  • 31
  • 3
  • One approach would be to prerender the math via KaTeX (e.g., using the `katex` CLI) and then insert that into the `html` field for a question. Rather ugly (the HTML is pretty big) but might work? You'd also need to include KaTeX's CSS. – edemaine Jun 20 '23 at 14:28
  • A runtime option would be to add a handler for an event like [onAfterRenderQuestion](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderQuestion) that calls KaTeX's auto-render on the updated `htmlElement`. – edemaine Jun 20 '23 at 14:30

0 Answers0