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

Licensing question (for packaging and use) #671

Closed
SuzanneSoy opened this issue Mar 29, 2017 · 5 comments
Closed

Licensing question (for packaging and use) #671

SuzanneSoy opened this issue Mar 29, 2017 · 5 comments

Comments

@SuzanneSoy
Copy link
Contributor

Hello,

My apologies for asking this question here, I could not find a forum or mailing list for KaTeX.

KaTeX is a great tool for rendering math online :) .

Scribble [1] is a documentation language (think of it as an alternative to LaTeX with HTML output), and I created a package (available at [2]) which allows Scribble users to easily typeset math using KaTeX.

For example, one can write the following file, compile it with scribble, and obtain an HTML page which loads the KaTeX library to typeset the math.

#lang scribble/manual
@require[scribble-math]
Let's write some @${m \alpha \tau h} !

I am not a lawyer, and therefore am uncertain concerning licensing issues.

  1. I am including the relevant part of the gh-pages branch of the official KaTeX repo [3] it as a subdirectory [4] of the scribble-math package (in order for it to get downloaded by the package manager), keeping the LICENSE.txt file intact inside that katex subdirectory.
    Does distributing KaTeX in a subdirectory, with its own license, have an impact on the license of the rest of the scribble-math code or repository?
  2. The scribble-math code instructs scribble to copy the katex directory into the output directory, along with the produced HTML file.
    Is this copy a sort of linking which could taint the license of the scribble-math code itself?
    I am not aware of any linking / tainting issues concerning the MIT license, these legal terms are vague and subject to interpretation, so I feel it's better to ask at the source.
  3. Is there any impact on the license of the source scribble documents which make use of the scribble-math library?
  4. The resulting HTML files contain a tiny piece of code which writes a script tag and a link rel=stylesheet tag which load the katex.min.js and katex.min.css file.
    Is there any impact on the license of the generated HTML files themselves?
    Is there any impact on the source scribble documents used to generate these files?
  5. I am considering the possibility to perform the rendering as a pre-processing step, via Node.Js. Does the HTML generated by KaTeX that way have any licensing impact on the source or HTML documents?
  6. Some fonts are included in the KaTeX folder. Are there any issues related to distributing those, as long as they are left in their respective subfolders, without altering the LICENSE files?

FWIW, currently, the scribble-math code is based on an existing math package for Scribble, and keeps the original license of that former package (LGPLv3), but I might discard the few relevant files and switch the scribble-math code to a Public Domain / CC0 "license".

I would like to make it easier for Scribble users to beautifully typeset math using KaTeX, but I wouldn't want this to set up a licensing trap, forcing users to change the license of their documentation (either source or generated HTML). Note that I cannot afford to pay a lawyer to answer these questions, and asking at the source will give a more definitive answer anyway.

Thank you very much,
Georges Dupéron

[1] http://docs.racket-lang.org/scribble/
[2] https://github.com/jsmaniac/scribble-math
[3] https://github.com/Khan/KaTeX
[4] https://github.com/jsmaniac/scribble-math/tree/master/katex

@xymostech
Copy link
Contributor

I am not a lawyer either, but here's what I've found via a bit of googling:

  1. I am including the relevant part of the gh-pages branch of the official KaTeX repo [3] it as a subdirectory [4] of the scribble-math package (in order for it to get downloaded by the package manager), keeping the LICENSE.txt file intact inside that katex subdirectory.
    Does distributing KaTeX in a subdirectory, with its own license, have an impact on the license of the rest of the scribble-math code or repository?

Based on this answer and this answer and this wikipedia page on License Compatibility, the MIT license is compatible with the GPL license. So by including the KaTeX source inside of scribble, the code of KaTeX that is distributed with it will become subject to the restrictions of the LGPL (like copyleft), but the package overall will remain LGPL licensed (actually, the answers are about GPL licenses, so maybe this is different, but GPL vs. LGPL seem similar enough on this front).

  1. The scribble-math code instructs scribble to copy the katex directory into the output directory, along with the produced HTML file.
    Is this copy a sort of linking which could taint the license of the scribble-math code itself?
    I am not aware of any linking / tainting issues concerning the MIT license, these legal terms are vague and subject to interpretation, so I feel it's better to ask at the source.

Again, since the MIT license is compatible with the (L)GPL license, it sounds like this is fine and scribble will continue to be LGPL licensed.

  1. Is there any impact on the license of the source scribble documents which make use of the scribble-math library?

As long as the KaTeX license is distributed with the KaTeX code, I don't think so. If it isn't, you'd have to include the KaTeX license in there, I think.

  1. The resulting HTML files contain a tiny piece of code which writes a script tag and a link rel=stylesheet tag which load the katex.min.js and katex.min.css file.
    Is there any impact on the license of the generated HTML files themselves?
    Is there any impact on the source scribble documents used to generate these files?

That code is not part of KaTeX, so it should be covered by whatever license scribble or scribble-math is under.

  1. I am considering the possibility to perform the rendering as a pre-processing step, via Node.Js. Does the HTML generated by KaTeX that way have any licensing impact on the source or HTML documents?

According to this answer, the output that KaTeX generates isn't licensed under the KaTeX license, so it shouldn't have an impact.

  1. Some fonts are included in the KaTeX folder. Are there any issues related to distributing those, as long as they are left in their respective subfolders, without altering the LICENSE files?

According to #339 (answered by me!) our fonts are licensed under the SIL, and this license is embedded in the fonts so no separate license to distribute. Reading this question it's not really clear whether that license is compatible with the (L)GPL, but since you're going to be distributing the fonts alongside the code, you should be fine.

Hopefully that vaguely answers your questions! Sounds like you should be in the clear as long as you distribute the KaTeX license alongside the code, but again I am definitely not a lawyer so some of this might be wrong.

I am including the relevant part of the gh-pages branch of the official KaTeX repo [3]

Side note, you probably just want the code that comes inside of one of our releases from the releases page, not by copying from the gh-pages branch. :)

(I'm going to close this issue because it's not related to an actual bug in the project. Feel free to continue the discussion here though!)

@SuzanneSoy
Copy link
Contributor Author

Thank you very much @xymostech for your prompt and detailed answer.

Based on this answer and this answer and this wikipedia page on License Compatibility, the MIT license is compatible with the GPL license. So by including the KaTeX source inside of scribble, the code of KaTeX that is distributed with it will become subject to the restrictions of the LGPL (like copyleft), but the package overall will remain LGPL licensed (actually, the answers are about GPL licenses, so maybe this is different, but GPL vs. LGPL seem similar enough on this front).

The KaTeX folder distributed with scribble-math is copied as-is, as a resource, if you will (just like KaTeX itself contains fonts under a different (SIL) license, as resources), so I suspect the "outer" scribble-math package's license should affect the bundled KaTeX in the first place. It is good to know that, in this case (LGPL), it wouldn't be a problem anyway.

  1. Is there any impact on the license of the source scribble documents which make use of the scribble-math library?

As long as the KaTeX license is distributed with the KaTeX code, I don't think so. If it isn't, you'd have to include the KaTeX license in there, I think.

That's good to know, thanks for the clarification. The LICENSE file is kept, and the license header in the katex.min.js file is preserved, so users shouldn't have issues here, without the need to explicitly mention KaTeX and its license in the document itself (IIUC).

  1. Some fonts are included in the KaTeX folder. Are there any issues related to distributing those, as long as they are left in their respective subfolders, without altering the LICENSE files?

According to this answer, the output that KaTeX generates isn't licensed under the KaTeX license, so it shouldn't have an impact.

That seems to depend on whether substantial parts of the KaTeX source code are included in the generated output (e.g. copied over from constant strings etc.), the answer you linked to mentions for example YACC which embeds chunks of source code in its output. I would think in the case of KaTeX that such code to be small enough fragments that the issue will not arise, but I would prefer confirmation, rather than just assuming (the legal notion of "small enough that it does not taint the output" is not particularly precise, AFAIK).


I think I'll take care to clearly state that in the scribble-math repository, the LGPL (currently, hopefully CC0 sometime in the future) applies only to the scribble-math code, not to the KaTeX folder (just as KaTeX's license affects KaTeX itself, not the fonts distributed alongside). I will also mention in the scribble-math user documentation that the katex folder in the generated HTML output, and the fonts within, are under their respective licenses.

@xymostech
Copy link
Contributor

That seems to depend on whether substantial parts of the KaTeX source code are included in the generated output (e.g. copied over from constant strings etc.), the answer you linked to mentions for example YACC which embeds chunks of source code in its output. I would think in the case of KaTeX that such code to be small enough fragments that the issue will not arise, but I would prefer confirmation, rather than just assuming (the legal notion of "small enough that it does not taint the output" is not particularly precise, AFAIK).

Ah, that's a good point, I forgot to point that out explicitly. KaTeX does not embed any of its code inside the output, so you should be good there!

I think I'll take care to clearly state that in the scribble-math repository, the LGPL (currently, hopefully CC0 sometime in the future) applies only to the scribble-math code, not to the KaTeX folder (just as KaTeX's license affects KaTeX itself, not the fonts distributed alongside). I will also mention in the scribble-math user documentation that the katex folder in the generated HTML output, and the fonts within, are under their respective licenses.

I'm not even sure you need to do that; since the licenses are compatible, it sounds like you can just say "all of this code is LGPL licensed; some of it was originally MIT licensed and here's the license for that" but maybe I'm reading things wrong.

@SuzanneSoy
Copy link
Contributor Author

Ah, that's a good point, I forgot to point that out explicitly. KaTeX does not embed any of its code inside the output, so you should be good there!

Thanks for the clarification!

I'm not even sure you need to do that; since the licenses are compatible, it sounds like you can just say "all of this code is LGPL licensed; some of it was originally MIT licensed and here's the license for that" but maybe I'm reading things wrong.

I think you're right, as long as it's in the MIT → LGPL direction. If I eventually manage to drop the few LGPL'd files and switch to CC0/Public Domain, I obviously shouldn't make it sound like the MIT code from KaTeX is licensed as CC0. Right now (LGPL), I think you're right in saying it shouldn't be a problem :) .

Thanks again for the helpful answers, and good luck with KaTeX!

@edemaine
Copy link
Member

Right: MIT→ LGPL is fine, but reverse is not and MIT → CC0 is not. So you couldn't release the whole package as CC0, only MIT, but you could release the parts you wrote as CC0.

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

3 participants