Can I publish a book and the source code in the book under two different licenses?
Eg. Publish a book under the GNU FDL license, but license the source code examples in this book under the Apache license?

  • Books are not generally licensed. Did you see a license in your copy of Green Eggs and Ham? – phoog Jul 24 '15 at 23:33
  • 1
    What about "Free as in Freedom" by Richard Stallman? – pitastic Jul 25 '15 at 13:44
  • 2
    It is very common for some free publications to be licensed under a free license like CreativeCommons. – pitastic Jul 25 '15 at 13:52

As long as you own the copyright to the works, you can even publish the source code itself under two different licenses, which can be radically different. For example, MySQL is licensed under both a commercial and an open-source license.

Given that you can publish a single piece of work as multiple licenses, it is your choice which one you wish to grant to the book or the code, as long as you own the copyright.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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