9

With some colleagues, we have been developing a programming university course over some years, and now we want to make it available to the public as open-source, in the form of a GitLab repository.

The repository contains:

  • LaTeX code to generate the course slides based on a minimal template
  • Some code example files, as well as exercise solutions in code
  • Some third-party data files that I can isolate into a thirdparty/ directory.

What we mainly want is a Creative Commons Attribution Share-Alike license, so that others attribute our work, but we don't want the course to just be copied into a proprietary format. As far as I understand, CC BY could also be enough here.

Questions:

  1. Does LaTeX code count as software or as text? My main focus is the content, not so much that it is in LaTeX. I will include a minimal template, but nothing special.
  2. Following the answer of (1): Would a CC license be appropriate for LaTeX files?
  3. It would be convenient to license the code examples with the same license, but CC seems to be discouraged for code. Would it be fine in this context, in which the code only has the purpose of accompanying the slides?
  4. Is it enough if I isolate the foreign files into a thirdparty/ directory and maintain the license notices?

I already see examples of such material published under CC BY, while I also see examples of a LICENSE file containing a "The instructional material is available under CC BY" followed by a "Software is available as MIT / BSD-3 Clause". Would that be better practice, or just make everything more complicated?

1
  • My blog consists of both software and "ordinary text", and I went with the following: "This work consists of a combination of software and non-software source files. Insofar as those files are copyrightable, they are conveyed to you under either of the following licenses: [Explanation of GPL-v3]; [Explanation of CC-BY-SA]". The full license text is here: gitlab.com/danielittlewood0/danielittlewood-xyz/-/blob/master/… Jan 5 at 9:57

2 Answers 2

9

Does LaTeX code count as software or as text?

Both. Neither. A mixture of the two. Copyright law doesn't in general make this kind of distinction, in the same way that a piece of paper might be "software" if it's got code printed on it, or "text" if it's got a novel printed on it.

Would a CC license be appropriate for LaTeX files?

Probably, given the typical content of LaTeX files - they are normally much more like text than software. Although if you've taken the entirety of your program's source code and just dumped it into a LaTeX file without any additional text or explanation round it, you may want to treat it more like software. (I'm not saying this latter thing is a good or sensible idea, but it's something you could do if you really wanted to).

It would be convenient to license the code examples with the same license, but CC seems to be discouraged for code. Would it be fine in this context, in which the code only has the purpose of accompanying the slides?

This (as always) depends what you mean by "fine". If the examples are pedagogical and you don't really expect people to copy them wholesale into working programs, there's no real pain to having them under a CC license. If on the other hand, they are more like boilerplate examples which you expect people to copy and "fill in the blanks" for their actual programs, you may want to consider (dual) licensing them under a more common code license.

Is it enough if I isolate the foreign files into a thirdparty/ directory and maintain the license notices?

This is impossible to answer without knowing the licenses (or lack thereof) of those files, but "probably", assuming that you have the rights to distribute the files at all. If they are open source, then yes.

we don't want the course to just be copied into a proprietary format. As far as I understand, CC BY could also be enough here.

CC-BY would not accomplish this, all that requires is for the source to be acknowledged. You need a copyleft license (CC-BY-SA or similar) to ensure that the materials remain open, even when reused.

Note that the MIT and BSD licenses would also allow your code to be used in proprietary products if you go that route.

4

LaTeX is a funny beast since it's both code and content intermingled. Licensing it can be tricky. What I typically do is to move all the "code-like" portions into a separate package (.sty) file. Then, there's a separate .tex file(s) containing the content. The .tex files will unavoidably contain some LaTeX code, but that code should either be calls to macros in my custom package or very basic typesetting commands. Nothing beyond the trivial.

You can then license the package file under a source code license (MIT, Apache, etc) and the content under a license for creative works (GFDL, CC-BY, etc). Being cleanly separated means you can store them in different directories, each with its own license notice. You'll likely find that you re-use a lot of the LaTeX code in other projects, and it may be worth storing the code portion as a completely separate project/repository.

As far as code examples go, I typically use the listings package and do something like this:

\usepackage{listings}
\lstset{language=C}
\begin{document}
\lstinputlisting{example_1.c}
\end{document}

The code stays in a separate file, where it can be licensed separately from the rest of the content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.