Artemis icon indicating copy to clipboard operation
Artemis copied to clipboard

Styling of multiple-choice answers also applies inside inline KaTeX, messes up font size and padding

Open just-max opened this issue 7 months ago • 0 comments

Describe the bug

Multiple-choice answer options are styled with some padding and a font size. This is done by selecting .answer-option.content.text (via SCSS). Unfortunately, KaTeX also uses the text HTML class for some components, so this styling gets applied inside KaTeX formulas.

To Reproduce

  1. Create a quiz, and set the following as an answer option: [wrong] $$(\texttt{x})$$
  2. Save an preview the quiz.

Expected behavior

The KaTeX is rendered properly.

Screenshots

The actual output image

Which version of Artemis are you seeing the problem on?

7.3.0

What browsers are you seeing the problem on?

Chrome, Firefox

Additional context

A workaround is to add

<style>.katex .text { font-size: unset !important; padding: unset !important }</style> 

to the question body.

The relevant code is here:

https://github.com/ls1intum/Artemis/blob/257eefc2db8b037038dba62d3eae1b934c09c694/src/main/webapp/app/exercises/quiz/shared/questions/multiple-choice-question/multiple-choice-question.component.scss#L28-L32

Relevant log output

No response

just-max avatar Jun 30 '24 23:06 just-max