Proper licenses for free books written in Typst

This is a legal issue. As Chinese is my native language, the Chinese version below reflects my views more precisely.

The Typst workflow involves writing Typst source code, compiling it into PDF or other common formats, and then distributing those compiled files. I want to use Typst to write a handbook that is open-source and freely distributable, with the following requirements:

  • If someone modifies the Typst source code, they must publish the modified source code (similar to the “transparent copy” defined in the GFDL). Otherwise, if someone modifies only the Typst styling, CeTZ-generated image code, template functions, etc., and only releases the compiled PDF, the source behind these modifications will remain unknown.
  • If someone copies part or all of the text from the generated PDF into Microsoft Word, Notepad, or other editors and makes modifications (e.g., expanding, shortening—similar to a “non-transparent copy” in the GFDL), or edits images generated by tools like CeTZ using Photoshop or similar software, then they should only be required—just like under CC BY-SA 4.0 or similar licenses—to acknowledge the original source, without needing to include the full license text.

If I release the handbook repository under the GPL or AGPL, and define the transparent copy (i.e., the Typst source code) as the “source code,” and the non-transparent copies (such as PDFs) as “binary files,” this would offer stronger protection for the source code. However, under such licenses, anyone quoting content from the generated handbook—even just a paragraph or a couple of images—would technically be required to include the entire GPL or AGPL license text, which is inconvenient.

If I use the CC BY-SA 4.0 license to publish the handbook repository, then others could modify the Typst source code and distribute only the compiled non-transparent copy under the same license. While this still allows for free knowledge sharing, it would permit others to keep their modified Typst source code closed.

If I choose the GFDL to license the handbook repository, then small-scale modifications or quotations of the content do not require distributing the transparent copy, but large-scale reproduction does. This approach partially aligns with my goals but does not fully meet my requirements.

My current plan is to release the entire repository under the AGPL license, while also releasing the accompanying non-transparent copies under the CC BY-SA 4.0 license. Although this means that even if someone merely converts the PDF to a less popular format like MOBI—without modifying the Typst source code—they would still need to provide the full AGPL license text, this approach still comes closest to achieving my objectives.

For document formats like Markdown, the difference between a transparent and non-transparent copy is minimal, so the distinction is less important. But with Typst, one can write highly flexible code, and the gap between the transparent and non-transparent versions can be substantial, while not everyone cares about the code used to generate the final document, so I believe a license specifically designed to address this type of workflow would be ideal.

这是一个法律问题,由于中文是我的母语,所以更能反映我的观点。

Typst 的模式是编写 Typst 源代码,然后编译为 PDF 或者类似的更通用的文件格式并分发。现在我想用 Typst 写一篇开源而自由分发的手册,要求:

  • 如果别人修改了 Typst 源代码,他必须将修改过的源代码(类似 GFDL 的“透明拷贝”)公开。否则假如有人修改了 Typst 样式、CeTZ 图像代码、模板函数等,他可以只公开编译过后的 PDF 成果,我们就不知道这部分源码了。
  • 如果别人复制了 PDF 中的部分或所有文字到 Microsoft Word、记事本等编辑器并加以修改(如扩写、缩减等,类似 GFDL 的“浑浊拷贝”),或者用 Photoshop 等工具编辑 CeTZ 等工具已经生成的图像,他只需如 CC BY-SA 4.0 或类似的协议一般说明文章出处而无需附带完整的协议文本。

如果我采用 GPL 或 AGPL 协议发布书籍仓库,并将透明拷贝部分(在这里是 Typst 源码)定义为源代码,将浑浊拷贝部分(如 PDF 等文件)定义为二进制文件,可以更好地保护程序源代码,但是当别人引述生成后的手册的内容,即使是一段话或一两张图片时将不得不同时包含整个 GPL 或 AGPL 文档,这样会更麻烦。

如果我采用 CC BY-SA 4.0 协议发布书籍仓库,别人可以修改 Typst 源代码后只以 CC BY-SA 4.0 协议发布生成后的浑浊拷贝,用这种方式传播知识仍然是自由的,但是显然别人可以将修改过的 Typst 源码闭源。

如果我采用 GFDL 协议发布书籍仓库,别人在小范围修改并引述书籍内容时不必分发透明拷贝,而在大段复制书籍内容时必须提供透明拷贝,这与我上述的要求不完全契合。

我目前的方案是,用 AGPL 协议公开整个仓库,同时用 CC BY-SA 4.0 协议公开同时发布的浑浊拷贝。尽管别人在想办法生成 MOBI 等相对小众一点的文件却未对 Typst 源码作出任何修改时仍然需要如 AGPL 一般提供完整许可证文本,但这已经是最契合我的要求的做法了。

对于 Markdown 等文档格式,透明拷贝与浑浊拷贝差得不是很多,因此不需要太在意这种细节;但是 Typst 可以编写非常灵活的代码,有时透明拷贝与浑浊拷贝相差很大,同时不是所有人都关心生成书籍所用的的源代码,我认为应该专门设计契合此类需求的许可证。

1 Like

Hello. I don’t see any reason you can’t specify which stuff is covered by what license. As a sole copyright holder, you are free to choose under what conditions others can use your work. So add both licenses and explicitly specify which part/files can be used under GPL and which by CC. It’s that easy (IMO).