michael-brade / LaTeX.js

JavaScript LaTeX to HTML5 translator
https://latex.js.org
MIT License
736 stars 58 forks source link

Picture with Tikz #123

Open fbob opened 3 years ago

fbob commented 3 years ago

I just found this project today and was wondering if:

Anyway it's a really awesome project ! Congratulations :)

michael-brade commented 3 years ago

Hi, thank you :-)

No, I did not implement that yet but there is no reason LaTeX.js couldn't support it. And yeah, I would LOVE to work on support for that! I like TikZ a lot. But I just don't have enough time right now, only little bits and pieces here and there. One of the next things will be images and SVG support, then you can export a TikZ picture as SVG and display it that way.

fbob commented 3 years ago

With images and SVG support no doubt that LaTeX.js could replace LaTeX in a daily work for A LOT of people. Rendering time is blazing fast. Sincerely, it's a pretty impressive work !

dzackgarza commented 3 years ago

Just wanted to mention that tikzcd would probably suffice for a lot of people!

Mahdi-Roozbahani commented 3 years ago

Any chance to work on this library?

michael-brade commented 3 years ago

@Mahdi-Roozbahani which library do you mean? this as in LaTeX.js or tikzcd?

Mahdi-Roozbahani commented 3 years ago

@Mahdi-Roozbahani which library do you mean? this as in LaTeX.js or tikzcd?

@michael-brade I meant tickzcd. So lines can be drawn using latex.js.

michael-brade commented 3 years ago

I see. Well, it won't be me for the time being.... Once \includegraphics works, you can include SVGs as a workaround.

dzackgarza commented 3 years ago

Will this actually work though? I seem to remember that \includegraphics has some issues with SVG in usual latex, see this Tex SE question for all of the various workarounds people seem to have to use: https://tex.stackexchange.com/questions/2099/how-to-include-svg-diagrams-in-latex

Mahdi-Roozbahani commented 3 years ago

Will this actually work though? I seem to remember that \includegraphics has some issues with SVG in usual latex, see this Tex SE question for all of the various workarounds people seem to have to use: https://tex.stackexchange.com/questions/2099/how-to-include-svg-diagrams-in-latex

It is a good point. It would be great to an SVG in your playground demo.

michael-brade commented 3 years ago

@dzackgarza Sure. I am completely independent of the real LaTeX. Imagine it that way: I am reimplementing LaTeX's syntax in JavaScript. So I can choose what syntax produces which result, limited only by what is or isn't possible with HTML/CSS.

Of course, I try to be as close to LaTeX as possible, but if some features that aren't available in LaTeX are easily possible with LaTeX.js, I won't prohibit them. See the playground, for instance ;-)