Skip to content
New issue

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

How can we integrate Latex with React or any other UI framework? #147

Open
RohitKuwar opened this issue Dec 29, 2023 · 0 comments
Open

How can we integrate Latex with React or any other UI framework? #147

RohitKuwar opened this issue Dec 29, 2023 · 0 comments

Comments

@RohitKuwar
Copy link

I want to create Latex.js with existing React project. There I have to create runtime environment for latex just like playground. For which I am going through Latex documentation. In documentation I got code snippet which is not working for me. It is giving me an error can not find module 'fs' for svgdom package.

import { parse, HtmlGenerator } from 'latex.js'
import { createHTMLWindow } from 'svgdom'

global.window = createHTMLWindow()
global.document = window.document


let latex = "Hi, this is a line of text."

let generator = new HtmlGenerator({ hyphenate: false })

let doc = parse(latex, { generator: generator }).htmlDocument()

console.log(doc.documentElement.outerHTML)

Please provide detail information here or in docs.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant