Monday, July 19, 2010

Theoretical Physics Reference Book

Today I fulfilled my old dream --- I just created my first book! Here is how it looks like:

More images

Here is the source code of the book:, the repository contains a branch 'master' with the code and 'gh-pages' with the generated html pages, that are hosted at github, at the url

Then I published the book at Lulu:, I wanted a hardcover book, so I setup a project at Lulu, used some Lulu templates for the cover and that was it. Lulu's price for the book is $19.20 (166 black & white pages, hardcover), then I can set my own price and the rest of the money probably goes to me. I set the price to $20, because Lulu has free shipping for orders $20 or more. You can also download the pdf (for free) at the above link (or just use my git repository). So far this didn't cost me anything.

I have then ordered the book myself (just like anybody else would, at the above address) and it arrived today. It's a regular hardcover book. Beautiful, you can browse the pictures above. It smells deliciously (that you have to believe me). And all that it cost me was $19.20.

As for the contents itself, you can browse it online at, essentially it's most of my physics notes, that I collected over the years. I'd like to treat books like software --- release early release often. This is my first release and I would call it beta. The main purpose of it was to see if everything goes through, how long it takes (the date inside the book is July 4, 2010, I created and ordered it on July 5, got the physical book on July 19) and what the quality is (excellent). I also wanted to see how the pages correspond to the pdf (you can see for yourself on the photos, click on the picasa link above).

Now I need to improve the first pages a bit, as well as the last pages, improve the index, write some foreword and so on. I also need to think how to better organize the contents itself and generally improve it. I also need to figure out some versioning scheme, so far this is version 0.1. I think I'll do edition 1, edition 2, edition 3, and so on. And whenever I feel that I have added enough new content, I'll just publish it as a new edition. So if you want to buy it, I suggest to wait for my 1.0 version, that will have the mentioned improvements.

It'd be also cool to have all the editions online somehow and create nice webpages for it (currently points directly to the book html itself).

So far the book is just text. I still need to figure out how to handle pictures and also whether or not to use program examples (in Python, using sympy, scipy, etc.). So far I am inclining not to put there any program codes, as then I don't need to maintain them.

Overall I am very pleased with the quality, up to some minor issues that I mentioned above, everything else end up just fine. I think we have come a long way from the discovery of the printing press. Anybody can now create a book for free, and if you want to hold the hardcopy in your hands, it costs around $20. You don't need to order certain amounts of books, nor partner with some publisher etc. I think that's just awesome.


Unknown said...

Please give a shout when you reach alpha-- I've found your notes to be quite useful and would happily support them with a purchase.

Anonymous said...

Some formulas do not fit in the page (page 94, 96 and 100 for some examples). Does it look the same in the printed book ? Is there a way to handle it ?

Simon said...

Hi Ondřej,

Your book looks good. Also, it's probably fairly unique to have a textbook produced using Sphinx. Maybe you should get it linked to on

Thanks for all of your work on SymPy

Unknown said...

Looks very nice, and the use of Sphinx for this type of documentation seems very convenient.

I'm wondering about the license of this work though, I couldn't find any information on the website or on github regarding this topic (maybe I missed it). Is it a free license? Are you open to contributions?



Unknown said...

hi, great idea. I did the same thing with the LaTeX sources, which is in the public domain. I needed a real hardcopy and now I have one for $25.

Like you, I can't believe the ease and the quality. What do you use to write so you can produce pdf and html?

Unknown said...


Unknown said...

Thanks for all the comments. I'll reply to them later today or tomorrow.

Philipp --- that's a very good question and I have fixed this immediately. I have put there a license file and improved the readme. I use the MIT license for all files, which is the most permissive license. I was also thinking about the, but I feel that most of them are non-free. I will have to study them more. The MIT license is well known and it's short.

Yes, I am very open to contributions. As long as it's along the same style (the way I derive/explain things) as the rest of the book. I am also open to all suggestions about the style too. I think that there is no style that everybody would like though. So I just use the style that I like myself. But I am very much open to do changes in it, I am still trying to figure out the best way to explain things.

If more people like this kind of book and the style, it'd be cool to run it as an opensource project.

So I am just putting it out there and we'll see what people like and if the sourcecode is usable for someone and what the best way for collaborating in these things is. I kind of know how to collaborate on software, but books is something new to me. :)

Unknown said...

Finally found some time to reply:

Rhys --- sure, I'll post a blog post, when I make some reasonable release.

jbd --- I have uploaded the photos of such pages at the end of:

The way to handle it is to rewrite the equations in Sphinx to fit on one page. I autogenerated those matrices using sympy and I didn't have time to reformat them.

Simon --- that's an awesome idea, I'll do it. I noticed that you study string theory --- I guess the QFT in my notes must be very easy for you --- if you have any feedback, I am interested.

Tim --- can you post a link to your book? You are right, I just showed to book to my roommates and labmates and everyone is excited. I think that will get some more customers. :)

Tim & sylware --- I use Sphinx (, you can see the sources at the github page I posted in the blog

Noel O'Boyle said...

Hi Ondřej,

You said that you are storing the reST on github, and that you would like to set up a website for it. Have you read about "Read the docs"? ( It seems to solve this very problem.

- Noel

Unknown said...

Hi Noel,

that's a great idea, thanks! I tried it first for SymPy and it seems to be working great.

Naveen said...

I hope you reconsider putting sympy code for some of the math formulas / derivations / examples. I think having code to go along with the notation would be the logical next step to "notation allows us a very conv[e]nient computation". well code for the computation is even better than notation, because notation seems magical whereas code is dissectable in a much more interactive and fun way for programmers.

Unknown said...

Hi Naveen,

yes, I do want to use sympy whenever possible. I have already started, see for example here:

I keep putting more and more sympy code in there. It'd be nice to represent all equations in sympy eventually, but many things sympy cannot yet represent. We are working on the QM module for sympy, so eventually more and more things will work.