kisonecat / tikzjax

TikZJax is TikZ running under WebAssembly in the browser
LaTeX Project Public License v1.3c
443 stars 39 forks source link

Call from another script #8

Open ifndev opened 4 years ago

ifndev commented 4 years ago

It seems that tikzjax only processes the page on load. Is there a way to call tikzjax from another script at any moment ?

Thanks !

bjeevana94 commented 4 years ago

I have experienced a similar issue. tikzjax is able to process only at the initial load but not when I try to call it inside the component.

Please let me know if there is any solution to it. Thanks

kaisugi commented 4 years ago

I think it would be nice to register tikzjax.js compressed file (used in here for example) to some CDN service such as https://www.jsdelivr.com/.

kaisugi commented 4 years ago

@kisonecat If you don't mind, I'd like to do the job instead. What do you think?

ifndev commented 4 years ago

Unfortunately the author doesn't seem to be very active... Wich is sad as the code isn't explicitely licensed.

kisonecat commented 4 years ago

I very much apologize! I'd be happy for any help, and I'm also happy to get the actual open license statement in this repo. (The licensing is a bit confusing to me since it is built off the TeX sources.)

kaisugi commented 4 years ago

The licensing is a bit confusing to me since it is built off the TeX sources.

Hmm.. This is a tough problem.

kisonecat commented 4 years ago

Looking at this some more today, the license situation is not so bad: Knuth's TeX has the "Knuth license" which just requires that the name be changed if the files are modified, but tikzjax actually uses the unchanged source and distributes "compiled" wasm so the license is really not a problem. The LaTeX stuff like TikZ is mostly LPPL or GPL or dual, so a dual LPPL/GPL licesne is the correct license since, say, tikzjax incorporates some PGF driver code. Does this sound good?

kaisugi commented 4 years ago

Sounds good! I really appreciate your consideration.

ifndev commented 4 years ago

Sounds perfect ! I'm really glad you made time to get the license right !

ghost commented 3 years ago

Looking at this some more today, the license situation is not so bad: Knuth's TeX has the "Knuth license" which just requires that the name be changed if the files are modified, but tikzjax actually uses the unchanged source and distributes "compiled" wasm so the license is really not a problem. The LaTeX stuff like TikZ is mostly LPPL or GPL or dual, so a dual LPPL/GPL licesne is the correct license since, say, tikzjax incorporates some PGF driver code. Does this sound good?

I am a little bit confused, under which license this library is now available. We want to use your library in our e-learning platform, but can't do so, if it is licensed under a GPL license, since we can't put our platform under GPL at the moment. If your library would be available under a dual license in terms of LPPL and/or GPL, we could use it, since LPPL doesn't have a copyleft. You say that stuff like TikZ is mostly LPPL or GPL or dual. Do I understand it correctly, that some of the stuff is only available under GPL? If so, your library can't have a dual LPPL/GPL license, since GPL has a copyleft. Excuse me, if I am mistaken here. Could you give me some insight, under which license your library is available? In the package.json it says GPL-3.0, but that file wasn't touched since your comment here.

kisonecat commented 3 years ago

I apologize for the confusion.

Everything I've written in this repository is dual licensed under the LPPL and the GPL and I've updated package.json to reflect that in 8a00c2ed83c9b8fc8f4714f1d1cb77072c9b13fb. The LPPL handles people who might want to bundle this with LaTeX, and the GPL would permit someone to take the GPL'd code, modify it, and then release it under that license.

GokulNC commented 3 years ago

Thanks @kisonecat for creating this. Would it be possible to support the feature requested in the OP?

That is basically exposing this block of code (inside window.onload()) as a callable function like renderTikZ(targetNode): https://github.com/kisonecat/tikzjax/blob/8a00c2ed83c9b8fc8f4714f1d1cb77072c9b13fb/src/index.js#L77

The following line could be made generic: https://github.com/kisonecat/tikzjax/blob/8a00c2ed83c9b8fc8f4714f1d1cb77072c9b13fb/src/index.js#L116

Like this:

var scripts = targetNode.getElementsByTagName('script');

where targetNode is a parameter which is explicitly passed by the programmer, the default value being targetNode=document


Also please add in the README about the instruction to build the static js file. (Sorry if that's basic, I do not have much experience with JS)