Feedback: Minor fix for KaTeX

When using gemini for math and pasting in latex code with nonstandard macros, then the output tends to use these macros as well, which leads to exceptions in the browser console like
ParseError: KaTeX parse error: Undefined control sequence: \norm at position 7:.
The problem is that then the UI will not show the entire equation $...$.
This can be fixed with the throwOnError = false options for katex.render. To try this, you can enter
katex_render = katex.render; katex.render = function(e,t,r){r.throwOnError = false; return katex_render(e,t,r); }
into the browser console. With this fix, the formula will be shown, but e.g. \norm would just appear in red inside the formula, so that the output remains at least readable.

1 Like