Artemis
Artemis copied to clipboard
Styling of multiple-choice answers also applies inside inline KaTeX, messes up font size and padding
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
- Create a quiz, and set the following as an answer option:
[wrong] $$(\texttt{x})$$
- Save an preview the quiz.
Expected behavior
The KaTeX is rendered properly.
Screenshots
The actual output
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