-
-
-
diff --git a/src/main.ts b/src/main.ts
index 8fc3451..6c36c2d 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,6 +8,10 @@ import 'vuetify/styles' // Global CSS has to be imported
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
+import 'katex/dist/katex.min.css'
+import 'katex/dist/contrib/auto-render.min'
+
+
const app = createApp(App)
const vuetify = createVuetify({
diff --git a/src/support/parse.ts b/src/support/parse.ts
index f92b28c..6dfdae2 100644
--- a/src/support/parse.ts
+++ b/src/support/parse.ts
@@ -284,15 +284,18 @@ export class MathStatement {
/** Render the statement as HTML string. */
toHTMLString(): HTMLString {
return katex.renderToString(this.toLaTeX(), {
- output: 'mathml',
+ output: 'html',
}) as HTMLString
}
/** Render the statement to a DOM element. */
- toDOM(): HTMLSpanElement {
- const node = document.createElement('span')
+ toDOM(node?: HTMLElement): HTMLSpanElement {
+ if ( !node ) {
+ node = document.createElement('span')
+ }
+
katex.render(this.toLaTeX(), node, {
- output: 'mathml',
+ output: 'html',
})
return node
}