We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using the Auto-render extension heavily (github).
I use the error handling like this:
renderMathInElement(document.body, { delimiters: [ {left: "$$", right: "$$", display: true}, {left: "\\(", right: "\\)", display: false}, {left: "\\[", right: "\\]", display: false}, ], macros: { ":": "{\\char`:}", ",": "{\\char`,}", "·": "{\\char`·}", }, fleqn: true, errorCallback: function(error) { // LATEX ERROR FOUND - Katex cannot parse // show error box bottom right var $div = $("<div>", {id: "dialog-box-error", "class": "error-bg" }); // $div.click( function(){ $(this).remove() }); $('.main').append($div); $div.text(error.replace('\\(', '').replace('\\)', '').replace(' with', '')); //console.log(error); }, preProcess: (math) => math.replace(/ /g, ' '), }); console.log('Katex rendered');
With autorender I get (example):
KaTeX auto-render: Failed to parse a_N(150 \frac{ \mbox {km}}{\text{h}})=\frac{v^2}{r}=\frac{ \left(150 \frac{ \mbox {km}}{\text{h}} \right) ^2 }{200\text{m} }= \frac{\left( 150\frac{1000\mbox {m}}{3600\text{s}} \right)^2 }{200\text{m}} \approx 8,681 \frac{\text{m}}{\text{s}^2}KaTeX auto-render: Failed to parse s=v_0 \cdot t + \frac{1}{2}a_T \cdot t^2=120 \frac{\mbox {km}}{\text{h}} \cdot 3\text{s} + \frac{1}{2} 2,778\frac{\text{m}}{\text{s}^2} \cdot (3\text{s})^2=112,5\text{m} with
a_N(150 \frac{ \mbox {km}}{\text{h}})=\frac{v^2}{r}=\frac{ \left(150 \frac{ \mbox {km}}{\text{h}} \right) ^2 }{200\text{m} }= \frac{\left( 150\frac{1000\mbox {m}}{3600\text{s}} \right)^2 }{200\text{m}} \approx 8,681 \frac{\text{m}}{\text{s}^2}
s=v_0 \cdot t + \frac{1}{2}a_T \cdot t^2=120 \frac{\mbox {km}}{\text{h}} \cdot 3\text{s} + \frac{1}{2} 2,778\frac{\text{m}}{\text{s}^2} \cdot (3\text{s})^2=112,5\text{m}
With Katex error handling, however, I get:
KaTeX auto-render: Failed to parse s=v_0 \cdot t + \frac{1}{2}a_T \cdot t^2=120 \frac{\mbox {km}}{\text{h}} \cdot 3\text{s} + \frac{1}{2} 2,778\frac{\text{m}}{\text{s}^2} \cdot (3\text{s})^2=112,5\text{m} with ParseError: KaTeX parse error: Undefined control sequence: \mbox at position 53: … t^2=120 \frac{\̲m̲b̲o̲x̲ ̲{km}}{\text{h}}…
The important part is missing:
ParseError: KaTeX parse error: Undefined control sequence: \mbox at position 53: … t^2=120 \frac{\̲m̲b̲o̲x̲ ̲{km}}{\text{h}}…
How to get the ParseError message in the callback?
REF: #2616
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using the Auto-render extension heavily (github).
I use the error handling like this:
With autorender I get (example):
With Katex error handling, however, I get:
The important part is missing:
How to get the ParseError message in the callback?
REF: #2616
The text was updated successfully, but these errors were encountered: