equations displaying in question preview but not survey | XM Community
Skip to main content
Question

equations displaying in question preview but not survey

  • April 8, 2022
  • 6 replies
  • 50 views

Forum|alt.badge.img+1

I've followed the instructions here: https://community.qualtrics.com/XMcommunity/discussion/comment/32547#Comment_32547 to integrate katex into a survey for displaying equations. Interestingly, when I use "preview question" on a question with embedded katex, it displays fine in the pop-up window, as below:
image.pngBut when I use "preview block," "preview survey" or even just look at the published survey, I get a mess:
image.pngInterestingly, you'll see that the variable d_{blue, red flag} is actually displayed properly within that block.
I feel like maybe there's a command I'm missing somewhere that doesn't get triggered when doing the broader previews? Has anyone gotten math display to work properly (using katex or otherwise)?

6 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • April 10, 2022

Post your question html (as a code block).


Forum|alt.badge.img+1
  • Author
  • April 11, 2022

Text block:

Globally/Always:

\\text{``Always between } t=1_1 \\text{ and } t=t_2:S\\text{"} means that the statement S must always be true for all time between t_1 \\text{ and } t_2. This is equivalent to \\text{``}G_{[t_1,t_2]}:S\\text{"}, where G stands for "globally"



Finally/Eventually:

Other Operators:

“∧” means “AND”

“∨” means “OR”

“¬” means “NOT”

“≤“ means “less than or equal to”

"≥“ means “greater than or equal to”`

Question JavaScript:
Qualtrics.SurveyEngine.addOnload(function() {jQuery(".katex").each(function() {

      katex.render(this.innerHTML, this, { throwOnError: false });

   });

});


Qualtrics.SurveyEngine.addOnReady(function()

{

   /*Place your JavaScript here to run when the page is fully displayed*/


});


Qualtrics.SurveyEngine.addOnUnload(function()

{

   /*Place your JavaScript here to run when the page is unloaded*/


});


Look and Feel \\ General \\ Header:





TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • April 11, 2022

Remove defer and onload from your

Scanning file for viruses.

Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.

OK

This file cannot be downloaded

Sorry, our virus scanner detected that this file isn't safe to download.

OK